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

Release the first version of web-app #22

Merged
merged 22 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void setUp() {
this.mockMvc = MockMvcBuilders.standaloneSetup(accountController).build();
}

@Test

void authGetToken() throws Exception {
JsonWebTokenUtil.setDefaultSecretKey("dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp"
+ "CyaFv0bwq2Eik0jdrKUtsA6bx3sDJeFV643R"
Expand All @@ -58,7 +58,7 @@ void authGetToken() throws Exception {
.andReturn();
}

@Test

void refreshToken() throws Exception {
this.mockMvc.perform(MockMvcRequestBuilders.get("/api/account/auth/refresh/{refreshToken}",
"123456"))
Expand Down
4 changes: 4 additions & 0 deletions web-app/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ ENV = 'development'

# base api
VUE_APP_BASE_API = '/dev-api'
VUE_APP_MOCK_API = '/mock-api'

# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
3 changes: 2 additions & 1 deletion web-app/mock/mock-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function registerRoutes(app) {
let mockLastIndex
const { mocks } = require('./index.js')
const mocksForServer = mocks.map(route => {
console.log(route)
return responseFake(route.url, route.type, route.response)
})
for (const mock of mocksForServer) {
Expand All @@ -34,7 +35,7 @@ function unregisterRoutes() {
// for mock server
const responseFake = (url, type, respond) => {
return {
url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`),
url: new RegExp(`${process.env.VUE_APP_MOCK_API}${url}`),
type: type || 'get',
response(req, res) {
console.log('request invoke:' + req.path)
Expand Down
2 changes: 1 addition & 1 deletion web-app/mock/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = [
type: 'get',
response: config => {
const { token } = config.query
const info = users[token]
const info = users['admin-token']

// mock error
if (!info) {
Expand Down
5 changes: 4 additions & 1 deletion web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
"core-js": "3.6.5",
"driver.js": "0.9.5",
"dropzone": "5.5.1",
"echarts": "4.2.1",
"echarts": "^5.4.1",
"element-ui": "2.13.2",
"file-saver": "2.0.1",
"fuse.js": "3.4.4",
"jquery-csv": "^1.0.21",
"js-cookie": "2.2.0",
"jsonlint": "1.6.3",
"jszip": "3.2.1",
"marked": "^4.2.12",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
Expand All @@ -38,6 +40,7 @@
"tui-editor": "1.3.3",
"vue": "2.6.10",
"vue-count-to": "1.0.13",
"vue-grid-layout": "^2.4.0",
"vue-i18n": "7.3.2",
"vue-router": "3.0.2",
"vue-splitpane": "1.0.4",
Expand Down
90 changes: 90 additions & 0 deletions web-app/public/csvData/detailLayout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
const data = 'mysql,基本信息,单指标,mysql.status.uptime,Single,,0,0,6,3,,,,5\n' +
'mysql,基本信息,单指标,mysql.basic.version,Single,,0,6,6,3,,,,5\n' +
'mysql,基本信息,单指标,mysql.performance.qps,SingleGraph,,0,12,6,3,,,,\n' +
'mysql,基本信息,单指标,mysql.innodb.innodb_buffer_pool_size,SingleGraph,,0,18,6,3,,,,\n' +
'mysql,基本信息,单指标,mysql.handler.handler_used_ratio,SingleGraph,,3,0,6,3,,,,\n' +
'mysql,基本信息,单指标,mysql.table_cache.table_open_cache_miss_ratio,SingleGraph,,3,6,6,3,,,,\n' +
'mysql,基本信息,单指标,mysql.table_cache.table_open_cache_size,SingleGraph,,3,12,6,3,,,,\n' +
'mysql,基本信息,单指标,mysql.table_cache.table_definition_cache_size,SingleGraph,,3,18,6,3,,,,\n' +
'mysql,基本信息,指标组合,cb.mysql.connections,Graph,,6,0,12,8,,,,\n' +
'mysql,基本信息,指标组合,cb.mysql.thread_activity,Graph,,6,12,12,8,,,,\n' +
'mysql,基本信息,指标组合,cb.mysql.handlers,Graph,堆叠,14,0,12,8,,,,\n' +
'mysql,基本信息,指标组合,cb.mysql.com_counters,Graph,堆叠,14,12,12,8,,,,\n' +
'mysql,基本信息,单指标,mysql.process_state.num,Graph,堆叠,22,0,12,8,,,,\n' +
'mysql,基本信息,指标组合,cb.mysql.net_traffic,Graph,堆叠,22,12,12,8,,,,\n' +
'mysql,连接&线程,指标组合,cb.mysql.connections,Graph,,0,0,24,8,连接,,,\n' +
'mysql,连接&线程,指标组合,cb.mysql.aborted_connections,Graph,,8,0,24,8,中止的连接,,,\n' +
'mysql,连接&线程,指标组合,cb.mysql.thread_activity,Graph,,16,0,24,8,客户端线程活动,,,\n' +
'mysql,连接&线程,指标组合,cb.mysql.thread_cache,Graph,,24,0,24,8,线程缓存,,,\n' +
'mysql,查询性能,单指标,mysql.performance.current_qps,Graph,,0,0,24,8,当前QPS,,,\n' +
'mysql,查询性能,指标组合,cb.mysql.tmp_obj,Graph,,8,0,12,8,临时对象,,,\n' +
'mysql,查询性能,单指标,mysql.performance.slow_queries,Graph,,8,12,12,8,慢查询,,,\n' +
'mysql,查询性能,指标组合,cb.mysql.select_types,Graph,,16,0,12,8,Select类型,,,\n' +
'mysql,查询性能,指标组合,cb.mysql.sorts,Graph,,16,12,12,8,排序,,,\n' +
'mysql,查询性能,指标组合,cb.mysql.table_locks,Graph,,24,0,12,8,表锁,,,\n' +
'mysql,查询性能,单指标,mysql.performance.questions,Graph,,24,12,12,8,Questions,,,\n' +
'mysql,查询性能,指标组合,cb.mysql.query_cache_memory,Graph,,32,0,12,8,查询缓存内存,,,\n' +
'mysql,查询性能,指标组合,cb.mysql.query_cache_activity,Graph,,32,12,12,8,查询缓存活动,,,\n' +
'mysql,查询性能,单指标,mysql.slow_sql.sql_text,TableView,,40,0,24,8,慢SQL,,,\n' +
'mysql,命令&句柄&进程,指标组合,cb.mysql.com_counters,Graph,堆叠,0,0,24,8,命令计数器,,,\n' +
'mysql,命令&句柄&进程,指标组合,cb.mysql.handlers_no_trans,Graph,堆叠,8,0,24,8,非事务句柄,,,\n' +
'mysql,命令&句柄&进程,指标组合,cb.mysql.handlers_trans,Graph,堆叠,16,0,24,8,事务句柄,,,\n' +
'mysql,命令&句柄&进程,单指标,mysql.process_state.num,Graph,堆叠,24,0,24,8,进程状态,,,\n' +
'pgsql,基本信息,单指标,pgsql.status.uptime,Single,,0,0,6,3,,,,\n' +
'pgsql,基本信息,单指标,pgsql.basic.version,Single,,0,6,6,3,,,,\n' +
'pgsql,基本信息,单指标,pgsql.memory.shared_buffers,SingleGraph,,0,12,6,3,,,,\n' +
'pgsql,基本信息,单指标,pgsql.memory.work_mem,SingleGraph,,0,18,6,3,,,,\n' +
'pgsql,基本信息,单指标,pgsql.autovacuum .state,SingleGraph,,3,0,6,3,,,,\n' +
'pgsql,基本信息,单指标,pgsql.connection.max_connections,SingleGraph,,3,6,6,3,,,,\n' +
'pgsql,基本信息,单指标,pgsql.planner_cost.effective_cache_size,SingleGraph,,3,12,6,3,,,,\n' +
'pgsql,基本信息,单指标,pgsql.wal.wal_buffers,SingleGraph,,3,18,6,3,,,,\n' +
'pgsql,基本信息,单指标,pgsql.connection_state.num,Graph,,6,0,12,8,,,,\n' +
'pgsql,基本信息,指标组合,cb.pgsql.tuples,Graph,,6,12,12,8,,,,\n' +
'pgsql,基本信息,指标组合,cb.pgsql.transactions,Graph,,14,0,12,8,,,,\n' +
'pgsql,基本信息,单指标,pgsql.transaction_state.duration,Graph,,14,12,12,8,,,,\n' +
'pgsql,基本信息,单指标,pgsql.temp_file.num,Graph,,22,0,12,8,,,,\n' +
'pgsql,基本信息,单指标,pgsql.temp_file.size,Graph,,22,12,12,8,,,,\n' +
'pgsql,行查询,指标组合,cb.pgsql.tuples,Graph,,0,0,24,8,,,,\n' +
'pgsql,行查询,指标组合,cb.pgsql.tuples_read_by_queries,Graph,,8,0,24,8,,,,\n' +
'pgsql,行查询,指标组合,cb.pgsql.tuples_change_by_queries,Graph,,16,0,24,8,,,,\n' +
'pgsql,行查询,单指标,pgsql.connection_db.active,Graph,堆叠,24,0,24,6,库活动连接数,,,\n' +
'pgsql,锁与性能,指标组合,cb.pgsql.conflicts_deadlocks,Graph,,0,0,12,8,,,,\n' +
'pgsql,锁与性能,单指标,pgsql.lock_num.num,Graph,,0,12,12,8,,,,\n' +
'pgsql,锁与性能,单指标,pgsql.operation.read,Graph,,8,0,12,8,,,,\n' +
'pgsql,锁与性能,单指标,pgsql.operation.write,Graph,,8,12,12,8,,,,\n' +
'pgsql,锁与性能,指标组合,cb.pgsql.buffers,Graph,,16,0,12,8,,,,\n' +
'pgsql,锁与性能,指标组合,cb.pgsql.canceled_queries,Graph,,16,12,12,8,,,,\n' +
'pgsql,锁与性能,单指标,pgsql.cache_hit_ratio.ratio,Graph,,24,0,12,8,,,,\n' +
'pgsql,锁与性能,指标组合,cb.pgsql.checkpoint_stats,Graph,,24,12,12,8,,,,\n' +
'pgsql,锁与性能,单指标,pgsql.slow_sql.sql_text,TableView,,32,0,24,8,,,,\n' +
'pgsql,临时文件,单指标,pgsql.temp_file.num,Graph,,0,0,24,8,,,,\n' +
'pgsql,临时文件,单指标,pgsql.temp_file.size,Graph,,8,0,24,8,,,,\n' +
'pgsql,临时文件,单指标,pgsql.temp_file.activity,Graph,,16,0,24,8,,,,\n' +
'pgsql,临时文件,单指标,pgsql.temp_file.util,Graph,,24,0,24,8,,,,\n' +
'oracle,基本信息,单指标,oracle.status.uptime,Single,,0,0,6,3,,,,\n' +
'oracle,基本信息,单指标,oracle.basic.version,Single,,0,6,6,3,,,,\n' +
'oracle,基本信息,单指标,oracle.process.process_count,SingleGraph,,0,12,6,3,,,,\n' +
'oracle,基本信息,单指标,oracle.transaction.commits,SingleGraph,,0,18,6,3,,,,\n' +
'oracle,基本信息,单指标,oracle.session.total_sessions,SingleGraph,,3,0,6,3,,,,\n' +
'oracle,基本信息,单指标,oracle.session.active_sessions,SingleGraph,,3,6,6,3,,,,\n' +
'oracle,基本信息,单指标,oracle.execute.executes,SingleGraph,,3,12,6,3,,,,\n' +
'oracle,基本信息,单指标,oracle.transaction.rollbacks,SingleGraph,,3,18,6,3,,,,\n' +
'oracle,基本信息,单指标,oracle.performance.qps,Graph,,6,0,12,8,,,,\n' +
'oracle,基本信息,单指标,oracle.performance.tps,Graph,,6,12,12,8,,,,\n' +
'oracle,基本信息,单指标,oracle.performance.mbps,Graph,,14,0,12,8,,,,\n' +
'oracle,基本信息,单指标,oracle.performance.sql_resp_time,Graph,,14,12,12,8,,,,\n' +
'oracle,基本信息,指标组合,cb.oracle.cache_hit_ratio,Graph,,22,0,12,8,,,,\n' +
'oracle,基本信息,单指标,oracle.res_util.res_util,Graph,,22,12,12,8,,,,\n' +
'oracle,基本信息,单指标,oracle.perf_collector.total_collection,Single,,30,0,6,3,,,,\n' +
'oracle,基本信息,单指标,oracle.perf_collector.final_collection_time,SingleGraph,,30,6,6,3,,,,\n' +
'oracle,表空间,单指标,oracle.tablespace.name,TableView,,0,0,24,20,,,,\n' +
'oracle,等待时间,单指标,oracle.wait.concurrent_wait_time,Graph,,0,0,12,8,,,,\n' +
'oracle,等待时间,单指标,oracle.wait.commit_wait_time,Graph,,0,12,12,8,,,,\n' +
'oracle,等待时间,单指标,oracle.wait.app_wait_time,Graph,,8,0,12,8,,,,\n' +
'oracle,等待时间,单指标,oracle.wait.network_wait_time,Graph,,8,12,12,8,,,,\n' +
'oracle,等待时间,单指标,oracle.wait.system_io_wait_time,Graph,,16,0,12,8,,,,\n' +
'oracle,等待时间,单指标,oracle.wait.user_io_wait_time,Graph,,16,12,12,8,,,,\n' +
'oracle,等待时间,单指标,oracle.wait.configure_wait_time,Graph,,24,0,12,8,,,,\n' +
'oracle,等待时间,单指标,oracle.wait.scheduler_wait_time,Graph,,24,12,12,8,,,,'

export default data
Loading