Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set member mode indicators in table. #399

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/components/networkByIdPage/table/memberEditCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ const MemberEditCell = ({ nwid, central = false, organizationId }: IProp) => {
);
}
if (id === "ipAssignments") {
const { noAutoAssignIps, activeBridge } = original || null;
const hasRfc4193 = networkById?.network?.v6AssignMode?.rfc4193;
const has6plane = networkById?.network?.v6AssignMode?.["6plane"];

Expand Down Expand Up @@ -226,6 +227,22 @@ const MemberEditCell = ({ nwid, central = false, organizationId }: IProp) => {
</div>
)}
</div>
<div className="flex gap-1 pl-1">
{noAutoAssignIps ? (
<kbd title="Do Not Auto-Assign IPs" className="kbd kbd-xs">
AA
</kbd>
) : (
""
)}
{activeBridge ? (
<kbd title="Allow Ethernet Bridging" className="kbd kbd-xs">
EB
</kbd>
) : (
""
)}
</div>
</div>
);
})}
Expand Down
2 changes: 1 addition & 1 deletion src/components/organization/networkTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface OrgMemberEntity extends CentralMemberEntity {
export const OrganizationNetworkTable = ({ tableData = [] }) => {
// Load initial state from localStorage or set to default
const initialSortingState = getLocalStorageItem(LOCAL_STORAGE_KEY, [
{ id: "id", desc: true },
{ id: "nwid", desc: true },
]);

const router = useRouter();
Expand Down
4 changes: 2 additions & 2 deletions src/server/api/routers/networkRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { throwError, type APIError } from "~/server/helpers/errorHandler";
import { createTransporter, inviteUserTemplate, sendEmail } from "~/utils/mail";
import ejs from "ejs";
import { type TagsByName, type NetworkEntity } from "~/types/local/network";
import { type CapabilitiesByName } from "~/types/local/member";
import { MemberEntity, type CapabilitiesByName } from "~/types/local/member";
import { type CentralNetwork } from "~/types/central/network";
import { checkUserOrganizationRole } from "~/utils/role";
import { Role } from "@prisma/client";
Expand Down Expand Up @@ -173,7 +173,7 @@ export const networkRouter = createTRPCRouter({
...networkFromDatabase,
cidr: cidrOptions,
},
members: mergedMembers,
members: mergedMembers as MemberEntity[],
zombieMembers,
};
}),
Expand Down
1 change: 1 addition & 0 deletions src/types/central/network.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ export interface CentralNetwork extends NetworkBase {
export interface FlattenCentralNetwork extends NetworkBase, Partial<NetworkConfig> {
cidr?: string[];
nwid?: string;
autoAssignIp?: boolean;
}
1 change: 1 addition & 0 deletions src/types/local/network.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface NetworkEntity {
private?: boolean;
description?: string;
remoteTraceLevel?: number;
autoAssignIp?: boolean;
remoteTraceTarget?: null;
revision?: number;
tags?: Tag[];
Expand Down
Loading