Browse Source

minor fixes

pull/2226/head
Bernd Storath 9 months ago
committed by Bernd Storath
parent
commit
39c9e45a39
  1. 28
      src/app/components/Form/NullNumberField.vue
  2. 2
      src/app/components/Form/NumberField.vue
  3. 2
      src/app/components/Form/TextField.vue
  4. 16
      src/app/pages/admin/config.vue
  5. 32
      src/app/pages/admin/interface.vue
  6. 16
      src/app/pages/clients/[id].vue

28
src/app/components/Form/NullNumberField.vue

@ -0,0 +1,28 @@
<template>
<div class="flex items-center">
<FormLabel :for="id">
{{ label }}
</FormLabel>
<BaseTooltip v-if="description" :text="description">
<IconsInfo class="size-4" />
</BaseTooltip>
</div>
<BaseInput :id="id" v-model.number="data" :name="id" type="number" />
</template>
<script lang="ts" setup>
defineProps<{ id: string; label: string; description?: string }>();
const data = defineModel<number | null>({
set(value) {
const temp = value ?? null;
if (temp === 0) {
return null;
}
if ((temp as string | null) === '') {
return null;
}
return temp;
},
});
</script>

2
src/app/components/Form/NumberField.vue

@ -13,5 +13,5 @@
<script lang="ts" setup>
defineProps<{ id: string; label: string; description?: string }>();
const data = defineModel<number | null>();
const data = defineModel<number>();
</script>

2
src/app/components/Form/TextField.vue

@ -26,5 +26,5 @@ defineProps<{
disabled?: boolean;
}>();
const data = defineModel<string | null>();
const data = defineModel<string>();
</script>

16
src/app/pages/admin/config.vue

@ -50,19 +50,19 @@
<FormGroup v-if="globalStore.information?.isAwg">
<FormHeading>{{ $t('awg.obfuscationParameters') }}</FormHeading>
<FormNumberField
<FormNullNumberField
id="jC"
v-model="data.defaultJC"
:label="$t('awg.jCLabel')"
:description="$t('awg.jCDescription')"
/>
<FormNumberField
<FormNullNumberField
id="jMin"
v-model="data.defaultJMin"
:label="$t('awg.jMinLabel')"
:description="$t('awg.jMinDescription')"
/>
<FormNumberField
<FormNullNumberField
id="jMax"
v-model="data.defaultJMax"
:label="$t('awg.jMaxLabel')"
@ -71,31 +71,31 @@
<div class="col-span-full text-sm">* {{ $t('awg.mtuNote') }}</div>
<FormTextField
<FormNullTextField
id="i1"
v-model="data.defaultI1"
:label="$t('awg.i1Label')"
:description="$t('awg.i1Description')"
/>
<FormTextField
<FormNullTextField
id="i2"
v-model="data.defaultI2"
:label="$t('awg.i2Label')"
:description="$t('awg.i2Description')"
/>
<FormTextField
<FormNullTextField
id="i3"
v-model="data.defaultI3"
:label="$t('awg.i3Label')"
:description="$t('awg.i3Description')"
/>
<FormTextField
<FormNullTextField
id="i4"
v-model="data.defaultI4"
:label="$t('awg.i4Label')"
:description="$t('awg.i4Description')"
/>
<FormTextField
<FormNullTextField
id="i5"
v-model="data.defaultI5"
:label="$t('awg.i5Label')"

32
src/app/pages/admin/interface.vue

@ -24,31 +24,31 @@
<FormGroup v-if="globalStore.information?.isAwg">
<FormHeading>{{ $t('awg.obfuscationParameters') }}</FormHeading>
<FormNumberField
<FormNullNumberField
id="jC"
v-model="data.jC"
:label="$t('awg.jCLabel')"
:description="$t('awg.jCDescription')"
/>
<FormNumberField
<FormNullNumberField
id="jMin"
v-model="data.jMin"
:label="$t('awg.jMinLabel')"
:description="$t('awg.jMinDescription')"
/>
<FormNumberField
<FormNullNumberField
id="jMax"
v-model="data.jMax"
:label="$t('awg.jMaxLabel')"
:description="$t('awg.jMaxDescription')"
/>
<FormNumberField
<FormNullNumberField
id="s1"
v-model="data.s1"
:label="$t('awg.s1Label')"
:description="$t('awg.s1Description')"
/>
<FormNumberField
<FormNullNumberField
id="s2"
v-model="data.s2"
:label="$t('awg.s2Label')"
@ -57,67 +57,67 @@
<div class="col-span-full text-sm">* {{ $t('awg.mtuNote') }}</div>
<FormNumberField
<FormNullNumberField
id="s3"
v-model="data.s3"
:label="$t('awg.s3Label')"
:description="$t('awg.s3Description')"
/>
<FormNumberField
<FormNullNumberField
id="s4"
v-model="data.s4"
:label="$t('awg.s4Label')"
:description="$t('awg.s4Description')"
/>
<FormTextField
<FormNullTextField
id="i1"
v-model="data.i1"
:label="$t('awg.i1Label')"
:description="$t('awg.i1Description')"
/>
<FormTextField
<FormNullTextField
id="i2"
v-model="data.i2"
:label="$t('awg.i2Label')"
:description="$t('awg.i2Description')"
/>
<FormTextField
<FormNullTextField
id="i3"
v-model="data.i3"
:label="$t('awg.i3Label')"
:description="$t('awg.i3Description')"
/>
<FormTextField
<FormNullTextField
id="i4"
v-model="data.i4"
:label="$t('awg.i4Label')"
:description="$t('awg.i4Description')"
/>
<FormTextField
<FormNullTextField
id="i5"
v-model="data.i5"
:label="$t('awg.i5Label')"
:description="$t('awg.i5Description')"
/>
<FormNumberField
<FormNullNumberField
id="h1"
v-model="data.h1"
:label="$t('awg.h1Label')"
:description="$t('awg.h1Description')"
/>
<FormNumberField
<FormNullNumberField
id="h2"
v-model="data.h2"
:label="$t('awg.h2Label')"
:description="$t('awg.h2Description')"
/>
<FormNumberField
<FormNullNumberField
id="h3"
v-model="data.h3"
:label="$t('awg.h3Label')"
:description="$t('awg.h3Description')"
/>
<FormNumberField
<FormNullNumberField
id="h4"
v-model="data.h4"
:label="$t('awg.h4Label')"

16
src/app/pages/clients/[id].vue

@ -85,19 +85,19 @@
<FormGroup v-if="globalStore.information?.isAwg">
<FormHeading>{{ $t('awg.obfuscationParameters') }}</FormHeading>
<FormNumberField
<FormNullNumberField
id="jC"
v-model="data.jC"
:label="$t('awg.jCLabel')"
:description="$t('awg.jCDescription')"
/>
<FormNumberField
<FormNullNumberField
id="Jmin"
v-model="data.jMin"
:label="$t('awg.jMinLabel')"
:description="$t('awg.jMinDescription')"
/>
<FormNumberField
<FormNullNumberField
id="Jmax"
v-model="data.jMax"
:label="$t('awg.jMaxLabel')"
@ -106,31 +106,31 @@
<div class="col-span-full text-sm">* {{ $t('awg.mtuNote') }}</div>
<FormTextField
<FormNullTextField
id="i1"
v-model="data.i1"
:label="$t('awg.i1Label')"
:description="$t('awg.i1Description')"
/>
<FormTextField
<FormNullTextField
id="i2"
v-model="data.i2"
:label="$t('awg.i2Label')"
:description="$t('awg.i2Description')"
/>
<FormTextField
<FormNullTextField
id="i3"
v-model="data.i3"
:label="$t('awg.i3Label')"
:description="$t('awg.i3Description')"
/>
<FormTextField
<FormNullTextField
id="i4"
v-model="data.i4"
:label="$t('awg.i4Label')"
:description="$t('awg.i4Description')"
/>
<FormTextField
<FormNullTextField
id="i5"
v-model="data.i5"
:label="$t('awg.i5Label')"

Loading…
Cancel
Save