mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 11:52:08 +08:00
体验环境
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ant-design/icons": "^4.6.2",
|
||||
"@babel/core": "^7.5.5",
|
||||
"@babel/core": "^7.18.13",
|
||||
"@babel/plugin-proposal-class-properties": "^7.4.0",
|
||||
"@babel/plugin-proposal-decorators": "^7.4.0",
|
||||
"@babel/plugin-proposal-export-default-from": "^7.2.0",
|
||||
@@ -50,7 +50,7 @@
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"@babel/preset-typescript": "^7.14.5",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
|
||||
"@types/lodash": "^4.14.138",
|
||||
"@types/lodash": "^4.14.184",
|
||||
"@types/react-dom": "^17.0.5",
|
||||
"@types/react-router": "5.1.18",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
@@ -76,6 +76,7 @@
|
||||
"hard-source-webpack-plugin": "^0.13.1",
|
||||
"html-webpack-plugin": "^4.0.0",
|
||||
"husky": "4.3.7",
|
||||
"knowdesign": "^1.3.7",
|
||||
"less-loader": "^4.1.0",
|
||||
"lint-staged": "10.5.3",
|
||||
"mini-css-extract-plugin": "^1.3.0",
|
||||
|
||||
@@ -109,7 +109,15 @@ class CoverHtmlWebpackPlugin {
|
||||
<script src='${isProd ? PublicPath : ''}/static/js/named-exports.min.js'></script>
|
||||
<script src='${isProd ? PublicPath : ''}/static/js/use-default.min.js'></script>
|
||||
<script src='${isProd ? PublicPath : ''}/static/js/amd.js'></script>
|
||||
${process.env.BUSINESS_VERSION === 'true' ? `<script src=${isProd ? PublicPath : ''}/static/js/ksl.min.js></script>` : ''}
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?16d7da6d1dd79237d801ee55809cfe90";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
${depsMap}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
"webpack-bundle-analyzer": "^4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.5.5",
|
||||
"@babel/core": "^7.18.13",
|
||||
"@babel/plugin-proposal-class-properties": "^7.4.0",
|
||||
"@babel/plugin-proposal-decorators": "^7.4.0",
|
||||
"@babel/plugin-proposal-export-default-from": "^7.2.0",
|
||||
@@ -79,7 +79,7 @@
|
||||
"@babel/preset-typescript": "^7.14.5",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
|
||||
"@types/crypto-js": "^4.1.0",
|
||||
"@types/lodash": "^4.14.171",
|
||||
"@types/lodash": "^4.14.184",
|
||||
"@types/node": "^12.12.25",
|
||||
"@types/pubsub-js": "^1.5.18",
|
||||
"@typescript-eslint/eslint-plugin": "4.13.0",
|
||||
@@ -100,6 +100,7 @@
|
||||
"file-loader": "^6.0.0",
|
||||
"hard-source-webpack-plugin": "^0.13.1",
|
||||
"husky": "4.3.7",
|
||||
"knowdesign": "^1.3.7",
|
||||
"less": "^3.9.0",
|
||||
"less-loader": "^4.1.0",
|
||||
"lint-staged": "10.5.3",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
/* eslint-disable no-constant-condition */
|
||||
import '@babel/polyfill';
|
||||
import React, { useState, useEffect, useLayoutEffect } from 'react';
|
||||
@@ -84,6 +85,17 @@ const AppContent = (props: { setlanguage: (language: string) => void }) => {
|
||||
} else {
|
||||
setCurActiveAppName('cluster');
|
||||
}
|
||||
// @ts-ignore
|
||||
window._hmt = window._hmt || [];
|
||||
// window._hmt.push([
|
||||
// '_setPageviewProperty',
|
||||
// {
|
||||
// page_name: 'test',
|
||||
// page_title: null, // 当属性值传入 null 时,其作用为删除此前设置的该 PV 属性
|
||||
// },
|
||||
// ]);
|
||||
// @ts-ignore
|
||||
window._hmt.push(['_trackPageview', pathname]);
|
||||
}, [pathname]);
|
||||
|
||||
// 获取版本信息
|
||||
|
||||
BIN
km-console/packages/layout-clusters-fe/src/assets/pro-tag.png
Normal file
BIN
km-console/packages/layout-clusters-fe/src/assets/pro-tag.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -154,15 +154,15 @@ export const urlParser = () => {
|
||||
|
||||
export const getLicenseInfo = (cbk: (msg: string) => void) => {
|
||||
if (process.env.BUSINESS_VERSION) {
|
||||
const info = (window as any).code;
|
||||
if (!info) {
|
||||
setTimeout(() => getLicenseInfo(cbk), 1000);
|
||||
} else {
|
||||
const res = info() || {};
|
||||
if (res.code !== 0) {
|
||||
cbk(res.msg);
|
||||
}
|
||||
}
|
||||
// const info = (window as any).code;
|
||||
// if (!info) {
|
||||
// setTimeout(() => getLicenseInfo(cbk), 1000);
|
||||
// } else {
|
||||
// const res = info() || {};
|
||||
// if (res.code !== 0) {
|
||||
// cbk(res.msg);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -150,7 +150,14 @@ export const leftMenus = (clusterId?: string, clusterRunState?: number) => ({
|
||||
children: [
|
||||
process.env.BUSINESS_VERSION
|
||||
? {
|
||||
name: 'balance',
|
||||
name: (intl: any) => {
|
||||
return (
|
||||
<div className="menu-item-with-pro-tag">
|
||||
<span>{intl.formatMessage({ id: 'menu.cluster.operation.balance' })}</span>
|
||||
<div className="pro-tag"></div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
path: 'balance',
|
||||
icon: '#icon-luoji',
|
||||
}
|
||||
@@ -164,19 +171,26 @@ export const leftMenus = (clusterId?: string, clusterRunState?: number) => ({
|
||||
},
|
||||
process.env.BUSINESS_VERSION
|
||||
? {
|
||||
name: 'produce-consume',
|
||||
name: (intl: any) => {
|
||||
return (
|
||||
<div className="menu-item-with-pro-tag">
|
||||
<span>{intl.formatMessage({ id: 'menu.cluster.produce-consume' })}</span>
|
||||
<div className="pro-tag"></div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
path: 'testing',
|
||||
icon: 'icon-Message',
|
||||
permissionPoint: [ClustersPermissionMap.TEST_CONSUMER, ClustersPermissionMap.TEST_PRODUCER],
|
||||
children: [
|
||||
{
|
||||
name: 'producer',
|
||||
name: (intl: any) => <span>{intl.formatMessage({ id: 'menu.cluster.produce-consume.producer' })}</span>,
|
||||
path: 'producer',
|
||||
icon: 'icon-luoji',
|
||||
permissionPoint: ClustersPermissionMap.TEST_PRODUCER,
|
||||
},
|
||||
{
|
||||
name: 'consumer',
|
||||
name: (intl: any) => <span>{intl.formatMessage({ id: 'menu.cluster.produce-consume.consumer' })}</span>,
|
||||
path: 'consumer',
|
||||
icon: 'icon-luoji',
|
||||
permissionPoints: ClustersPermissionMap.TEST_CONSUMER,
|
||||
|
||||
@@ -259,6 +259,19 @@ li {
|
||||
}
|
||||
}
|
||||
|
||||
.menu-item-with-pro-tag {
|
||||
display: flex;
|
||||
.pro-tag {
|
||||
width: 24px;
|
||||
margin-left: 4px;
|
||||
background: no-repeat center/24px 16px url('./assets/pro-tag.png');
|
||||
}
|
||||
}
|
||||
|
||||
.dcloud-menu-item-selected .menu-item-with-pro-tag .pro-tag {
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.menu-item-with-beta-tag {
|
||||
display: flex;
|
||||
.beta-tag {
|
||||
|
||||
@@ -45,6 +45,7 @@ export const FormMap = [
|
||||
prefix: <></>,
|
||||
// prefix: <UserOutlined style={{ color: 'rgba(0,0,0,.25)' }} />,
|
||||
},
|
||||
initialValue: 'admin',
|
||||
},
|
||||
{
|
||||
key: 'pw',
|
||||
@@ -64,6 +65,7 @@ export const FormMap = [
|
||||
placeholder: '请输入密码',
|
||||
// prefix: <LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />,
|
||||
},
|
||||
initialValue: 'admin2022_',
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -58,7 +58,14 @@ export const LoginForm: React.FC<any> = (props) => {
|
||||
{FormMap.map((formItem) => {
|
||||
return (
|
||||
<Row key={formItem.key}>
|
||||
<Form.Item key={formItem.key} name={formItem.key} label={formItem.label} rules={formItem.rules} style={{ width: '100%' }}>
|
||||
<Form.Item
|
||||
key={formItem.key}
|
||||
name={formItem.key}
|
||||
label={formItem.label}
|
||||
rules={formItem.rules}
|
||||
initialValue={formItem.initialValue}
|
||||
style={{ width: '100%' }}
|
||||
>
|
||||
{renderFormItem(formItem)}
|
||||
</Form.Item>
|
||||
</Row>
|
||||
|
||||
Reference in New Issue
Block a user