Skip to content

Commit

Permalink
网速、cpu、空间统计
Browse files Browse the repository at this point in the history
  • Loading branch information
eee555 committed Apr 30, 2024
1 parent 36188cc commit 1e83cf9
Show file tree
Hide file tree
Showing 6 changed files with 395 additions and 10 deletions.
12 changes: 8 additions & 4 deletions back_end/saolei/monitor/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,16 @@ def get_dir_size(path):
return total

# 服务器总容量、录像占用大小
@throttled(interval=500)
@throttled(interval=188)
def get_capacity(request):
disk_total = psutil.disk_usage(".")
# 服务器总容量情况
disk = psutil.disk_usage(".")
# 录像占用容量情况
video_size = get_dir_size(os.path.join(settings.BASE_DIR, 'assets/videos'))
return JsonResponse({"t_t": disk_total.total, "t_u": disk_total.used, "t_p": disk_total.percent,
"v": video_size})
# 内存占用情况
virtual = psutil.virtual_memory()
return JsonResponse({"d_t": disk.total, "d_u": disk.used, "v": video_size,
"v_t": virtual.total, "v_u": virtual.used})



136 changes: 136 additions & 0 deletions front_end/package-lock.json

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

2 changes: 2 additions & 0 deletions front_end/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
"@types/lowdb": "^1.0.11",
"@types/node": "^20.5.1",
"axios": "^0.21.1",
"echarts": "^5.5.0",
"element-plus": "^2.2.32",
"flag-icon-css": "^4.1.7",
"image-conversion": "^2.1.1",
"js-cookie": "^2.2.1",
"ms-toollib": "1.4.6-alpha",
"uuid": "^9.0.0",
"vue": "^3.2.13",
"vue-echarts": "^6.7.1",
"vue-router": "^4.0.3",
"vuex": "^4.1.0"
},
Expand Down
2 changes: 1 addition & 1 deletion front_end/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const routes: Array<RouteRecordRaw> = [
{
path: '/world',
name: 'world',
component: () => import('../views/AboutView.vue')
component: () => import('../views/WorldView.vue')
},
{
path: '/guide',
Expand Down
5 changes: 0 additions & 5 deletions front_end/src/views/AboutView.vue

This file was deleted.

Loading

0 comments on commit 1e83cf9

Please sign in to comment.