diff --git a/src/assets/img/icons.js b/src/assets/img/icons.js deleted file mode 100755 index 8c669f60..00000000 --- a/src/assets/img/icons.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const requireComponent = require.context("../../assets", false, /\.png$/); - -const result = {}; -function capitalizeFirstLetter(str) { - return str.toUpperCase(); -} -function validateFileName(str) { - return ( - /^\S+\.png$/.test(str) && - str.replace(/^\S+\/(\w+)\.png$/, (rs, $1) => capitalizeFirstLetter($1)) - ); -} -requireComponent.keys().forEach((filePath) => { - const componentConfig = requireComponent(filePath); - const fileName = validateFileName(filePath); - result[fileName] = componentConfig; -}); -export default result; diff --git a/src/views/dashboard/related/topology/utils/icons.ts b/src/assets/img/icons.ts similarity index 72% rename from src/views/dashboard/related/topology/utils/icons.ts rename to src/assets/img/icons.ts index c9d05939..396bbdd5 100755 --- a/src/views/dashboard/related/topology/utils/icons.ts +++ b/src/assets/img/icons.ts @@ -14,9 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -const requireComponent = require.context("./images", false, /\.png$/); - +const requireComponent = require.context("./technologies", false, /\.png$/); +const requireTool = require.context("./tools", false, /\.png$/); const result: { [key: string]: string } = {}; +const t: { [key: string]: string } = {}; + function capitalizeFirstLetter(str: string) { return str.toUpperCase(); } @@ -27,11 +29,21 @@ function validateFileName(str: string): string | undefined { ); } } -requireComponent.keys().forEach((filePath: string) => { +[...requireComponent.keys()].forEach((filePath: string) => { const componentConfig = requireComponent(filePath); + const fileName = validateFileName(filePath); if (fileName) { result[fileName] = componentConfig; } }); -export default result; +[...requireTool.keys()].forEach((filePath: string) => { + const componentConfig = requireTool(filePath); + + const fileName = validateFileName(filePath); + if (fileName) { + t[fileName] = componentConfig; + } +}); + +export default { ...result, ...t }; diff --git a/src/assets/img/tool/ALARM.png b/src/assets/img/tools/ALARM.png similarity index 100% rename from src/assets/img/tool/ALARM.png rename to src/assets/img/tools/ALARM.png diff --git a/src/assets/img/tool/API.png b/src/assets/img/tools/API.png similarity index 100% rename from src/assets/img/tool/API.png rename to src/assets/img/tools/API.png diff --git a/src/assets/img/tool/ENDPOINT.png b/src/assets/img/tools/ENDPOINT.png similarity index 100% rename from src/assets/img/tool/ENDPOINT.png rename to src/assets/img/tools/ENDPOINT.png diff --git a/src/assets/img/tool/INSTANCE.png b/src/assets/img/tools/INSTANCE.png similarity index 100% rename from src/assets/img/tool/INSTANCE.png rename to src/assets/img/tools/INSTANCE.png diff --git a/src/assets/img/tool/TRACE.png b/src/assets/img/tools/TRACE.png similarity index 100% rename from src/assets/img/tool/TRACE.png rename to src/assets/img/tools/TRACE.png diff --git a/src/locales/lang/en.ts b/src/locales/lang/en.ts index 7d368a34..704133ef 100644 --- a/src/locales/lang/en.ts +++ b/src/locales/lang/en.ts @@ -81,6 +81,8 @@ const msg = { nodeMetrics: "Metrics related with topology nodes", instanceDashboard: "Dashboard name related with service instances", endpointDashboard: "Dashboard name related with endpoints", + callSettings: "Call settings", + nodeSettings: "Node Settings", hourTip: "Select Hour", minuteTip: "Select Minute", secondTip: "Select Second", diff --git a/src/locales/lang/zh.ts b/src/locales/lang/zh.ts index 2a31de40..00170ac2 100644 --- a/src/locales/lang/zh.ts +++ b/src/locales/lang/zh.ts @@ -80,6 +80,8 @@ const msg = { nodeMetrics: "拓扑节点关联的指标", instanceDashboard: "拓节点关联的实例的仪表板名称", endpointDashboard: "拓节点端点的实例的仪表板名称", + callSettings: "拓扑线设置", + nodeSettings: "拓扑点设置", hourTip: "选择小时", minuteTip: "选择分钟", secondTip: "选择秒数", diff --git a/src/views/dashboard/related/topology/Settings.vue b/src/views/dashboard/related/topology/Settings.vue index d0347e82..f3b83b1f 100644 --- a/src/views/dashboard/related/topology/Settings.vue +++ b/src/views/dashboard/related/topology/Settings.vue @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. -->