kube-rs gateway (nodes, namespaces, deployments/statefulsets/daemonsets with images, PVCs; rollout restart, scale, set image via patches) using the microk8s kubeconfig by default, fake gateway for dev, /api/cluster routes, Kubernetes page with node cards, workload table with admin actions and PVC list. Also implements the streaming command runner that WP-11 relied on. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
52 lines
1.7 KiB
Vue
52 lines
1.7 KiB
Vue
<script setup lang="ts">
|
|
import { useRouter } from 'vue-router'
|
|
import { useAuthStore } from '../stores/auth'
|
|
|
|
const auth = useAuthStore()
|
|
const router = useRouter()
|
|
const nav = [
|
|
{ to: '/', label: 'Dashboard' },
|
|
{ to: '/updates', label: 'Updates' },
|
|
{ to: '/cluster', label: 'Kubernetes' },
|
|
{ to: '/vulnerabilities', label: 'Vulnerabilities' },
|
|
{ to: '/backups', label: 'Backups' },
|
|
{ to: '/jobs', label: 'Jobs' },
|
|
{ to: '/users', label: 'Users', admin: true },
|
|
{ to: '/settings', label: 'Settings' },
|
|
]
|
|
|
|
async function signOut() {
|
|
await auth.logout()
|
|
router.push('/login')
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div class="flex min-h-screen bg-gray-50 text-gray-900">
|
|
<aside class="flex w-56 flex-col border-r border-gray-200 bg-white">
|
|
<div class="px-5 py-4 text-lg font-semibold">SoftVisor Monitoring</div>
|
|
<nav class="flex-1 space-y-1 px-3">
|
|
<template v-for="item in nav" :key="item.to">
|
|
<RouterLink
|
|
v-if="!item.admin || auth.isAdmin"
|
|
:to="item.to"
|
|
class="block rounded-md px-3 py-2 text-sm hover:bg-gray-100"
|
|
active-class="bg-gray-100 font-medium"
|
|
:exact-active-class="item.to === '/' ? 'bg-gray-100 font-medium' : undefined"
|
|
>
|
|
{{ item.label }}
|
|
</RouterLink>
|
|
</template>
|
|
</nav>
|
|
<div class="border-t border-gray-200 px-5 py-4 text-sm">
|
|
<div class="truncate font-medium">{{ auth.user?.display_name }}</div>
|
|
<div class="truncate text-gray-500">{{ auth.user?.email }}</div>
|
|
<button class="mt-2 text-blue-600 hover:underline" @click="signOut">Sign out</button>
|
|
</div>
|
|
</aside>
|
|
<main class="flex-1 p-8">
|
|
<RouterView />
|
|
</main>
|
|
</div>
|
|
</template>
|