feat(storepkg): widening updates wait for approval, rollback restores the previous pin
This commit is contained in:
1 parent
fc0e156649
commit
b702a7ea67
18 files changed
+1884
-694
No files matched your search
@@ -83,6 +83,17 @@ const tones = {
|
||||
<StatusPill :tone="tones[stage(extension)].tone" :dot="tones[stage(extension)].dot">
|
||||
{{ tones[stage(extension)].label }}
|
||||
</StatusPill>
|
||||
<div v-if="extension.pending" class="w-full rounded-md border border-border px-3 py-2">
|
||||
<p class="text-xs font-medium">Update waiting for approval, it adds:</p>
|
||||
<ul class="font-mono text-xs">
|
||||
<li v-for="line in grants(extension.pending.added).filter((l) => !l.startsWith('network:'))" :key="line">{{ line }}</li>
|
||||
</ul>
|
||||
<Button size="sm" class="mt-2" :disabled="!!store.busy" @click="store.approveUpdate(extension.name)">Approve</Button>
|
||||
</div>
|
||||
<Button variant="ghost" size="sm" :disabled="!!store.busy" @click="store.update(extension.name)">Update</Button>
|
||||
<Button v-if="extension.can_rollback" variant="ghost" size="sm" :disabled="!!store.busy" @click="store.rollback(extension.name)"
|
||||
>Roll back</Button
|
||||
>
|
||||
<Button
|
||||
v-if="stage(extension) === 'accept'"
|
||||
variant="ghost"
|
||||
|
||||
@@ -21,6 +21,9 @@ export interface Extension {
|
||||
declared: Authority;
|
||||
accepted: Authority | null;
|
||||
enabled: boolean;
|
||||
/** An update waiting for approval, with only the grants it adds. */
|
||||
pending: { digest: string; added: Authority } | null;
|
||||
can_rollback: boolean;
|
||||
}
|
||||
|
||||
/** A package the verified catalogue offers. */
|
||||
@@ -118,6 +121,9 @@ export const useExtensionsStore = defineStore("extensions", () => {
|
||||
installFromCatalogue: (name: string) =>
|
||||
mutate(name, () => call(`/api/extensions/catalogue/${encodeURIComponent(name)}/install`, { method: "POST" })),
|
||||
accept: (name: string) => mutate(name, () => call(`${path(name)}/accept`, { method: "POST" })),
|
||||
update: (name: string) => mutate(name, () => call(`${path(name)}/update`, { method: "POST" })),
|
||||
approveUpdate: (name: string) => mutate(name, () => call(`${path(name)}/approve-update`, { method: "POST" })),
|
||||
rollback: (name: string) => mutate(name, () => call(`${path(name)}/rollback`, { method: "POST" })),
|
||||
setEnabled: (name: string, enabled: boolean) =>
|
||||
mutate(name, () => call(`${path(name)}/enabled`, { method: "PUT", body: JSON.stringify({ enabled }) })),
|
||||
remove: (name: string) => mutate(name, () => call(path(name), { method: "DELETE" })),
|
||||
|
||||
Reference in new issue
Block a user