Add resources defined in config and a bundle of the site's own screens
This commit is contained in:
1 parent
37a29d9195
commit
3345797141
35 files changed
+905
-19
No files matched your search
@@ -14,6 +14,8 @@ import MediaLibrary from './pages/MediaLibrary.vue';
|
||||
import AuditLog from './pages/AuditLog.vue';
|
||||
import StatisticsReport from './pages/StatisticsReport.vue';
|
||||
import ListPage from './pages/ListPage.vue';
|
||||
import RecordForm from './pages/RecordForm.vue';
|
||||
import RecordsIndex from './pages/RecordsIndex.vue';
|
||||
import PageForm from './pages/PageForm.vue';
|
||||
import PagesIndex from './pages/PagesIndex.vue';
|
||||
|
||||
@@ -33,9 +35,19 @@ const routes: { pattern: RegExp; component: any; guest?: boolean; data?: boolean
|
||||
{ pattern: /^\/labels$/, component: LabelsIndex, data: true },
|
||||
{ pattern: /^\/pages$/, component: PagesIndex, data: true },
|
||||
{ pattern: /^\/pages\/[a-z0-9]+(?:-[a-z0-9]+)*$/, component: PageForm, data: true },
|
||||
{ pattern: /^\/records\/[a-z][a-z0-9_]*$/, component: RecordsIndex, data: true },
|
||||
{ pattern: /^\/records\/[a-z][a-z0-9_]*\/(create|\d+\/edit)$/, component: RecordForm, data: true },
|
||||
{ pattern: /^\/reviews$/, component: ListPage, data: true },
|
||||
];
|
||||
|
||||
/**
|
||||
* A screen of a site's own bundle (config `manager.extensions`): `pattern` is a regular expression for the path inside the
|
||||
* manager, `data` fetches the same address (or `source`) as JSON and passes it as props. Its screens win over the built in ones.
|
||||
*/
|
||||
export function register(pattern: string, component: any, options: { data?: boolean; source?: string } = {}): void {
|
||||
routes.unshift({ pattern: new RegExp(pattern), component, data: options.data, source: options.source });
|
||||
}
|
||||
|
||||
export const state = reactive({
|
||||
path: '',
|
||||
component: null as any,
|
||||
|
||||
Reference in new issue
Block a user