Skip to content

Commit

Permalink
feat(dcellar-web-ui): add apollo configuration tip (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
aiden-cao authored Aug 21, 2024
1 parent af02c7d commit 393b835
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
12 changes: 12 additions & 0 deletions apps/dcellar-web-ui/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "dcellar-web-ui",
"entries": [
{
"version": "1.7.2",
"tag": "dcellar-web-ui_v1.7.2",
"date": "Wed, 21 Aug 2024 03:41:57 GMT",
"comments": {
"patch": [
{
"comment": "Add Apollo configuration tip"
}
]
}
},
{
"version": "1.7.1",
"tag": "dcellar-web-ui_v1.7.1",
Expand Down
9 changes: 8 additions & 1 deletion apps/dcellar-web-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - dcellar-web-ui

This log was last generated on Fri, 21 Jun 2024 06:15:11 GMT and should not be manually modified.
This log was last generated on Wed, 21 Aug 2024 03:41:57 GMT and should not be manually modified.

## 1.7.2
Wed, 21 Aug 2024 03:41:57 GMT

### Patches

- Add Apollo configuration tip

## 1.7.1
Fri, 21 Jun 2024 06:15:11 GMT
Expand Down
5 changes: 3 additions & 2 deletions apps/dcellar-web-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dcellar-web-ui",
"version": "1.7.1",
"version": "1.7.2",
"private": false,
"scripts": {
"dev": "node ./scripts/dev.js -p 3200",
Expand Down Expand Up @@ -92,5 +92,6 @@
"prettier --write"
],
"*.ts?(x)": "tsc-files --noEmit"
}
},
"packageManager": "pnpm@8.5.0+sha1.83c41fe4ebdb61e08446f8bb68a75fb48756b330"
}
11 changes: 10 additions & 1 deletion apps/dcellar-web-ui/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@ export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
const { ConfigService } = await import('apollo-node-client');
// https://apollo.bk.nodereal.cc/ https://apollo.nodereal.link/
const apolloEndpoint = `https://apollo-config.bk.nodereal.cc`;

if (process.env.NODE_ENV === 'development') {
console.error(
'\x1b[36m%s\x1b[0m',
`This Apollo endpoint(${apolloEndpoint}) configuration is for internal use only, please replace it with your own service endpoint, or if you do not have an Apollo configuration service, you can directly delete the instrumentation file.`,
);
}

const service = new ConfigService({
appId: 'dcellar-ui',
configServerUrl:
process.env.NODE_ENV === 'development'
? 'https://apollo-config.bk.nodereal.cc'
? apolloEndpoint
: 'http://configcenter-apollo-configservice.configcenter.svc.cluster.local:8080',
});

Expand Down

0 comments on commit 393b835

Please sign in to comment.