mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-25 17:26:15 -04:00
chore(lint): switched to a better lint config
This commit is contained in:
parent
4d2b037dbe
commit
33c9b6643f
178 changed files with 4105 additions and 3371 deletions
|
@ -1,32 +1,10 @@
|
|||
<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-input-number v-model:value="bits" min="256" max="16384" step="8" />
|
||||
</n-form-item>
|
||||
|
||||
<c-button @click="refreshCerts">Refresh key-pair</c-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3>Public key</h3>
|
||||
<textarea-copyable :value="certs.publicKeyPem" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3>Private key</h3>
|
||||
<textarea-copyable :value="certs.privateKeyPem" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
import { ref } from 'vue';
|
||||
import { generateKeyPair } from './rsa-key-pair-generator.service';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
import { withDefaultOnErrorAsync } from '@/utils/defaults';
|
||||
import { useValidation } from '@/composable/validation';
|
||||
import { computedRefreshableAsync } from '@/composable/computedRefreshable';
|
||||
import { generateKeyPair } from './rsa-key-pair-generator.service';
|
||||
|
||||
const bits = ref(2048);
|
||||
const emptyCerts = { publicKeyPem: '', privateKeyPem: '' };
|
||||
|
@ -36,7 +14,7 @@ const { attrs: bitsValidationAttrs } = useValidation({
|
|||
rules: [
|
||||
{
|
||||
message: 'Bits should be 256 <= bits <= 16384 and be a multiple of 8',
|
||||
validator: (value) => value >= 256 && value <= 16384 && value % 8 === 0,
|
||||
validator: value => value >= 256 && value <= 16384 && value % 8 === 0,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
@ -47,4 +25,26 @@ const [certs, refreshCerts] = computedRefreshableAsync(
|
|||
);
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<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-input-number v-model:value="bits" min="256" max="16384" step="8" />
|
||||
</n-form-item>
|
||||
|
||||
<c-button @click="refreshCerts">
|
||||
Refresh key-pair
|
||||
</c-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3>Public key</h3>
|
||||
<TextareaCopyable :value="certs.publicKeyPem" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3>Private key</h3>
|
||||
<TextareaCopyable :value="certs.privateKeyPem" />
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue