feat: integrate toast notifications in settings and layout components
- Added ToastService for managing toast notifications. - Replaced alert in settings component with toast notifications for success and error messages. - Included ToastComponent in layout for displaying notifications. - Created loading spinner component for better user experience. - Implemented domain detail component with detailed views for certificates, requirements, and services. - Added functionality to manage and display SSL certificates and their statuses. - Introduced a registry manager class for handling Docker registry operations.
This commit is contained in:
@@ -505,6 +505,35 @@ export class OneboxDatabase {
|
||||
this.setMigrationVersion(3);
|
||||
logger.success('Migration 3 completed: Domain management tables created');
|
||||
}
|
||||
|
||||
// Migration 4: Add Onebox Registry support columns to services table
|
||||
const version4 = this.getMigrationVersion();
|
||||
if (version4 < 4) {
|
||||
logger.info('Running migration 4: Adding Onebox Registry columns to services table...');
|
||||
|
||||
// Add new columns for registry support
|
||||
this.query(`
|
||||
ALTER TABLE services ADD COLUMN use_onebox_registry INTEGER DEFAULT 0
|
||||
`);
|
||||
this.query(`
|
||||
ALTER TABLE services ADD COLUMN registry_repository TEXT
|
||||
`);
|
||||
this.query(`
|
||||
ALTER TABLE services ADD COLUMN registry_token TEXT
|
||||
`);
|
||||
this.query(`
|
||||
ALTER TABLE services ADD COLUMN registry_image_tag TEXT DEFAULT 'latest'
|
||||
`);
|
||||
this.query(`
|
||||
ALTER TABLE services ADD COLUMN auto_update_on_push INTEGER DEFAULT 0
|
||||
`);
|
||||
this.query(`
|
||||
ALTER TABLE services ADD COLUMN image_digest TEXT
|
||||
`);
|
||||
|
||||
this.setMigrationVersion(4);
|
||||
logger.success('Migration 4 completed: Onebox Registry columns added to services table');
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error(`Migration failed: ${error.message}`);
|
||||
logger.error(`Stack: ${error.stack}`);
|
||||
@@ -589,8 +618,12 @@ export class OneboxDatabase {
|
||||
|
||||
const now = Date.now();
|
||||
this.query(
|
||||
`INSERT INTO services (name, image, registry, env_vars, port, domain, container_id, status, created_at, updated_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||
`INSERT INTO services (
|
||||
name, image, registry, env_vars, port, domain, container_id, status,
|
||||
created_at, updated_at,
|
||||
use_onebox_registry, registry_repository, registry_token, registry_image_tag,
|
||||
auto_update_on_push, image_digest
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||
[
|
||||
service.name,
|
||||
service.image,
|
||||
@@ -602,6 +635,12 @@ export class OneboxDatabase {
|
||||
service.status,
|
||||
now,
|
||||
now,
|
||||
service.useOneboxRegistry ? 1 : 0,
|
||||
service.registryRepository || null,
|
||||
service.registryToken || null,
|
||||
service.registryImageTag || 'latest',
|
||||
service.autoUpdateOnPush ? 1 : 0,
|
||||
service.imageDigest || null,
|
||||
]
|
||||
);
|
||||
|
||||
@@ -663,6 +702,31 @@ export class OneboxDatabase {
|
||||
fields.push('status = ?');
|
||||
values.push(updates.status);
|
||||
}
|
||||
// Onebox Registry fields
|
||||
if (updates.useOneboxRegistry !== undefined) {
|
||||
fields.push('use_onebox_registry = ?');
|
||||
values.push(updates.useOneboxRegistry ? 1 : 0);
|
||||
}
|
||||
if (updates.registryRepository !== undefined) {
|
||||
fields.push('registry_repository = ?');
|
||||
values.push(updates.registryRepository);
|
||||
}
|
||||
if (updates.registryToken !== undefined) {
|
||||
fields.push('registry_token = ?');
|
||||
values.push(updates.registryToken);
|
||||
}
|
||||
if (updates.registryImageTag !== undefined) {
|
||||
fields.push('registry_image_tag = ?');
|
||||
values.push(updates.registryImageTag);
|
||||
}
|
||||
if (updates.autoUpdateOnPush !== undefined) {
|
||||
fields.push('auto_update_on_push = ?');
|
||||
values.push(updates.autoUpdateOnPush ? 1 : 0);
|
||||
}
|
||||
if (updates.imageDigest !== undefined) {
|
||||
fields.push('image_digest = ?');
|
||||
values.push(updates.imageDigest);
|
||||
}
|
||||
|
||||
fields.push('updated_at = ?');
|
||||
values.push(Date.now());
|
||||
@@ -701,6 +765,13 @@ export class OneboxDatabase {
|
||||
status: String(row.status || row[8]) as IService['status'],
|
||||
createdAt: Number(row.created_at || row[9]),
|
||||
updatedAt: Number(row.updated_at || row[10]),
|
||||
// Onebox Registry fields
|
||||
useOneboxRegistry: row.use_onebox_registry ? Boolean(row.use_onebox_registry) : undefined,
|
||||
registryRepository: row.registry_repository ? String(row.registry_repository) : undefined,
|
||||
registryToken: row.registry_token ? String(row.registry_token) : undefined,
|
||||
registryImageTag: row.registry_image_tag ? String(row.registry_image_tag) : undefined,
|
||||
autoUpdateOnPush: row.auto_update_on_push ? Boolean(row.auto_update_on_push) : undefined,
|
||||
imageDigest: row.image_digest ? String(row.image_digest) : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user