-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: John Cowen <[email protected]>
- Loading branch information
Showing
12 changed files
with
56 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,55 @@ | ||
import ControlPlaneStatus from './components/ControlPlaneStatus.vue' | ||
import { features } from './features' | ||
import { routes } from './routes' | ||
import { sources } from './sources' | ||
import type { ServiceDefinition } from '@/services/utils' | ||
import { token } from '@/services/utils' | ||
|
||
import { token, createInjections } from '@/services/utils' | ||
|
||
type Token = ReturnType<typeof token> | ||
|
||
const $ = { | ||
sources: token<ReturnType<typeof sources>>('control-planes.sources'), | ||
ControlPlaneStatus: token<typeof ControlPlaneStatus>('control-planes.components.ControlPlaneStatus'), | ||
} | ||
export const services = (app: Record<string, Token>): ServiceDefinition[] => { | ||
return [ | ||
[$.sources, { | ||
service: sources, | ||
arguments: [ | ||
app.env, | ||
app.api, | ||
], | ||
labels: [ | ||
app.sources, | ||
], | ||
}], | ||
[$.ControlPlaneStatus, { | ||
service: () => { | ||
return ControlPlaneStatus | ||
}, | ||
}], | ||
[token('control-planes.routes'), { | ||
service: routes, | ||
labels: [ | ||
app.routes, | ||
], | ||
}], | ||
[token('control-planes.features'), { | ||
service: features, | ||
arguments: [ | ||
app.env, | ||
], | ||
labels: [ | ||
app.features, | ||
], | ||
}], | ||
] | ||
} | ||
|
||
export const TOKENS = $ | ||
export const [ | ||
useControlPlaneStatus, | ||
] = createInjections( | ||
$.ControlPlaneStatus, | ||
) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
import { DataSourceResponse } from '@/app/application/services/data-source/DataSourcePool' | ||
import type { DataSourceResponse } from '@/app/application' | ||
import type Env from '@/services/env/Env' | ||
import type KumaApi from '@/services/kuma-api/KumaApi' | ||
import type { GlobalInsight } from '@/types/index.d' | ||
|
||
export type ControlPlaneAddresses = { | ||
http: string | ||
kds: string | ||
} | ||
|
||
export type ControlPlaneAddressesSource = DataSourceResponse<ControlPlaneAddresses> | ||
export const sources = (env: Env['var']) => { | ||
export type GlobalInsightSource = DataSourceResponse<GlobalInsight> | ||
|
||
export const sources = (env: Env['var'], api: KumaApi) => { | ||
return { | ||
'/control-plane/addresses': async (_params: {}, source: { close: () => void }): Promise<ControlPlaneAddresses> => { | ||
source.close() | ||
'/control-plane/addresses': async (): Promise<ControlPlaneAddresses> => { | ||
return { | ||
http: env('KUMA_API_URL'), | ||
kds: 'grpcs://<global-kds-address>:5685', | ||
} | ||
}, | ||
'/global-insight': () => { | ||
return api.getGlobalInsight() | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters