From 029adcbc178153b722abc9460a2421253ca362ef Mon Sep 17 00:00:00 2001 From: stuzer05 Date: Sun, 29 Sep 2024 10:06:13 +0300 Subject: [PATCH] Refactor views structure --- src/components/Sidebar.vue | 4 +- src/router/index.js | 98 ++++++++++--------- .../RenameVolume.vue} | 0 src/views/{ => general}/DummyImage.vue | 0 src/views/{ => general}/ExplainCrontab.vue | 0 .../{ => general}/FileBase64EncodeDecode.vue | 0 src/views/{ => general}/HomeView.vue | 0 src/views/{ => general}/HumansTxt.vue | 0 src/views/{ => general}/QRCode.vue | 2 +- .../{ => general}/TableToMarkdownTable.vue | 0 .../{ => general}/TableToMediawikiTable.vue | 0 src/views/{ => general}/UnixTimestamp.vue | 0 .../JSONToStruct.vue} | 0 .../SQLTablesToStruct.vue} | 0 src/views/{ => json}/JSONFormatter.vue | 0 src/views/{ => json}/JSONMinifier.vue | 0 src/views/{ => php}/PHPArrayToJson.vue | 2 +- .../{PHPSerialize.vue => php/Serialize.vue} | 2 +- src/views/{ => php}/StrToPHPArray.vue | 2 +- .../{SQLFormatter.vue => sql/Formatter.vue} | 0 .../SplitInView.vue} | 0 src/views/{ => strings}/FixRuEnKeyboard.vue | 0 .../{StrLength.vue => strings/Length.vue} | 0 .../NATOAlphabet.vue} | 2 +- .../Numeronym.vue} | 2 +- src/views/{StrPad.vue => strings/Pad.vue} | 0 .../RemoveDuplicateLines.vue} | 0 .../SortLines.vue} | 0 .../ToLowerUppper.vue} | 0 src/views/{ => strings}/UrlEncodeDecode.vue | 0 src/views/{ => strings}/UrlQueryViewer.vue | 0 31 files changed, 58 insertions(+), 56 deletions(-) rename src/views/{DockerRenameVolume.vue => docker/RenameVolume.vue} (100%) rename src/views/{ => general}/DummyImage.vue (100%) rename src/views/{ => general}/ExplainCrontab.vue (100%) rename src/views/{ => general}/FileBase64EncodeDecode.vue (100%) rename src/views/{ => general}/HomeView.vue (100%) rename src/views/{ => general}/HumansTxt.vue (100%) rename src/views/{ => general}/QRCode.vue (99%) rename src/views/{ => general}/TableToMarkdownTable.vue (100%) rename src/views/{ => general}/TableToMediawikiTable.vue (100%) rename src/views/{ => general}/UnixTimestamp.vue (100%) rename src/views/{GoJSONToStruct.vue => go/JSONToStruct.vue} (100%) rename src/views/{GoSQLTablesToStruct.vue => go/SQLTablesToStruct.vue} (100%) rename src/views/{ => json}/JSONFormatter.vue (100%) rename src/views/{ => json}/JSONMinifier.vue (100%) rename src/views/{ => php}/PHPArrayToJson.vue (96%) rename src/views/{PHPSerialize.vue => php/Serialize.vue} (97%) rename src/views/{ => php}/StrToPHPArray.vue (97%) rename src/views/{SQLFormatter.vue => sql/Formatter.vue} (100%) rename src/views/{SQLSplitInView.vue => sql/SplitInView.vue} (100%) rename src/views/{ => strings}/FixRuEnKeyboard.vue (100%) rename src/views/{StrLength.vue => strings/Length.vue} (100%) rename src/views/{StrToNATOAlphabet.vue => strings/NATOAlphabet.vue} (96%) rename src/views/{StrNumeronym.vue => strings/Numeronym.vue} (95%) rename src/views/{StrPad.vue => strings/Pad.vue} (100%) rename src/views/{StrRemoveDuplicateLines.vue => strings/RemoveDuplicateLines.vue} (100%) rename src/views/{StrSortLines.vue => strings/SortLines.vue} (100%) rename src/views/{StrToLowerUppper.vue => strings/ToLowerUppper.vue} (100%) rename src/views/{ => strings}/UrlEncodeDecode.vue (100%) rename src/views/{ => strings}/UrlQueryViewer.vue (100%) diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 042e3ba..5b7faa9 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -33,7 +33,7 @@ export default { }; }, mounted() { - let menuRoutes = { + this.menuRoutes = { 'General': { 'home': 'Home', 'explain_crontab': 'Explain crontab', @@ -78,8 +78,6 @@ export default { 'sql_split_in': 'SQL split IN', }, }; - - this.menuRoutes = menuRoutes; } } \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index b8fd632..f095af1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -9,42 +9,47 @@ const router = createRouter({ { path: '/', name: 'home', - component: () => import('../views/HomeView.vue'), + component: () => import('../views/general/HomeView.vue'), }, { path: '/explain_crontab', name: 'explain_crontab', - component: () => import('../views/ExplainCrontab.vue'), + component: () => import('../views/general/ExplainCrontab.vue'), }, { path: '/table_to_markdown_table', name: 'table_to_markdown_table', - component: () => import('../views/TableToMarkdownTable.vue'), + component: () => import('../views/general/TableToMarkdownTable.vue'), }, { path: '/table_to_mediawiki_table', name: 'table_to_mediawiki_table', - component: () => import('../views/TableToMediawikiTable.vue'), + component: () => import('../views/general/TableToMediawikiTable.vue'), }, { path: '/dummy_image', name: 'dummy_image', - component: () => import('../views/DummyImage.vue'), + component: () => import('../views/general/DummyImage.vue'), }, { path: '/humans_txt', name: 'humans_txt', - component: () => import('../views/HumansTxt.vue'), + component: () => import('../views/general/HumansTxt.vue'), }, { path: '/qr_code', name: 'qr_code', - component: () => import('../views/QRCode.vue'), + component: () => import('../views/general/QRCode.vue'), }, { path: '/unix_timestamp', name: 'unix_timestamp', - component: () => import('../views/UnixTimestamp.vue'), + component: () => import('../views/general/UnixTimestamp.vue'), + }, + { + path: '/file_base64_encode_decode', + name: 'file_base64_encode_decode', + component: () => import('../views/general/FileBase64EncodeDecode.vue'), }, /** @@ -53,72 +58,71 @@ const router = createRouter({ { path: '/str_length', name: 'str_length', - component: () => import('../views/StrLength.vue'), + component: () => import('../views/strings/Length.vue'), }, { path: '/str_sort_lines', name: 'str_sort_lines', - component: () => import('../views/StrSortLines.vue'), + component: () => import('../views/strings/SortLines.vue'), }, { path: '/str_to_lower_upper', name: 'str_to_lower_upper', - component: () => import('../views/StrToLowerUppper.vue'), + component: () => import('../views/strings/ToLowerUppper.vue'), }, { path: '/str_remove_duplicate_lines', name: 'str_remove_duplicate_lines', - component: () => import('../views/StrRemoveDuplicateLines.vue'), + component: () => import('../views/strings/RemoveDuplicateLines.vue'), }, { path: '/str_pad', name: 'str_pad', - component: () => import('../views/StrPad.vue'), - }, - { - path: '/str_to_php_array', - name: 'str_to_php_array', - component: () => import('../views/StrToPHPArray.vue'), + component: () => import('../views/strings/Pad.vue'), }, { path: '/str_numeronym', name: 'str_numeronym', - component: () => import('../views/StrNumeronym.vue'), + component: () => import('../views/strings/Numeronym.vue'), }, { path: '/str_to_nato_alphabet', name: 'str_to_nato_alphabet', - component: () => import('../views/StrToNATOAlphabet.vue'), - }, - { - path: '/php_array_to_json', - name: 'php_array_to_json', - component: () => import('../views/PHPArrayToJson.vue'), - }, - { - path: '/php_serialize', - name: 'php_serialize', - component: () => import('../views/PHPSerialize.vue'), - }, - { - path: '/fix_ru_en_keyboard', - name: 'fix_ru_en_keyboard', - component: () => import('../views/FixRuEnKeyboard.vue'), + component: () => import('../views/strings/NATOAlphabet.vue'), }, { path: '/url_encode_decode', name: 'url_encode_decode', - component: () => import('../views/UrlEncodeDecode.vue'), + component: () => import('../views/strings/UrlEncodeDecode.vue'), }, { path: '/url_query_viewer', name: 'url_query_viewer', - component: () => import('../views/UrlQueryViewer.vue'), + component: () => import('../views/strings/UrlQueryViewer.vue'), }, { - path: '/file_base64_encode_decode', - name: 'file_base64_encode_decode', - component: () => import('../views/FileBase64EncodeDecode.vue'), + path: '/fix_ru_en_keyboard', + name: 'fix_ru_en_keyboard', + component: () => import('../views/strings/FixRuEnKeyboard.vue'), + }, + + /** + * PHP + */ + { + path: '/str_to_php_array', + name: 'str_to_php_array', + component: () => import('../views/php/StrToPHPArray.vue'), + }, + { + path: '/php_array_to_json', + name: 'php_array_to_json', + component: () => import('../views/php/PHPArrayToJson.vue'), + }, + { + path: '/php_serialize', + name: 'php_serialize', + component: () => import('../views/php/Serialize.vue'), }, /** @@ -127,12 +131,12 @@ const router = createRouter({ { path: '/json_formatter', name: 'json_formatter', - component: () => import('../views/JSONFormatter.vue'), + component: () => import('../views/json/JSONFormatter.vue'), }, { path: '/json_minifier', name: 'json_minifier', - component: () => import('../views/JSONMinifier.vue'), + component: () => import('../views/json/JSONMinifier.vue'), }, /** @@ -141,12 +145,12 @@ const router = createRouter({ { path: '/go_json_to_struct', name: 'go_json_to_struct', - component: () => import('../views/GoJSONToStruct.vue'), + component: () => import('../views/go/JSONToStruct.vue'), }, { path: '/sql_tables_to_struct', name: 'sql_tables_to_struct', - component: () => import('../views/GoSQLTablesToStruct.vue'), + component: () => import('../views/go/SQLTablesToStruct.vue'), }, /** @@ -155,7 +159,7 @@ const router = createRouter({ { path: '/docker_rename_volume', name: 'docker_rename_volume', - component: () => import('../views/DockerRenameVolume.vue'), + component: () => import('../views/docker/RenameVolume.vue'), }, /** @@ -164,12 +168,12 @@ const router = createRouter({ { path: '/sql_split_in', name: 'sql_split_in', - component: () => import('../views/SQLSplitInView.vue'), + component: () => import('../views/sql/SplitInView.vue'), }, { path: '/sql_formatter', name: 'sql_formatter', - component: () => import('../views/SQLFormatter.vue'), + component: () => import('../views/sql/Formatter.vue'), }, ], }) diff --git a/src/views/DockerRenameVolume.vue b/src/views/docker/RenameVolume.vue similarity index 100% rename from src/views/DockerRenameVolume.vue rename to src/views/docker/RenameVolume.vue diff --git a/src/views/DummyImage.vue b/src/views/general/DummyImage.vue similarity index 100% rename from src/views/DummyImage.vue rename to src/views/general/DummyImage.vue diff --git a/src/views/ExplainCrontab.vue b/src/views/general/ExplainCrontab.vue similarity index 100% rename from src/views/ExplainCrontab.vue rename to src/views/general/ExplainCrontab.vue diff --git a/src/views/FileBase64EncodeDecode.vue b/src/views/general/FileBase64EncodeDecode.vue similarity index 100% rename from src/views/FileBase64EncodeDecode.vue rename to src/views/general/FileBase64EncodeDecode.vue diff --git a/src/views/HomeView.vue b/src/views/general/HomeView.vue similarity index 100% rename from src/views/HomeView.vue rename to src/views/general/HomeView.vue diff --git a/src/views/HumansTxt.vue b/src/views/general/HumansTxt.vue similarity index 100% rename from src/views/HumansTxt.vue rename to src/views/general/HumansTxt.vue diff --git a/src/views/QRCode.vue b/src/views/general/QRCode.vue similarity index 99% rename from src/views/QRCode.vue rename to src/views/general/QRCode.vue index 55f1eac..8032f2d 100644 --- a/src/views/QRCode.vue +++ b/src/views/general/QRCode.vue @@ -93,7 +93,7 @@