mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +00:00
fix(console): lock the group editor while saving
Prevent edits while a group save is in flight and make super-only installation settings readonly instead of silently ignoring edits.
This commit is contained in:
1 parent
f8dbb8ec0b
commit
0878a7768c
1 file changed
+9
-1
@@ -14,6 +14,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<form class="editor-body" @submit.prevent="save">
|
<form class="editor-body" @submit.prevent="save">
|
||||||
|
<!-- Locked while saving: an edit made meanwhile would be lost when the
|
||||||
|
save closes the editor. -->
|
||||||
|
<fieldset :disabled="saving" class="contents">
|
||||||
<section class="editor-section">
|
<section class="editor-section">
|
||||||
<h3 class="editor-section-title">{{ t("groupEditor.sectionBasic") }}</h3>
|
<h3 class="editor-section-title">{{ t("groupEditor.sectionBasic") }}</h3>
|
||||||
<div class="row2">
|
<div class="row2">
|
||||||
@@ -166,10 +169,14 @@
|
|||||||
<span class="lbl-note">{{ t("groupEditor.installationIdNote") }}</span></label
|
<span class="lbl-note">{{ t("groupEditor.installationIdNote") }}</span></label
|
||||||
>
|
>
|
||||||
<div class="ctl-md">
|
<div class="ctl-md">
|
||||||
|
<!-- Only super admins bind installations here (the server keeps
|
||||||
|
the stored value for anyone else); owners use the install flow. -->
|
||||||
<RcInput
|
<RcInput
|
||||||
v-model="form.installationId"
|
v-model="form.installationId"
|
||||||
type="text"
|
type="text"
|
||||||
inputmode="numeric"
|
inputmode="numeric"
|
||||||
|
:class="superAdmin ? '' : 'opacity-60'"
|
||||||
|
:disabled="!superAdmin"
|
||||||
:placeholder="t('groupEditor.installationIdPlaceholder')"
|
:placeholder="t('groupEditor.installationIdPlaceholder')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -233,6 +240,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<div class="err">{{ formError }}</div>
|
<div class="err">{{ formError }}</div>
|
||||||
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="editor-foot">
|
<div class="editor-foot">
|
||||||
@@ -424,7 +432,7 @@ function save(): void {
|
|||||||
const all = [...form.providers, ...kept];
|
const all = [...form.providers, ...kept];
|
||||||
return all.length ? all : undefined;
|
return all.length ? all : undefined;
|
||||||
})(),
|
})(),
|
||||||
installationId,
|
installationId: props.superAdmin ? installationId : props.group?.installationId,
|
||||||
emoji: form.emoji,
|
emoji: form.emoji,
|
||||||
forgeSources: form.forgeSources.length
|
forgeSources: form.forgeSources.length
|
||||||
? form.forgeSources.map((s) => ({
|
? form.forgeSources.map((s) => ({
|
||||||
|
|||||||
Reference in new issue
Block a user