Skip to content

Conversation

baurine
Copy link
Collaborator

@baurine baurine commented Sep 27, 2021

How to build a distro dashboard:

  1. Add the following code in the populate.go to pass the compile:

    var Resource = map[string]string{
    	"tidb":    "TiDB",
    	"tikv":    "TiKV",
    	"tiflash": "TiFlash",
    	"pd":      "PD",
    }
    
  2. Build UI

    UI=1 DISTRO_BUILD_TAG=1 make UI
    
  3. Build all

    UI=1 DISTRO_BUILD_TAG=1 make
    

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 27, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • shhdgit

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@@ -172,7 +173,13 @@ function useSignInSubmit(
} catch (e) {
if (!e.handled) {
const errMsg = t('signin.message.error', { msg: e.message })
if (e.errCode === 'error.api.user.insufficient_privileges') {
if (
distro.tidb !== 'TiDB' ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible that the distribution's TiDB has not been renamed.
We can use process.env.DISTRO_BUILD_TAG to distinguish whether the build is a distro.

And we should add

  overrideProcessEnv({
    REACT_APP_RELEASE_VERSION: JSON.stringify(getInternalVersion()),
    DISTRO_BUILD_TAG: process.env.DISTRO_BUILD_TAG,
  }),

at config-overrides.js

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me try it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@@ -60,4 +60,8 @@ i18next
},
})

export function isDistro() {
return process.env.REACT_APP_DISTRO_BUILD_TAG !== undefined
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried use return process.env.REACT_APP_DISTRO_BUILD_TAG !== 1 to judge, but can't pass the ts compile, it says process.env.xxx values are string | null,although in this case, process.env.REACT_APP_DISTRO_BUILD_TAG is a number.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can export the variables directly, like const isDistro = process.env.REACT_APP_DISTRO_BUILD_TAG !== undefined.

Copy link
Collaborator Author

@baurine baurine Sep 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense, let me update it.

@shhdgit
Copy link
Member

shhdgit commented Sep 28, 2021

LGTM.

@baurine baurine merged commit f1cd99c into pingcap:master Sep 28, 2021
@baurine baurine deleted the compatible-for-distro branch September 28, 2021 08:38
shhdgit pushed a commit to shhdgit/tidb-dashboard that referenced this pull request Sep 28, 2021
shhdgit added a commit that referenced this pull request Sep 28, 2021
* fix(stmt): evict & unbound schema stmt query (#1006)

* fix(client): goroutine leak (#1013)

* Update release version

* hide help link for non TiDB distro (#1015)

Co-authored-by: Sparkle <1284531+baurine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants