diff --git a/src/app.html b/src/app.html index 77a5ff5..7a71a4a 100644 --- a/src/app.html +++ b/src/app.html @@ -1,12 +1,15 @@ -
- - - - %sveltekit.head% - - -Loading credential types...
- {:else} - - {/if} -+ No entries yet. Add an entry to define + sub-credentials for this field. +
+ {:else} + {#each subCredentials[field.id] as entry, entryIdx} +No permission data available.
- {:else if filteredEntries.length === 0} -No permissions match your search.
{:else} - {#each filteredEntries as [catKey, category] (catKey)} - {@const catPerms = category.permissions} + {#each permissionEntries as [catKey, category] (catKey)} + {@const catPerms = category.permissions ?? []} {@const allSel = catPerms.length > 0 && catPerms.every((p) => selectedPermissions.has(p.node))} {@const someSel = !allSel && catPerms.some((p) => selectedPermissions.has(p.node))} - {@const isExpanded = - permissionSearch.trim().length > 0 || - expandedCategories.has(catKey)} + {@const isExpanded = expandedCategories.has(catKey)}{customPermError}
+ {/if}+ Update information for {user.name} +
+ {#if editError} +{editError}
+ {/if} + +- Credential type definitions and configuration will be wired up here. - Connect an API module to populate this view. + There are no credential types configured yet. Create your first credential + type to get started.
+ {#if canCreate} + + {/if}+ Are you sure you want to delete + {typeToDelete.name}? + {#if typeToDelete.credentialCount > 0} + This type has {typeToDelete.credentialCount} + credential{typeToDelete.credentialCount === 1 ? "" : "s"} associated + with it. + {/if} + This action cannot be undone. +
+ {#if deleteError} +{deleteError}
+ {/if} +| Name | +Permission Scope | +Fields | +Credentials | +Created | +Updated | ++ |
|---|---|---|---|---|---|---|
|
+
+
+ {ct.name}
+
+ |
+ + {ct.permissionScope} + | ++ + {ct.fields.length} field{ct.fields.length === 1 ? "" : "s"} + + | ++ + + {ct.credentialCount} credential{ct.credentialCount === 1 + ? "" + : "s"} + + | +{formatDate(ct.createdAt)} | +{formatDate(ct.updatedAt)} | +
+
+ {#if canEdit || canDelete}
+
+ {/if}
+
+
+ |
+
|
+
+
+
+
+
+
+
+
+
+ + + Details ++
+
+
+ ID
+ {ct.id}
+
+
+ Permission Scope
+ {ct.permissionScope}
+
+ {#if ct.icon}
+
+ Icon
+ {ct.icon}
+
+ {/if}
+
+ Credentials
+ {ct.credentialCount} credential{ct.credentialCount ===
+ 1
+ ? ""
+ : "s"}
+
+
+ Created
+ {formatDate(ct.createdAt)}
+
+
+ Updated
+ {formatDate(ct.updatedAt)}
+
+
+
+ + + Fields + {ct.fields.length} ++ {#if ct.fields.length === 0} +No fields defined + {:else} +
+ {#each ct.fields as field (field.id)}
+
+ {/if}
+
+
+
+ {#if field.valueType === "multi_credential" && field.subFields && field.subFields.length > 0}
+
+ {field.name}
+
+
+
+
+
+ {/if}
+ {/each}
+
+ {#each field.subFields as subField (subField.id)}
+
+
+
+
+ {/each}
+
+ {subField.name}
+
+
+ |
+ ||||||
+ No credential types match “{searchQuery}”. Try a different + search. +
+- User listing and editing will be wired up here. Connect an API module to - populate this view. -
+There are no users in the system yet.
+ Are you sure you want to delete + {userToDelete.name}? This action cannot be undone. +
+ {#if deleteError} +{deleteError}
+ {/if} +| User | +Login | +Roles | +Created | ++ | |
|---|---|---|---|---|---|
|
+
+ {#if user.image}
+
+
+ {initials(user.name)}
+
+ {/if}
+ {user.name}
+ |
+ + {user.email} + | ++ {user.login} + | ++ + {user.roleDetails.length} role{user.roleDetails.length === 1 + ? "" + : "s"} + + | +{formatDate(user.createdAt)} | +
+
+ {#if canEdit || canDelete}
+
+ {/if}
+
+
+ |
+
|
+
+
+
+
+
+
+
+
+
+ + + Details ++
+
+
+ ID
+ {user.id}
+
+
+ Email
+ {user.email}
+
+
+ Login
+ {user.login}
+
+
+ Created
+ {formatDate(user.createdAt)}
+
+
+ Updated
+ {formatDate(user.updatedAt)}
+
+
+
+
+
+ + + Roles + {user.roleDetails.length} ++ {#if user.roleDetails.length === 0} +No roles assigned + {:else} +
+ {#each user.roleDetails as role (role.id)}
+
+ {/if}
+
+
+ {/each}
+
+
+ {role.title}
+ {role.moniker}
+
+ {#if role.permissions.length > 0}
+
+ {/if}
+
+
+ + + Additional Permissions + {#if user.permissions?.length} + {user.permissions.length} + {/if} ++ {#if !user.permissions?.length} ++ No additional permissions assigned + + {:else} + + {/if} + |
+ |||||
No users match “{searchQuery}”. Try a different search.
+Credentials content
+ {#if activeTab === "Overview"} +No configurations found
-{config.description}
- {/if} - {#if config.key} -{selectedConfig.notes}
-No configuration fields available
-Users content
+Activity content
+Company not found.
+Activity feed coming soon.
+No credentials found for this company
+{cred.type.name}
+ {/if} + {#if cred.fields.length > 0} + + {cred.fields.length} field{cred.fields.length === 1 + ? "" + : "s"} + + {/if} + {#if formatDate(cred.updatedAt) || formatDate(cred.createdAt)} + + {#if formatDate(cred.updatedAt)} + Updated {formatDate(cred.updatedAt)} + {:else} + Created {formatDate(cred.createdAt)} + {/if} + + {/if} + {/if} +No configurations found
+{config.description}
+ {/if} + {#if config.key} +No contacts found
+No overview data available
+No devices found
+| Status | +Name | +Model | +IP | +MAC | +Version | +Uptime | +
|---|---|---|---|---|---|---|
| + + | ++ {device.name || device.mac} + | +{device.model} | +{device.ip || "—"} | +{device.mac} | +{device.version || "—"} | ++ {#if device.uptime} + {formatUptime(device.uptime)} + {:else} + — + {/if} + | +
No WiFi networks found
+Select a network to view and edit settings
+No networks found
+No UniFi sites linked to this company
+Activity content
+ {/if} +Activity content
diff --git a/src/routes/companies/[id]/components/CompanySidebar.svelte b/src/routes/companies/[id]/components/CompanySidebar.svelte new file mode 100644 index 0000000..84cf98a --- /dev/null +++ b/src/routes/companies/[id]/components/CompanySidebar.svelte @@ -0,0 +1,260 @@ + + +Company not found.
+No configurations found
+{config.description}
+ {/if} + {#if config.key} +No contacts found
+No credentials found for this company
+{cred.type.name}
+ {/if} + {#if cred.fields.length > 0} + + {cred.fields.length} field{cred.fields.length === 1 ? "" : "s"} + + {/if} + {#if formatDate(cred.updatedAt) || formatDate(cred.createdAt)} + + {#if formatDate(cred.updatedAt)} + Updated {formatDate(cred.updatedAt)} + {:else} + Created {formatDate(cred.createdAt)} + {/if} + + {/if} + {/if} +Activity feed coming soon.
+No overview data available
No devices found
+| Status | Name | Model | IP | MAC | Version | Uptime |
|---|---|---|---|---|---|---|
| + | {device.name || device.mac} | +{device.model} | +{device.ip || "—"} | +{device.mac} | +{device.version || "—"} | +{#if device.uptime}{formatUptime( + device.uptime, + )}{:else}—{/if} | +
No WiFi networks found
+| + | Group Name | +APs | +
|---|---|---|
| + {#if canEditWifi} + { + const validIds = new Set( + unifiApGroups.map((g) => g.id), + ); + const current = Array.isArray( + wifiEditState.apGroupIds, + ) + ? ( + wifiEditState.apGroupIds as string[] + ).filter((id) => + validIds.has(id), + ) + : []; + if (isChecked) { + updateWifiField( + "apGroupIds", + current.filter( + (id) => id !== group.id, + ), + ); + } else { + updateWifiField("apGroupIds", [ + ...current, + group.id, + ]); + } + }} + /> + {:else} + + {/if} + | +{group.name} | +{group.deviceMacs.length} + {group.deviceMacs.length === 1 + ? "AP" + : "APs"} | +
| + | Access Point | +Model | +IP | +
|---|---|---|---|
| + {#if canEditWifi} + { + const validMacs = new Set( + unifiAccessPoints.map( + (a) => a.mac, + ), + ); + const current = Array.isArray( + wifiEditState.deviceMacs, + ) + ? ( + wifiEditState.deviceMacs as string[] + ).filter((mac) => + validMacs.has(mac), + ) + : []; + if (isChecked) { + updateWifiField( + "deviceMacs", + current.filter( + (mac) => mac !== ap.mac, + ), + ); + } else { + updateWifiField("deviceMacs", [ + ...current, + ap.mac, + ]); + } + }} + /> + {:else} + + {/if} + | ++ {ap.name || ap.mac} + {#if ap.name}{ap.mac}{/if} + | +{ap.model} | +{ap.ip} | +
Select a network to view and edit settings
+No networks found
+No UniFi sites linked to this company
+