fix(web-ui): stabilize app store service creation flow and add Ghost sqlite defaults

This commit is contained in:
2026-03-18 09:48:12 +00:00
parent 829f7e47f1
commit 6e5743c837
9 changed files with 139 additions and 366 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@serve.zone/onebox',
version: '1.22.1',
version: '1.22.2',
description: 'Self-hosted container platform with automatic SSL and DNS - a mini Heroku for single servers'
}

View File

@@ -48,6 +48,8 @@ const appTemplates = [
image: 'ghost:latest',
port: 2368,
envVars: [
{ key: 'database__client', value: 'sqlite3', description: 'Database client (sqlite3 for standalone)' },
{ key: 'database__connection__filename', value: '/var/lib/ghost/content/data/ghost.db', description: 'SQLite database path' },
{ key: 'url', value: 'http://localhost:2368', description: 'Public URL of the blog' },
],
},
@@ -208,13 +210,15 @@ export class ObViewAppStore extends DeesElement {
const app = e.detail?.app;
if (!app) return;
// Store the template in appstate so the services create view can pre-fill
appstate.uiStatePart.setState({
...appstate.uiStatePart.getState(),
pendingAppTemplate: app,
});
// Navigate to Services tab — the services view will detect the pending template
appstate.uiStatePart.dispatchAction(appstate.setActiveViewAction, { view: 'services' });
// Store the template and navigate on next microtask to avoid
// destroying the current view while the event handler is still on the call stack
setTimeout(() => {
// Set both pendingAppTemplate and activeView atomically
appstate.uiStatePart.setState({
...appstate.uiStatePart.getState(),
pendingAppTemplate: app,
activeView: 'services',
});
}, 0);
}
}

View File

@@ -158,6 +158,8 @@ export class ObViewServices extends DeesElement {
this.backupsState = newState;
});
this.rxSubscriptions.push(backupsSub);
// No subscription needed — pendingAppTemplate is checked in render()
}
public static styles = [
@@ -226,9 +228,13 @@ export class ObViewServices extends DeesElement {
this.navigateToPlatformDetail(type);
}
// If an app template was selected from the App Store, switch to create view
}
updated(changedProperties: Map<string, any>) {
super.updated(changedProperties);
// Check for pending app template from the App Store after each update
const uiState = appstate.uiStatePart.getState();
if (uiState.pendingAppTemplate) {
if (uiState.pendingAppTemplate && !this.pendingTemplate) {
this.pendingTemplate = uiState.pendingAppTemplate;
appstate.uiStatePart.setState({
...appstate.uiStatePart.getState(),