diff --git a/src/components/Terminal/index.jsx b/src/components/Terminal/index.jsx index cba013a3472..5ef47447c85 100644 --- a/src/components/Terminal/index.jsx +++ b/src/components/Terminal/index.jsx @@ -18,7 +18,7 @@ import React, { lazy, Suspense, Component } from 'react' import { observer } from 'mobx-react' -import { getWebSocketProtocol } from 'utils' +import { getWebSocketProtocol, getClusterUrl } from 'utils' const ContainerTerminal = lazy(() => import(/* webpackChunkName: "terminal" */ './terminal') @@ -31,7 +31,7 @@ export default class SessionTerminal extends Component { get url() { return `${getWebSocketProtocol(window.location.protocol)}://${ window.location.host - }/${this.props.url}` + }${getClusterUrl(`/${this.props.url}`)}` } resizeTerminal = () => { diff --git a/src/pages/workspaces/components/Modals/WorkspaceCreate/index.jsx b/src/pages/workspaces/components/Modals/WorkspaceCreate/index.jsx index 3179b7907f6..569931b3e63 100644 --- a/src/pages/workspaces/components/Modals/WorkspaceCreate/index.jsx +++ b/src/pages/workspaces/components/Modals/WorkspaceCreate/index.jsx @@ -60,6 +60,17 @@ export default class WorkspaceCreateModal extends React.Component { } get steps() { + if (!globals.app.isMultiCluster) { + return [ + { + title: 'Basic Info', + component: BaseInfo, + required: true, + isForm: true, + }, + ] + } + return [ { title: 'Basic Info', diff --git a/src/stores/logging/index.js b/src/stores/logging/index.js index 8d10e99e8b3..4a1001fabd9 100644 --- a/src/stores/logging/index.js +++ b/src/stores/logging/index.js @@ -48,7 +48,7 @@ export default class LoggingStore { getApiPath(cluster) { return cluster - ? `kapis/clusters/${cluster}/tenant.kubesphere.io/v1alpha2/logs` + ? `kapis/klusters/${cluster}/tenant.kubesphere.io/v1alpha2/logs` : 'kapis/tenant.kubesphere.io/v1alpha2/logs' } diff --git a/src/stores/terminal.js b/src/stores/terminal.js index 469face4cd9..9aa48742bb4 100644 --- a/src/stores/terminal.js +++ b/src/stores/terminal.js @@ -25,9 +25,9 @@ export default class TerminalStore { @computed get kubeWebsocketUrl() { const { cluster, namespace, pod, container, shell = 'sh' } = this.kubectl - return `kapis${this.getClusterPath({ + return `kapis/terminal.kubesphere.io/v1alpha2${this.getClusterPath({ cluster, - })}/terminal.kubesphere.io/v1alpha2/namespaces/${namespace}/pods/${pod}?container=${container}&shell=${shell}` + })}/namespaces/${namespace}/pods/${pod}?container=${container}&shell=${shell}` } @observable @@ -51,16 +51,16 @@ export default class TerminalStore { } getClusterPath({ cluster } = {}) { - return cluster ? `/clusters/${cluster}` : '' + return cluster ? `/klusters/${cluster}` : '' } @action async fetchKubeCtl({ cluster }) { this.kubectl.isLoading = true const result = await request.get( - `kapis${this.getClusterPath({ + `kapis/resources.kubesphere.io/v1alpha2${this.getClusterPath({ cluster, - })}/resources.kubesphere.io/v1alpha2/users/${this.username}/kubectl`, + })}/users/${this.username}/kubectl`, null, null, this.reject @@ -75,9 +75,9 @@ export default class TerminalStore { @action async fetchKubeConfig(params) { const result = await request.get( - `kapis${this.getClusterPath( + `kapis/resources.kubesphere.io/v1alpha2${this.getClusterPath( params - )}/resources.kubesphere.io/v1alpha2/users/${this.username}/kubeconfig` + )}/users/${this.username}/kubeconfig` ) this.kubeconfig = result }