Add screens for media, the audit log and statistics
This commit is contained in:
1 parent
0caa196908
commit
1c9ccadf4e
10 files changed
+478
-6
No files matched your search
+8
-2
@@ -10,16 +10,22 @@ import Profile from './pages/Profile.vue';
|
||||
import AccountsIndex from './pages/AccountsIndex.vue';
|
||||
import GroupsIndex from './pages/GroupsIndex.vue';
|
||||
import LabelsIndex from './pages/LabelsIndex.vue';
|
||||
import MediaLibrary from './pages/MediaLibrary.vue';
|
||||
import AuditLog from './pages/AuditLog.vue';
|
||||
import StatisticsReport from './pages/StatisticsReport.vue';
|
||||
import ListPage from './pages/ListPage.vue';
|
||||
|
||||
/** The screens that exist. Every other manager address shows `Fallback` until its module gets a screen. */
|
||||
const routes: { pattern: RegExp; component: any; guest?: boolean; data?: boolean }[] = [
|
||||
const routes: { pattern: RegExp; component: any; guest?: boolean; data?: boolean; source?: string }[] = [
|
||||
{ pattern: /^\/?$/, component: Dashboard, data: true },
|
||||
{ pattern: /^\/login$/, component: Login, guest: true },
|
||||
{ pattern: /^\/profile$/, component: Profile, data: true },
|
||||
{ pattern: /^\/posts$/, component: PostsIndex, data: true },
|
||||
{ pattern: /^\/posts\/create$/, component: PostForm, data: true },
|
||||
{ pattern: /^\/posts\/\d+\/edit$/, component: PostForm, data: true },
|
||||
{ pattern: /^\/media$/, component: MediaLibrary, data: true, source: '/media/items' },
|
||||
{ pattern: /^\/audit$/, component: AuditLog, data: true },
|
||||
{ pattern: /^\/statistics$/, component: StatisticsReport, data: true },
|
||||
{ pattern: /^\/accounts$/, component: AccountsIndex, data: true },
|
||||
{ pattern: /^\/groups$/, component: GroupsIndex, data: true },
|
||||
{ pattern: /^\/labels$/, component: LabelsIndex, data: true },
|
||||
@@ -68,7 +74,7 @@ export async function load(url: string): Promise<void> {
|
||||
state.props = {};
|
||||
|
||||
try {
|
||||
state.props = route?.data ? await api.get(url) : {};
|
||||
state.props = route?.data ? await api.get(route.source ? boot.base + route.source : url) : {};
|
||||
} catch (error) {
|
||||
if (error instanceof ApiError && error.status === 401) {
|
||||
window.location.assign(boot.base + '/login');
|
||||
|
||||
Reference in new issue
Block a user