diff --git a/dashboard/config/config.js b/dashboard/config/config.js
index aecde756e..44335c32c 100644
--- a/dashboard/config/config.js
+++ b/dashboard/config/config.js
@@ -12,9 +12,7 @@ export default defineConfig({
hmr: true,
},
locale: {
- // default zh-CN
default: 'en-US',
- // default true, when it is true, will use `navigator.language` overwrite default
antd: false,
baseNavigator: false,
},
@@ -36,13 +34,11 @@ export default defineConfig({
routes: [
{
path: '/',
- // redirect: `/${envname}/ApplicationList`,
redirect: `/ApplicationList`,
},
{
name: 'ApplicationList',
icon: 'table',
- // path: `/${envname}/ApplicationList`,
path: `/ApplicationList`,
component: './ApplicationList',
},
@@ -77,25 +73,6 @@ export default defineConfig({
icon: 'table',
path: '/Workload',
routes: [
- // {
- // name: 'Deployment',
- // icon: 'table',
- // path: '/Workload/Deployment',
- // component: './Workload/Deployment',
- // },
- // {
- // name: 'Containerized',
- // icon: 'smile',
- // path: '/Workload/Containerized',
- // component: './Workload/Containerized',
- // },
- // {
- // name: 'Detail',
- // icon: 'smile',
- // path: '/Workload/Detail',
- // component: './Workload/Detail',
- // hideInMenu: true,
- // },
{
name: 'WorkloadItem',
icon: 'smile',
@@ -109,25 +86,6 @@ export default defineConfig({
name: 'Traits',
icon: 'table',
routes: [
- // {
- // name: 'Scale',
- // icon: 'table',
- // path: '/Traits/Scale',
- // component: './Traits/Scale',
- // },
- // {
- // name: 'Rollout',
- // icon: 'smile',
- // path: '/Traits/Rollout',
- // component: './Traits/Rollout',
- // },
- // {
- // name: 'Detail',
- // icon: 'smile',
- // path: '/Traits/Detail',
- // component: './Traits/Detail',
- // hideInMenu: true,
- // },
{
name: 'TraitItem',
icon: 'smile',
@@ -136,12 +94,6 @@ export default defineConfig({
},
],
},
- // {
- // name: 'Release',
- // icon: 'table',
- // path: '/Release',
- // component: './Release',
- // },
{
name: 'Capability',
icon: 'table',
@@ -183,8 +135,13 @@ export default defineConfig({
],
// Theme for antd: https://ant.design/docs/react/customize-theme-cn
theme: {
- // ...darkTheme,
+ // 主题配置
'primary-color': defaultSettings.primaryColor,
+ 'link-color': defaultSettings.linkColor,
+ 'link-hover-color': defaultSettings.linkHoverColor,
+ 'disabled-bg': defaultSettings.disabledBg,
+ 'disabled-color': defaultSettings.disabledColor,
+ 'btn-disable-color': defaultSettings.btnDisableColor,
},
// @ts-ignore
title: false,
diff --git a/dashboard/config/defaultSettings.js b/dashboard/config/defaultSettings.js
index 82914b6ea..5c9f559c9 100644
--- a/dashboard/config/defaultSettings.js
+++ b/dashboard/config/defaultSettings.js
@@ -1,14 +1,19 @@
const proSettings = {
navTheme: 'dark',
- // 拂晓蓝
- primaryColor: '#1890ff',
+ // 主题颜色配置
+ primaryColor: '#1B58F4', // 全局主色
+ linkColor: '#1B58F4', // 链接色
+ linkHoverColor: '#1B58F4',
+ disabledBg: '#EBEBEB', // 失效背景色,
+ disabledColor: '#BEBEBE', // 失效文本色,
+ btnDisableColor: '#A4A4A4', // 禁用btn文字颜色
layout: 'side',
contentWidth: 'Fluid',
fixedHeader: false,
fixSiderbar: true,
colorWeak: false,
menu: {
- locale: true,
+ locale: false,
},
title: 'Micro App Engine',
pwa: false,
diff --git a/dashboard/config/proxy.js b/dashboard/config/proxy.js
index a34c90336..a21e760c9 100644
--- a/dashboard/config/proxy.js
+++ b/dashboard/config/proxy.js
@@ -8,11 +8,8 @@
export default {
dev: {
'/api': {
- target: 'http://123.56.222.218:8081/',
+ target: 'http://30.11.171.17:38081/',
changeOrigin: true,
- // pathRewrite: {
- // "^/api": "",
- // },
},
},
test: {
diff --git a/dashboard/src/components/AttachOneTrait/index.jsx b/dashboard/src/components/AttachOneTrait/index.jsx
index 1eec51916..026bdeb1a 100644
--- a/dashboard/src/components/AttachOneTrait/index.jsx
+++ b/dashboard/src/components/AttachOneTrait/index.jsx
@@ -102,7 +102,7 @@ export default class CreateTraitItem extends React.PureComponent {
{this.state.parameters ? (
this.state.parameters.map((item) => {
- return (
+ return item.type === 4 ? (
+
+
+ ) : (
+
diff --git a/dashboard/src/components/GlobalHeader/WorkSpaceDropDown.jsx b/dashboard/src/components/GlobalHeader/WorkSpaceDropDown.jsx
index 21fd7df1f..341d63650 100644
--- a/dashboard/src/components/GlobalHeader/WorkSpaceDropDown.jsx
+++ b/dashboard/src/components/GlobalHeader/WorkSpaceDropDown.jsx
@@ -19,22 +19,19 @@ export default class WorkSpaceDropDown extends React.Component {
type: 'envs/getEnvs',
});
if (envs) {
- const result = envs.find((env) => {
+ const { envName, namespace } = envs.find((env) => {
return env.current === '*';
});
- if (result) {
- const { name, namespace } = result;
- this.setState({
- workSpaceName: name,
- namespace,
- });
- this.props.dispatch({
- type: 'globalData/currentEnv',
- payload: {
- currentEnv: name,
- },
- });
- }
+ this.setState({
+ workSpaceName: envName,
+ namespace,
+ });
+ this.props.dispatch({
+ type: 'globalData/currentEnv',
+ payload: {
+ currentEnv: envName,
+ },
+ });
}
}
@@ -76,9 +73,9 @@ export default class WorkSpaceDropDown extends React.Component {
{envs.envs &&
envs.envs.map((item) => {
return (
-
+
-
{item.name}
+
{item.envName}
{item.namespace}
diff --git a/dashboard/src/components/Trait/index.jsx b/dashboard/src/components/Trait/index.jsx
index eaf2a0d69..2ae22e855 100644
--- a/dashboard/src/components/Trait/index.jsx
+++ b/dashboard/src/components/Trait/index.jsx
@@ -105,23 +105,6 @@ class Trait extends React.Component {
}
}
}
- // const { selectValue } = this.state;
- // if (selectValue) {
- // this.setState({
- // visible: false,
- // });
- // const { history } = this.props.propsObj;
- // history.push({
- // pathname: '/ApplicationList/ApplicationListDetail',
- // state: {
- // appName: selectValue,
- // envName: this.props.currentEnv,
- // traitType: this.props.propsObj.title,
- // },
- // });
- // } else {
- // message.warn('please select a application');
- // }
};
handleCancel = () => {
@@ -263,7 +246,7 @@ class Trait extends React.Component {
{settings ? (
settings.map((item) => {
- return (
+ return item.type === 4 ? (
+
+
+ ) : (
+
diff --git a/dashboard/src/components/Workload/index.jsx b/dashboard/src/components/Workload/index.jsx
index 5bab78694..7a42692e7 100644
--- a/dashboard/src/components/Workload/index.jsx
+++ b/dashboard/src/components/Workload/index.jsx
@@ -6,16 +6,7 @@ import './index.less';
export default class Workload extends React.PureComponent {
render() {
- const {
- btnValue,
- pathname,
- title,
- crdInfo,
- state,
- settings,
- hrefAddress,
- btnIsShow,
- } = this.props.propsObj;
+ const { btnValue, pathname, title, crdInfo, state, settings, btnIsShow } = this.props.propsObj;
return (
@@ -31,7 +22,6 @@ export default class Workload extends React.PureComponent {
-
?
{title}
diff --git a/dashboard/src/e2e/baseLayout.e2e.js b/dashboard/src/e2e/baseLayout.e2e.js
index 8356d4c52..09fdb8197 100644
--- a/dashboard/src/e2e/baseLayout.e2e.js
+++ b/dashboard/src/e2e/baseLayout.e2e.js
@@ -29,13 +29,6 @@ beforeEach(async () => {
describe('Ant Design Pro E2E test', () => {
const testPage = (path) => async () => {
await page.goto(`${BASE_URL}${path}`);
- // await page.waitForSelector('footer', {
- // timeout: 2000,
- // });
- // const haveFooter = await page.evaluate(
- // () => document.getElementsByTagName('footer').length > 0,
- // );
- // expect(haveFooter).toBeTruthy();
};
const routers = formatter(RouterConfig);
@@ -46,12 +39,5 @@ describe('Ant Design Pro E2E test', () => {
it('topmenu should have footer', async () => {
const params = '?navTheme=light&layout=topmenu';
await page.goto(`${BASE_URL}${params}`);
- // await page.waitForSelector('footer', {
- // timeout: 2000,
- // });
- // const haveFooter = await page.evaluate(
- // () => document.getElementsByTagName('footer').length > 0,
- // );
- // expect(haveFooter).toBeTruthy();
});
});
diff --git a/dashboard/src/global.less b/dashboard/src/global.less
index ff5fcff8b..0e03130a9 100644
--- a/dashboard/src/global.less
+++ b/dashboard/src/global.less
@@ -82,3 +82,6 @@ ol {
padding: 12px 24px;
background: #fff;
}
+.ant-breadcrumb a:hover {
+ color: #1b58f4 !important;
+}
diff --git a/dashboard/src/layouts/BasicLayout.jsx b/dashboard/src/layouts/BasicLayout.jsx
index 7e3bc31bf..fdafe8ad3 100644
--- a/dashboard/src/layouts/BasicLayout.jsx
+++ b/dashboard/src/layouts/BasicLayout.jsx
@@ -4,7 +4,7 @@
* https://github.com/ant-design/ant-design-pro-layout
*/
import ProLayout from '@ant-design/pro-layout';
-import React, { useEffect } from 'react';
+import React, { useEffect, useState } from 'react';
import { Link, useIntl, connect, history } from 'umi';
import RightContent from '@/components/GlobalHeader/RightContent';
import {
@@ -16,15 +16,6 @@ import {
} from '@ant-design/icons';
import _ from 'lodash';
-// const menuDataRender = (menuList) => {
-// return menuList.map((item) => {
-// const localItem = {
-// ...item,
-// children: item.children ? menuDataRender(item.children) : undefined,
-// };
-// return localItem;
-// });
-// };
const AddIcon = (menuData) => {
return menuData.map((item) => {
const name = _.get(item, 'name', '');
@@ -52,18 +43,37 @@ const AddIcon = (menuData) => {
const BasicLayout = (props) => {
const { settings, dispatch, menus } = props;
+ const [currentSelectKeys, setCurrentSelectedKeys] = useState('');
+ const getCurrentSelectKeys = () => {
+ const pathnameCur = props.history.location.pathname;
+ if (pathnameCur) {
+ if (pathnameCur.includes('Application')) {
+ setCurrentSelectedKeys(['applist']);
+ } else if (pathnameCur.includes('Capability')) {
+ setCurrentSelectedKeys(['Capability']);
+ } else if (pathnameCur.includes('System/Env')) {
+ setCurrentSelectedKeys(['Env']);
+ } else if (pathnameCur.includes('Workload')) {
+ const arr = pathnameCur.split('/');
+ const key = arr[arr.length - 1];
+ setCurrentSelectedKeys([key]);
+ } else if (pathnameCur.includes('Traits')) {
+ const arr = pathnameCur.split('/');
+ const key = arr[arr.length - 1];
+ setCurrentSelectedKeys([key]);
+ }
+ }
+ };
useEffect(() => {
if (dispatch) {
- // dispatch({
- // type: 'user/fetchCurrent',
- // });
- // dispatch({
- // type: 'settings/getSetting',
- // });
dispatch({
type: 'menus/getMenuData',
});
}
+ props.history.listen((route) => {
+ getCurrentSelectKeys(route.pathname);
+ });
+ // setCurrentSelectedKeys('applist')
}, []);
const { formatMessage } = useIntl();
@@ -75,9 +85,19 @@ const BasicLayout = (props) => {
if (menuItemProps.isUrl || !menuItemProps.path) {
return defaultDom;
}
-
- return {defaultDom};
+ // return {defaultDom};
+ return (
+ {
+ setCurrentSelectedKeys([menuItemProps.key]);
+ history.push(menuItemProps.path);
+ }}
+ >
+ {defaultDom}
+
+ );
}}
+ selectedKeys={currentSelectKeys}
breadcrumbRender={(routers = []) => [
{
path: '/',
diff --git a/dashboard/src/models/application.js b/dashboard/src/models/application.js
index d5aedaf2c..40e4d68cc 100644
--- a/dashboard/src/models/application.js
+++ b/dashboard/src/models/application.js
@@ -2,17 +2,15 @@ import { getapplist, createApp, getAppDetail, deleteApp } from '@/services/appli
const TestModel = {
namespace: 'applist',
- state: {
- // initailState: '8880'
- },
+ state: {},
effects: {
*getList({ payload }, { call, put }) {
const res = yield call(getapplist, payload);
// getlist是引入services层那个js文件的getlist方法,payload是后台要求传递的参数,res就是后台返过来的数据
yield put({
- type: 'addList', // 这就是reducer的addNum方法,put用来触发reducer中的方法,payload是传过去的参数。同时也能触发同等级effects中的方法
+ type: 'addList',
payload: {
- returnObj: res, // 把后台返回的数据赋值给num,假如哪个reducer中的方法是由这里effects去触发的,哪个num名必须是这里的名字num,如果reducer中的方法不是这触发,那名字可以随意取
+ returnObj: res,
},
});
},
diff --git a/dashboard/src/models/capability.js b/dashboard/src/models/capability.js
index 61e0f3127..0a361d111 100644
--- a/dashboard/src/models/capability.js
+++ b/dashboard/src/models/capability.js
@@ -10,9 +10,7 @@ import {
const TestModel = {
namespace: 'capability',
- state: {
- // initailState: '8880'
- },
+ state: {},
effects: {
*getCapabilityCenterlist({ payload }, { call }) {
const res = yield call(getCapabilityCenterlist, payload);
diff --git a/dashboard/src/models/env.js b/dashboard/src/models/env.js
index 9753deac4..889e3d6d0 100644
--- a/dashboard/src/models/env.js
+++ b/dashboard/src/models/env.js
@@ -1,4 +1,4 @@
-import { getEnvs, switchEnv, initialEnvs, deleteEnv } from '@/services/env';
+import { getEnvs, switchEnv, initialEnvs, deleteEnv, updateEnv } from '@/services/env';
const TestModel = {
namespace: 'envs',
@@ -36,6 +36,15 @@ const TestModel = {
});
return res;
},
+ *updateEnv({ payload }, { call, put }) {
+ yield call(updateEnv, payload);
+ const res = yield call(getEnvs);
+ yield put({
+ type: 'onGetEnvsSuccess',
+ payload: res,
+ });
+ return res;
+ },
},
reducers: {
onGetEnvsSuccess(state, { payload }) {
diff --git a/dashboard/src/models/global.js b/dashboard/src/models/global.js
index 74cf45565..59fc0585b 100644
--- a/dashboard/src/models/global.js
+++ b/dashboard/src/models/global.js
@@ -6,7 +6,7 @@ const globalModel = {
effects: {
*currentEnv({ payload }, { put }) {
yield put({
- type: 'setCurrentEnv', // 这就是reducer的addNum方法,put用来触发reducer中的方法,payload是传过去的参数。同时也能触发同等级effects中的方法
+ type: 'setCurrentEnv',
payload,
});
},
diff --git a/dashboard/src/models/menu.js b/dashboard/src/models/menu.js
index 46b731758..887931c2a 100644
--- a/dashboard/src/models/menu.js
+++ b/dashboard/src/models/menu.js
@@ -1,36 +1,31 @@
-import { capabilityList } from '@/services/capability.js';
+import { getTraits } from '@/services/trait.js';
+import { getWorkload } from '@/services/workload.js';
-function getMenuList(response) {
+function getMenuList(workload, trait) {
let workloadList = [];
let traitList = [];
- // eslint-disable-next-line no-param-reassign
- response = response.filter((item) => {
- return item.status === 'installed';
- });
- response.forEach((item) => {
- if (item.type === 'workload') {
- workloadList.push(item.name);
- } else if (item.type === 'trait') {
- traitList.push(item.name);
- }
- });
- // 在此之前要对workloadList和traitList进行一次去重操作
- workloadList = workloadList.map((item) => {
- // eslint-disable-next-line no-param-reassign
- item = item.charAt(0).toUpperCase() + item.slice(1);
- return {
- name: item,
- path: `/Workload/${item}`,
- };
- });
- traitList = traitList.map((item) => {
- // eslint-disable-next-line no-param-reassign
- item = item.charAt(0).toUpperCase() + item.slice(1);
- return {
- name: item,
- path: `/Traits/${item}`,
- };
- });
+ if (workload) {
+ workloadList = workload.map((item) => {
+ let name1 = item.name;
+ name1 = name1.charAt(0).toUpperCase() + name1.slice(1);
+ return {
+ name: name1,
+ path: `/Workload/${name1}`,
+ key: name1,
+ };
+ });
+ }
+ if (trait) {
+ traitList = trait.map((item) => {
+ let name1 = item.name;
+ name1 = name1.charAt(0).toUpperCase() + name1.slice(1);
+ return {
+ name: name1,
+ path: `/Traits/${name1}`,
+ key: name1,
+ };
+ });
+ }
// 只是动态生成侧边栏(name,path,icon),路由还是config.js里面配置的路由
const menuList = [
{
@@ -41,6 +36,7 @@ function getMenuList(response) {
name: 'ApplicationList',
icon: 'Table',
path: `/ApplicationList`,
+ key: 'applist',
},
{
name: 'ApplicationList.ApplicationListDetail',
@@ -76,13 +72,10 @@ function getMenuList(response) {
},
],
},
- // {
- // name: 'Release',
- // path: '/Release',
- // },
{
name: 'Capability',
path: '/Capability',
+ key: 'Capability',
},
{
path: '/System',
@@ -91,6 +84,7 @@ function getMenuList(response) {
{
name: 'Env',
path: '/System/Env',
+ key: 'Env',
},
],
},
@@ -110,8 +104,9 @@ const TestModel = {
},
effects: {
*getMenuData({ payload }, { call, put }) {
- let response = yield call(capabilityList, payload);
- response = getMenuList(response);
+ const workloadList = yield call(getWorkload, payload);
+ const traitList = yield call(getTraits, payload);
+ const response = getMenuList(workloadList, traitList);
yield put({
type: 'saveMenuData',
payload: response,
diff --git a/dashboard/src/models/trait.js b/dashboard/src/models/trait.js
index e8ce12321..d02b2792e 100644
--- a/dashboard/src/models/trait.js
+++ b/dashboard/src/models/trait.js
@@ -2,9 +2,7 @@ import { getTraitByName, getTraits, attachOneTraits, deleteOneTrait } from '@/se
const TestModel = {
namespace: 'trait',
- state: {
- // initailState: '8880'
- },
+ state: {},
effects: {
*getTraitByName({ payload }, { call }) {
const res = yield call(getTraitByName, payload);
diff --git a/dashboard/src/models/workload.js b/dashboard/src/models/workload.js
index 22390aa6a..1a00bcf34 100644
--- a/dashboard/src/models/workload.js
+++ b/dashboard/src/models/workload.js
@@ -2,9 +2,7 @@ import { createWorkload, getWorkload, getWorkloadByName } from '@/services/workl
const TestModel = {
namespace: 'workload',
- state: {
- // initailState: '8880'
- },
+ state: {},
effects: {
*createWorkload({ payload }, { call }) {
const res = yield call(createWorkload, payload);
diff --git a/dashboard/src/pages/ApplicationList/ApplicationListDetail/Topology.jsx b/dashboard/src/pages/ApplicationList/ApplicationListDetail/Topology.jsx
index b686d5a57..aff61e680 100644
--- a/dashboard/src/pages/ApplicationList/ApplicationListDetail/Topology.jsx
+++ b/dashboard/src/pages/ApplicationList/ApplicationListDetail/Topology.jsx
@@ -43,8 +43,6 @@ const Topology = () => {
],
};
- // const width = document.getElementById('container').scrollWidth;
- // const height = document.getElementById('container').scrollHeight || 500;
const width = 1000;
const height = 400;
diff --git a/dashboard/src/pages/ApplicationList/ApplicationListDetail/index.jsx b/dashboard/src/pages/ApplicationList/ApplicationListDetail/index.jsx
index bc0aa9c50..0d7c6860e 100644
--- a/dashboard/src/pages/ApplicationList/ApplicationListDetail/index.jsx
+++ b/dashboard/src/pages/ApplicationList/ApplicationListDetail/index.jsx
@@ -17,7 +17,6 @@ import { connect } from 'dva';
import _ from 'lodash';
import { Link } from 'umi';
import CreateTraitItem from '../../../components/AttachOneTrait/index.jsx';
-// import Topology from './Topology.jsx';
const { TabPane } = Tabs;
@@ -66,18 +65,18 @@ class TableList extends React.Component {
const traits = await this.props.dispatch({
type: 'trait/getTraits',
});
- this.setState({
- traitList: traits,
- });
+ if (traits) {
+ this.setState({
+ traitList: traits,
+ });
+ }
const workloadType = _.get(res, 'Workload.workload.kind', '');
if (workloadType && workloadType === 'ContainerizedWorkload') {
this.getAcceptTrait('containerized');
} else if (workloadType && workloadType === 'Deployment') {
this.getAcceptTrait('deployment');
}
- // 如果traitType存在,是从特定trait跳转来新增单个trait的
if (traitType && times === 1) {
- // this.createTrait(traitType)
await this.setState({
visible: true,
});
@@ -100,7 +99,7 @@ class TableList extends React.Component {
deleteApp = async (e) => {
e.stopPropagation();
- const { currentEnv: envName } = this.props;
+ const { envName } = this.state;
const { appDetailData } = this.state;
const appName = _.get(appDetailData, 'Workload.workload.metadata.name', '');
if (appName && envName) {
@@ -200,27 +199,8 @@ class TableList extends React.Component {
gotoWorkloadDetail = (e) => {
e.stopPropagation();
- // const appName = _.get(this.props, 'location.state.appName', '');
- // const envName = _.get(this.props, 'location.state.envName', '');
- // if (appName && envName) {
- // this.props.history.push({
- // pathname: '/ApplicationList/WorkloadDetail',
- // state: { appName, envName },
- // });
- // }
};
- // gotoTraitDetail = (e, traitItem) => {
- // e.stopPropagation();
- // const appName = _.get(this.props, 'location.state.appName', '');
- // const envName = _.get(this.props, 'location.state.envName', '');
- // if (appName && envName) {
- // this.props.history.push({
- // pathname: '/ApplicationList/TraitDetail',
- // state: { traitItem, appName, envName },
- // });
- // }
- // };
gotoTraitDetail = (e) => {
e.stopPropagation();
};
@@ -230,11 +210,6 @@ class TableList extends React.Component {
const Workload = _.get(this.state.appDetailData, 'Workload.workload', {});
const Traits = _.get(this.state.appDetailData, 'Traits', []);
let containers = {};
- // if (Workload.kind === 'ContainerizedWorkload') {
- // containers = _.get(Workload, 'spec.containers[0]', {});
- // } else if (Workload.kind === 'Deployment') {
- // containers = _.get(Workload, 'spec.template.spec.containers[0]', {});
- // }
containers = _.get(Workload, 'spec.containers[0]', {});
let { loadingAll } = this.props;
loadingAll = loadingAll || false;
@@ -272,14 +247,12 @@ class TableList extends React.Component {
onClick={(e) => this.gotoWorkloadDetail(e)}
style={{ background: colorObj[status] || '#1890ff' }}
>
- {/* */}
{Workload.kind}
{Workload.apiVersion}
- {/* ? */}
?
@@ -305,6 +278,18 @@ class TableList extends React.Component {
// eslint-disable-next-line no-else-return
} else if (currentKey === 'name') {
return ;
+ // eslint-disable-next-line no-else-return
+ } else if (currentKey === 'env') {
+ return (
+
+
+ env
+
+
+ {_.get(containers[currentKey], '[0].value', '')}
+
+
+ );
}
return (
@@ -425,18 +410,6 @@ class TableList extends React.Component {
);
})
)}
- {/* {Object.keys(spec).map((currentKey) => {
- return (
-
-
- {currentKey}
-
-
- {spec[currentKey]}
-
-
- );
- })} */}
diff --git a/dashboard/src/pages/ApplicationList/ApplicationListDetail/index.less b/dashboard/src/pages/ApplicationList/ApplicationListDetail/index.less
index dd9188dd2..102224fe1 100644
--- a/dashboard/src/pages/ApplicationList/ApplicationListDetail/index.less
+++ b/dashboard/src/pages/ApplicationList/ApplicationListDetail/index.less
@@ -19,7 +19,6 @@
font-weight: 500;
font-size: 16px;
line-height: 36px;
- // color: #fff;
}
p {
margin: 0;
diff --git a/dashboard/src/pages/ApplicationList/CreateApplication/index.jsx b/dashboard/src/pages/ApplicationList/CreateApplication/index.jsx
index ce83926f9..46b02595d 100644
--- a/dashboard/src/pages/ApplicationList/CreateApplication/index.jsx
+++ b/dashboard/src/pages/ApplicationList/CreateApplication/index.jsx
@@ -73,12 +73,8 @@ class TableList extends React.Component {
this.setState({
traitList: traits,
});
- // 如果直接跳转到第二步,需要设置值
const traitType = _.get(this.props, 'location.state.TraitType', '');
if (traitType) {
- // let availableTraitList = traits.filter((item)=>{
- // return item.name === traitType
- // })
this.setState({
availableTraitList: traits,
traitNum: [
@@ -168,7 +164,11 @@ class TableList extends React.Component {
};
createApp = async () => {
- const { step1SubmitObj, traitNum } = this.state;
+ const { traitNum } = this.state;
+ const { step1SubmitObj } = this.state;
+ if (step1SubmitObj.env_name !== this.props.currentEnv) {
+ step1SubmitObj.env_name = this.props.currentEnv;
+ }
const submitObj = _.cloneDeep(step1SubmitObj);
const { workload_name: workloadName } = step1SubmitObj;
submitObj.flags.push({
@@ -294,9 +294,6 @@ class TableList extends React.Component {
this.state.traitNum = this.state.traitNum.filter((item) => {
return item.uniq !== uniq;
});
- // this.setState(()=>({
- // traitNum: this.state.traitNum
- // }));
this.setState((prev) => ({
traitNum: prev.traitNum,
}));
@@ -325,6 +322,11 @@ class TableList extends React.Component {
name="workload_name"
label="Name"
rules={[
+ {
+ pattern: /^[a-z0-9-_]+$/,
+ message:
+ 'Names can only use digits(0-9),lowercase letters(a-z),and dashes(-),Underline.',
+ },
{
required: true,
message: 'Please input name!',
@@ -373,7 +375,7 @@ class TableList extends React.Component {
if (item.name === 'name') {
return
;
}
- return (
+ return item.type === 4 ? (
+
+
+ ) : (
+
@@ -556,11 +574,6 @@ class TableList extends React.Component {
- {/*
-
- */}
- {/*
?
*/}
{this.state.parameters ? (
this.state.parameters.map((item) => {
- return (
+ return item.type === 4 ? (
+
+
+ ) : (
+
diff --git a/dashboard/src/pages/ApplicationList/index.jsx b/dashboard/src/pages/ApplicationList/index.jsx
index be3e3894f..60dfabb0a 100644
--- a/dashboard/src/pages/ApplicationList/index.jsx
+++ b/dashboard/src/pages/ApplicationList/index.jsx
@@ -9,9 +9,6 @@ import { Link } from 'umi';
@connect(({ loading, applist, globalData }) => ({
loadingAll: loading.models.applist,
- // 当applist这个models有数据请求行为的时候,loading为true,没有请求的时候为false
- // loadingList: loading.effects['applist/getList'],
- // 当applist的effects中的getList有异步请求行为时为true,没有请求行为时为false
returnObj: applist.returnObj,
currentEnv: globalData.currentEnv,
}))
@@ -25,7 +22,7 @@ class TableList extends React.Component {
const { currentEnv } = this.props;
if (currentEnv) {
this.props.dispatch({
- type: 'applist/getList', // applist对应models层的命名空间namespace
+ type: 'applist/getList',
payload: {
url: `/api/envs/${currentEnv}/apps/`,
},
@@ -38,26 +35,21 @@ class TableList extends React.Component {
return true;
}
this.props.dispatch({
- type: 'applist/getList', // applist对应models层的命名空间namespace
+ type: 'applist/getList',
payload: {
url: `/api/envs/${nextProps.currentEnv}/apps/`,
},
});
return true;
- // return true;
}
- onFinish = () => {
- // const data = moment(values.createTime).format('YYYY-MM-DD')
- };
+ onFinish = () => {};
handleChange = () => {};
handleAdd = () => {};
- onSelect = () => {
- // console.log("selected", selectedKeys, info);
- };
+ onSelect = () => {};
getHeight = (num) => {
return `${num * 43}px`;
@@ -91,26 +83,6 @@ class TableList extends React.Component {
-
-
-
-
-
-
- } htmlType="submit">
- Search
-
- */}