Skip to content

Commit fb666c7

Browse files
committed
New root adding for athena
1 parent 81bb743 commit fb666c7

File tree

6 files changed

+19
-4
lines changed

6 files changed

+19
-4
lines changed

.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
VITE_ORCHESTRATOR_ROOT="/orchestrator"
2+
VITE_ATHENA_ROOT="/athena"
23
VITE_GRAFANA_ORG_ID=2
34
VITE_K8S_CLIENT=false
45
VITE_NODE_ENV="development"

.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
VITE_ORCHESTRATOR_ROOT="/orchestrator"
2+
VITE_ATHENA_ROOT="/athena"
23
VITE_GRAFANA_ORG_ID=2
34
VITE_NODE_ENV="production"
45
BASE_URL="/dashboard"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export const getDataSourceDetailsFromEnvironment = async (envName: string): Prom
5454

5555
export function isDatasourceHealthy(datasourceId: number | string) {
5656
const timestamp = new Date()
57+
// const root = window.__ORCHESTRATOR_ROOT__.replace('/orchestrator', '')
5758
const root = window.__ORCHESTRATOR_ROOT__.replace('/orchestrator', '')
5859
const URL = `${root}/grafana/api/datasources/proxy/${datasourceId}/api/v1/query?query=1&time=${timestamp.getTime()}`
5960
return fetchWithFullRoute(URL, 'GET')

src/components/app/service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ import { Routes, Moment12HourFormat, NO_COMMIT_SELECTED } from '../../config'
3737
import { AppDetails, ArtifactsCiJob, EditAppRequest, AppMetaInfo } from './types'
3838
import { BulkResponseStatus, BULK_VIRTUAL_RESPONSE_STATUS } from '../ApplicationGroup/Constants'
3939

40-
export const getAppList = (request, options?: APIOptions) => post(Routes.APP_LIST, request, options)
40+
41+
42+
export const getAppList = (request, options?: APIOptions) => {
43+
// Use ATHENA_ROOT instead of ORCHESTRATOR_ROOT for app list API
44+
const athenaUrl = `${window.__ATHENA_ROOT__}/${Routes.APP_LIST}`
45+
return post(athenaUrl, request, options)
46+
}
4147

4248
export function deleteResource({ appName, env, name, kind, group, namespace, version, appId, envId }) {
4349
if (!group) {

src/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ declare global {
4141
Worker: any
4242
__BASE_URL__: string
4343
__ORCHESTRATOR_ROOT__: string
44+
__ATHENA_ROOT__: string
4445
__GRAFANA_ORG_ID__: number
4546
}
4647
}
4748

48-
if (!window.__BASE_URL__ || !window.__ORCHESTRATOR_ROOT__) {
49+
if (!window.__BASE_URL__ || !window.__ORCHESTRATOR_ROOT__ || !window.__ATHENA_ROOT__) {
4950
window.__BASE_URL__ = import.meta.env.BASE_URL || '/dashboard'
5051
window.__ORCHESTRATOR_ROOT__ = import.meta.env.VITE_ORCHESTRATOR_ROOT || 'orchestrator'
52+
window.__ATHENA_ROOT__ = import.meta.env.VITE_ATHENA_ROOT || 'athena'
5153
window.__GRAFANA_ORG_ID__ = import.meta.env.VITE_GRAFANA_ORG_ID || 2
5254
}
5355

vite.config.mts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import tsconfigPaths from 'vite-tsconfig-paths'
3131
import { compression, defineAlgorithm } from 'vite-plugin-compression2'
3232

3333
const WRONG_CODE = `import { bpfrpt_proptype_WindowScroller } from "../WindowScroller.js";`
34-
const TARGET_URL = 'https://preview.devtron.ai/'
34+
const TARGET_URL = 'https://gadgeon-dashboard.devtron.info/';
3535

3636
function reactVirtualized(): PluginOption {
3737
return {
@@ -96,7 +96,7 @@ const jsToBottomNoModule = () => {
9696
export default defineConfig(({ mode }) => {
9797
const secretsEnv = loadEnv('secrets', process.cwd(), '')
9898
const targetUrl = secretsEnv.VITE_TARGET_URL ?? TARGET_URL
99-
99+
const targetUrl1 = secretsEnv.VITE_TARGET_URL ?? TARGET_URL
100100
process.env = { ...process.env, ...loadEnv(mode, process.cwd(), ''), ...secretsEnv }
101101

102102
const baseConfig: UserConfig = {
@@ -275,6 +275,10 @@ export default defineConfig(({ mode }) => {
275275
target: targetUrl,
276276
changeOrigin: true,
277277
},
278+
'/athena': {
279+
target: targetUrl,
280+
changeOrigin: true,
281+
},
278282
'/grafana': targetUrl,
279283
},
280284
},

0 commit comments

Comments
 (0)