Skip to content

Modern Docker Management, Designed for Everyone

chore: fix type errors (#311)

Kyle Mendell08eef4610458
diff --git a/backend/internal/api/routes.go b/backend/internal/api/routes.go
index f588bc074..c313383f2 100644
--- a/backend/internal/api/routes.go
+++ b/backend/internal/api/routes.go
@@ -328,6 +328,7 @@ func setupTemplateRoutes(router *gin.RouterGroup, services *Services) {
templatesAuth.POST("", templateHandler.CreateTemplate)
templatesAuth.PUT("/:id", templateHandler.UpdateTemplate)
templatesAuth.DELETE("/:id", templateHandler.DeleteTemplate)
+ templatesAuth.POST("/:id/download", templateHandler.DownloadTemplate)
templatesAuth.GET("/env/default", templateHandler.GetEnvTemplate)
templatesAuth.POST("/env/default", templateHandler.SaveEnvTemplate)
templatesAuth.GET("/registries", templateHandler.GetRegistries)
diff --git a/backend/internal/api/template_handler.go b/backend/internal/api/template_handler.go
index 169bd1d0b..b05be7519 100644
--- a/backend/internal/api/template_handler.go
+++ b/backend/internal/api/template_handler.go
@@ -507,3 +507,46 @@ func (h *TemplateHandler) FetchRegistry(c *gin.Context) {
c.Header("Content-Type", "application/json")
c.Data(http.StatusOK, "application/json", body)
}
+
+func (h *TemplateHandler) DownloadTemplate(c *gin.Context) {
+ id := c.Param("id")
+ if id == "" {
+ c.JSON(http.StatusBadRequest, gin.H{
+ "success": false,
+ "error": "Template ID is required",
+ })
+ return
+ }
+
+ template, err := h.templateService.GetTemplate(c.Request.Context(), id)
+ if err != nil {
+ c.JSON(http.StatusNotFound, gin.H{
+ "success": false,
+ "error": "Template not found",
+ })
+ return
+ }
+
+ if !template.IsRemote {
+ c.JSON(http.StatusBadRequest, gin.H{
+ "success": false,
+ "error": "Template is already local",
+ })
+ return
+ }
+
+ localTemplate, err := h.templateService.DownloadTemplate(c.Request.Context(), template)
+ if err != nil {
+ c.JSON(http.StatusInternalServerError, gin.H{
+ "success": false,
+ "error": "Failed to download template: " + err.Error(),
+ })
+ return
+ }
+
+ c.JSON(http.StatusOK, gin.H{
+ "success": true,
+ "template": localTemplate,
+ "message": "Template downloaded successfully",
+ })
+}
diff --git a/backend/internal/services/template_service.go b/backend/internal/services/template_service.go
index c41d2af14..58f033e13 100644
--- a/backend/internal/services/template_service.go
+++ b/backend/internal/services/template_service.go
@@ -333,3 +333,49 @@ func (s *TemplateService) fetchURL(url string) (string, error) {
return string(body), nil
}
+
+func (s *TemplateService) DownloadTemplate(ctx context.Context, remoteTemplate *models.ComposeTemplate) (*models.ComposeTemplate, error) {
+ if !remoteTemplate.IsRemote {
+ return nil, fmt.Errorf("template is not remote")
+ }
+
+ composeContent, envContent, err := s.FetchTemplateContent(ctx, remoteTemplate)
+ if err != nil {
+ return nil, fmt.Errorf("failed to fetch template content: %w", err)
+ }
+
+ localTemplate := &models.ComposeTemplate{
+ ID: s.generateTemplateID(remoteTemplate.Name + "-local"),
+ Name: remoteTemplate.Name,
+ Description: fmt.Sprintf("%s (Downloaded from %s)", remoteTemplate.Description, remoteTemplate.Registry.Name),
+ Content: composeContent,
+ IsCustom: true,
+ IsRemote: false,
+ RegistryID: nil,
+ Registry: nil,
+ }
+
+ if envContent != "" {
+ localTemplate.EnvContent = &envContent
+ }
+
+ if remoteTemplate.Metadata != nil {
+ localTemplate.Metadata = &models.ComposeTemplateMetadata{
+ Version: remoteTemplate.Metadata.Version,
+ Author: remoteTemplate.Metadata.Author,
+ Tags: remoteTemplate.Metadata.Tags,
+ RemoteURL: remoteTemplate.Metadata.RemoteURL,
+ EnvURL: remoteTemplate.Metadata.EnvURL,
+ DocumentationURL: remoteTemplate.Metadata.DocumentationURL,
+ IconURL: remoteTemplate.Metadata.IconURL,
+ UpdatedAt: remoteTemplate.Metadata.UpdatedAt,
+ }
+ }
+
+ err = s.db.WithContext(ctx).Create(localTemplate).Error
+ if err != nil {
+ return nil, fmt.Errorf("failed to save local template: %w", err)
+ }
+
+ return localTemplate, nil
+}
diff --git a/frontend/src/lib/components/dialogs/template-selection-dialog.svelte b/frontend/src/lib/components/dialogs/template-selection-dialog.svelte
index d0b84f35f..962ea995f 100644
--- a/frontend/src/lib/components/dialogs/template-selection-dialog.svelte
+++ b/frontend/src/lib/components/dialogs/template-selection-dialog.svelte
@@ -67,10 +67,10 @@
try {
const result = await templateAPI.download(templateId);
- if (result.success) {
+ if (result) {
toast.success(`Template "${template.name}" downloaded successfully!`);
} else {
- toast.error(result.message || 'Failed to download template');
+ toast.error('Failed to download template');
}
} catch (error) {
console.error('Error downloading template:', error);
diff --git a/frontend/src/lib/components/sidebar/sidebar-agent-switcher.svelte b/frontend/src/lib/components/sidebar/sidebar-env-switcher.svelte
similarity index 89%
rename from frontend/src/lib/components/sidebar/sidebar-agent-switcher.svelte
rename to frontend/src/lib/components/sidebar/sidebar-env-switcher.svelte
index 7a8b2bb5d..74404bc36 100644
--- a/frontend/src/lib/components/sidebar/sidebar-agent-switcher.svelte
+++ b/frontend/src/lib/components/sidebar/sidebar-env-switcher.svelte
@@ -1,10 +1,11 @@
<script lang="ts">
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
+ import { Label } from '$lib/components/ui/label/index.js';
import { useSidebar } from '$lib/components/ui/sidebar/index.js';
import ChevronsUpDownIcon from '@lucide/svelte/icons/chevrons-up-down';
import PlusIcon from '@lucide/svelte/icons/plus';
- import { GalleryVerticalEndIcon } from '@lucide/svelte';
+ import { GlobeIcon } from '@lucide/svelte';
import ServerIcon from '@lucide/svelte/icons/server';
import { environmentStore, type Environment } from '$lib/stores/environment.store';
import { goto } from '$app/navigation';
@@ -39,6 +40,9 @@
</script>
<Sidebar.Menu>
+ {#if sidebar.open}
+ <Label class="px-2 mb-2 text-xs font-medium text-sidebar-foreground/60">Environment</Label>
+ {/if}
<Sidebar.MenuItem>
<DropdownMenu.Root>
<DropdownMenu.Trigger>
@@ -49,7 +53,7 @@
{#if currentSelectedEnvironment.isLocal}
<ServerIcon class="size-4" />
{:else}
- <GalleryVerticalEndIcon class="size-4" />
+ <GlobeIcon class="size-4" />
{/if}
</div>
<div class="grid flex-1 text-left text-sm leading-tight">
@@ -57,7 +61,7 @@
{currentSelectedEnvironment.hostname}
</span>
<span class="truncate text-xs">
- {currentSelectedEnvironment.isLocal ? 'Local Docker' : currentSelectedEnvironment.apiUrl}
+ {currentSelectedEnvironment.isLocal ? 'unix:///var/run/docker.sock' : currentSelectedEnvironment.apiUrl}
</span>
</div>
{:else}
@@ -89,13 +93,13 @@
{#if env.isLocal}
<ServerIcon class="size-3.5 shrink-0" />
{:else}
- <GalleryVerticalEndIcon class="size-3.5 shrink-0" />
+ <GlobeIcon class="size-3.5 shrink-0" />
{/if}
</div>
<div class="flex flex-col">
<span>{env.hostname}</span>
{#if env.isLocal}
- <span class="text-muted-foreground text-xs">Local Docker</span>
+ <span class="text-muted-foreground text-xs">unix:///var/run/docker.sock</span>
{:else}
<span class="text-muted-foreground text-xs truncate max-w-32">{env.apiUrl}</span>
{/if}
diff --git a/frontend/src/lib/components/sidebar/sidebar.svelte b/frontend/src/lib/components/sidebar/sidebar.svelte
index 35dcd3bca..3b5e40943 100644
--- a/frontend/src/lib/components/sidebar/sidebar.svelte
+++ b/frontend/src/lib/components/sidebar/sidebar.svelte
@@ -11,8 +11,7 @@
{ title: 'General', url: '/settings/general', icon: SettingsIcon },
{ title: 'Docker', url: '/settings/docker', icon: DatabaseIcon },
{ title: 'Users', url: '/settings/users', icon: UserIcon },
- { title: 'Security', url: '/settings/security', icon: Shield },
- { title: 'Environments', url: '/environments', icon: ComputerIcon }
+ { title: 'Security', url: '/settings/security', icon: Shield }
]
}
],
@@ -28,6 +27,13 @@
icon: LockKeyholeIcon
}
],
+ environmentItems: [
+ {
+ title: 'Environments',
+ url: '/environments',
+ icon: ComputerIcon
+ }
+ ],
managementItems: [
{ title: 'Dashboard', url: '/', icon: Home },
{ title: 'Containers', url: '/containers', icon: Container },
@@ -42,7 +48,7 @@
<script lang="ts">
import SidebarItemGroup from './sidebar-itemgroup.svelte';
import SidebarUser from './sidebar-user.svelte';
- import SidebarAgentSwitcher from './sidebar-agent-switcher.svelte';
+ import SidebarEnvSwitcher from './sidebar-env-switcher.svelte';
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
import { useSidebar } from '$lib/components/ui/sidebar/index.js';
import type { ComponentProps } from 'svelte';
@@ -70,11 +76,12 @@
<Sidebar.Root {collapsible} {...restProps}>
<Sidebar.Header>
<SidebarLogo {isCollapsed} {versionInformation} />
- <SidebarAgentSwitcher />
+ <SidebarEnvSwitcher />
</Sidebar.Header>
<Sidebar.Content>
<SidebarItemGroup label="Management" items={staticData.managementItems} />
<SidebarItemGroup label="Customization" items={staticData.customizationItems} />
+ <SidebarItemGroup label="Environments" items={staticData.environmentItems} />
<SidebarItemGroup label="Administration" items={staticData.settingsItems} />
</Sidebar.Content>
<Sidebar.Footer>
diff --git a/frontend/src/lib/models/stack.type.ts b/frontend/src/lib/models/stack.type.ts
index 8b1ef9090..234fdf7fb 100644
--- a/frontend/src/lib/models/stack.type.ts
+++ b/frontend/src/lib/models/stack.type.ts
@@ -15,6 +15,17 @@ export interface StackPort {
[key: string]: any;
}
+export interface NetworkSettings {
+ Networks: Record<
+ string,
+ {
+ IPAddress?: string;
+ Driver?: string;
+ [key: string]: any;
+ }
+ >;
+}
+
export interface StackService {
container_id: string;
name: string;
@@ -26,6 +37,7 @@ export interface StackService {
environment?: Record<string, string>;
restart_count?: number;
health?: string;
+ networkSettings?: NetworkSettings;
}
export interface Stack {
diff --git a/frontend/src/lib/services/api/environment-api-service.ts b/frontend/src/lib/services/api/environment-api-service.ts
index ba416355b..ad94e5e4d 100644
--- a/frontend/src/lib/services/api/environment-api-service.ts
+++ b/frontend/src/lib/services/api/environment-api-service.ts
@@ -1,7 +1,7 @@
import BaseAPIService from './api-service';
import { get } from 'svelte/store';
import { environmentStore, LOCAL_DOCKER_ENVIRONMENT_ID } from '$lib/stores/environment.store';
-import type { ContainerCreateOptions, NetworkCreateOptions, VolumeCreateOptions } from 'dockerode';
+import type { ContainerCreateOptions, NetworkCreateOptions, VolumeCreateOptions, ContainerStats } from 'dockerode';
import type { Stack, StackService } from '$lib/models/stack.type';
import { browser } from '$app/environment';
@@ -39,10 +39,10 @@ export class EnvironmentAPIService extends BaseAPIService {
return this.handleResponse(this.api.post(`/environments/${envId}/containers`, options));
}
- async getContainerStats(containerId: string, stream: boolean = false) {
+ async getContainerStats(containerId: string, stream: boolean = false): Promise<ContainerStats> {
const envId = await this.getCurrentEnvironmentId();
const url = `/environments/${envId}/containers/${containerId}/stats${stream ? '?stream=true' : ''}`;
- return this.handleResponse(this.api.get(url));
+ return this.handleResponse(this.api.get(url)) as Promise<ContainerStats>;
}
async stopContainer(containerId: string): Promise<any> {
@@ -129,7 +129,6 @@ export class EnvironmentAPIService extends BaseAPIService {
}
async getAllResources(): Promise<Record<string, any>> {
- const envId = await this.getCurrentEnvironmentId();
const [containers, images, networks, volumes] = await Promise.all([this.getContainers(), this.getImages(), this.getNetworks(), this.getVolumes()]);
return {
@@ -259,9 +258,9 @@ export class EnvironmentAPIService extends BaseAPIService {
return this.handleResponse(this.api.get(`/environments/${envId}/stacks/${stackName}/changes`));
}
- async getStackStats(stackName: string): Promise<any> {
+ async getStackStats(stackName: string): Promise<ContainerStats[]> {
const envId = await this.getCurrentEnvironmentId();
- return this.handleResponse(this.api.get(`/environments/${envId}/stacks/${stackName}/stats`));
+ return this.handleResponse(this.api.get(`/environments/${envId}/stacks/${stackName}/stats`)) as Promise<ContainerStats[]>;
}
async validateStack(stackName: string): Promise<{ valid: boolean; errors?: string[] }> {
diff --git a/frontend/src/lib/services/api/oidc-api-service.ts b/frontend/src/lib/services/api/oidc-api-service.ts
index 0f608284d..b6feb6c2a 100644
--- a/frontend/src/lib/services/api/oidc-api-service.ts
+++ b/frontend/src/lib/services/api/oidc-api-service.ts
@@ -1,5 +1,16 @@
import BaseAPIService from './api-service';
-import type { OidcConfig, OidcUserInfo } from '$lib/types/settings.type';
+import type { OidcConfig } from '$lib/types/settings.type';
+
+export interface OidcUserInfo {
+ sub: string;
+ email: string;
+ name: string;
+ preferred_username?: string;
+ given_name?: string;
+ family_name?: string;
+ picture?: string;
+ groups?: string[];
+}
export default class OidcAPIService extends BaseAPIService {
async getAuthUrl(redirectUri: string): Promise<string> {
diff --git a/frontend/src/lib/services/api/settings-api-service.ts b/frontend/src/lib/services/api/settings-api-service.ts
index 629db43c8..b279c75ac 100644
--- a/frontend/src/lib/services/api/settings-api-service.ts
+++ b/frontend/src/lib/services/api/settings-api-service.ts
@@ -1,23 +1,11 @@
import BaseAPIService from './api-service';
-import type { Settings } from '$lib/types/settings.type';
-
-export interface OidcConfig {
- clientId: string;
- clientSecret: string;
- redirectUri: string;
- authorizationEndpoint: string;
- tokenEndpoint: string;
- userinfoEndpoint: string;
- scopes: string[];
-}
+import type { Settings, OidcStatusInfo } from '$lib/types/settings.type';
export default class SettingsAPIService extends BaseAPIService {
async getSettings(): Promise<Settings> {
try {
const response = await this.api.get('/settings');
-
const data = response.data?.settings || response.data?.data || response.data;
-
return data;
} catch (error) {
console.error('Error fetching settings:', error);
@@ -28,9 +16,7 @@ export default class SettingsAPIService extends BaseAPIService {
async updateSettings(settings: Partial<Settings>): Promise<Settings> {
try {
const response = await this.api.put('/settings', settings);
-
const data = response.data?.settings || response.data?.data || response.data;
-
return data;
} catch (error) {
console.error('Error updating settings:', error);
@@ -41,9 +27,7 @@ export default class SettingsAPIService extends BaseAPIService {
async resetSettings(): Promise<Settings> {
try {
const response = await this.api.post('/settings/reset');
-
const data = response.data?.settings || response.data?.data || response.data;
-
return data;
} catch (error) {
console.error('Error resetting settings:', error);
@@ -51,51 +35,7 @@ export default class SettingsAPIService extends BaseAPIService {
}
}
- // OIDC specific methods
- async getOidcConfig(): Promise<OidcConfig> {
- return this.handleResponse(this.api.get('/auth/oidc/config'));
- }
-
- async updateOidcConfig(config: Partial<OidcConfig>): Promise<OidcConfig> {
- return this.handleResponse(this.api.put('/settings/oidc', config));
- }
-
- async testOidcConfig(): Promise<{ success: boolean; message: string }> {
- return this.handleResponse(this.api.post('/settings/oidc/test'));
- }
-
- async getOidcStatus(): Promise<{
- enabled: boolean;
- configured: boolean;
- envConfigured: boolean;
- settingsConfigured: boolean;
- }> {
+ async getOidcStatus(): Promise<OidcStatusInfo> {
return this.handleResponse(this.api.get('/auth/oidc/status'));
}
-
- async getOidcAuthUrl(redirectUri: string): Promise<{ authUrl: string; state: string }> {
- return this.handleResponse(this.api.post('/auth/oidc/url', { redirectUri }));
- }
-
- async handleOidcCallback(
- code: string,
- state: string
- ): Promise<{
- success: boolean;
- user?: any;
- token?: string;
- refreshToken?: string;
- expiresAt?: string;
- error?: string;
- }> {
- return this.handleResponse(this.api.post('/auth/oidc/callback', { code, state }));
- }
-
- async getOidcUserInfo(): Promise<any> {
- return this.handleResponse(this.api.get('/auth/oidc/userinfo'));
- }
-
- async logoutOidc(): Promise<void> {
- return this.handleResponse(this.api.post('/auth/oidc/logout'));
- }
}
diff --git a/frontend/src/lib/services/api/template-api-service.ts b/frontend/src/lib/services/api/template-api-service.ts
index fd9630af7..bb95f08cf 100644
--- a/frontend/src/lib/services/api/template-api-service.ts
+++ b/frontend/src/lib/services/api/template-api-service.ts
@@ -46,7 +46,11 @@ export default class TemplateAPIService extends BaseAPIService {
await this.api.delete(`/templates/${id}`);
}
- // Environment template operations
+ async download(id: string): Promise<Template> {
+ const response = await this.api.post(`/templates/${id}/download`);
+ return response.data.template;
+ }
+
async getEnvTemplate(): Promise<string> {
const response = await this.api.get('/templates/env/default');
return response.data.content;
@@ -56,7 +60,6 @@ export default class TemplateAPIService extends BaseAPIService {
await this.api.post('/templates/env/default', { content });
}
- // Registry operations
async getRegistries(): Promise<TemplateRegistry[]> {
const response = await this.api.get('/templates/registries');
return response.data.registries;
@@ -88,10 +91,7 @@ export default class TemplateAPIService extends BaseAPIService {
await this.api.delete(`/templates/registries/${id}`);
}
- // Legacy methods for backward compatibility (can be removed if not needed)
async getByName(name: string): Promise<Template> {
- // This would need to be implemented on backend if needed
- // For now, get all templates and filter by name
const templates = await this.loadAll();
const template = templates.find((t) => t.name === name);
if (!template) {
@@ -101,15 +101,11 @@ export default class TemplateAPIService extends BaseAPIService {
}
async search(query: string, category?: string): Promise<Template[]> {
- // This would need to be implemented on backend if needed
- // For now, get all templates and filter client-side
const templates = await this.loadAll();
return templates.filter((template) => template.name.toLowerCase().includes(query.toLowerCase()) || template.description.toLowerCase().includes(query.toLowerCase()));
}
async getCategories(): Promise<string[]> {
- // This would need to be implemented on backend if needed
- // For now, extract categories from template metadata
const templates = await this.loadAll();
const categories = new Set<string>();
templates.forEach((template) => {
@@ -122,8 +118,6 @@ export default class TemplateAPIService extends BaseAPIService {
}
async refresh(): Promise<{ updated: number; added: number; removed: number }> {
- // This would need to be implemented on backend if needed
- // For now, just reload templates
await this.loadAll();
return { updated: 0, added: 0, removed: 0 };
}
@@ -133,8 +127,6 @@ export default class TemplateAPIService extends BaseAPIService {
errors: string[];
warnings: string[];
}> {
- // This would need to be implemented on backend if needed
- // For now, basic client-side validation
const errors: string[] = [];
const warnings: string[] = [];
@@ -149,31 +141,24 @@ export default class TemplateAPIService extends BaseAPIService {
}
async getTemplateByRegistry(registryId: string): Promise<Template[]> {
- // This would need to be implemented on backend if needed
- // For now, get all templates and filter by registry
const templates = await this.loadAll();
return templates.filter((template) => template.registryId?.toString() === registryId);
}
async importFromUrl(url: string): Promise<Template> {
- // This would need to be implemented on backend if needed
throw new Error('Import from URL not yet implemented');
}
async exportTemplate(id: string): Promise<Blob> {
- // This would need to be implemented on backend if needed
const template = await this.getById(id);
const content = JSON.stringify(template, null, 2);
return new Blob([content], { type: 'application/json' });
}
async refreshRegistry(id: string): Promise<void> {
- // This would need to be implemented on backend if needed
- // For now, just reload templates
await this.loadAll();
}
- // Alias methods for backward compatibility
async getTemplates(registryId?: string): Promise<Template[]> {
if (registryId) {
return this.getTemplateByRegistry(registryId);
diff --git a/frontend/src/lib/services/api/user-api-service.ts b/frontend/src/lib/services/api/user-api-service.ts
index e866a5f68..43f6b9c4b 100644
--- a/frontend/src/lib/services/api/user-api-service.ts
+++ b/frontend/src/lib/services/api/user-api-service.ts
@@ -8,30 +8,34 @@ export interface Role {
description?: string;
}
+interface UsersResponse {
+ users: User[];
+}
+
export default class UserAPIService extends BaseAPIService {
async list(): Promise<User[]> {
- const response = await this.handleResponse(this.api.get('/users'));
+ const response = (await this.handleResponse(this.api.get('/users'))) as UsersResponse;
return response.users;
}
async get(id: string): Promise<User> {
- return this.handleResponse(this.api.get(`/users/${id}`));
+ return this.handleResponse(this.api.get(`/users/${id}`)) as Promise<User>;
}
async getCurrentUser(): Promise<User> {
- return this.handleResponse(this.api.get(`/auth/me`));
+ return this.handleResponse(this.api.get(`/auth/me`)) as Promise<User>;
}
async create(user: Omit<User, 'id' | 'createdAt' | 'updatedAt'>): Promise<User> {
- return this.handleResponse(this.api.post('/users', user));
+ return this.handleResponse(this.api.post('/users', user)) as Promise<User>;
}
async update(id: string, user: Partial<User>): Promise<User> {
- return this.handleResponse(this.api.put(`/users/${id}`, user));
+ return this.handleResponse(this.api.put(`/users/${id}`, user)) as Promise<User>;
}
async delete(id: string): Promise<void> {
- return this.handleResponse(this.api.delete(`/users/${id}`));
+ return this.handleResponse(this.api.delete(`/users/${id}`)) as Promise<void>;
}
async login(credentials: { username: string; password: string; rememberMe?: boolean }) {
@@ -39,11 +43,11 @@ export default class UserAPIService extends BaseAPIService {
}
async logout(): Promise<void> {
- return this.handleResponse(this.api.post('/auth/logout'));
+ return this.handleResponse(this.api.post('/auth/logout')) as Promise<void>;
}
async changePassword(data: { currentPassword: string; newPassword: string }): Promise<void> {
- return this.handleResponse(this.api.post('/auth/password', data));
+ return this.handleResponse(this.api.post('/auth/password', data)) as Promise<void>;
}
async resetPassword(userId: string, newPassword: string): Promise<void> {
@@ -51,51 +55,50 @@ export default class UserAPIService extends BaseAPIService {
this.api.post(`/users/${userId}/reset-password`, {
newPassword
})
- );
+ ) as Promise<void>;
}
async getByUsername(username: string): Promise<User> {
- return this.handleResponse(this.api.get(`/users/by-username/${encodeURIComponent(username)}`));
+ return this.handleResponse(this.api.get(`/users/by-username/${encodeURIComponent(username)}`)) as Promise<User>;
}
async getByOidcSubjectId(oidcSubjectId: string): Promise<User> {
- return this.handleResponse(this.api.get(`/users/by-oidc-subject/${encodeURIComponent(oidcSubjectId)}`));
+ return this.handleResponse(this.api.get(`/users/by-oidc-subject/${encodeURIComponent(oidcSubjectId)}`)) as Promise<User>;
}
- // RBAC methods
async getRoles(): Promise<Role[]> {
- return this.handleResponse(this.api.get('/roles'));
+ return this.handleResponse(this.api.get('/roles')) as Promise<Role[]>;
}
async getRole(id: string): Promise<Role> {
- return this.handleResponse(this.api.get(`/roles/${id}`));
+ return this.handleResponse(this.api.get(`/roles/${id}`)) as Promise<Role>;
}
async createRole(role: Omit<Role, 'id'>): Promise<Role> {
- return this.handleResponse(this.api.post('/roles', role));
+ return this.handleResponse(this.api.post('/roles', role)) as Promise<Role>;
}
async updateRole(id: string, role: Partial<Role>): Promise<Role> {
- return this.handleResponse(this.api.put(`/roles/${id}`, role));
+ return this.handleResponse(this.api.put(`/roles/${id}`, role)) as Promise<Role>;
}
async deleteRole(id: string): Promise<void> {
- return this.handleResponse(this.api.delete(`/roles/${id}`));
+ return this.handleResponse(this.api.delete(`/roles/${id}`)) as Promise<void>;
}
async assignRole(userId: string, roleId: string): Promise<void> {
- return this.handleResponse(this.api.post(`/users/${userId}/roles`, { roleId }));
+ return this.handleResponse(this.api.post(`/users/${userId}/roles`, { roleId })) as Promise<void>;
}
async removeRole(userId: string, roleId: string): Promise<void> {
- return this.handleResponse(this.api.delete(`/users/${userId}/roles/${roleId}`));
+ return this.handleResponse(this.api.delete(`/users/${userId}/roles/${roleId}`)) as Promise<void>;
}
async getUserRoles(userId: string): Promise<Role[]> {
- return this.handleResponse(this.api.get(`/users/${userId}/roles`));
+ return this.handleResponse(this.api.get(`/users/${userId}/roles`)) as Promise<Role[]>;
}
async getPermissions(): Promise<string[]> {
- return this.handleResponse(this.api.get('/permissions'));
+ return this.handleResponse(this.api.get('/permissions')) as Promise<string[]>;
}
}
diff --git a/frontend/src/lib/stores/environment.store.ts b/frontend/src/lib/stores/environment.store.ts
index 29ccb445e..f66c12717 100644
--- a/frontend/src/lib/stores/environment.store.ts
+++ b/frontend/src/lib/stores/environment.store.ts
@@ -1,5 +1,6 @@
import { writable, get } from 'svelte/store';
import { browser } from '$app/environment';
+import { invalidateAll } from '$app/navigation';
export type Environment = {
id: string;
@@ -94,9 +95,8 @@ function createEnvironmentManagementStore() {
if (!_initialized) {
_selectInitialEnvironment(available);
_initialized = true;
- _resolveReadyPromiseFunction(); // Resolve ready promise on first successful initialization
+ _resolveReadyPromiseFunction();
} else {
- // If already initialized, ensure the selected environment is still valid
const currentSelected = get(_selectedEnvironment);
if (currentSelected && !available.find((env) => env.id === currentSelected.id)) {
_selectInitialEnvironment(available);
@@ -105,10 +105,19 @@ function createEnvironmentManagementStore() {
}
}
},
- setEnvironment: (environment: Environment) => {
- _selectedEnvironment.set(environment);
- if (browser && localStorage) {
- localStorage.setItem('selectedEnvironmentId', environment.id);
+ setEnvironment: async (environment: Environment) => {
+ const currentSelected = get(_selectedEnvironment);
+
+ if (currentSelected?.id !== environment.id) {
+ _selectedEnvironment.set(environment);
+
+ if (browser && localStorage) {
+ localStorage.setItem('selectedEnvironmentId', environment.id);
+ }
+
+ if (browser) {
+ await invalidateAll();
+ }
}
},
isInitialized: () => _initialized,
diff --git a/frontend/src/lib/types/settings.type.ts b/frontend/src/lib/types/settings.type.ts
index f4766a7a1..d275caeb5 100644
--- a/frontend/src/lib/types/settings.type.ts
+++ b/frontend/src/lib/types/settings.type.ts
@@ -2,17 +2,11 @@ export interface AuthSettings {
localAuthEnabled: boolean;
oidcEnabled: boolean;
sessionTimeout: number;
- passwordPolicy: 'basic' | 'standard' | 'strong';
+ passwordPolicy: string;
rbacEnabled: boolean;
oidc?: OidcConfig;
}
-export interface RegistryCredential {
- url: string;
- username: string;
- password: string;
-}
-
export interface OidcConfig {
clientId: string;
clientSecret: string;
@@ -23,9 +17,32 @@ export interface OidcConfig {
scopes: string;
}
+export interface OidcStatusInfo {
+ envForced: boolean;
+ envConfigured: boolean;
+ dbEnabled: boolean;
+ dbConfigured: boolean;
+ effectivelyEnabled: boolean;
+ effectivelyConfigured: boolean;
+}
+
+export interface RegistryCredential {
+ url: string;
+ username: string;
+ password: string;
+}
+
+export interface TemplateRegistryConfig {
+ url: string;
+ name: string;
+ enabled: boolean;
+ lastUpdated?: number;
+ cacheTtl?: number;
+}
+
export interface Onboarding {
completed: boolean;
- completedAt?: string;
+ completedAt?: number;
steps?: {
welcome?: boolean;
password?: boolean;
@@ -33,57 +50,21 @@ export interface Onboarding {
};
}
-export interface TemplateRegistryConfig {
- url: string;
- name: string;
- enabled: boolean;
- last_updated?: string;
- cache_ttl?: number;
-}
-
export interface Settings {
+ id: number;
+ dockerTLSCert: string;
stacksDirectory: string;
autoUpdate: boolean;
autoUpdateInterval: number;
pollingEnabled: boolean;
pollingInterval: number;
- pruneMode: 'all' | 'dangling' | undefined;
+ pruneMode?: string;
registryCredentials: RegistryCredential[];
templateRegistries: TemplateRegistryConfig[];
auth: AuthSettings;
onboarding?: Onboarding;
baseServerUrl?: string;
maturityThresholdDays: number;
-}
-
-export interface OidcUserInfo {
- sub: string;
- email: string;
- name: string;
- preferred_username?: string;
- given_name?: string;
- family_name?: string;
- picture?: string;
- groups?: string[];
-}
-
-export interface RegistryCredential {
- id: string;
- name: string;
- serverAddress: string;
- username: string;
- password: string; // This should be encrypted
- email?: string;
- isDefault?: boolean;
-}
-
-export interface TemplateRegistrySettings {
- id: string;
- name: string;
- url: string;
- username?: string;
- password?: string; // This should be encrypted
- enabled: boolean;
- autoUpdate: boolean;
- updateInterval: number; // in hours
+ createdAt: string;
+ updatedAt: string;
}
diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte
index 46641cc67..71a78d888 100644
--- a/frontend/src/routes/+page.svelte
+++ b/frontend/src/routes/+page.svelte
@@ -711,5 +711,5 @@
</div>
</section>
- <PruneConfirmationDialog bind:open={dashboardStates.isPruneDialogOpen} isPruning={isLoading.pruning} imagePruneMode={dashboardStates.settings?.pruneMode || 'dangling'} onConfirm={confirmPrune} onCancel={() => (dashboardStates.isPruneDialogOpen = false)} />
+ <PruneConfirmationDialog bind:open={dashboardStates.isPruneDialogOpen} isPruning={isLoading.pruning} imagePruneMode={(dashboardStates.settings?.pruneMode as 'dangling' | 'all') || 'dangling'} onConfirm={confirmPrune} onCancel={() => (dashboardStates.isPruneDialogOpen = false)} />
</div>
diff --git a/frontend/src/routes/compose/[composeId]/+page.svelte b/frontend/src/routes/compose/[composeId]/+page.svelte
index 88b487c66..5c5db6c82 100644
--- a/frontend/src/routes/compose/[composeId]/+page.svelte
+++ b/frontend/src/routes/compose/[composeId]/+page.svelte
@@ -90,7 +90,7 @@
}
function getHostForService(service: StackService): string {
- if (!service || !service.networkSettings?.Networks) return baseServerUrl;
+ if (!service?.networkSettings?.Networks) return baseServerUrl;
const networks = service.networkSettings.Networks;
for (const networkName in networks) {
@@ -294,7 +294,8 @@
<div class="flex flex-wrap gap-2">
{#each allUniquePorts as port (port)}
{@const portValue = typeof port === 'string' || typeof port === 'number' || (typeof port === 'object' && port !== null) ? port : String(port)}
- <a href={getServicePortUrl(stack, portValue)} target="_blank" rel="noopener noreferrer" class="inline-flex items-center rounded-md bg-blue-500/10 px-3 py-2 font-medium text-blue-600 transition-colors hover:bg-blue-500/20 dark:text-blue-400">
+ {@const serviceWithPort = stack.services?.find((s) => s.ports?.includes(String(port))) || { container_id: '', name: '', status: '' }}
+ <a href={getServicePortUrl(serviceWithPort, portValue)} target="_blank" rel="noopener noreferrer" class="inline-flex items-center rounded-md bg-blue-500/10 px-3 py-2 font-medium text-blue-600 transition-colors hover:bg-blue-500/20 dark:text-blue-400">
Port {port}
<ExternalLink class="ml-2 size-4" />
</a>
diff --git a/frontend/src/routes/environments/+page.svelte b/frontend/src/routes/environments/+page.svelte
index 69e738dfc..a93758fec 100644
--- a/frontend/src/routes/environments/+page.svelte
+++ b/frontend/src/routes/environments/+page.svelte
@@ -137,10 +137,6 @@
}
</script>
-<svelte:head>
- <title>Environment Management - Arcane</title>
-</svelte:head>
-
<div class="space-y-6">
<div>
<h1 class="text-3xl font-bold tracking-tight">Environment Management</h1>
diff --git a/frontend/src/routes/environments/[id]/+page.svelte b/frontend/src/routes/environments/[id]/+page.svelte
index 9a7f5e454..212e03d93 100644
--- a/frontend/src/routes/environments/[id]/+page.svelte
+++ b/frontend/src/routes/environments/[id]/+page.svelte
@@ -68,10 +68,6 @@
const environmentDisplayName = $derived(environment?.hostname || 'Environment Details');
</script>
-<svelte:head>
- <title>{environmentDisplayName} - Arcane</title>
-</svelte:head>
-
<div class="space-y-6 pb-16">
<div class="flex items-center justify-between">
<div class="flex items-center gap-4">
diff --git a/frontend/src/routes/images/[imageId]/+page.svelte b/frontend/src/routes/images/[imageId]/+page.svelte
index 809bf29ce..172f83e82 100644
--- a/frontend/src/routes/images/[imageId]/+page.svelte
+++ b/frontend/src/routes/images/[imageId]/+page.svelte
@@ -24,9 +24,11 @@
refreshing: false
});
- const shortId = $derived(image?.Id.split(':')[1].substring(0, 12) || 'N/A');
- const createdDate = $derived(image?.Created ? formatDate(image.Created) : 'N/A');
+ const shortId = $derived(image?.Id.split(':')[1]?.substring(0, 12) || 'N/A');
+ const createdDate = $derived(image?.Created ? formatDate(new Date(image.Created * 1000).toISOString()) : 'N/A');
const imageSize = $derived(formatBytes(image?.Size || 0));
+ const architecture = $derived(image?.Manifests?.[0]?.ImageData?.Platform?.architecture || 'N/A');
+ const osName = $derived(image?.Manifests?.[0]?.ImageData?.Platform?.os || 'N/A');
async function handleImageRemove(id: string) {
openConfirmDialog({
@@ -126,7 +128,7 @@
</div>
<div class="min-w-0 flex-1">
<p class="text-muted-foreground text-sm font-medium">Architecture</p>
- <p class="mt-1 text-base font-semibold">{image.Architecture || 'N/A'}</p>
+ <p class="mt-1 text-base font-semibold">{architecture}</p>
</div>
</div>
@@ -137,7 +139,7 @@
</div>
<div class="min-w-0 flex-1">
<p class="text-muted-foreground text-sm font-medium">OS</p>
- <p class="mt-1 text-base font-semibold">{image.Os || 'N/A'}</p>
+ <p class="mt-1 text-base font-semibold">{osName}</p>
</div>
</div>
</div>
@@ -161,18 +163,18 @@
{/if}
<!-- Labels Card -->
- {#if image.Config?.Labels && Object.keys(image.Config.Labels).length > 0}
+ {#if image.Labels && Object.keys(image.Labels).length > 0}
<Card.Root class="border shadow-sm">
<Card.Header>
<Card.Title>Labels</Card.Title>
</Card.Header>
<Card.Content class="space-y-2">
- {#each Object.entries(image.Config.Labels) as [key, value] (key)}
+ {#each Object.entries(image.Labels) as [key, value] (key)}
<div class="flex flex-col text-sm sm:flex-row sm:items-center">
<span class="text-muted-foreground w-full font-medium break-all sm:w-1/4">{key}:</span>
<span class="w-full font-mono text-xs break-all sm:w-3/4 sm:text-sm">{value}</span>
</div>
- {#if !Object.is(Object.keys(image.Config.Labels).length - 1, Object.keys(image.Config.Labels).indexOf(key))}
+ {#if !Object.is(Object.keys(image.Labels).length - 1, Object.keys(image.Labels).indexOf(key))}
<Separator class="my-2" />
{/if}
{/each}
diff --git a/frontend/src/routes/onboarding/settings/+page.svelte b/frontend/src/routes/onboarding/settings/+page.svelte
index b616d5a06..b150c5f64 100644
--- a/frontend/src/routes/onboarding/settings/+page.svelte
+++ b/frontend/src/routes/onboarding/settings/+page.svelte
@@ -16,7 +16,6 @@
let error = $state('');
let loading = $state(false);
- let dockerHost = $state(data.settings.dockerHost);
let stacksDirectory = $state(data.settings.stacksDirectory);
let pollingEnabled = $state(data.settings.pollingEnabled);
let pollingInterval = $state(data.settings.pollingInterval);
@@ -24,7 +23,6 @@
function getUpdatedSettings(): Partial<Settings> {
return {
- dockerHost,
stacksDirectory,
pollingEnabled,
pollingInterval,
@@ -36,7 +34,7 @@
settings: true
},
completed: true,
- completedAt: new Date().toISOString()
+ completedAt: Date.now()
}
};
}
@@ -67,22 +65,6 @@
{/if}
<form class="space-y-5" onsubmit={() => continueToNextStep()}>
- <Card.Root class="border shadow-sm">
- <Card.Header class="py-4">
- <Card.Title>Docker Connection</Card.Title>
- <Card.Description>Configure how Arcane connects to Docker</Card.Description>
- </Card.Header>
- <Card.Content class="pt-0 pb-4">
- <div class="space-y-3">
- <Label for="dockerHost" class="mb-2 block text-base">Docker Host</Label>
- <Input id="dockerHost" bind:value={dockerHost} placeholder="unix:///var/run/docker.sock" class="bg-muted/10 h-12 px-4" />
- <p class="text-muted-foreground text-xs">
- Examples: Unix: <code class="bg-muted/30 rounded px-1 py-0.5">unix:///var/run/docker.sock</code>
- </p>
- </div>
- </Card.Content>
- </Card.Root>
-
<Card.Root class="border shadow-sm">
<Card.Header class="py-4">
<Card.Title>Monitoring & Updates</Card.Title>
diff --git a/frontend/src/routes/settings/+layout.svelte b/frontend/src/routes/settings/+layout.svelte
index e14e54619..e7afe2372 100644
--- a/frontend/src/routes/settings/+layout.svelte
+++ b/frontend/src/routes/settings/+layout.svelte
@@ -8,7 +8,6 @@
let { children }: Props = $props();
let currentPageName = $derived(page.url.pathname.split('/').pop() || 'settings');
- let pageTitle = $derived(currentPageName.charAt(0).toUpperCase() + currentPageName.slice(1));
</script>
<div class="settings-container">
diff --git a/frontend/src/routes/settings/docker/+page.svelte b/frontend/src/routes/settings/docker/+page.svelte
index 7b4d58a62..882fc5907 100644
--- a/frontend/src/routes/settings/docker/+page.svelte
+++ b/frontend/src/routes/settings/docker/+page.svelte
@@ -1,6 +1,6 @@
<script lang="ts">
import * as Card from '$lib/components/ui/card/index.js';
- import type { FormInput as FormInputType } from '$lib/types/form.type';
+ import type { FormInput as FormInputType } from '$lib/utils/form.utils';
import { Button } from '$lib/components/ui/button/index.js';
import { RefreshCw, ImageMinus, Save, Clock, Zap, InfoIcon } from '@lucide/svelte';
import * as RadioGroup from '$lib/components/ui/radio-group/index.js';
@@ -50,34 +50,22 @@
let pollingIntervalInput = $state<FormInputType<number>>({
value: 0,
- valid: true,
- touched: false,
- error: null,
- errors: []
+ error: null
});
let pollingEnabledSwitch = $state<FormInputType<boolean>>({
value: false,
- valid: true,
- touched: false,
- error: null,
- errors: []
+ error: null
});
let autoUpdateSwitch = $state<FormInputType<boolean>>({
value: false,
- valid: true,
- touched: false,
- error: null,
- errors: []
+ error: null
});
let autoUpdateIntervalInput = $state<FormInputType<number>>({
value: 5,
- valid: true,
- touched: false,
- error: null,
- errors: []
+ error: null
});
$effect(() => {
@@ -94,10 +82,6 @@
let canSave = $derived(isPollingConfigValid && isAutoUpdateConfigValid);
</script>
-<svelte:head>
- <title>Docker Settings - Arcane</title>
-</svelte:head>
-
<div class="settings-page">
<!-- Header Section -->
<div class="settings-header">
diff --git a/frontend/src/routes/settings/general/+page.svelte b/frontend/src/routes/settings/general/+page.svelte
index ff958be08..ff2bea09a 100644
--- a/frontend/src/routes/settings/general/+page.svelte
+++ b/frontend/src/routes/settings/general/+page.svelte
@@ -63,10 +63,6 @@
});
</script>
-<svelte:head>
- <title>General Settings - Arcane</title>
-</svelte:head>
-
<div class="space-y-6">
<!-- Header -->
<div class="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
diff --git a/frontend/src/routes/settings/rbac/+page.svelte b/frontend/src/routes/settings/rbac/+page.svelte
index 1d093fd50..978cf7199 100644
--- a/frontend/src/routes/settings/rbac/+page.svelte
+++ b/frontend/src/routes/settings/rbac/+page.svelte
@@ -65,10 +65,6 @@
let selectedRole = $state(roles[0]);
</script>
-<svelte:head>
- <title>RBAC Settings - Arcane</title>
-</svelte:head>
-
<div class="space-y-6">
<div class="flex flex-col justify-between gap-4 sm:flex-row sm:items-center">
<div>
diff --git a/frontend/src/routes/settings/security/+page.svelte b/frontend/src/routes/settings/security/+page.svelte
index 26709531c..5914d86e1 100644
--- a/frontend/src/routes/settings/security/+page.svelte
+++ b/frontend/src/routes/settings/security/+page.svelte
@@ -16,12 +16,48 @@
let { data }: { data: PageData } = $props();
let currentSettings = $state(data.settings);
+ let showOidcConfigDialog = $state(false);
+ let oidcConfigForm = $state({
+ clientId: '',
+ clientSecret: '',
+ redirectUri: 'http://localhost:3000/auth/oidc/callback',
+ authorizationEndpoint: '',
+ tokenEndpoint: '',
+ userinfoEndpoint: '',
+ scopes: 'openid email profile'
+ });
+
+ let localAuthEnabled = $state(true);
+ let oidcEnabled = $state(false);
+ let sessionTimeout = $state(60);
+ let passwordPolicy = $state('strong');
+
+ let isLoading = $state({
+ saving: false
+ });
+
+ let isOidcViewMode = $derived(data.oidcStatus.envForced && data.oidcStatus.envConfigured);
+
+ $effect(() => {
+ localAuthEnabled = currentSettings.auth?.localAuthEnabled ?? true;
+ oidcEnabled = currentSettings.auth?.oidcEnabled ?? false;
+ sessionTimeout = currentSettings.auth?.sessionTimeout ?? 60;
+ passwordPolicy = currentSettings.auth?.passwordPolicy ?? 'strong';
+
+ oidcConfigForm.clientId = currentSettings.auth?.oidc?.clientId || '';
+ oidcConfigForm.redirectUri = currentSettings.auth?.oidc?.redirectUri || 'http://localhost:3000/auth/oidc/callback';
+ oidcConfigForm.authorizationEndpoint = currentSettings.auth?.oidc?.authorizationEndpoint || '';
+ oidcConfigForm.tokenEndpoint = currentSettings.auth?.oidc?.tokenEndpoint || '';
+ oidcConfigForm.userinfoEndpoint = currentSettings.auth?.oidc?.userinfoEndpoint || '';
+ oidcConfigForm.scopes = currentSettings.auth?.oidc?.scopes || 'openid email profile';
+ oidcConfigForm.clientSecret = '';
+ });
+
async function updateSettingsConfig(updatedSettings: Partial<Settings>) {
currentSettings = await settingsAPI.updateSettings({
...currentSettings,
...updatedSettings
});
-
settingsStore.reload();
}
@@ -38,7 +74,7 @@
? {
oidc: {
clientId: oidcConfigForm.clientId,
- clientSecret: oidcConfigForm.clientSecret || undefined,
+ clientSecret: oidcConfigForm.clientSecret || '',
redirectUri: oidcConfigForm.redirectUri,
authorizationEndpoint: oidcConfigForm.authorizationEndpoint,
tokenEndpoint: oidcConfigForm.tokenEndpoint,
@@ -58,47 +94,6 @@
});
}
- let showOidcConfigDialog = $state(false);
- let oidcConfigForm = $state({
- clientId: '',
- clientSecret: '',
- redirectUri: 'http://localhost:3000/auth/oidc/callback',
- authorizationEndpoint: '',
- tokenEndpoint: '',
- userinfoEndpoint: '',
- scopes: 'openid email profile'
- });
-
- // State variables for form inputs
- let localAuthEnabled = $state(true);
- let oidcEnabled = $state(false);
- let sessionTimeout = $state(60);
- let passwordPolicy = $state<'basic' | 'standard' | 'strong'>('strong');
-
- // Loading states
- let isLoading = $state({
- saving: false
- });
-
- let isOidcViewMode = $derived(data.oidcStatus.envForced && data.oidcStatus.envConfigured);
-
- // Update state when currentSettings changes
- $effect(() => {
- localAuthEnabled = currentSettings.auth?.localAuthEnabled ?? true;
- oidcEnabled = currentSettings.auth?.oidcEnabled ?? false;
- sessionTimeout = currentSettings.auth?.sessionTimeout ?? 60;
- passwordPolicy = currentSettings.auth?.passwordPolicy ?? 'strong';
-
- // Update OIDC form
- oidcConfigForm.clientId = currentSettings.auth?.oidc?.clientId || '';
- oidcConfigForm.redirectUri = currentSettings.auth?.oidc?.redirectUri || 'http://localhost:3000/auth/oidc/callback';
- oidcConfigForm.authorizationEndpoint = currentSettings.auth?.oidc?.authorizationEndpoint || '';
- oidcConfigForm.tokenEndpoint = currentSettings.auth?.oidc?.tokenEndpoint || '';
- oidcConfigForm.userinfoEndpoint = currentSettings.auth?.oidc?.userinfoEndpoint || '';
- oidcConfigForm.scopes = currentSettings.auth?.oidc?.scopes || 'openid email profile';
- oidcConfigForm.clientSecret = '';
- });
-
function handleOidcSwitchChange(checked: boolean) {
oidcEnabled = checked;
@@ -134,12 +129,7 @@
}
</script>
-<svelte:head>
- <title>Security Settings - Arcane</title>
-</svelte:head>
-
<div class="settings-page">
- <!-- Header Section -->
<div class="settings-header">
<div class="settings-header-content">
<h1 class="settings-title">Security Settings</h1>
@@ -159,9 +149,7 @@
</div>
</div>
- <!-- Settings Grid -->
<div class="settings-grid settings-grid-double">
- <!-- Authentication Methods Card -->
<Card.Root class="settings-card">
<Card.Header class="settings-card-header">
<div class="settings-card-title-wrapper">
@@ -195,11 +183,11 @@
<label for="oidcAuthSwitch" class="text-base font-medium">OIDC Authentication</label>
<p class="text-muted-foreground text-sm">
Use an External OIDC Provider
- {#if 'envForced' in data.oidcStatus && data.oidcStatus.envForced}
+ {#if data.oidcStatus.envForced}
<span class="text-muted-foreground text-xs">(Forced ON by server environment)</span>
{/if}
</p>
- {#if 'envForced' in data.oidcStatus && (data.oidcStatus.effectivelyEnabled || data.oidcStatus.envForced)}
+ {#if data.oidcStatus.effectivelyEnabled || data.oidcStatus.envForced}
{#if data.oidcStatus.envForced && !data.oidcStatus.envConfigured}
<Button variant="link" class="text-destructive h-auto p-0 text-xs hover:underline" onclick={openOidcDialog}>
<AlertTriangle class="mr-1 size-3" />
@@ -221,20 +209,14 @@
OIDC enabled, but app settings incomplete. Configure.
</Button>
{/if}
- {:else if 'enabled' in data.oidcStatus && data.oidcStatus.enabled}
- <Button variant="link" class="h-auto p-0 text-xs text-sky-600 hover:underline" onclick={openOidcDialog}>
- <Info class="mr-1 size-3" />
- OIDC enabled (legacy mode). Manage.
- </Button>
{/if}
</div>
- <Switch id="oidcAuthSwitch" checked={oidcEnabled} disabled={'envForced' in data.oidcStatus && data.oidcStatus.envForced} onCheckedChange={handleOidcSwitchChange} />
+ <Switch id="oidcAuthSwitch" checked={oidcEnabled} disabled={data.oidcStatus.envForced} onCheckedChange={handleOidcSwitchChange} />
</div>
</div>
</Card.Content>
</Card.Root>
- <!-- OIDC Configuration/Status Dialog -->
<Dialog.Root bind:open={showOidcConfigDialog}>
<Dialog.Content class="sm:max-w-[600px]">
<Dialog.Header>
@@ -285,7 +267,6 @@
<p class="text-muted-foreground mt-3 text-xs">Changes to these settings must be made in your server's environment configuration.</p>
</div>
{:else}
- <!-- Form for setup/configuration -->
<div class="grid max-h-[50vh] gap-4 overflow-y-auto py-4 pr-2">
<div class="grid grid-cols-4 items-center gap-4">
<Label for="oidcClientId" class="col-span-1 text-right">Client ID</Label>
@@ -327,7 +308,6 @@
</Dialog.Content>
</Dialog.Root>
- <!-- Session Settings Card -->
<Card.Root class="settings-card">
<Card.Header class="settings-card-header">
<div class="settings-card-title-wrapper">
diff --git a/frontend/src/routes/settings/users/+page.svelte b/frontend/src/routes/settings/users/+page.svelte
index f0c7889cc..c50693770 100644
--- a/frontend/src/routes/settings/users/+page.svelte
+++ b/frontend/src/routes/settings/users/+page.svelte
@@ -89,10 +89,6 @@
}
</script>
-<svelte:head>
- <title>User Management - Arcane</title>
-</svelte:head>
-
<UserFormSheet bind:open={userPageStates.isUserDialogOpen} bind:userToEdit={userPageStates.userToEdit} {roles} onSubmit={handleDialogSubmit} bind:this={userDialogRef} isLoading={isLoading.saving} allowUsernameEdit={true} />
<div class="space-y-6">
diff --git a/frontend/src/routes/volumes/+page.ts b/frontend/src/routes/volumes/+page.ts
index 23bada858..53177338d 100644
--- a/frontend/src/routes/volumes/+page.ts
+++ b/frontend/src/routes/volumes/+page.ts
@@ -4,6 +4,7 @@ import type { VolumeInspectInfo } from 'dockerode';
type EnhancedVolumeInfo = VolumeInspectInfo & {
inUse: boolean;
+ CreatedAt: string;
};
type VolumePageData = {