mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-22 05:51:44 +03:00
i18n: extract more strings
This commit is contained in:
1 parent
92bf2b5bd7
commit
4103bd7e6e
7 files changed
+1778
-1803
No files matched your search
+1689
-1720
File diff suppressed because it is too large.
Load diff
@@ -141,7 +141,7 @@ async function onUpload(file: File) {
|
|||||||
|
|
||||||
<n-space justify="center" mb-1>
|
<n-space justify="center" mb-1>
|
||||||
<n-checkbox v-model:checked="includeDataUri">
|
<n-checkbox v-model:checked="includeDataUri">
|
||||||
Include data: URI prefix
|
{{ $t('tools.base64-file-converter.texts.include-data-uri-prefix') }}
|
||||||
</n-checkbox>
|
</n-checkbox>
|
||||||
</n-space>
|
</n-space>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useITStorage } from '@/composable/queryParams';
|
import { useITStorage } from '@/composable/queryParams';
|
||||||
import { Base64 } from 'js-base64';
|
import { Base64 } from 'js-base64';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
const url = ref('');
|
const url = ref('');
|
||||||
const html = ref('');
|
const html = ref('');
|
||||||
const error = ref('');
|
const error = ref('');
|
||||||
@@ -26,12 +29,12 @@ const options = useITStorage('html-to-pdf:opts', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const pdfFormats = [
|
const pdfFormats = [
|
||||||
{ label: 'A2', value: 'A2' },
|
{ label: t('tools.html-to-pdf.texts.label-a2'), value: 'A2' },
|
||||||
{ label: 'A3', value: 'A3' },
|
{ label: t('tools.html-to-pdf.texts.label-a3'), value: 'A3' },
|
||||||
{ label: 'A4', value: 'A4' },
|
{ label: t('tools.html-to-pdf.texts.label-a4'), value: 'A4' },
|
||||||
{ label: 'A5', value: 'A5' },
|
{ label: t('tools.html-to-pdf.texts.label-a5'), value: 'A5' },
|
||||||
{ label: 'Letter', value: 'Letter' },
|
{ label: t('tools.html-to-pdf.texts.label-letter'), value: 'Letter' },
|
||||||
{ label: 'Legal', value: 'Legal' },
|
{ label: t('tools.html-to-pdf.texts.label-legal'), value: 'Legal' },
|
||||||
];
|
];
|
||||||
|
|
||||||
function downloadURL(data: string, fileName: string) {
|
function downloadURL(data: string, fileName: string) {
|
||||||
@@ -186,28 +189,27 @@ async function generateBatch() {
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<details mb-2>
|
<details mb-2>
|
||||||
<summary>HTML to PDF Service Configuration (self hosted)</summary>
|
<summary>{{ t('tools.html-to-pdf.texts.tag-html-to-pdf-service-configuration-self-hosted') }}</summary>
|
||||||
<n-card>
|
<n-card>
|
||||||
<NFormItem label="HTML to PDF Service Url:" label-placement="top">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-html-to-pdf-service-url')" label-placement="top">
|
||||||
<NInput v-model:value="serverHost" placeholder="http://localhost:3000" />
|
<NInput v-model:value="serverHost" :placeholder="t('tools.html-to-pdf.texts.placeholder-http-localhost-3000')" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NFormItem label="Basic Authentication:" label-placement="left" label-width="auto">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-basic-authentication')" label-placement="left" label-width="auto">
|
||||||
<NInput v-model:value="serverAuth" placeholder="username:password" />
|
<NInput v-model:value="serverAuth" :placeholder="t('tools.html-to-pdf.texts.placeholder-username-password')" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<n-p>
|
<n-p>
|
||||||
You must self host HTML to PDF Service. See:
|
{{ t('tools.html-to-pdf.texts.tag-you-must-self-host-html-to-pdf-service-see') }}<c-link href="https://github.com/sharevb/puppeteer-htmltopdf?tab=readme-ov-file#running-in-docker" target="_blank">
|
||||||
<c-link href="https://github.com/sharevb/puppeteer-htmltopdf?tab=readme-ov-file#running-in-docker" target="_blank">
|
{{ t('tools.html-to-pdf.texts.tag-html-to-pdf-service-install') }}
|
||||||
HTML to PDF Service install
|
|
||||||
</c-link>
|
</c-link>
|
||||||
</n-p>
|
</n-p>
|
||||||
</n-card>
|
</n-card>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<NTabs type="line">
|
<NTabs type="line">
|
||||||
<NTabPane name="url" tab="URL → PDF">
|
<NTabPane name="url" :tab="t('tools.html-to-pdf.texts.tab-url-pdf')">
|
||||||
<NForm label-placement="left">
|
<NForm label-placement="left">
|
||||||
<NFormItem label="URL:">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-url')">
|
||||||
<NInput v-model:value="url" placeholder="https://example.com" />
|
<NInput v-model:value="url" :placeholder="t('tools.html-to-pdf.texts.placeholder-https-example-com')" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<n-space mb-2 justify="center">
|
<n-space mb-2 justify="center">
|
||||||
@@ -217,7 +219,7 @@ async function generateBatch() {
|
|||||||
:disabled="isRunning"
|
:disabled="isRunning"
|
||||||
@click="generateFromUrl"
|
@click="generateFromUrl"
|
||||||
>
|
>
|
||||||
Generate PDF
|
{{ t('tools.html-to-pdf.texts.tag-generate-pdf') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
</n-space>
|
</n-space>
|
||||||
|
|
||||||
@@ -227,9 +229,9 @@ async function generateBatch() {
|
|||||||
</NForm>
|
</NForm>
|
||||||
</NTabPane>
|
</NTabPane>
|
||||||
|
|
||||||
<NTabPane name="html" tab="HTML → PDF">
|
<NTabPane name="html" :tab="t('tools.html-to-pdf.texts.tab-html-pdf')">
|
||||||
<NForm label-placement="top">
|
<NForm label-placement="top">
|
||||||
<NFormItem label="HTML Content:">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-html-content')">
|
||||||
<NInput
|
<NInput
|
||||||
v-model:value="html"
|
v-model:value="html"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@@ -244,7 +246,7 @@ async function generateBatch() {
|
|||||||
:disabled="isRunning"
|
:disabled="isRunning"
|
||||||
@click="generateFromHtml"
|
@click="generateFromHtml"
|
||||||
>
|
>
|
||||||
Generate PDF
|
{{ t('tools.html-to-pdf.texts.tag-generate-pdf') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
</n-space>
|
</n-space>
|
||||||
|
|
||||||
@@ -254,9 +256,9 @@ async function generateBatch() {
|
|||||||
</NForm>
|
</NForm>
|
||||||
</NTabPane>
|
</NTabPane>
|
||||||
|
|
||||||
<NTabPane name="batch" tab="Batch URL → PDF">
|
<NTabPane name="batch" :tab="t('tools.html-to-pdf.texts.tab-batch-url-pdf')">
|
||||||
<NForm label-placement="top">
|
<NForm label-placement="top">
|
||||||
<NFormItem label="URLs (one per line):">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-urls-one-per-line')">
|
||||||
<NInput
|
<NInput
|
||||||
v-model:value="batchUrls"
|
v-model:value="batchUrls"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@@ -271,7 +273,7 @@ async function generateBatch() {
|
|||||||
:disabled="isBatchRunning"
|
:disabled="isBatchRunning"
|
||||||
@click="generateBatch"
|
@click="generateBatch"
|
||||||
>
|
>
|
||||||
Generate PDFs
|
{{ t('tools.html-to-pdf.texts.tag-generate-pdfs') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
</n-space>
|
</n-space>
|
||||||
</NForm>
|
</NForm>
|
||||||
@@ -289,11 +291,11 @@ async function generateBatch() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Results -->
|
<!-- Results -->
|
||||||
<NCard v-if="batchResults.length > 0" title="Results">
|
<NCard v-if="batchResults.length > 0" :title="t('tools.html-to-pdf.texts.title-results')">
|
||||||
<n-table>
|
<n-table>
|
||||||
<thead>
|
<thead>
|
||||||
<th>Url</th>
|
<th>{{ t('tools.html-to-pdf.texts.tag-url') }}</th>
|
||||||
<th>Download</th>
|
<th>{{ t('tools.html-to-pdf.texts.tag-download') }}</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr
|
<tr
|
||||||
@@ -311,13 +313,13 @@ async function generateBatch() {
|
|||||||
type="success"
|
type="success"
|
||||||
@click="downloadBlob(item.pdfBlob!, `${urlToFilename(item.url)}.pdf`)"
|
@click="downloadBlob(item.pdfBlob!, `${urlToFilename(item.url)}.pdf`)"
|
||||||
>
|
>
|
||||||
Download PDF
|
{{ t('tools.html-to-pdf.texts.tag-download-pdf') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<NButton size="small" type="error" disabled>
|
<NButton size="small" type="error" disabled>
|
||||||
Failed
|
{{ t('tools.html-to-pdf.texts.tag-failed') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
<div style="color: red; font-size: 12px">
|
<div style="color: red; font-size: 12px">
|
||||||
{{ item.error }}
|
{{ item.error }}
|
||||||
@@ -331,52 +333,52 @@ async function generateBatch() {
|
|||||||
</NTabPane>
|
</NTabPane>
|
||||||
|
|
||||||
<!-- Custom PDF Options -->
|
<!-- Custom PDF Options -->
|
||||||
<NTabPane name="custom-options" tab="Custom PDF Options">
|
<NTabPane name="custom-options" :tab="t('tools.html-to-pdf.texts.tab-custom-pdf-options')">
|
||||||
<NForm label-placement="left">
|
<NForm label-placement="left">
|
||||||
<NFormItem label="Format:">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-format')">
|
||||||
<NSelect
|
<NSelect
|
||||||
v-model:value="options.format"
|
v-model:value="options.format"
|
||||||
:options="pdfFormats"
|
:options="pdfFormats"
|
||||||
/>
|
/>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<NFormItem label="Language:">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-language')">
|
||||||
<NInput v-model:value="options.language" placeholder="en-US" />
|
<NInput v-model:value="options.language" :placeholder="t('tools.html-to-pdf.texts.placeholder-en-us')" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<n-space justify="center">
|
<n-space justify="center">
|
||||||
<NFormItem label="Landscape:">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-landscape')">
|
||||||
<NSwitch v-model:value="options.landscape" />
|
<NSwitch v-model:value="options.landscape" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<NFormItem label="One Long Page:">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-one-long-page')">
|
||||||
<NSwitch v-model:value="options.onePage" />
|
<NSwitch v-model:value="options.onePage" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<NFormItem label="Auto-Hide Cookie Banners:">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-auto-hide-cookie-banners')">
|
||||||
<NSwitch v-model:value="options.autoHideCookies" />
|
<NSwitch v-model:value="options.autoHideCookies" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<NFormItem label="Print Background:">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-print-background')">
|
||||||
<NSwitch v-model:value="options.printBackground" />
|
<NSwitch v-model:value="options.printBackground" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
</n-space>
|
</n-space>
|
||||||
|
|
||||||
<c-card title="Margins">
|
<c-card :title="t('tools.html-to-pdf.texts.title-margins')">
|
||||||
<NSpace justify="center">
|
<NSpace justify="center">
|
||||||
<NFormItem label="Top (mm):" style="width: 200px">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-top-mm')" style="width: 200px">
|
||||||
<NInputNumber v-model:value="options.margin.top" />
|
<NInputNumber v-model:value="options.margin.top" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<NFormItem label="Bottom (mm):" style="width: 200px">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-bottom-mm')" style="width: 200px">
|
||||||
<NInputNumber v-model:value="options.margin.bottom" />
|
<NInputNumber v-model:value="options.margin.bottom" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<NFormItem label="Left (mm):" style="width: 200px">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-left-mm')" style="width: 200px">
|
||||||
<NInputNumber v-model:value="options.margin.left" />
|
<NInputNumber v-model:value="options.margin.left" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|
||||||
<NFormItem label="Right (mm):" style="width: 200px">
|
<NFormItem :label="t('tools.html-to-pdf.texts.label-right-mm')" style="width: 200px">
|
||||||
<NInputNumber v-model:value="options.margin.right" />
|
<NInputNumber v-model:value="options.margin.right" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
</NSpace>
|
</NSpace>
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
|
import { translate as t } from '@/plugins/i18n.plugin';
|
||||||
import { Printer } from '@vicons/tabler';
|
import { Printer } from '@vicons/tabler';
|
||||||
import { defineTool } from '../tool';
|
import { defineTool } from '../tool';
|
||||||
|
|
||||||
export const tool = defineTool({
|
export const tool = defineTool({
|
||||||
name: 'HTML to PDF',
|
name: t('tools.html-to-pdf.title'),
|
||||||
path: '/html-to-pdf',
|
path: '/html-to-pdf',
|
||||||
description: 'Generate PDF from HTML content or URL with format selection and auto hide cookie banners',
|
description: t('tools.html-to-pdf.description'),
|
||||||
keywords: ['html', 'url', 'pdf'],
|
keywords: ['html', 'url', 'pdf'],
|
||||||
component: () => import('./html-to-pdf.vue'),
|
component: () => import('./html-to-pdf.vue'),
|
||||||
icon: Printer,
|
icon: Printer,
|
||||||
createdAt: new Date('2026-04-07'),
|
createdAt: new Date('2026-04-07'),
|
||||||
category: 'PDF',
|
category: 'PDF',
|
||||||
externAccessDescription: 'This tool sends URLs and HTML content to the *self hosted* Puppeteer webservice configured.',
|
externAccessDescription: t('tools.html-to-pdf.externalAccess'),
|
||||||
});
|
});
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
|
import { translate as t } from '@/plugins/i18n.plugin';
|
||||||
import { SunOff } from '@vicons/tabler';
|
import { SunOff } from '@vicons/tabler';
|
||||||
import { defineTool } from '../tool';
|
import { defineTool } from '../tool';
|
||||||
|
|
||||||
export const tool = defineTool({
|
export const tool = defineTool({
|
||||||
name: 'Shutdown Command Generator',
|
name: t('tools.shutdown-command-generator.title'),
|
||||||
path: '/shutdown-command-generator',
|
path: '/shutdown-command-generator',
|
||||||
description: 'Generate shutdown command for various OS',
|
description: t('tools.shutdown-command-generator.description'),
|
||||||
keywords: ['shutdown', 'command'],
|
keywords: ['shutdown', 'command'],
|
||||||
component: () => import('./shutdown-command-generator.vue'),
|
component: () => import('./shutdown-command-generator.vue'),
|
||||||
icon: SunOff,
|
icon: SunOff,
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
type Platform = 'windows' | 'linux' | 'macos';
|
type Platform = 'windows' | 'linux' | 'macos';
|
||||||
type Mode = 'delay' | 'time';
|
type Mode = 'delay' | 'time';
|
||||||
|
|
||||||
@@ -22,14 +25,14 @@ const cancel = ref(false);
|
|||||||
const hibernate = ref(false);
|
const hibernate = ref(false);
|
||||||
|
|
||||||
const platformOptions = [
|
const platformOptions = [
|
||||||
{ label: 'Windows', value: 'windows' },
|
{ label: t('tools.shutdown-command-generator.texts.label-windows'), value: 'windows' },
|
||||||
{ label: 'Linux', value: 'linux' },
|
{ label: t('tools.shutdown-command-generator.texts.label-linux'), value: 'linux' },
|
||||||
{ label: 'macOS', value: 'macos' },
|
{ label: t('tools.shutdown-command-generator.texts.label-macos'), value: 'macos' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const modeOptions = [
|
const modeOptions = [
|
||||||
{ label: 'Delay', value: 'delay' },
|
{ label: t('tools.shutdown-command-generator.texts.label-delay'), value: 'delay' },
|
||||||
{ label: 'Specific Time', value: 'time' },
|
{ label: t('tools.shutdown-command-generator.texts.label-specific-time'), value: 'time' },
|
||||||
];
|
];
|
||||||
|
|
||||||
// --- Command Builders -------------------------------------------------------
|
// --- Command Builders -------------------------------------------------------
|
||||||
@@ -167,7 +170,7 @@ const command = computed(() => {
|
|||||||
<c-select
|
<c-select
|
||||||
v-model:value="platform"
|
v-model:value="platform"
|
||||||
:options="platformOptions"
|
:options="platformOptions"
|
||||||
label="Platform:"
|
:label="t('tools.shutdown-command-generator.texts.label-platform')"
|
||||||
label-position="left"
|
label-position="left"
|
||||||
mb-1
|
mb-1
|
||||||
/>
|
/>
|
||||||
@@ -185,27 +188,22 @@ const command = computed(() => {
|
|||||||
</NSpace>
|
</NSpace>
|
||||||
|
|
||||||
<NSpace v-if="mode === 'delay'" justify="center" mb-1>
|
<NSpace v-if="mode === 'delay'" justify="center" mb-1>
|
||||||
<NFormItem label="Delay:" label-placement="left" mb-1>
|
<NFormItem :label="t('tools.shutdown-command-generator.texts.label-delay')" label-placement="left" mb-1>
|
||||||
<NInputNumber
|
<NInputNumber
|
||||||
v-model:value="delayHours"
|
v-model:value="delayHours"
|
||||||
:min="0"
|
:min="0"
|
||||||
/>
|
/>{{ t('tools.shutdown-command-generator.texts.tag-nbsp-h-nbsp') }}<NInputNumber
|
||||||
h
|
|
||||||
<NInputNumber
|
|
||||||
v-model:value="delayMinutes"
|
v-model:value="delayMinutes"
|
||||||
:min="0"
|
:min="0"
|
||||||
/>
|
/>{{ t('tools.shutdown-command-generator.texts.tag-nbsp-m-nbsp') }}<NInputNumber
|
||||||
m
|
|
||||||
<NInputNumber
|
|
||||||
v-model:value="delaySeconds"
|
v-model:value="delaySeconds"
|
||||||
:min="0"
|
:min="0"
|
||||||
/>
|
/>{{ t('tools.shutdown-command-generator.texts.tag-nbsp-s') }}
|
||||||
s
|
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
</NSpace>
|
</NSpace>
|
||||||
|
|
||||||
<NSpace v-if="mode === 'time'" justify="center" mb-1>
|
<NSpace v-if="mode === 'time'" justify="center" mb-1>
|
||||||
<NFormItem label="Shutdown time:" label-placement="left">
|
<NFormItem :label="t('tools.shutdown-command-generator.texts.label-shutdown-time')" label-placement="left">
|
||||||
<NDatePicker
|
<NDatePicker
|
||||||
v-model:value="timeValue"
|
v-model:value="timeValue"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
@@ -214,14 +212,14 @@ const command = computed(() => {
|
|||||||
</NSpace>
|
</NSpace>
|
||||||
|
|
||||||
<NSpace justify="center" mb-1>
|
<NSpace justify="center" mb-1>
|
||||||
<NCheckbox v-model:checked="force" label="Force" />
|
<NCheckbox v-model:checked="force" :label="t('tools.shutdown-command-generator.texts.label-force')" />
|
||||||
<NCheckbox v-model:checked="reboot" label="Reboot" />
|
<NCheckbox v-model:checked="reboot" :label="t('tools.shutdown-command-generator.texts.label-reboot')" />
|
||||||
<NCheckbox v-model:checked="logoff" label="Logoff" />
|
<NCheckbox v-model:checked="logoff" :label="t('tools.shutdown-command-generator.texts.label-logoff')" />
|
||||||
<NCheckbox v-model:checked="cancel" label="Cancel" />
|
<NCheckbox v-model:checked="cancel" :label="t('tools.shutdown-command-generator.texts.label-cancel')" />
|
||||||
<NCheckbox v-model:checked="hibernate" label="Hibernate" />
|
<NCheckbox v-model:checked="hibernate" :label="t('tools.shutdown-command-generator.texts.label-hibernate')" />
|
||||||
</NSpace>
|
</NSpace>
|
||||||
|
|
||||||
<c-card title="Generated command">
|
<c-card :title="t('tools.shutdown-command-generator.texts.title-generated-command')">
|
||||||
<textarea-copyable :value="command" language="bash" />
|
<textarea-copyable :value="command" language="bash" />
|
||||||
</c-card>
|
</c-card>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
const billAmount = ref<number>();
|
const billAmount = ref<number>();
|
||||||
const tipPercentage = ref<number>(15);
|
const tipPercentage = ref<number>(15);
|
||||||
const numberOfPeople = ref<number>(1);
|
const numberOfPeople = ref<number>(1);
|
||||||
@@ -35,33 +39,33 @@ const amountPerPersonFormatted = computed(() => formatCurrency(amountPerPerson.v
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div style="margin: 0 auto; max-width: 600px">
|
<div style="margin: 0 auto; max-width: 600px">
|
||||||
<c-card mb-3 title="Bill Details">
|
<c-card mb-3 :title="t('tools.tip-calculator.texts.title-bill-details')">
|
||||||
<n-form label-placement="left" label-width="150px" label-align="left">
|
<n-form label-placement="left" label-width="150px" label-align="left">
|
||||||
<n-form-item label="Bill Amount:">
|
<n-form-item :label="t('tools.tip-calculator.texts.label-bill-amount')">
|
||||||
<n-input-number v-model:value="billAmount" :min="0" placeholder="Total Bill" />
|
<n-input-number v-model:value="billAmount" :min="0" :placeholder="t('tools.tip-calculator.texts.placeholder-total-bill')" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<n-form-item label="Tip Percentage:">
|
<n-form-item :label="t('tools.tip-calculator.texts.label-tip-percentage')">
|
||||||
<n-input-number v-model:value="tipPercentage" :min="0" placeholder="Tip %">
|
<n-input-number v-model:value="tipPercentage" :min="0" :placeholder="t('tools.tip-calculator.texts.placeholder-tip')">
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
%
|
{{ t('tools.tip-calculator.texts.tag-') }}
|
||||||
</template>
|
</template>
|
||||||
</n-input-number>
|
</n-input-number>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
<n-form-item label="Number of person:">
|
<n-form-item :label="t('tools.tip-calculator.texts.label-number-of-person')">
|
||||||
<n-input-number v-model:value="numberOfPeople" :min="1" placeholder="People" />
|
<n-input-number v-model:value="numberOfPeople" :min="1" :placeholder="t('tools.tip-calculator.texts.placeholder-people')" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</n-form>
|
</n-form>
|
||||||
</c-card>
|
</c-card>
|
||||||
|
|
||||||
<c-card mb-3 title="Results">
|
<c-card mb-3 :title="t('tools.tip-calculator.texts.title-results')">
|
||||||
<input-copyable label="Tip Amount:" :value="tipAmountFormatted" readonly label-position="left" label-width="150px" mb-1 />
|
<input-copyable :label="t('tools.tip-calculator.texts.label-tip-amount')" :value="tipAmountFormatted" readonly label-position="left" label-width="150px" mb-1 />
|
||||||
<input-copyable label="Total Bill:" :value="totalAmountFormatted" readonly label-position="left" label-width="150px" mb-1 />
|
<input-copyable :label="t('tools.tip-calculator.texts.label-total-bill')" :value="totalAmountFormatted" readonly label-position="left" label-width="150px" mb-1 />
|
||||||
<input-copyable label="Amount Per Person:" :value="amountPerPersonFormatted" readonly label-position="left" label-width="150px" mb-1 />
|
<input-copyable :label="t('tools.tip-calculator.texts.label-amount-per-person')" :value="amountPerPersonFormatted" readonly label-position="left" label-width="150px" mb-1 />
|
||||||
</c-card>
|
</c-card>
|
||||||
|
|
||||||
<c-card title="Quick Tip %">
|
<c-card :title="t('tools.tip-calculator.texts.title-quick-tip')">
|
||||||
<n-space justify="center">
|
<n-space justify="center">
|
||||||
<n-button v-for="tip in [10, 15, 18, 20, 25]" :key="tip" size="small" @click="tipPercentage = tip">
|
<n-button v-for="tip in [10, 15, 18, 20, 25]" :key="tip" size="small" @click="tipPercentage = tip">
|
||||||
{{ tip }}%
|
{{ tip }}%
|
||||||
|
|||||||
Reference in new issue
Block a user