Skip to content

Commit

Permalink
Release v2020.09.08.1 (#753)
Browse files Browse the repository at this point in the history
* feature: Query Editor (#713)
* Backend: replace UNIX_TIMESTAMP with FROM_UNIXTIME in statement query (#731)
* test: Stablize e2e tests (#732)
* ui: Add store location tree (#728)
* log_search: Display instance port (#722)
* ui: show store location topology (#719)
* ui: Online Config (#733)
* ui: Support sharing session (#741)
* doc: Update to sig-diagnosis (#742)
* statement: Display number of plans in the list (#746)
* log search: return zip instead of tar or gzip (#724)
  • Loading branch information
breezewish authored Sep 8, 2020
1 parent 01f0abe commit a715a95
Show file tree
Hide file tree
Showing 121 changed files with 5,373 additions and 1,632 deletions.
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ Thanks for using TiDB Dashboard! Before asking a question, please take a look in
- GitHub issues
https://github.com/pingcap-incubator/tidb-dashboard/issues?q=is%3Aissue
- Documentation (English)
https://docs.pingcap.com/tidb/stable/dashboard-intro
- Documentation (Chinese)
https://pingcap.com/docs-cn/stable/dashboard/dashboard-intro/
https://docs.pingcap.com/zh/tidb/stable/dashboard-intro
- AskTUG forum (Chinese)
https://asktug.com/
You might also get a faster response in Slack (English / Chinese):
https://slack.tidb.io/invite?team=tidb-community&channel=sig-dashboard&ref=github_issue_create
https://slack.tidb.io/invite?team=tidb-community&channel=sig-diagnosis&ref=github_issue_create
-->
18 changes: 16 additions & 2 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Load tiup cache
- name: Load TiUP cache
uses: actions/cache@v1
with:
path: ~/.tiup/components
Expand All @@ -46,7 +46,7 @@ jobs:
run: |
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
source /home/runner/.profile
tiup update --nightly --all
tiup update --nightly
tiup playground nightly --tiflash=0 &
- name: Build UI
run: |
Expand All @@ -55,6 +55,20 @@ jobs:
NO_MINIMIZE: true
CI: true
REACT_APP_MIXPANEL_TOKEN: ""
- name: Debug TiUP
run: |
source /home/runner/.profile
tiup --version
ls /home/runner/.tiup/components/playground/
DATA_PATH=$(ls /home/runner/.tiup/data/)
echo $DATA_PATH
tiup playground display
echo "==== TiDB Log ===="
head -n 3 /home/runner/.tiup/data/$DATA_PATH/tidb-0/tidb.log
echo "==== TiKV Log ===="
head -n 3 /home/runner/.tiup/data/$DATA_PATH/tikv-0/tikv.log
echo "==== PD Log ===="
head -n 3 /home/runner/.tiup/data/$DATA_PATH/pd-0/pd.log
- name: Build and run backend in the background
run: |
make
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Thanks for your interest in contributing to TiDB Dashboard! This document outlines some of the conventions on building, running, and testing TiDB Dashboard, the development workflow, commit message formatting, contact points and other resources.

If you need any help (for example, mentoring getting started or understanding the codebase), feel free to join the discussion of [TiDB Dashboard SIG] (Special Interest Group):
If you need any help (for example, mentoring getting started or understanding the codebase), feel free to join the discussion of [Diagnosis SIG] (Special Interest Group):

- Slack: [#sig-dashboard](https://slack.tidb.io/invite?team=tidb-community&channel=sig-dashboard&ref=github_dashboard_repo)
- Slack: [#sig-diagnosis](https://slack.tidb.io/invite?team=tidb-community&channel=sig-diagnosis&ref=github_dashboard_repo)

## Setting up a development workspace

Expand Down Expand Up @@ -251,7 +251,7 @@ If the change affects many subsystems, you can use `*` instead, like `*: foo`.

The body of the commit message should describe why the change was made and at a high level, how the code works.

[tidb dashboard sig]: https://github.com/pingcap/community/tree/master/special-interest-groups/sig-dashboard
[diagnosis sig]: https://github.com/pingcap/community/tree/master/special-interest-groups/sig-diagnosis
[pd]: https://github.com/pingcap/pd
[tidb]: https://github.com/pingcap/tidb
[tikv]: https://github.com/tikv/tikv
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ endif
go build -o bin/tidb-dashboard -ldflags '$(LDFLAGS)' -tags "${BUILD_TAGS}" cmd/tidb-dashboard/main.go

run:
bin/tidb-dashboard --debug
bin/tidb-dashboard --debug --experimental
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ TiDB Dashboard is a Web UI for monitoring, diagnosing and managing the TiDB clus

## Documentation

- [Product User Manual (Chinese)](https://pingcap.com/docs-cn/stable/dashboard/dashboard-intro/)
- [FAQ (Chinese)](https://pingcap.com/docs-cn/stable/dashboard/dashboard-faq/)
- [Product User Manual (English)](https://docs.pingcap.com/tidb/stable/dashboard-intro)
- [Product User Manual (Chinese)](https://docs.pingcap.com/zh/tidb/stable/dashboard-intro)
- [FAQ (English)](https://docs.pingcap.com/tidb/stable/dashboard-faq)
- [FAQ (Chinese)](https://docs.pingcap.com/zh/tidb/stable/dashboard-faq)

## Question, Suggestion

Feel free to [open GitHub issues](https://github.com/pingcap-incubator/tidb-dashboard/issues/new/choose)
for questions, support and suggestions.

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

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

Expand All @@ -35,7 +37,7 @@ for a list of recommended tasks, in which we have also marked the difficulty lev
See [CONTRIBUTING.md](./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].
If you need any help, feel free to community chat in the Slack channel [#sig-diagnosis].

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

Expand Down Expand Up @@ -65,6 +67,7 @@ Thank you to all the people who already contributed to TiDB Dashboard!

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

## Architecture
Expand All @@ -83,5 +86,5 @@ TiDB Dashboard can also be integrated into PD, as follows:
Copyright 2020 PingCAP, Inc.

[pd]: https://github.com/pingcap/pd
[#sig-dashboard]: https://slack.tidb.io/invite?team=tidb-community&channel=sig-dashboard&ref=github_dashboard_repo
[#sig-diagnosis]: https://slack.tidb.io/invite?team=tidb-community&channel=sig-diagnosis&ref=github_dashboard_repo
[asktug.com]: https://asktug.com/
11 changes: 6 additions & 5 deletions cmd/tidb-dashboard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@ type DashboardCLIConfig struct {
// NewCLIConfig generates the configuration of the dashboard in standalone mode.
func NewCLIConfig() *DashboardCLIConfig {
cfg := &DashboardCLIConfig{}
cfg.CoreConfig = &config.Config{}
cfg.CoreConfig = config.Default()

flag.StringVarP(&cfg.ListenHost, "host", "h", "127.0.0.1", "listen host of the Dashboard Server")
flag.IntVarP(&cfg.ListenPort, "port", "p", 12333, "listen port of the Dashboard Server")
flag.BoolVarP(&cfg.EnableDebugLog, "debug", "d", false, "enable debug logs")
flag.StringVar(&cfg.CoreConfig.DataDir, "data-dir", "/tmp/dashboard-data", "path to the Dashboard Server data directory")
flag.StringVar(&cfg.CoreConfig.PublicPathPrefix, "path-prefix", config.DefaultPublicPathPrefix, "public URL path prefix for reverse proxies")
flag.StringVar(&cfg.CoreConfig.PDEndPoint, "pd", "http://127.0.0.1:2379", "PD endpoint address that Dashboard Server connects to")
flag.BoolVar(&cfg.CoreConfig.EnableTelemetry, "enable-telemetry", true, "enable client to report data for analysis")
flag.StringVar(&cfg.CoreConfig.DataDir, "data-dir", cfg.CoreConfig.DataDir, "path to the Dashboard Server data directory")
flag.StringVar(&cfg.CoreConfig.PublicPathPrefix, "path-prefix", cfg.CoreConfig.PublicPathPrefix, "public URL path prefix for reverse proxies")
flag.StringVar(&cfg.CoreConfig.PDEndPoint, "pd", cfg.CoreConfig.PDEndPoint, "PD endpoint address that Dashboard Server connects to")
flag.BoolVar(&cfg.CoreConfig.EnableTelemetry, "telemetry", cfg.CoreConfig.EnableTelemetry, "allow telemetry")
flag.BoolVar(&cfg.CoreConfig.EnableExperimental, "experimental", cfg.CoreConfig.EnableExperimental, "allow experimental features")

showVersion := flag.BoolP("version", "v", false, "print version information and exit")

Expand Down
2 changes: 1 addition & 1 deletion etc/manualTestEnv/multiHost/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ TiDB, PD, TiKV, TiFlash each in different hosts.
1. Use [TiUP](https://tiup.io/) to deploy the cluster to the box (only need to do it once):

```bash
tiup cluster deploy multiHost v4.0.0 topology.yaml -i ../_shared/vagrant_key -y --user vagrant
tiup cluster deploy multiHost v4.0.4 topology.yaml -i ../_shared/vagrant_key -y --user vagrant
```

1. Start the cluster in the box:
Expand Down
2 changes: 1 addition & 1 deletion etc/manualTestEnv/multiReplica/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Multiple TiKV nodes in different labels.
1. Use [TiUP](https://tiup.io/) to deploy the cluster to the box (only need to do it once):

```bash
tiup cluster deploy multiReplica v4.0.0 topology.yaml -i ../_shared/vagrant_key -y --user vagrant
tiup cluster deploy multiReplica v4.0.4 topology.yaml -i ../_shared/vagrant_key -y --user vagrant
```

1. Start the cluster in the box:
Expand Down
2 changes: 1 addition & 1 deletion etc/manualTestEnv/singleHost/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ TiDB, PD, TiKV, TiFlash in the same host.
1. Use [TiUP](https://tiup.io/) to deploy the cluster to the box (only need to do it once):

```bash
tiup cluster deploy singleHost v4.0.0 topology.yaml -i ../_shared/vagrant_key -y --user vagrant
tiup cluster deploy singleHost v4.0.4 topology.yaml -i ../_shared/vagrant_key -y --user vagrant
```

1. Start the cluster in the box:
Expand Down
2 changes: 1 addition & 1 deletion etc/manualTestEnv/singleHostMultiDisk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ All instances in a single host, but on different disks.
1. Use [TiUP](https://tiup.io/) to deploy the cluster to the box (only need to do it once):

```bash
tiup cluster deploy singleHostMultiDisk v4.0.0 topology.yaml -i ../_shared/vagrant_key -y --user vagrant
tiup cluster deploy singleHostMultiDisk v4.0.4 topology.yaml -i ../_shared/vagrant_key -y --user vagrant
```

1. Start the cluster in the box:
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/pingcap-incubator/tidb-dashboard
go 1.13

require (
github.com/VividCortex/mysqlerr v0.0.0-20200629151747-c28746d985dd
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/appleboy/gin-jwt/v2 v2.6.3
github.com/cenkalti/backoff/v4 v4.0.2
Expand All @@ -29,9 +30,10 @@ require (
github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
github.com/spf13/pflag v1.0.1
github.com/stretchr/testify v1.4.0
github.com/stretchr/testify v1.5.1
github.com/swaggo/http-swagger v0.0.0-20200308142732-58ac5e232fba
github.com/swaggo/swag v1.6.6-0.20200529100950-7c765ddd0476
github.com/vmihailenco/msgpack/v5 v5.0.0-beta.1
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738
go.uber.org/atomic v1.5.0
go.uber.org/fx v1.10.0
Expand Down
15 changes: 15 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/VividCortex/mysqlerr v0.0.0-20200629151747-c28746d985dd h1:59Whn6shj5MTVjTf2OX6+7iMcmY6h5CK0kTWwRaplL4=
github.com/VividCortex/mysqlerr v0.0.0-20200629151747-c28746d985dd/go.mod h1:f3HiCrHjHBdcm6E83vGaXh1KomZMA2P6aeo3hKx/wg0=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
Expand Down Expand Up @@ -127,6 +129,8 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk=
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
Expand Down Expand Up @@ -299,6 +303,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14 h1:PyYN9JH5jY9j6av01SpfRMb+1DWg/i3MbGOKPxJ2wjM=
github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14/go.mod h1:gxQT6pBGRuIGunNf/+tSOB5OHvguWi8Tbt82WOkf35E=
github.com/swaggo/gin-swagger v1.2.0 h1:YskZXEiv51fjOMTsXrOetAjrMDfFaXD79PEoQBOe2W0=
Expand Down Expand Up @@ -329,6 +335,11 @@ github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli/v2 v2.1.1 h1:Qt8FeAtxE/vfdrLmR3rxR6JRE0RoVmbXu8+6kZtYU4k=
github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
github.com/vmihailenco/msgpack/v4 v4.3.11/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4=
github.com/vmihailenco/msgpack/v5 v5.0.0-beta.1 h1:d71/KA0LhvkrJ/Ok+Wx9qK7bU8meKA1Hk0jpVI5kJjk=
github.com/vmihailenco/msgpack/v5 v5.0.0-beta.1/go.mod h1:xlngVLeyQ/Qi05oQxhQ+oTuqa03RjMwMfk/7/TCs+QI=
github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY=
github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/yookoala/realpath v1.0.0/go.mod h1:gJJMA9wuX7AcqLy1+ffPatSCySA1FQ2S8Ya9AIoYBpE=
Expand Down Expand Up @@ -391,6 +402,7 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190611141213-3f473d35a33a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
Expand All @@ -399,6 +411,7 @@ golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191002035440-2ec189313ef0 h1:2mqDk8w/o6UmeUCu5Qiq2y7iMf6anbx+YA8d1JFoFrs=
golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 h1:eDrdRpKgkcCqKZQwyZRyeFZgfqt37SL7Kv3tok06cKE=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
Expand Down Expand Up @@ -457,6 +470,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181004005441-af9cb2a35e7f/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
Expand Down
20 changes: 12 additions & 8 deletions pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,25 @@ import (
"go.uber.org/fx"

"github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver/clusterinfo"
"github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver/configuration"
"github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver/diagnose"
"github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver/foo"
"github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver/info"
"github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver/logsearch"
"github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver/metrics"
"github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver/profiling"
"github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver/queryeditor"
"github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver/slowquery"
"github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver/statement"
"github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver/user"
apiutils "github.com/pingcap-incubator/tidb-dashboard/pkg/apiserver/utils"
"github.com/pingcap-incubator/tidb-dashboard/pkg/config"
"github.com/pingcap-incubator/tidb-dashboard/pkg/dbstore"
pkghttp "github.com/pingcap-incubator/tidb-dashboard/pkg/http"
"github.com/pingcap-incubator/tidb-dashboard/pkg/httpc"
"github.com/pingcap-incubator/tidb-dashboard/pkg/keyvisual"
keyvisualregion "github.com/pingcap-incubator/tidb-dashboard/pkg/keyvisual/region"
"github.com/pingcap-incubator/tidb-dashboard/pkg/pd"
"github.com/pingcap-incubator/tidb-dashboard/pkg/tidb"
"github.com/pingcap-incubator/tidb-dashboard/pkg/tikv"
"github.com/pingcap-incubator/tidb-dashboard/pkg/utils"
"github.com/pingcap-incubator/tidb-dashboard/pkg/utils/version"
)
Expand Down Expand Up @@ -103,14 +105,13 @@ func (s *Service) Start(ctx context.Context) error {
newAPIHandlerEngine,
s.provideLocals,
dbstore.NewDBStore,
httpc.NewHTTPClient,
pd.NewEtcdClient,
pd.NewPDClient,
config.NewDynamicConfigManager,
tidb.NewForwarderConfig,
tidb.NewForwarder,
pkghttp.NewHTTPClientWithConf,
tidb.NewTiDBClient,
tikv.NewTiKVClient,
user.NewAuthService,
foo.NewService,
info.NewService,
clusterinfo.NewService,
profiling.NewService,
Expand All @@ -120,11 +121,12 @@ func (s *Service) Start(ctx context.Context) error {
diagnose.NewService,
keyvisual.NewService,
metrics.NewService,
queryeditor.NewService,
configuration.NewService,
),
fx.Populate(&s.apiHandlerEngine),
fx.Invoke(
user.Register,
foo.Register,
info.Register,
clusterinfo.Register,
profiling.Register,
Expand All @@ -134,6 +136,8 @@ func (s *Service) Start(ctx context.Context) error {
diagnose.Register,
keyvisual.Register,
metrics.Register,
queryeditor.Register,
configuration.Register,
// Must be at the end
s.status.Register,
),
Expand Down Expand Up @@ -192,7 +196,7 @@ func newAPIHandlerEngine() (apiHandlerEngine *gin.Engine, endpoint *gin.RouterGr
apiHandlerEngine = gin.New()
apiHandlerEngine.Use(gin.Recovery())
apiHandlerEngine.Use(cors.AllowAll())
apiHandlerEngine.Use(gzip.Gzip(gzip.BestSpeed))
apiHandlerEngine.Use(gzip.Gzip(gzip.DefaultCompression))
apiHandlerEngine.Use(apiutils.MWHandleErrors())

endpoint = apiHandlerEngine.Group("/dashboard/api")
Expand Down
Loading

0 comments on commit a715a95

Please sign in to comment.