mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-30 17:10:42 +03:00
30 lines
715 B
Vue
30 lines
715 B
Vue
<script setup lang="ts">
|
|
import { useI18n } from 'vue-i18n';
|
|
import { fromARPA } from '@/utils/ip';
|
|
|
|
const { t } = useI18n();
|
|
|
|
const arpaInput = ref('');
|
|
|
|
const decodedIP = computed(() => {
|
|
try {
|
|
return fromARPA(arpaInput.value.trim());
|
|
}
|
|
catch (e: any) {
|
|
return `# ${e.toString()}`;
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<NFormItem :label="t('tools.arpa-decoder.texts.label-arpa-address')" label-placement="left" mb-2>
|
|
<NInput v-model:value="arpaInput" :placeholder="t('tools.arpa-decoder.texts.placeholder-e-g-10-1-168-192-in-addr-arpa-or-xxxx-ip6-arpa')" />
|
|
</NFormItem>
|
|
|
|
<c-card v-if="decodedIP">
|
|
<textarea-copyable :value="decodedIP" />
|
|
</c-card>
|
|
</div>
|
|
</template>
|