体验环境

This commit is contained in:
zengqiao
2023-02-27 18:43:48 +08:00
parent 77b87f1dbe
commit aa35965d7a
11 changed files with 78 additions and 20 deletions

View File

@@ -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]);
// 获取版本信息

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -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);
// }
// }
}
};

View File

@@ -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,

View File

@@ -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 {

View File

@@ -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_',
},
];

View File

@@ -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>