Files
shopdb-flask/plugins/backups/frontend/routes.js

38 lines
1.6 KiB
JavaScript

/**
* Backups plugin routes.
*
* One route: the per-asset revision history. The asset-detail panel (ADR-010
* Path A) lists recent revisions but the generic renderer has no per-item
* actions, and downloading a .reg needs a per-revision control plus a dialect
* choice. So the panel links here via its manage link rather than the renderer
* growing a backups-shaped feature.
*
* meta.plugin = 'backups' so the ADR-009 guard redirects when the backend
* plugin is disabled. requiresAuth because every backups API route is behind
* JWT + a backups.* permission; an anonymous visit would only render errors.
*/
export default [
{
// The plugin's five settings had no page at all until this one: the core
// settings catalog is a hardcoded list that a plugin cannot extend, so
// backups_shareroot and friends were reachable only through the API or a
// shell on the server. Paired with get_settings_cards in plugin.py, which
// puts the card in the rail - both vanish when the plugin is disabled.
path: 'settings/backups',
name: 'backups-settings',
component: () => import('./views/BackupsSettings.vue'),
meta: { requiresAuth: true, requiresAdmin: true, plugin: 'backups' }
},
{
path: 'backups/asset/:assetid',
name: 'backups-asset-history',
component: () => import('./views/BackupHistory.vue'),
meta: { requiresAuth: true, plugin: 'backups' }
}
]
// No full-screen routes: every view in this plugin renders inside
// AppLayout. Declared so routes.gen.js can read `.toplevel` off the module
// without Rollup warning about a missing export.
export const toplevel = []