fbf24410db
Backend changes: - Added WG_METRICS_PASSWORD environment variable override - Updated applyGeneralOverrides() to include metrics password - Updated /api/admin/overrides endpoint to include metrics password Frontend changes: - Added override indicators (warning icons with tooltips) to all form fields - Updated TextField, NumberField, NullTextField, SwitchField, HostField, ArrayField components - Added overridden prop support to all form components - Fetched /api/admin/overrides in all admin pages (interface, general, config, hooks) - Warning icon displays when field is overridden by environment variable - ArrayField shows banner when overridden - Updated documentation with WG_METRICS_PASSWORD Co-authored-by: kaaax0815 <32197462+kaaax0815@users.noreply.github.com>
57 lines
1.4 KiB
Vue
57 lines
1.4 KiB
Vue
<template>
|
|
<div class="flex items-center">
|
|
<FormLabel :for="id">
|
|
{{ label }}
|
|
</FormLabel>
|
|
<BaseTooltip v-if="description" :text="description">
|
|
<IconsInfo class="size-4" />
|
|
</BaseTooltip>
|
|
<BaseTooltip v-if="overridden" text="This field is overridden by an environment variable">
|
|
<IconsWarning class="size-4 ml-1 text-amber-500" />
|
|
</BaseTooltip>
|
|
</div>
|
|
<div class="flex gap-1">
|
|
<BaseInput
|
|
:id="id"
|
|
v-model.trim="data"
|
|
:name="id"
|
|
type="text"
|
|
class="w-full"
|
|
:placeholder="placeholder"
|
|
/>
|
|
<ClientOnly>
|
|
<AdminSuggestDialog :url="url" @change="data = $event">
|
|
<BasePrimaryButton as="span">
|
|
<div class="flex items-center gap-3">
|
|
<IconsSparkles class="w-4" />
|
|
<span class="whitespace-nowrap">
|
|
{{ $t('admin.config.suggest') }}
|
|
</span>
|
|
</div>
|
|
</BasePrimaryButton>
|
|
</AdminSuggestDialog>
|
|
</ClientOnly>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
defineProps<{
|
|
id: string;
|
|
label: string;
|
|
description?: string;
|
|
placeholder?: string;
|
|
url: '/api/admin/ip-info' | '/api/setup/4';
|
|
overridden?: boolean;
|
|
}>();
|
|
|
|
const data = defineModel<string | null>({
|
|
set(value) {
|
|
const temp = value?.trim() ?? null;
|
|
if (temp === '') {
|
|
return null;
|
|
}
|
|
return temp;
|
|
},
|
|
});
|
|
</script>
|