From b235929c7755f4633e6fc97877666d3f0399d73b Mon Sep 17 00:00:00 2001 From: Fine0830 Date: Tue, 20 Sep 2022 16:24:42 +0800 Subject: [PATCH] feat: enhance menu configuration to make it easier to change (#161) --- src/constants/data.ts | 33 +------------------- src/layout/components/SideBar.vue | 24 +++------------ src/router/alarm.ts | 4 --- src/router/dashboard.ts | 3 -- src/router/{ => data}/browser.ts | 12 ++------ src/router/{ => data}/database.ts | 19 ++++-------- src/router/{ => data}/functions.ts | 13 ++------ src/router/{ => data}/general.ts | 28 +++++------------ src/router/data/index.ts | 35 ++++++++++++++++++++++ src/router/{ => data}/infrastructure.ts | 12 ++------ src/router/{ => data}/k8s.ts | 17 ++++------- src/router/{ => data}/selfObservability.ts | 17 ++++------- src/router/{ => data}/serviceMesh.ts | 23 +++++--------- src/router/index.ts | 18 ++--------- src/router/layer.ts | 35 ++++++++++++++++++++++ src/router/setting.ts | 2 -- src/views/Layer.vue | 3 +- 17 files changed, 115 insertions(+), 183 deletions(-) rename src/router/{ => data}/browser.ts (76%) rename src/router/{ => data}/database.ts (72%) rename src/router/{ => data}/functions.ts (73%) rename src/router/{ => data}/general.ts (68%) create mode 100644 src/router/data/index.ts rename src/router/{ => data}/infrastructure.ts (82%) rename src/router/{ => data}/k8s.ts (77%) rename src/router/{ => data}/selfObservability.ts (75%) rename src/router/{ => data}/serviceMesh.ts (73%) create mode 100644 src/router/layer.ts diff --git a/src/constants/data.ts b/src/constants/data.ts index 84b4bb39..77238da5 100644 --- a/src/constants/data.ts +++ b/src/constants/data.ts @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export enum TimeType { MINUTE_TIME = "MINUTE", HOUR_TIME = "HOUR", @@ -25,35 +26,3 @@ export const Languages = [ { label: "Chinese", value: "zh" }, { label: "Spanish", value: "es" }, ]; - -export const RoutesMap: { [key: string]: string } = { - GeneralServices: "GENERAL", - GeneralServicesActiveTabIndex: "GENERAL", - VirtualDatabase: "VIRTUAL_DATABASE", - VirtualDatabaseActiveTabIndex: "VIRTUAL_DATABASE", - VirtualCache: "VIRTUAL_CACHE", - VirtualCacheActiveTabIndex: "VIRTUAL_CACHE", - MeshServices: "MESH", - MeshServicesActiveTabIndex: "MESH", - ControlPanel: "MESH_CP", - ControlPanelActiveTabIndex: "MESH_CP", - DataPanel: "MESH_DP", - DataPanelActiveTabIndex: "MESH_DP", - Linux: "OS_LINUX", - SkyWalkingServer: "SO11Y_OAP", - SkyWalkingServerActiveTabIndex: "SO11Y_OAP", - SatelliteActiveTabIndex: "SO11Y_SATELLITE", - Satellite: "SO11Y_SATELLITE", - Functions: "FAAS", - FunctionsActiveTabIndex: "FAAS", - Browser: "BROWSER", - BrowserActiveTabIndex: "BROWSER", - KubernetesCluster: "K8S", - KubernetesClusterActiveTabIndex: "K8S", - KubernetesService: "K8S_SERVICE", - KubernetesServiceActiveTabIndex: "K8S_SERVICE", - MySQL: "MYSQL", - MySQLActiveTabIndex: "MYSQL", - PostgreSQL: "POSTGRESQL", - PostgreSQLActiveTabIndex: "POSTGRESQL", -}; diff --git a/src/layout/components/SideBar.vue b/src/layout/components/SideBar.vue index a343cd59..b9afcc48 100644 --- a/src/layout/components/SideBar.vue +++ b/src/layout/components/SideBar.vue @@ -33,11 +33,7 @@ limitations under the License. -->