Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dcellar-web-ui): add apollo configuration tip #393

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading