mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-24 14:50:17 +03:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
071cd4c366 | ||
|
|
cb5b462e11 | ||
|
|
9eac9cb2a9 | ||
|
|
23f82d956a |
No files matched your search
@@ -15,7 +15,7 @@ jobs:
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Get Playwright version
|
||||
|
||||
Vendored
+4
@@ -11,6 +11,7 @@ declare module '@vue/runtime-core' {
|
||||
export interface GlobalComponents {
|
||||
'404.page': typeof import('./src/pages/404.page.vue')['default']
|
||||
About: typeof import('./src/pages/About.vue')['default']
|
||||
AirCodes: typeof import('./src/tools/air-codes/air-codes.vue')['default']
|
||||
App: typeof import('./src/App.vue')['default']
|
||||
AsciiTextDrawer: typeof import('./src/tools/ascii-text-drawer/ascii-text-drawer.vue')['default']
|
||||
'Base.layout': typeof import('./src/layouts/base.layout.vue')['default']
|
||||
@@ -138,12 +139,14 @@ declare module '@vue/runtime-core' {
|
||||
NH1: typeof import('naive-ui')['NH1']
|
||||
NH3: typeof import('naive-ui')['NH3']
|
||||
NIcon: typeof import('naive-ui')['NIcon']
|
||||
NInput: typeof import('naive-ui')['NInput']
|
||||
NInputNumber: typeof import('naive-ui')['NInputNumber']
|
||||
NLabel: typeof import('naive-ui')['NLabel']
|
||||
NLayout: typeof import('naive-ui')['NLayout']
|
||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||
NMenu: typeof import('naive-ui')['NMenu']
|
||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||
NSpace: typeof import('naive-ui')['NSpace']
|
||||
NSpin: typeof import('naive-ui')['NSpin']
|
||||
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
||||
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
|
||||
@@ -159,6 +162,7 @@ declare module '@vue/runtime-core' {
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
RsaKeyPairGenerator: typeof import('./src/tools/rsa-key-pair-generator/rsa-key-pair-generator.vue')['default']
|
||||
SafelinkDecoder: typeof import('./src/tools/safelink-decoder/safelink-decoder.vue')['default']
|
||||
SlugifyString: typeof import('./src/tools/slugify-string/slugify-string.vue')['default']
|
||||
SpanCopyable: typeof import('./src/components/SpanCopyable.vue')['default']
|
||||
SqlPrettify: typeof import('./src/tools/sql-prettify/sql-prettify.vue')['default']
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@
|
||||
"@vueuse/core": "^10.3.0",
|
||||
"@vueuse/head": "^1.0.0",
|
||||
"@vueuse/router": "^10.0.0",
|
||||
"ansible-vault": "^1.1.1",
|
||||
"aircodes": "^1.3.16",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"change-case": "^4.1.2",
|
||||
"colord": "^2.9.3",
|
||||
|
||||
@@ -9,7 +9,7 @@ const useWebServer = process.env.NO_WEB_SERVER !== 'true';
|
||||
*/
|
||||
export default defineConfig({
|
||||
testDir: './src',
|
||||
testMatch: /.*\.e2e\.(spec\.)?ts/,
|
||||
testMatch: /\.e2e\.(spec\.)?ts$/,
|
||||
/* Run tests in files in parallel */
|
||||
fullyParallel: true,
|
||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||
@@ -57,7 +57,7 @@ export default defineConfig({
|
||||
&& {
|
||||
webServer: {
|
||||
command: 'npm run preview',
|
||||
url: 'http://127.0.0.1:5050',
|
||||
url: 'http://localhost:5050',
|
||||
reuseExistingServer: !isCI,
|
||||
},
|
||||
}
|
||||
|
||||
Generated
+8
-13
@@ -41,9 +41,9 @@ dependencies:
|
||||
'@vueuse/router':
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0(vue-router@4.1.6)(vue@3.3.4)
|
||||
ansible-vault:
|
||||
specifier: ^1.1.1
|
||||
version: 1.1.1
|
||||
aircodes:
|
||||
specifier: ^1.3.16
|
||||
version: 1.3.16
|
||||
bcryptjs:
|
||||
specifier: ^2.4.3
|
||||
version: 2.4.3
|
||||
@@ -4054,6 +4054,10 @@ packages:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/aircodes@1.3.16:
|
||||
resolution: {integrity: sha512-ysPgP4iifjazWJfnfkywqpJMS+wVGzd9Z1t9oEeMjjbktavlxaJsFgmLl2OLdZru44sefc9/cCRUeeB7xKjxxQ==}
|
||||
dev: false
|
||||
|
||||
/ajv@6.12.6:
|
||||
resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
|
||||
dependencies:
|
||||
@@ -4098,12 +4102,6 @@ packages:
|
||||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
/ansible-vault@1.1.1:
|
||||
resolution: {integrity: sha512-JoUG/6poezcywvh0Fw5QJcrfwlmc5ZCSdZsYyHJkD6Qrby729jAoJ54mInTWg2pSDG+s2N09cp21A0Svzmo6+g==}
|
||||
dependencies:
|
||||
binascii: 0.0.2
|
||||
dev: false
|
||||
|
||||
/anymatch@3.1.3:
|
||||
resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}
|
||||
engines: {node: '>= 8'}
|
||||
@@ -4230,10 +4228,6 @@ packages:
|
||||
resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
/binascii@0.0.2:
|
||||
resolution: {integrity: sha512-rA2CrUl1+6yKrn+XgLs8Hdy18OER1UW146nM+ixzhQXDY+Bd3ySkyIJGwF2a4I45JwbvF1mDL/nWkqBwpOcdBA==}
|
||||
dev: false
|
||||
|
||||
/bl@4.1.0:
|
||||
resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
|
||||
dependencies:
|
||||
@@ -9455,6 +9449,7 @@ packages:
|
||||
|
||||
/workbox-google-analytics@7.0.0:
|
||||
resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==}
|
||||
deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
|
||||
dependencies:
|
||||
workbox-background-sync: 7.0.0
|
||||
workbox-core: 7.0.0
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<script setup lang="ts">
|
||||
import { findAirline, findAirport } from 'aircodes';
|
||||
import SpanCopyable from '@/components/SpanCopyable.vue';
|
||||
|
||||
const airlineQuery = ref('');
|
||||
const airportQuery = ref('');
|
||||
const resultAirline = computed(() => airlineQuery.value === '' ? [] : findAirline(airlineQuery.value));
|
||||
const resultAirport = computed(() => airportQuery.value === '' ? [] : findAirport(airportQuery.value));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-card title="Airline search" mb-1>
|
||||
<n-space>
|
||||
<n-form-item label="Airline query">
|
||||
<n-input v-model:value="airlineQuery" />
|
||||
</n-form-item>
|
||||
</n-space>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<div v-for="airline in resultAirline" :key="airline.iata">
|
||||
<n-form-item label="IATA">
|
||||
<SpanCopyable :value="airline.iata" />
|
||||
</n-form-item>
|
||||
<n-form-item label="ICAO">
|
||||
<SpanCopyable :value="airline.icao" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Name">
|
||||
<SpanCopyable :value="airline.name" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Logo">
|
||||
<img width="100" :alt="airline.name" :src="airline.logo">
|
||||
</n-form-item>
|
||||
</div>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Airport search">
|
||||
<n-space>
|
||||
<n-form-item label="Airport query">
|
||||
<n-input v-model:value="airportQuery" />
|
||||
</n-form-item>
|
||||
</n-space>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<div v-for="airport in resultAirport" :key="airport.iata">
|
||||
<n-form-item label="IATA">
|
||||
<SpanCopyable :value="airport.iata" />
|
||||
</n-form-item>
|
||||
<n-form-item label="ICAO">
|
||||
<SpanCopyable :value="airport.icao" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Name">
|
||||
<SpanCopyable :value="airport.name" />
|
||||
</n-form-item>
|
||||
<n-form-item label="City">
|
||||
<SpanCopyable :value="airport.city" />
|
||||
</n-form-item>
|
||||
<n-form-item label="State">
|
||||
<SpanCopyable :value="airport.state" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Country">
|
||||
<SpanCopyable :value="airport.country" />
|
||||
</n-form-item>
|
||||
</div>
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Plane } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Air Codes',
|
||||
path: '/air-codes',
|
||||
description: 'Get Airport and Airline info from name, ICAO code or IATA code',
|
||||
keywords: ['airport', 'airline', 'air', 'plane', 'icao', 'iata'],
|
||||
component: () => import('./air-codes.vue'),
|
||||
icon: Plane,
|
||||
createdAt: new Date('2024-04-20'),
|
||||
});
|
||||
@@ -1,103 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { Vault } from 'ansible-vault';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const decryptedInput = ref('');
|
||||
const encryptPassword = ref('');
|
||||
const encryptId = ref('');
|
||||
const cryptedOutput = computedAsync(
|
||||
async () => {
|
||||
try {
|
||||
const v = new Vault({ password: encryptPassword.value });
|
||||
return await v.encrypt(decryptedInput.value, encryptId.value);
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const cryptedInput = ref('');
|
||||
const decryptPassword = ref('');
|
||||
const decryptedOutput = computedAsync(
|
||||
async () => {
|
||||
try {
|
||||
const v = new Vault({ password: decryptPassword.value });
|
||||
// handle mac \r
|
||||
return (await v.decrypt(cryptedInput.value?.replace(/\r(?!\n)/, '\n'), undefined)) ?? '';
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card title="Encrypt Ansible Vault Secret">
|
||||
<c-input-text
|
||||
v-model:value="decryptedInput"
|
||||
placeholder="Put your string to encrypt..."
|
||||
label="String to encrypt"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
|
||||
<n-space>
|
||||
<c-input-text
|
||||
v-model:value="encryptPassword"
|
||||
placeholder="Encryption password"
|
||||
label="Encryption password"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
<c-input-text
|
||||
v-model:value="encryptId"
|
||||
placeholder="Encryption Id"
|
||||
label="Encryption Id"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
</n-space>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<TextareaCopyable
|
||||
label="Encrypted string"
|
||||
:value="cryptedOutput"
|
||||
multiline
|
||||
readonly
|
||||
rows="5"
|
||||
mb-5
|
||||
/>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Decrypt Ansible Vault Secret">
|
||||
<c-input-text
|
||||
v-model:value="cryptedInput"
|
||||
placeholder="Put your encrypted string here..."
|
||||
label="String to decrypt"
|
||||
raw-text multiline mb-5
|
||||
rows="5"
|
||||
/>
|
||||
|
||||
<c-input-text
|
||||
v-model:value="decryptPassword"
|
||||
placeholder="Decryption password"
|
||||
label="Decryption password"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<TextareaCopyable
|
||||
label="Decrypted string"
|
||||
:value="decryptedOutput"
|
||||
multiline
|
||||
readonly
|
||||
rows="5"
|
||||
mb-5
|
||||
/>
|
||||
</c-card>
|
||||
</template>
|
||||
@@ -1,12 +0,0 @@
|
||||
import { LockSquare } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Ansible vault crypt decrypt',
|
||||
path: '/ansible-vault-crypt-decrypt',
|
||||
description: 'Encrypt and decrypt Ansible Vault Secrets',
|
||||
keywords: ['ansible', 'vault', 'crypt', 'decrypt'],
|
||||
component: () => import('./ansible-vault-crypt-decrypt.vue'),
|
||||
icon: LockSquare,
|
||||
createdAt: new Date('2024-02-25'),
|
||||
});
|
||||
@@ -28,7 +28,7 @@ const compareMatch = computed(() => compareSync(compareString.value, compareHash
|
||||
mb-2
|
||||
/>
|
||||
<n-form-item label="Salt count: " label-placement="left" label-width="120">
|
||||
<n-input-number v-model:value="saltCount" placeholder="Salt rounds..." :max="10" :min="0" w-full />
|
||||
<n-input-number v-model:value="saltCount" placeholder="Salt rounds..." :max="100" :min="0" w-full />
|
||||
</n-form-item>
|
||||
|
||||
<c-input-text :value="hashed" readonly text-center />
|
||||
|
||||
+7
-16
@@ -5,7 +5,6 @@ import { tool as basicAuthGenerator } from './basic-auth-generator';
|
||||
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
||||
|
||||
import { tool as textToUnicode } from './text-to-unicode';
|
||||
import { tool as ansibleVaultCryptDecrypt } from './ansible-vault-crypt-decrypt';
|
||||
import { tool as safelinkDecoder } from './safelink-decoder';
|
||||
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
||||
import { tool as numeronymGenerator } from './numeronym-generator';
|
||||
@@ -15,6 +14,7 @@ import { tool as ulidGenerator } from './ulid-generator';
|
||||
import { tool as ibanValidatorAndParser } from './iban-validator-and-parser';
|
||||
import { tool as stringObfuscator } from './string-obfuscator';
|
||||
import { tool as textDiff } from './text-diff';
|
||||
import { tool as airCodes } from './air-codes';
|
||||
import { tool as emojiPicker } from './emoji-picker';
|
||||
import { tool as passwordStrengthAnalyser } from './password-strength-analyser';
|
||||
import { tool as yamlToToml } from './yaml-to-toml';
|
||||
@@ -86,20 +86,7 @@ import { tool as yamlViewer } from './yaml-viewer';
|
||||
export const toolsByCategory: ToolCategory[] = [
|
||||
{
|
||||
name: 'Crypto',
|
||||
components: [
|
||||
tokenGenerator,
|
||||
hashText,
|
||||
bcrypt,
|
||||
uuidGenerator,
|
||||
ulidGenerator,
|
||||
cypher,
|
||||
bip39,
|
||||
hmacGenerator,
|
||||
rsaKeyPairGenerator,
|
||||
ansibleVaultCryptDecrypt,
|
||||
passwordStrengthAnalyser,
|
||||
pdfSignatureChecker,
|
||||
],
|
||||
components: [tokenGenerator, hashText, bcrypt, uuidGenerator, ulidGenerator, cypher, bip39, hmacGenerator, rsaKeyPairGenerator, passwordStrengthAnalyser, pdfSignatureChecker],
|
||||
},
|
||||
{
|
||||
name: 'Converter',
|
||||
@@ -190,7 +177,11 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
},
|
||||
{
|
||||
name: 'Data',
|
||||
components: [phoneParserAndFormatter, ibanValidatorAndParser],
|
||||
components: [
|
||||
phoneParserAndFormatter,
|
||||
ibanValidatorAndParser,
|
||||
airCodes,
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@ describe('integer-base-converter', () => {
|
||||
expect(convertBase({ value: '10100101', fromBase: 2, toBase: 16 })).toEqual('a5');
|
||||
expect(convertBase({ value: '192654', fromBase: 10, toBase: 8 })).toEqual('570216');
|
||||
expect(convertBase({ value: 'zz', fromBase: 64, toBase: 10 })).toEqual('2275');
|
||||
expect(convertBase({ value: '42540766411283223938465490632011909384', fromBase: 10, toBase: 10 })).toEqual('42540766411283223938465490632011909384');
|
||||
expect(convertBase({ value: '42540766411283223938465490632011909384', fromBase: 10, toBase: 16 })).toEqual('20010db8000085a300000000ac1f8908');
|
||||
expect(convertBase({ value: '20010db8000085a300000000ac1f8908', fromBase: 16, toBase: 10 })).toEqual('42540766411283223938465490632011909384');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,16 +5,16 @@ export function convertBase({ value, fromBase, toBase }: { value: string; fromBa
|
||||
let decValue = value
|
||||
.split('')
|
||||
.reverse()
|
||||
.reduce((carry: number, digit: string, index: number) => {
|
||||
.reduce((carry: bigint, digit: string, index: number) => {
|
||||
if (!fromRange.includes(digit)) {
|
||||
throw new Error(`Invalid digit "${digit}" for base ${fromBase}.`);
|
||||
}
|
||||
return (carry += fromRange.indexOf(digit) * fromBase ** index);
|
||||
}, 0);
|
||||
return (carry += BigInt(fromRange.indexOf(digit)) * BigInt(fromBase) ** BigInt(index));
|
||||
}, 0n);
|
||||
let newValue = '';
|
||||
while (decValue > 0) {
|
||||
newValue = toRange[decValue % toBase] + newValue;
|
||||
decValue = (decValue - (decValue % toBase)) / toBase;
|
||||
newValue = toRange[Number(decValue % BigInt(toBase))] + newValue;
|
||||
decValue = (decValue - (decValue % BigInt(toBase))) / BigInt(toBase);
|
||||
}
|
||||
return newValue || '0';
|
||||
}
|
||||
@@ -23,7 +23,7 @@ const decodeInput = ref('Hello%20world%20%3A)');
|
||||
const decodeOutput = computed(() => withDefaultOnError(() => decodeURIComponent(decodeInput.value), ''));
|
||||
|
||||
const decodeValidation = useValidation({
|
||||
source: encodeInput,
|
||||
source: decodeInput,
|
||||
rules: [
|
||||
{
|
||||
validator: value => isNotThrowing(() => decodeURIComponent(value)),
|
||||
|
||||
Reference in new issue
Block a user