aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/router.ts8
-rw-r--r--src/tools/Tool.ts1
-rw-r--r--src/tools/base64-converter/index.ts1
-rw-r--r--src/tools/color-converter/index.ts1
-rw-r--r--src/tools/encryption/index.ts1
-rw-r--r--src/tools/hash-text/index.ts1
-rw-r--r--src/tools/qr-code-generator/index.ts2
-rw-r--r--src/tools/text-statistics/index.ts1
8 files changed, 14 insertions, 2 deletions
diff --git a/src/router.ts b/src/router.ts
index 68126b5..1149f8b 100644
--- a/src/router.ts
+++ b/src/router.ts
@@ -4,6 +4,11 @@ import HomePage from './pages/Home.page.vue';
import NotFound from './pages/404.page.vue';
import { tools } from './tools';
+const toolsRoutes = tools.map(({ path, name, component, ...config }) => ({ path, name, component, meta: { isTool: true, layout: layouts.toolLayout, name, ...config } }));
+const toolsRedirectRoutes = tools
+ .filter(({ redirectFrom }) => redirectFrom && redirectFrom.length > 0)
+ .flatMap(({ path, redirectFrom }) => redirectFrom?.map((redirectSource) => ({ path: redirectSource, redirect: path })) ?? []);
+
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
@@ -12,7 +17,8 @@ const router = createRouter({
name: 'home',
component: HomePage,
},
- ...tools.map(({ path, name, component, ...config }) => ({ path, name, component, meta: { isTool: true, layout: layouts.toolLayout, name, ...config } })),
+ ...toolsRoutes,
+ ...toolsRedirectRoutes,
{ path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound },
],
});
diff --git a/src/tools/Tool.ts b/src/tools/Tool.ts
index 9ccd2d7..4cd462c 100644
--- a/src/tools/Tool.ts
+++ b/src/tools/Tool.ts
@@ -7,6 +7,7 @@ export interface ITool {
keywords: string[];
component: () => Promise<Component>;
icon: Component;
+ redirectFrom?: string[];
}
export interface ToolCategory {
diff --git a/src/tools/base64-converter/index.ts b/src/tools/base64-converter/index.ts
index 5f3021a..4b67997 100644
--- a/src/tools/base64-converter/index.ts
+++ b/src/tools/base64-converter/index.ts
@@ -8,4 +8,5 @@ export const tool: ITool = {
keywords: ['base64', 'converter', 'upload', 'image', 'file', 'convertion', 'web', 'data', 'format'],
component: () => import('./base64-converter.vue'),
icon: FileDigit,
+ redirectFrom: ['/file-to-base64', '/base64-string-converter'],
};
diff --git a/src/tools/color-converter/index.ts b/src/tools/color-converter/index.ts
index 6ad7b22..e42ab37 100644
--- a/src/tools/color-converter/index.ts
+++ b/src/tools/color-converter/index.ts
@@ -8,4 +8,5 @@ export const tool: ITool = {
keywords: ['color', 'converter'],
component: () => import('./color-converter.vue'),
icon: Palette,
+ redirectFrom: ['/color-picker-converter'],
};
diff --git a/src/tools/encryption/index.ts b/src/tools/encryption/index.ts
index 0575f7d..1adef2b 100644
--- a/src/tools/encryption/index.ts
+++ b/src/tools/encryption/index.ts
@@ -8,4 +8,5 @@ export const tool: ITool = {
keywords: ['cypher', 'uncypher', 'text', 'AES', 'TripleDES', 'Rabbit', 'RC4'],
component: () => import('./encryption.vue'),
icon: Lock,
+ redirectFrom: ['/cypher'],
};
diff --git a/src/tools/hash-text/index.ts b/src/tools/hash-text/index.ts
index fbc9a2c..95604a1 100644
--- a/src/tools/hash-text/index.ts
+++ b/src/tools/hash-text/index.ts
@@ -8,4 +8,5 @@ export const tool: ITool = {
keywords: ['hash', 'digest', 'crypto', 'security', 'text', 'MD5', 'SHA1', 'SHA256', 'SHA224', 'SHA512', 'SHA384', 'SHA3', 'RIPEMD160'],
component: () => import('./hash-text.vue'),
icon: EyeOff,
+ redirectFrom: ['/hash'],
};
diff --git a/src/tools/qr-code-generator/index.ts b/src/tools/qr-code-generator/index.ts
index 70e86dc..7972ec3 100644
--- a/src/tools/qr-code-generator/index.ts
+++ b/src/tools/qr-code-generator/index.ts
@@ -3,7 +3,7 @@ import type { ITool } from './../Tool';
export const tool: ITool = {
name: 'QR Code generator',
- path: '/qr-code-generator',
+ path: '/qrcode-generator',
description: 'Generate and download QR-code for an url or just a text and customize the background and foreground colors.',
keywords: ['qr', 'code', 'generator', 'square', 'color', 'link', 'low', 'medium', 'quartile', 'high', 'transparent'],
component: () => import('./qr-code-generator.vue'),
diff --git a/src/tools/text-statistics/index.ts b/src/tools/text-statistics/index.ts
index 6f9ad84..bc92be1 100644
--- a/src/tools/text-statistics/index.ts
+++ b/src/tools/text-statistics/index.ts
@@ -8,4 +8,5 @@ export const tool: ITool = {
keywords: ['text', 'statistics', 'length', 'characters', 'count', 'size', 'bytes'],
component: () => import('./text-statistics.vue'),
icon: FileText,
+ redirectFrom: ['/text-stats'],
};