diff --git a/dashboard/src/components/GlobalHeader/WorkSpaceDropDown.jsx b/dashboard/src/components/GlobalHeader/WorkSpaceDropDown.jsx
deleted file mode 100644
index 7f1e364ec..000000000
--- a/dashboard/src/components/GlobalHeader/WorkSpaceDropDown.jsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import { Menu, Dropdown, Button, message } from 'antd';
-import { DownOutlined } from '@ant-design/icons';
-import React from 'react';
-import { connect } from 'dva';
-
-@connect(() => ({}))
-export default class WorkSpaceDropDown extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- workSpaceName: '',
- envs: [],
- };
- }
-
- async componentDidMount() {
- const envs = await this.props.dispatch({
- type: 'envs/getEnvs', // applist对应models层的命名空间namespace
- });
- if (envs) {
- const { name = 'test' } = envs.find((a) => {
- return a.current === '*';
- });
- this.setState({
- envs,
- workSpaceName: name,
- });
- this.props.dispatch({
- type: 'globalData/currentEnv',
- payload: {
- currentEnv: name,
- },
- });
- }
- }
-
- handleMenuClick = async (e) => {
- // 发送切换envs的接口
- const switchResult = await this.props.dispatch({
- type: 'envs/switchEnv',
- payload: {
- currentEnv: e.key,
- },
- });
- if (switchResult) {
- message.success(switchResult);
- }
- this.setState(
- {
- workSpaceName: e.key,
- },
- () => {
- // 值切换存储
- this.props.dispatch({
- type: 'globalData/currentEnv',
- payload: {
- currentEnv: e.key,
- },
- });
- },
- );
- };
-
- render() {
- const menu = (
-
- );
- return (
-
-
-
- );
- }
-}
diff --git a/dashboard/src/components/GlobalHeader/workSpaceDropDown.jsx b/dashboard/src/components/GlobalHeader/workSpaceDropDown.jsx
deleted file mode 100644
index 7f1e364ec..000000000
--- a/dashboard/src/components/GlobalHeader/workSpaceDropDown.jsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import { Menu, Dropdown, Button, message } from 'antd';
-import { DownOutlined } from '@ant-design/icons';
-import React from 'react';
-import { connect } from 'dva';
-
-@connect(() => ({}))
-export default class WorkSpaceDropDown extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- workSpaceName: '',
- envs: [],
- };
- }
-
- async componentDidMount() {
- const envs = await this.props.dispatch({
- type: 'envs/getEnvs', // applist对应models层的命名空间namespace
- });
- if (envs) {
- const { name = 'test' } = envs.find((a) => {
- return a.current === '*';
- });
- this.setState({
- envs,
- workSpaceName: name,
- });
- this.props.dispatch({
- type: 'globalData/currentEnv',
- payload: {
- currentEnv: name,
- },
- });
- }
- }
-
- handleMenuClick = async (e) => {
- // 发送切换envs的接口
- const switchResult = await this.props.dispatch({
- type: 'envs/switchEnv',
- payload: {
- currentEnv: e.key,
- },
- });
- if (switchResult) {
- message.success(switchResult);
- }
- this.setState(
- {
- workSpaceName: e.key,
- },
- () => {
- // 值切换存储
- this.props.dispatch({
- type: 'globalData/currentEnv',
- payload: {
- currentEnv: e.key,
- },
- });
- },
- );
- };
-
- render() {
- const menu = (
-
- );
- return (
-
-
-
- );
- }
-}