The source and channel fieldsets were the same markup over different options. updateChoices holds each set with its legend, radio name and when it is offered, and one v-for draws them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -147,6 +147,13 @@ const channelOptions = computed<UpdateOption[]>(() => [
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// Each set of choices, and when it is offered. A server holds one build, so a
|
||||||
|
// channel only means something on the forge.
|
||||||
|
const updateChoices = computed(() => [
|
||||||
|
{ legend: "Updates from", name: "update-source", shown: !!offeredServer.value, options: sourceOptions.value },
|
||||||
|
{ legend: "Channel", name: "update-channel", shown: source.value === null, options: channelOptions.value },
|
||||||
|
]);
|
||||||
|
|
||||||
// --- Quick capture -----------------------------------------------------------
|
// --- Quick capture -----------------------------------------------------------
|
||||||
// A desktop-local preference, so it lives here beside the update channel rather
|
// A desktop-local preference, so it lives here beside the update channel rather
|
||||||
// than in admin Settings: that screen is the SERVER's, and this is a property of
|
// than in admin Settings: that screen is the SERVER's, and this is a property of
|
||||||
@@ -650,36 +657,22 @@ onBeforeUnmount(() => stopSyncListener?.());
|
|||||||
This is version {{ update?.current_version ?? "—" }}.
|
This is version {{ update?.current_version ?? "—" }}.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<fieldset v-if="offeredServer" class="mt-4">
|
<template v-for="group in updateChoices" :key="group.name">
|
||||||
<legend class="section-label">
|
<fieldset v-if="group.shown" class="mt-4">
|
||||||
Updates from
|
<legend class="section-label">
|
||||||
</legend>
|
{{ group.legend }}
|
||||||
<div class="mt-2 flex flex-col gap-2">
|
</legend>
|
||||||
<label v-for="o in sourceOptions" :key="o.title" class="flex items-start gap-2 text-sm">
|
<div class="mt-2 flex flex-col gap-2">
|
||||||
<input type="radio" class="mt-1" name="update-source" :checked="o.checked" @change="o.pick()" />
|
<label v-for="o in group.options" :key="o.title" class="flex items-start gap-2 text-sm">
|
||||||
<span>
|
<input type="radio" class="mt-1" :name="group.name" :checked="o.checked" @change="o.pick()" />
|
||||||
<span class="font-medium">{{ o.title }}</span>
|
<span>
|
||||||
<span class="block text-neutral-500 dark:text-neutral-400">{{ o.detail }}</span>
|
<span class="font-medium">{{ o.title }}</span>
|
||||||
</span>
|
<span class="block text-neutral-500 dark:text-neutral-400">{{ o.detail }}</span>
|
||||||
</label>
|
</span>
|
||||||
</div>
|
</label>
|
||||||
</fieldset>
|
</div>
|
||||||
|
</fieldset>
|
||||||
<!-- A server holds one build, so a channel only means something on the forge. -->
|
</template>
|
||||||
<fieldset v-if="source === null" class="mt-4">
|
|
||||||
<legend class="section-label">
|
|
||||||
Channel
|
|
||||||
</legend>
|
|
||||||
<div class="mt-2 flex flex-col gap-2">
|
|
||||||
<label v-for="o in channelOptions" :key="o.title" class="flex items-start gap-2 text-sm">
|
|
||||||
<input type="radio" class="mt-1" name="update-channel" :checked="o.checked" @change="o.pick()" />
|
|
||||||
<span>
|
|
||||||
<span class="font-medium">{{ o.title }}</span>
|
|
||||||
<span class="block text-neutral-500 dark:text-neutral-400">{{ o.detail }}</span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<p
|
<p
|
||||||
v-if="update?.blocked_reason"
|
v-if="update?.blocked_reason"
|
||||||
|
|||||||
Reference in New Issue
Block a user