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";
|
2020-05-31 23:33:19 +02:00
|
|
|
import TextCypher from "./routes/tools/TextCypher";
|
2020-06-01 18:27:49 +02:00
|
|
|
import TextStats from "./routes/tools/TextStats";
|
2020-04-25 18:43:17 +02:00
|
|
|
|
|
|
|
Vue.use(VueRouter)
|
|
|
|
|
2020-06-01 18:27:49 +02:00
|
|
|
|
|
|
|
const toolsComponents = [
|
2020-04-25 21:05:40 +02:00
|
|
|
{
|
2020-06-01 18:27:49 +02:00
|
|
|
title: 'Crypto',
|
|
|
|
child: [
|
|
|
|
{
|
|
|
|
icon: 'fa-key',
|
|
|
|
text: 'Token generator',
|
|
|
|
path: '/token-generator',
|
|
|
|
component: TokenGenerator,
|
|
|
|
keywords: ['md5']
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: 'fa-font',
|
|
|
|
text: 'Hash text',
|
|
|
|
path: '/hash',
|
|
|
|
component: Hash
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: 'fa-lock',
|
|
|
|
text: 'Cypher/uncypher text',
|
|
|
|
path: '/cypher',
|
|
|
|
component: TextCypher
|
|
|
|
},
|
|
|
|
],
|
2020-04-25 21:05:40 +02:00
|
|
|
},
|
2020-04-27 00:39:40 +02:00
|
|
|
{
|
2020-06-01 18:27:49 +02:00
|
|
|
title: 'Converter',
|
|
|
|
child: [
|
|
|
|
{
|
|
|
|
icon: 'fa-calendar',
|
|
|
|
text: 'Date/Time converter',
|
|
|
|
path: '/date-converter',
|
|
|
|
component: DateConverter
|
|
|
|
},
|
|
|
|
],
|
2020-04-27 00:39:40 +02:00
|
|
|
},
|
|
|
|
{
|
2020-06-01 18:27:49 +02:00
|
|
|
title: 'Web',
|
|
|
|
child: [
|
|
|
|
{
|
|
|
|
icon: 'fa-link',
|
|
|
|
text: 'URL encode/decode',
|
|
|
|
path: '/url-encoder',
|
|
|
|
component: UrlEncoder
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: 'fa-file-image-o',
|
|
|
|
text: 'File to Base64',
|
|
|
|
path: '/file-to-base64',
|
|
|
|
component: FileToBase64
|
|
|
|
},
|
|
|
|
],
|
2020-05-31 23:33:19 +02:00
|
|
|
},
|
|
|
|
{
|
2020-06-01 18:27:49 +02:00
|
|
|
title: 'Miscellaneous',
|
|
|
|
child: [
|
|
|
|
{
|
|
|
|
icon: 'fa-file-text',
|
|
|
|
text: 'Text stats',
|
|
|
|
path: '/text-stats',
|
|
|
|
component: TextStats
|
|
|
|
},
|
|
|
|
],
|
2020-05-15 12:27:18 +02:00
|
|
|
}
|
2020-06-01 18:27:49 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
const toolsComponentsFlat = toolsComponents.reduce((acc, section) => [...acc, ...section.child], [])
|
2020-05-15 12:27:18 +02:00
|
|
|
|
|
|
|
const routes = [
|
2020-06-01 18:27:49 +02:00
|
|
|
...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')
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
const router = new VueRouter({
|
|
|
|
mode: 'history',
|
|
|
|
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,
|
2020-06-01 18:27:49 +02:00
|
|
|
toolsComponents,
|
|
|
|
toolsComponentsFlat
|
2020-05-15 12:27:18 +02:00
|
|
|
};
|