mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-21 11:25:56 +00:00
Add a configurable backup folder and drop-down bot settings
Backups can be stored in a chosen folder (new backups go there, older ones stay listed), and a backups folder that is a link to another drive no longer fails the update's safety backup check. SQUID settings that declare a fixed list of choices are edited as a drop-down and validated against it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f920ff8a59
commit
337418afe0
15 files changed
+253
-11
No files matched your search
@@ -175,7 +175,11 @@ for (const [category, categoryNames] of Object.entries(auctionCategories)) {
|
||||
}
|
||||
export function moduleField(key: string, locale: Locale, metadata?: ModuleSetting["field"]): ModuleField | undefined {
|
||||
const translated = locale !== "en" ? fields.find(f => f.key === key) : undefined;
|
||||
if (metadata) return { title: translated ? text(translated.title, locale) : metadata.title, description: translated ? text(translated.description, locale) : metadata.description, type: metadata.type, category: metadata.group, advanced: false, min: metadata.min ?? undefined, max: metadata.max ?? undefined };
|
||||
if (metadata) {
|
||||
// A fixed list of values is edited as a drop-down; the values stay strings, as they are written to the config.
|
||||
const options = metadata.choices?.length ? metadata.choices.map(c => ({ value: String(c.value), label: c.label })) : undefined;
|
||||
return { title: translated ? text(translated.title, locale) : metadata.title, description: translated ? text(translated.description, locale) : metadata.description, type: options ? "enum" : metadata.type, category: metadata.group, advanced: false, min: metadata.min ?? undefined, max: metadata.max ?? undefined, ...(options ? { options } : {}) } as ModuleField;
|
||||
}
|
||||
const field = fields.find(f => f.key === key);
|
||||
if (field) return { ...field, title: text(field.title, locale), description: text(field.description, locale), category: "general", advanced: field.advanced ?? false, step: field.type === "range" ? 0.05 : undefined, options: field.options?.map(o => ({ value: o.value, label: text(o.label, locale) })) };
|
||||
const existing = [...bots.settings, ...server.settings].find(s => s.key === key);
|
||||
|
||||
Reference in new issue
Block a user