- New page: /iam-users/:id/policies shows all policies in one view - Separated into global policies and per-project policies sections - Each section has inline add/remove with disabled duplicates - Backend: new policies/overview/ endpoint returns global + project policies - Replaces old popup-based policy management Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
50 lines
1.9 KiB
JavaScript
50 lines
1.9 KiB
JavaScript
import { createRouter, createWebHistory } from 'vue-router'
|
|
import { useAuthStore } from '../stores/auth'
|
|
|
|
const routes = [
|
|
{
|
|
path: '/login',
|
|
name: 'Login',
|
|
component: () => import('../views/LoginView.vue'),
|
|
meta: { public: true },
|
|
},
|
|
{
|
|
path: '/',
|
|
component: () => import('../layouts/MainLayout.vue'),
|
|
children: [
|
|
// Dynamic home: admin sees Dashboard, iam_user sees MyKeys
|
|
{
|
|
path: '',
|
|
name: 'Home',
|
|
component: () => import('../views/HomeRedirect.vue'),
|
|
},
|
|
// Admin routes
|
|
{ path: 'dashboard', name: 'Dashboard', component: () => import('../views/dashboard/DashboardView.vue') },
|
|
{ path: 'iam-users', name: 'IAMUsers', component: () => import('../views/iam/IAMUserList.vue') },
|
|
{ path: 'iam-users/:id/policies', name: 'UserPolicies', component: () => import('../views/iam/UserPoliciesView.vue'), props: true },
|
|
{ path: 'billing', name: 'Billing', component: () => import('../views/billing/BillingView.vue') },
|
|
{ path: 'alerts', name: 'Alerts', component: () => import('../views/alerts/AlertList.vue') },
|
|
{ path: 'ark-keys', name: 'ArkKeys', component: () => import('../views/ark/ArkKeysView.vue') },
|
|
{ path: 'settings', name: 'Settings', component: () => import('../views/settings/SettingsView.vue') },
|
|
{ path: 'admin', name: 'Admin', component: () => import('../views/admin/AdminView.vue') },
|
|
// IAM user (sub-account) routes
|
|
{ path: 'my-keys', name: 'MyKeys', component: () => import('../views/portal/MyKeysView.vue') },
|
|
{ path: 'my-password', name: 'MyPassword', component: () => import('../views/portal/MyPasswordView.vue') },
|
|
],
|
|
},
|
|
]
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(),
|
|
routes,
|
|
})
|
|
|
|
router.beforeEach((to) => {
|
|
const auth = useAuthStore()
|
|
if (!to.meta.public && !auth.isLoggedIn) {
|
|
return '/login'
|
|
}
|
|
})
|
|
|
|
export default router
|