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>
62 lines
1.9 KiB
Vue
62 lines
1.9 KiB
Vue
<script setup lang="ts">
|
|
import type { Workload } from '../api/types'
|
|
|
|
defineProps<{ workloads: Workload[]; canAct: boolean }>()
|
|
defineEmits<{ restart: [w: Workload]; scale: [w: Workload]; image: [w: Workload] }>()
|
|
</script>
|
|
|
|
<template>
|
|
<table class="w-full text-left text-sm">
|
|
<thead class="border-b border-gray-200 text-gray-500">
|
|
<tr>
|
|
<th class="py-2">Namespace</th>
|
|
<th>Name</th>
|
|
<th>Kind</th>
|
|
<th>Ready</th>
|
|
<th>Images</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr
|
|
v-for="w in workloads"
|
|
:key="`${w.namespace}/${w.kind}/${w.name}`"
|
|
class="border-b border-gray-100"
|
|
:class="w.ready < w.desired ? 'bg-red-50' : ''"
|
|
>
|
|
<td class="py-1.5">{{ w.namespace }}</td>
|
|
<td class="font-mono">{{ w.name }}</td>
|
|
<td>{{ w.kind }}</td>
|
|
<td :class="w.ready < w.desired ? 'font-medium text-red-700' : ''">
|
|
{{ w.ready }}/{{ w.desired }}
|
|
</td>
|
|
<td class="font-mono text-xs text-gray-600">
|
|
<div v-for="c in w.containers" :key="c.name">{{ c.image }}</div>
|
|
</td>
|
|
<td class="space-x-3 whitespace-nowrap text-right">
|
|
<template v-if="canAct">
|
|
<button
|
|
name="restart"
|
|
class="text-blue-600 hover:underline"
|
|
@click="$emit('restart', w)"
|
|
>
|
|
Restart
|
|
</button>
|
|
<button
|
|
v-if="w.kind !== 'daemonset'"
|
|
name="scale"
|
|
class="text-blue-600 hover:underline"
|
|
@click="$emit('scale', w)"
|
|
>
|
|
Scale
|
|
</button>
|
|
<button name="image" class="text-blue-600 hover:underline" @click="$emit('image', w)">
|
|
Set image
|
|
</button>
|
|
</template>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</template>
|