Skip to content
Open

Demo #13

Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ jobs:
run: |
docker buildx imagetools create \
--tag registry.cn-shanghai.aliyuncs.com/clklog/accesslog-ui:${{ steps.set-tag.outputs.tag }} \
zcunsoft/accesslog-ui:${{ steps.set-tag.outputs.tag }}
zcunsoft/accesslog-ui:${{ steps.set-tag.outputs.tag }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM nginx:alpine
FROM nginx:1.20-alpine

ARG HTML_DIR

COPY ${HTML_DIR} /usr/share/nginx/html
COPY ${HTML_DIR} /usr/share/nginx/html
28 changes: 3 additions & 25 deletions mock/role/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,11 @@ const routes = deepClone([...constantRoutes, ...asyncRoutes])

const roles = [
{
key: 'admin',
name: 'admin',
description: 'Super Administrator. Have Tracking to view all pages.',
key: 'accesslog',
name: 'accesslog',
description: 'Accesslog Administrator. Have Tracking to view all pages.',
routes: routes
},
{
key: 'editor',
name: 'editor',
description: 'Normal Editor. Can see all pages except permission page',
routes: routes.filter(i => i.path !== '/permission')// just a mock
},
{
key: 'visitor',
name: 'visitor',
description: 'Just a visitor. Can only see the home page and the document page',
routes: [{
path: '',
redirect: 'dashboard',
children: [
{
path: 'dashboard',
name: 'Dashboard',
meta: { title: 'dashboard', icon: 'dashboard' }
}
]
}]
}
]

module.exports = [
Expand Down
6 changes: 3 additions & 3 deletions mock/role/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const asyncRoutes = [
meta: {
title: 'Permission',
icon: 'lock',
roles: ['admin', 'editor']
roles: ['accesslog']
},
children: [
{
Expand All @@ -90,7 +90,7 @@ const asyncRoutes = [
name: 'PagePermission',
meta: {
title: 'Page Permission',
roles: ['admin']
roles: ['accesslog']
}
},
{
Expand All @@ -107,7 +107,7 @@ const asyncRoutes = [
name: 'RolePermission',
meta: {
title: 'Role Permission',
roles: ['admin']
roles: ['accesslog']
}
}
]
Expand Down
15 changes: 3 additions & 12 deletions mock/user.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@

const tokens = {
admin: {
accesslog: {
token: 'admin-token'
},
editor: {
token: 'editor-token'
}
}

const users = {
'admin-token': {
roles: ['admin'],
roles: ['accesslog'],
introduction: 'I am a super administrator',
avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
name: 'Super Admin'
},
'editor-token': {
roles: ['editor'],
introduction: 'I am an editor',
avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
name: 'Normal Editor'
}
}

Expand All @@ -36,7 +27,7 @@ module.exports = [
if (!token) {
return {
code: 60204,
message: 'Account and password are incorrect.'
message: '当前账号不存在'
}
}

Expand Down
24 changes: 20 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"js-cookie": "2.2.0",
"jsonlint": "1.6.3",
"jszip": "3.2.1",
"moment": "^2.30.1",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
Expand Down
16 changes: 8 additions & 8 deletions src/api/trackingapi/abnormal.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ export function getExceptionIpApi(params) {
data: params
})
}
// 状态码详情
export function getStatusDetailApi(params) {
return request({
url: '/accesslog/status/getStatusDetail',
method: 'post',
data: params
})
}
// // 状态码详情
// export function getStatusDetailApi(params) {
// return request({
// url: '/accesslog/status/getStatusDetail',
// method: 'post',
// data: params
// })
// }
57 changes: 26 additions & 31 deletions src/api/trackingapi/accessLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,6 @@ export function getFlowTrendApi(params) {
})
}

// 获取耗时TOP10数据
export function getRequestTimeTop10Api(params) {
return request({
url: '/accesslog/getRequestTimeTop10',
method: 'post',
data: params
})
}

// 获取访问TOP10数据
export function getUriTop10Api(params) {
return request({
url: '/accesslog/getUriTop10',
method: 'post',
data: params
})
}
// 获取IP访问量TOP10数据
export function getIpTop10Api(params) {
return request({
Expand Down Expand Up @@ -103,14 +86,9 @@ export function getIpByProvinceApi(params) {
})
}



// ------------------------------------------------------

// 按应用流量指标概览
export function getHostOverviewApi(params) {
return request({
// url: '/accesslog/getHostOverview',
url: '/getHostOverview',
method: 'post',
data: params
Expand All @@ -119,7 +97,6 @@ export function getHostOverviewApi(params) {
// 指标概览
export function getOverviewApi(params) {
return request({
// url: '/accesslog/getOverview',
url: '/getOverview',
method: 'post',
data: params
Expand All @@ -133,11 +110,29 @@ export function getPerformanceDetailApi(params) {
data: params
})
}
//状态码分析
// export function getStatusApi(params) {
// return request({
// url: '/getStatus',
// method: 'post',
// data: params
// })
// }
//获取ip列表
export function getIpListApi(params) {
return request({
url: '/accesslog/ip/getIpList',
method: 'post',
data: params
})
}

//按地域获取IP分布统计数据
export function getIpByAreaApi(params) {
return request({
url: '/accesslog/ip/getIpByArea',
method: 'post',
data: params
})
}

//获取ip详情列表
export function getIpDetailListApi(params) {
return request({
url: '/accesslog/ip/getIpDetailList',
method: 'post',
data: params
})
}
12 changes: 10 additions & 2 deletions src/api/trackingapi/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ export function getRequestimeGt100msApi(params) {
data: params
})
}
// 性能分析详情
// 性能分析详情弃用
// export function getPerformanceDetailApi(params) {
// return request({
// url: '/accesslog/performance/getPerformanceDetail',
// method: 'post',
// data: params
// })
// }
// 获取Uri列表
export function getPerformanceDetailApi(params) {
return request({
url: '/accesslog/performance/getPerformanceDetail',
url: '/accesslog/uri/getUriList',
method: 'post',
data: params
})
Expand Down
24 changes: 7 additions & 17 deletions src/api/trackingapi/status.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
import request from '@/utils/request'


// 状态码数据图表
export function getStatusApi(params) {
return request({
url: '/accesslog/status/getStatus',
method: 'post',
data: params
})
}
// 状态码列表
export function getStatusListApi(params) {
return request({
Expand All @@ -26,10 +16,10 @@ export function getStatusFlowTrendApi(params) {
})
}
// 状态码详情
export function getStatusDetailApi(params) {
return request({
url: '/accesslog/status/getStatusDetail',
method: 'post',
data: params
})
}
// export function getStatusDetailApi(params) {
// return request({
// url: '/accesslog/status/getStatusDetail',
// method: 'post',
// data: params
// })
// }
Binary file added src/assets/images/qrcode.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/qrcode.png
Binary file not shown.
7 changes: 6 additions & 1 deletion src/components/Charts/LineMarker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ export default {
this.initChart();
},
initChart() {
this.chart = echarts.init(document.getElementById(this.id));
const chartDom = document.getElementById(this.id);
if (!chartDom) {
console.warn(`Chart DOM element with id ${this.id} not found`);
return;
}
this.chart = echarts.init(chartDom);

this.chart.setOption({
backgroundColor: "#fff",
Expand Down
7 changes: 6 additions & 1 deletion src/components/Charts/pieMarker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ export default {
this.initChart();
},
initChart() {
this.chart = echarts.init(document.getElementById(this.id));
const chartDom = document.getElementById(this.id);
if (!chartDom) {
console.warn(`图表DOM元素(id: ${this.id})不存在,跳过ECharts初始化`);
return;
}
this.chart = echarts.init(chartDom);
this.chart.setOption({
title: {
left: "center",
Expand Down
Loading
Loading