iosmanthus / tidb-dashboard

A Web UI for monitoring, diagnosing and managing the TiDB cluster.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TiDB Dashboard

GitHub license

TiDB Dashboard is a Web UI for monitoring, diagnosing and managing the TiDB cluster.

Documentation

Question, Suggestion

Feel free to open GitHub issues for questions, support and suggestions.

You may also consider join our community chat in the Slack channel #sig-dashboard.

For Chinese users, you can visit the PingCAP official user forum AskTUG.com to make life easier.

Getting Started

The most easy way to use TiDB Dashboard with an existing TiDB cluster is to use the one embedded into PD: http://127.0.0.1:2379/dashboard. You need PD master branch or 4.0+ version to use TiDB Dashboard.

Note: The TiDB Dashboard inside PD may be not up to date. To play with latest TiDB Dashboard, build it from source (see next section).

Contributing & Developing

Checkout our help wanted issues for a list of recommended tasks, in which we have also marked the difficulty level.

See CONTRIBUTING.md for a detailed step-by-step contributing guide, or steps to build TiDB Dashboard from source.

If you need any help, feel free to community chat in the Slack channel #sig-dashboard.

Thank you to all the people who already contributed to TiDB Dashboard!

Architecture

This repository contains both Dashboard HTTP API and Dashboard UI. Dashboard HTTP API is placed in pkg/ directory, written in Golang. Dashboard UI is placed in ui/ directory, powered by React.

TiDB Dashboard can also be integrated into PD, as follows:

For Developers How to ...

Change the base URL of Dashboard API endpoint

By default, the base URL of Dashboard API is http://127.0.0.1:12333 if using yarn start to set up the dashboard for development. Sometimes you just want to change the URL for some reasons:

  1. Use .env

    Add setting below into your .env file ( create one under ui if you don't have one already)

    REACT_APP_DASHBOARD_API_URL=your_new_endpoint
  2. Use a environment variable

    Use a scoped or global environment variable to specify the REACT_APP_DASHBOARD_API_URL for convienience.

    REACT_APP_DASHBOARD_API_URL=your_new_endpoint yarn start

Keep session valid after rebooting the server

By default, the session secret key is generated dynamically when the server starts. This results in invalidating your previously acquired session token. For easier development, you can supply a fixed session secret key by setting DASHBOARD_SESSION_SECRET in the environment variable or in .env file like:

DASHBOARD_SESSION_SECRET=aaaaaaaaaabbbbbbbbbbccccccccccdd

The supplied secret key must be 32 bytes, otherwise it will not be effective.

Note: the maximum lifetime of a token is 24 hours by default, so you still need to acquire token every 24 hours.

Supply session token in the Swagger UI

  1. Acquire a token first through /user/login in the Swagger UI.

  2. Click the "Authorize" button in the Swagger UI, set value to Bearer xxxx where xxxx is the token you acquired in step 1.

Release new UI assets

Simply modify ui/.github_release_version. The assets will be released automatically after your change is merged to master.

License

Apache License

Copyright 2020 PingCAP, Inc.

About

A Web UI for monitoring, diagnosing and managing the TiDB cluster.

License:Apache License 2.0


Languages

Language:Go 55.3%Language:TypeScript 37.3%Language:CSS 3.3%Language:JavaScript 3.3%Language:Shell 0.3%Language:HTML 0.3%Language:Ruby 0.2%Language:Makefile 0.1%