mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-11-09 05:24:49 +09:00
"Marketplace" reads as a store; the page is where you browse and install extensions, so call it Extensions. - Nav label + page/tab title + route /marketplace -> /extensions (first tab drives the topbar title via TabGroupLayout). - /marketplace and /marketplace/installed now redirect to /extensions. - Update command palette, page-context map, NotFound, empty-state copy. - Keep the internal nav id, CSS classes, component/file names, and the backend /api/v1/marketplace/registry endpoints unchanged; palette keeps "marketplace" as a search keyword so the old term still finds it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
89 lines
3.1 KiB
JavaScript
89 lines
3.1 KiB
JavaScript
// Runnable actions for the command palette (plan 41, Phase 3). Typing `>` filters
|
|
// results to this list. v1 ships only safe, non-destructive verbs — openers and
|
|
// navigation-with-intent — never blind destructive/exec commands (those belong to
|
|
// entity rows with confirm dialogs; see the plan's "Deliberately deferred").
|
|
//
|
|
// Each action: { id, label, keywords, adminOnly?, suggested?, perform(ctx) }.
|
|
// `ctx` = { navigate, toggleTheme, logout, api } is assembled by CommandPalette
|
|
// from the app's hooks. `suggested: true` surfaces the action on the empty-query
|
|
// screen. Every action still passes the Phase-1 authz filter (adminOnly + nav).
|
|
|
|
export const COMMAND_ACTIONS = [
|
|
{
|
|
id: 'new-service',
|
|
label: 'New Service',
|
|
keywords: 'create app deploy add service container',
|
|
suggested: true,
|
|
perform: ({ navigate }) => navigate('/services/new'),
|
|
},
|
|
{
|
|
id: 'add-server',
|
|
label: 'Add Server',
|
|
keywords: 'connect agent fleet new server node',
|
|
suggested: true,
|
|
perform: ({ navigate }) => navigate('/servers'),
|
|
},
|
|
{
|
|
id: 'add-domain',
|
|
label: 'Add Domain',
|
|
keywords: 'dns new create domain zone',
|
|
perform: ({ navigate }) => navigate('/domains'),
|
|
},
|
|
{
|
|
id: 'new-cron',
|
|
label: 'New Cron Job',
|
|
keywords: 'schedule task create cron job',
|
|
perform: ({ navigate }) => navigate('/cron'),
|
|
},
|
|
{
|
|
id: 'new-backup-policy',
|
|
label: 'New Backup Policy',
|
|
keywords: 'backup schedule protection create policy',
|
|
perform: ({ navigate }) => navigate('/backups'),
|
|
},
|
|
{
|
|
id: 'install-extension',
|
|
label: 'Install Extension',
|
|
keywords: 'marketplace plugin add manual install extension',
|
|
perform: ({ navigate }) => navigate('/extensions'),
|
|
},
|
|
{
|
|
id: 'open-terminal',
|
|
label: 'Open Terminal',
|
|
keywords: 'shell ssh console terminal logs',
|
|
perform: ({ navigate }) => navigate('/terminal'),
|
|
},
|
|
{
|
|
id: 'toggle-theme',
|
|
label: 'Toggle Theme',
|
|
keywords: 'dark light mode appearance theme switch',
|
|
perform: ({ toggleTheme }) => toggleTheme && toggleTheme(),
|
|
},
|
|
{
|
|
id: 'copy-version',
|
|
label: 'Copy Panel Version',
|
|
keywords: 'about build version copy',
|
|
perform: async ({ api }) => {
|
|
try {
|
|
const data = (await (api.getSystemInfo
|
|
? api.getSystemInfo()
|
|
: api.getSystemSettings())) || {};
|
|
const version = data.version || data.app_version || data.panel_version;
|
|
if (version && navigator.clipboard) {
|
|
await navigator.clipboard.writeText(String(version));
|
|
}
|
|
} catch {
|
|
/* best-effort clipboard copy — never surface an error */
|
|
}
|
|
},
|
|
},
|
|
{
|
|
id: 'sign-out',
|
|
label: 'Sign Out',
|
|
keywords: 'logout log out exit sign out',
|
|
perform: ({ logout }) => logout && logout(),
|
|
},
|
|
];
|
|
|
|
export default COMMAND_ACTIONS;
|