WIP(translate): translate ulid-generator, encryption, bip39-generator, hmac-generator, rsa-key-pair-generator, password-strength-analyser and pdf-signature-checker tools

This commit is contained in:
Amery2010 2023-12-22 22:42:03 +08:00
parent 70515d32a5
commit 2ee3b01105
30 changed files with 383 additions and 88 deletions

View file

@ -8,11 +8,13 @@ import { computedRefreshableAsync } from '@/composable/computedRefreshable';
const bits = ref(2048);
const emptyCerts = { publicKeyPem: '', privateKeyPem: '' };
const { t } = useI18n();
const { attrs: bitsValidationAttrs } = useValidation({
source: bits,
rules: [
{
message: 'Bits should be 256 <= bits <= 16384 and be a multiple of 8',
message: t('tools.rsa-key-pair-generator.validationError'),
validator: value => value >= 256 && value <= 16384 && value % 8 === 0,
},
],
@ -27,23 +29,23 @@ const [certs, refreshCerts] = computedRefreshableAsync(
<template>
<div style="flex: 0 0 100%">
<div item-style="flex: 1 1 0" style="max-width: 600px" mx-auto flex gap-3>
<n-form-item label="Bits :" v-bind="bitsValidationAttrs as any" label-placement="left" label-width="100">
<n-form-item :label="t('tools.rsa-key-pair-generator.bits')" v-bind="bitsValidationAttrs as any" label-placement="left" label-width="100">
<n-input-number v-model:value="bits" min="256" max="16384" step="8" />
</n-form-item>
<c-button @click="refreshCerts">
Refresh key-pair
{{ t('tools.rsa-key-pair-generator.button.refresh') }}
</c-button>
</div>
</div>
<div>
<h3>Public key</h3>
<h3>{{ t('tools.rsa-key-pair-generator.publicKey') }}</h3>
<TextareaCopyable :value="certs.publicKeyPem" />
</div>
<div>
<h3>Private key</h3>
<h3>{{ t('tools.rsa-key-pair-generator.privateKey') }}</h3>
<TextareaCopyable :value="certs.privateKeyPem" />
</div>
</template>