Feat: Suggest IP or Hostname (#1739)
* get ip and hostnames * use heroicons * add host field * get private info * unstyled prototype * styled select * add to setup * fix types
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<div class="flex items-center">
|
||||
<FormLabel :for="id">
|
||||
{{ label }}
|
||||
</FormLabel>
|
||||
<BaseTooltip v-if="description" :text="description">
|
||||
<IconsInfo class="size-4" />
|
||||
</BaseTooltip>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<BaseInput
|
||||
:id="id"
|
||||
v-model.trim="data"
|
||||
:name="id"
|
||||
type="text"
|
||||
class="w-full"
|
||||
:placeholder="placeholder"
|
||||
/>
|
||||
<AdminSuggestDialog :url="url" @change="data = $event">
|
||||
<BaseButton as="span">
|
||||
<div class="flex items-center gap-3">
|
||||
<IconsSparkles class="w-4" />
|
||||
<span>{{ $t('admin.config.suggest') }}</span>
|
||||
</div>
|
||||
</BaseButton>
|
||||
</AdminSuggestDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
defineProps<{
|
||||
id: string;
|
||||
label: string;
|
||||
description?: string;
|
||||
placeholder?: string;
|
||||
url: '/api/admin/ip-info' | '/api/setup/4';
|
||||
}>();
|
||||
|
||||
const data = defineModel<string | null>({
|
||||
set(value) {
|
||||
const temp = value?.trim() ?? null;
|
||||
if (temp === '') {
|
||||
return null;
|
||||
}
|
||||
return temp;
|
||||
},
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user