fix(web-ui): stabilize app store service creation flow and add Ghost sqlite defaults
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user