feat: update topology

This commit is contained in:
Qiuxia Fan 2022-02-08 14:39:39 +08:00
parent 1a6ab74be8
commit 491bf88063
4 changed files with 4 additions and 21 deletions

View File

@ -23,6 +23,7 @@ const msg = {
infrastructure: "基础结构",
virtualMachine: "虚拟机",
kubernetes: "Kubernetes",
dashboardNew: "新建仪表板",
dashboardHome: "仪表盘首页",
dashboardList: "仪表盘列表",
log: "日志",

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const requireComponent = require.context("../../assets", false, /\.png$/);
const requireComponent = require.context("./tool", false, /\.png$/);
const result: { [key: string]: string } = {};
function capitalizeFirstLetter(str: string) {

View File

@ -14,26 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const requireComponent = require.context("./tool", false, /\.png$/);
const icons: { [key: string]: string } = {};
function capitalizeFirstLetter(str: string) {
return str.toUpperCase();
}
function validateFileName(str: string): string | undefined {
if (/^\S+\.png$/.test(str)) {
return str.replace(/^\S+\/(\w+)\.png$/, (rs, $1) =>
capitalizeFirstLetter($1)
);
}
}
requireComponent.keys().forEach((filePath: string) => {
const componentConfig = requireComponent(filePath);
const fileName = validateFileName(filePath);
if (fileName) {
icons[fileName] = componentConfig;
}
});
import icons from "./icons";
const Hexagon = (side: number, r: number, cx: number, cy: number) => {
let path = "";

View File

@ -30,6 +30,7 @@
"baseUrl": ".",
"allowJs": true,
"resolveJsonModule": true,
"noImplicitThis": false,
"types": [
"webpack-env",
"jest"