From 019c0c72e28444ed49cac247adafa71f101ff645 Mon Sep 17 00:00:00 2001 From: baurine <2008.hbl@gmail.com> Date: Thu, 2 Jul 2020 11:14:17 +0800 Subject: [PATCH] update the related docs and code after changing the default fe port to 3001 --- CONTRIBUTING.md | 2 +- ui/src/setupProxy.js | 8 ++++---- ui/tests/config-portal-test.html | 4 ++-- ui/tests/e2e/test_config.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b55d7e936a..a89b12459e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -136,7 +136,7 @@ The followings are required for developing TiDB Dashboard: 1. That's it! You can access TiDB Dashboard now: - TiDB Dashboard UI: http://127.0.0.1:3000 + TiDB Dashboard UI: http://127.0.0.1:3001 Swagger UI for TiDB Dashboard APIs: http://localhost:12333/dashboard/api/swagger diff --git a/ui/src/setupProxy.js b/ui/src/setupProxy.js index 69a6181ede..ccc8d95bbd 100644 --- a/ui/src/setupProxy.js +++ b/ui/src/setupProxy.js @@ -6,11 +6,11 @@ const dashboardApiPrefix = // The diagnose report will be served via WebpackDevServer. -// In debug mode, frontend host is localhost:3000, while the backend is 127.0.0.1:12333 +// In debug mode, frontend host is localhost:3001, while the backend is 127.0.0.1:12333 // In productio mode, frontend and backend host is the same module.exports = function (app) { // Proxy the `data.js` trick to the backend server. - // Proxy http://localhost:3000/dashboard/api/diagnose/reports/*/data.js to + // Proxy http://localhost:3001/dashboard/api/diagnose/reports/*/data.js to // http://http://127.0.0.1:12333/dashboard/api/diagnose/reports/*/data.js app.use( '/', @@ -21,8 +21,8 @@ module.exports = function (app) { ) // Rewrite the webpage to our static HTML. - // Rewrite http://localhost:3000/dashboard/api/diagnose/reports/*/detail - // to http://localhost:3000/dashboard/diagnoseReport.html + // Rewrite http://localhost:3001/dashboard/api/diagnose/reports/*/detail + // to http://localhost:3001/dashboard/diagnoseReport.html app.use('/dashboard/api/diagnose/reports/:id/detail', function (req, res) { req.url = paths.publicUrlOrPath + 'diagnoseReport.html' app.handle(req, res) diff --git a/ui/tests/config-portal-test.html b/ui/tests/config-portal-test.html index bf0074b91e..5b8401206d 100644 --- a/ui/tests/config-portal-test.html +++ b/ui/tests/config-portal-test.html @@ -9,7 +9,7 @@ function changeApp(app) { console.log('app:', app) const dashboard = document.getElementById('dashboard') - dashboard.src = `http://localhost:3000/dashboard/#/${app}` + dashboard.src = `http://localhost:3001/dashboard/#/${app}` } window.onload = function () { @@ -49,7 +49,7 @@

iframe test

id="dashboard" width="100%" height="100%" - src="http://localhost:3000/dashboard/#/portal" + src="http://localhost:3001/dashboard/#/portal" > diff --git a/ui/tests/e2e/test_config.ts b/ui/tests/e2e/test_config.ts index 7b9e70ad5e..9b6259a084 100644 --- a/ui/tests/e2e/test_config.ts +++ b/ui/tests/e2e/test_config.ts @@ -1,5 +1,5 @@ export let SERVER_URL = `${ - process.env.SERVER_URL || 'http://localhost:3000/dashboard' + process.env.SERVER_URL || 'http://localhost:3001/dashboard' }#` export const LOGIN_URL = SERVER_URL + '/signin' export const OVERVIEW_URL = SERVER_URL + '/overview'