Edits live in the control-plane store as drafts against the version they started from, so they survive moving between Settings pages. A sticky bar counts unsaved changes; the review drawer shows a field-level diff per section with Revert, and saves the sections one at a time, stopping at the first failure. A conflicting save rebases the draft onto the latest value. Restart pending is read from apply status. Per-card Save buttons, Live and Version badges go; leaving Settings with edits asks first.
34 lines
1000 B
Vue
34 lines
1000 B
Vue
<script setup lang="ts">
|
|
import {
|
|
Card,
|
|
CardAction,
|
|
CardContent,
|
|
CardDescription,
|
|
CardHeader,
|
|
CardTitle,
|
|
} from "@/components/ui/card";
|
|
|
|
/**
|
|
* One titled card of the System surface. Every card on the six pages opens the
|
|
* same way, so it is a component rather than six copies of the same CardHeader
|
|
* markup. A description is reserved for context the card cannot show itself.
|
|
*
|
|
* The card owns its own bottom margin: the pages stack cards directly, with
|
|
* nothing between them.
|
|
*/
|
|
defineProps<{ title?: string; description?: string; edited?: boolean }>();
|
|
</script>
|
|
|
|
<template>
|
|
<Card class="mb-4" :class="edited && 'ring-primary/60'">
|
|
<CardHeader v-if="title || description">
|
|
<CardTitle v-if="title">{{ title }}</CardTitle>
|
|
<CardDescription v-if="description">{{ description }}</CardDescription>
|
|
<CardAction v-if="$slots.action"><slot name="action" /></CardAction>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<slot />
|
|
</CardContent>
|
|
</Card>
|
|
</template>
|