Skip to content

Commit cfc7ad6

Browse files
committed
fixed import.meta.env
1 parent 14039b5 commit cfc7ad6

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

src/components/app/details/appDetails/appDetails.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { ClusterConnectionResponse, DeploymentStatusDetailsResponse, ModuleConfi
55
import { AppType } from '../../../v2/appDetails/appDetails.type'
66

77
export function isDatasourceConfigured(envName: string) {
8-
const root = import.meta.env.VITE_REACT_APP_ORCHESTRATOR_ROOT.replace('/orchestrator', '')
8+
const root = window.__REACT_APP_ORCHESTRATOR_ROOT__.replace('/orchestrator', '')
99
const URL = `${root}/grafana/api/datasources/id/Prometheus-${envName}`
1010
return fetchWithFullRoute(URL, 'GET')
1111
}
1212

1313
export function isDatasourceHealthy(datasourceId: number | string) {
1414
const timestamp = new Date()
15-
const root = import.meta.env.VITE_REACT_APP_ORCHESTRATOR_ROOT.replace('/orchestrator', '')
15+
const root = window.__REACT_APP_ORCHESTRATOR_ROOT__.replace('/orchestrator', '')
1616
const URL = `${root}/grafana/api/datasources/proxy/${datasourceId}/api/v1/query?query=1&time=${timestamp.getTime()}`
1717
return fetchWithFullRoute(URL, 'GET')
1818
}

src/components/login/Login.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default class Login extends Component<LoginProps, LoginFormState> {
5252
queryParam = ''
5353
}
5454
this.setState({
55-
continueUrl: encodeURI(`${window.location.origin}/orchestrator/${import.meta.env.BASE_URL}${queryParam}`),
55+
continueUrl: encodeURI(`${window.location.origin}/orchestrator${window.__BASE_URL__}${queryParam}`),
5656
})
5757
getSSOConfigList().then((response) => {
5858
const list = response.result || []

src/components/terminal/TerminalWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export class TerminalView extends Component<TerminalViewProps, TerminalViewState
222222
initialize(sessionId): void {
223223
this.createNewTerminal()
224224

225-
const socketURL = `${import.meta.env.VITE_REACT_APP_ORCHESTRATOR_ROOT}/api/vi/pod/exec/ws/`
225+
const socketURL = `${window.__REACT_APP_ORCHESTRATOR_ROOT__}/api/vi/pod/exec/ws/`
226226

227227
this._socket?.close()
228228
this.setState({ firstMessageReceived: false })

src/components/v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/terminal/Terminal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export default function TerminalView({
117117
}
118118

119119
const generateSocketURL = () => {
120-
let socketURL = import.meta.env.VITE_REACT_APP_ORCHESTRATOR_ROOT
120+
let socketURL = window.__REACT_APP_ORCHESTRATOR_ROOT__
121121
socketURL += '/k8s/pod/exec/sockjs/ws/'
122122
return socketURL
123123
}

src/index.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,3 @@ ReactDOM.render(
182182
</React.StrictMode>,
183183
root,
184184
)
185-
186-
// if (import.meta.env.VITE_NODE_ENV === 'development') {
187-
// (module as any).hot.accept()
188-
// }

0 commit comments

Comments
 (0)