it-tools/src/router.js

143 lines
4.1 KiB
JavaScript
Raw Normal View History

2020-04-25 18:43:17 +02:00
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from './routes/Home.vue'
2020-04-27 00:39:40 +02:00
import TokenGenerator from "./routes/tools/TokenGenerator";
import Hash from "./routes/tools/Hash";
import DateConverter from "./routes/tools/DateConverter";
import UrlEncoder from "./routes/tools/UrlEncoder";
import FileToBase64 from "./routes/tools/FileToBase64";
import TextCypher from "./routes/tools/TextCypher";
import TextStats from "./routes/tools/TextStats";
import BaseConverter from "./routes/tools/BaseConverter";
import UuidGenerator from "./routes/tools/UuidGenerator";
import ColorConverter from "./routes/tools/ColorConverter";
2020-04-25 18:43:17 +02:00
Vue.use(VueRouter)
const toolsComponents = [
{
title: 'Crypto',
child: [
{
icon: 'fa-key',
text: 'Token generator',
path: '/token-generator',
component: TokenGenerator,
keywords: ['token', 'random', 'string', 'alphanumeric'],
description: 'Generate random tokens.'
},
{
icon: 'fa-fingerprint',
text: 'Uuid generator',
path: '/uuid-generator',
component: UuidGenerator,
keywords: ['token', 'v4', 'string', 'alphanumeric']
},
{
icon: 'fa-font',
text: 'Hash text',
path: '/hash',
component: Hash,
keywords: ['md5', 'sha1', 'sha256', 'sha224', 'sha512', 'sha384', 'sha3', 'ripemd160', 'random']
},
{
icon: 'fa-lock',
text: 'Cypher/uncypher text',
path: '/cypher',
component: TextCypher,
keywords: ['aes', 'tripledes', 'rabbit', 'rabbitlegacy', 'rc4']
},
],
},
2020-04-27 00:39:40 +02:00
{
title: 'Converter',
child: [
{
icon: 'fa-calendar',
text: 'Date/Time converter',
path: '/date-converter',
component: DateConverter,
keywords: ['locale', 'format', 'iso 8601', 'utc', 'timestamp', 'unix', 'year', 'month', 'day', 'hours', 'minutes', 'seconds']
},
{
icon: 'fa-exchange-alt',
text: 'Base converter',
path: '/base-converter',
component: BaseConverter,
keywords: ['binary', 'hexadecimal', 'decimal']
},
{
icon: 'fa-palette',
text: 'Color picker/converter',
path: '/color-picker-converter',
component: ColorConverter,
keywords: ['rgb', 'rgba', 'hexadecimal', 'hsla', 'red', 'green', 'blue', 'alpha']
},
],
2020-04-27 00:39:40 +02:00
},
{
title: 'Web',
child: [
{
icon: 'fa-link',
text: 'URL encode/decode',
path: '/url-encoder',
component: UrlEncoder,
keywords: ['%20']
},
{
icon: 'fa-file-export',
text: 'File to Base64',
path: '/file-to-base64',
component: FileToBase64
},
],
},
{
title: 'Miscellaneous',
child: [
{
icon: 'fa-align-left\n',
text: 'Text stats',
path: '/text-stats',
component: TextStats,
keywords: ['word', 'count', 'size', 'bytes', 'length']
},
],
2020-05-15 12:27:18 +02:00
}
];
const toolsComponentsFlat = toolsComponents.reduce((acc, section) => [...acc, ...section.child], [])
2020-05-15 12:27:18 +02:00
const routes = [
...toolsComponentsFlat,
2020-05-15 12:27:18 +02:00
{
path: '/',
component: Home
2020-04-27 00:39:40 +02:00
},
2020-04-25 18:43:17 +02:00
{
path: '/about',
name: 'About',
component: () => import('./routes/About.vue')
},
{
path: '*',
name: '404',
component: () => import('./routes/NotFound.vue')
2020-04-25 18:43:17 +02:00
}
]
const router = new VueRouter({
base: process.env.BASE_URL,
routes
2020-05-15 12:27:18 +02:00
});
2020-04-25 18:43:17 +02:00
2020-05-15 12:27:18 +02:00
export default router;
export {
routes,
toolsComponents,
toolsComponentsFlat
2020-05-15 12:27:18 +02:00
};