Skip to content

Commit

Permalink
Show free disk space in banner instead of station UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
bclswl0827 committed Mar 23, 2024
1 parent 708759a commit 67a28d4
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Starting from v2.2.5, all notable changes to this project will be documented in this file.

## v2.11.9

- Show free disk space in banner instead of station UUID

## v2.11.8

- Add earthquake event source API support of CEA and INGV
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.11.8
v2.11.9
6 changes: 3 additions & 3 deletions frontend/dist/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"files": {
"main.css": "./static/css/main.7a040865.css",
"main.js": "./static/js/main.6f5b5049.js",
"main.js": "./static/js/main.62b97fc9.js",
"static/css/594.d6bfd15f.chunk.css": "./static/css/594.d6bfd15f.chunk.css",
"static/js/594.ef2a52fb.chunk.js": "./static/js/594.ef2a52fb.chunk.js",
"static/js/594.7755917b.chunk.js": "./static/js/594.7755917b.chunk.js",
"static/js/846.88ce4ddb.chunk.js": "./static/js/846.88ce4ddb.chunk.js",
"static/js/154.ce486a33.chunk.js": "./static/js/154.ce486a33.chunk.js",
"static/js/600.a5f3996c.chunk.js": "./static/js/600.a5f3996c.chunk.js",
Expand Down Expand Up @@ -49,6 +49,6 @@
},
"entrypoints": [
"static/css/main.7a040865.css",
"static/js/main.6f5b5049.js"
"static/js/main.62b97fc9.js"
]
}
2 changes: 1 addition & 1 deletion frontend/dist/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/><link rel="apple-touch-icon" href="./logo192.png"/><link rel="manifest" href="./manifest.json"/><style>.public-loading{width:100%;height:100%;display:flex;position:fixed;align-items:center;flex-direction:column;justify-content:center}.public-loading span{color:#1f2937;margin-top:20px;font-weight:600;font-size:1.25rem}.public-loading svg{animation:rotate 1s linear infinite}@keyframes rotate{100%{transform:rotate(360deg)}}</style><script defer="defer" src="./static/js/main.6f5b5049.js"></script><link href="./static/css/main.7a040865.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div class="public-loading"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#6b21a8" width="70px"><path d="M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z"/></svg> <span>Loading...</span></div><div id="root"></div></body></html>
<!doctype html><html><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/><link rel="apple-touch-icon" href="./logo192.png"/><link rel="manifest" href="./manifest.json"/><style>.public-loading{width:100%;height:100%;display:flex;position:fixed;align-items:center;flex-direction:column;justify-content:center}.public-loading span{color:#1f2937;margin-top:20px;font-weight:600;font-size:1.25rem}.public-loading svg{animation:rotate 1s linear infinite}@keyframes rotate{100%{transform:rotate(360deg)}}</style><script defer="defer" src="./static/js/main.62b97fc9.js"></script><link href="./static/css/main.7a040865.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div class="public-loading"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#6b21a8" width="70px"><path d="M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z"/></svg> <span>Loading...</span></div><div id="root"></div></body></html>

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions frontend/dist/static/js/main.62b97fc9.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions frontend/dist/static/js/main.6f5b5049.js

This file was deleted.

4 changes: 2 additions & 2 deletions frontend/src/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
REACT_APP_VERSION=v2.11.8
REACT_APP_RELEASE=f2b6d43c-20240320123501
REACT_APP_VERSION=v2.11.9
REACT_APP_RELEASE=708759a4-20240323123030
2 changes: 1 addition & 1 deletion frontend/src/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"success": {
"title": "{{ station }} Connected",
"content": "Server Uptime: {{ uptime }} seconds\nServer Architecture: {{ arch }}/{{ os }}\nUUID: {{ uuid }}"
"content": "Uptime: {{ uptime }} s\nFree disk: {{ disk }}%\nArchitecture: {{ arch }}/{{ os }}"
},
"error": {
"title": "Connection Failed",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"success": {
"title": "{{ station }} 已连接",
"content": "服务器在线时长 {{ uptime }} 秒\n服务器采用架构 {{ arch }}/{{ os }}\nUUID {{ uuid }}"
"content": "服务器在线 {{ uptime }} 秒\n磁盘剩余容量 {{ disk }}%\n服务器架构 {{ arch }}/{{ os }}"
},
"error": {
"title": "连接失败",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/src/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"success": {
"title": "{{ station }} 已連線",
"content": "伺服器在線時長 {{ uptime }} 秒\n伺服器採用架構 {{ arch }}/{{ os }}\nUUID {{ uuid }}"
"content": "在線時長 {{ uptime }} 秒\n硬碟可用空間 {{ disk }}%\n伺服器架構 {{ arch }}/{{ os }}"
},
"error": {
"title": "連線失敗",
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/src/views/Home/handleSetBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { StationUpdates } from "./getStationUpdates";
export const handleSetBanner = (
res: StationUpdates,
stateFn: Dispatch<
SetStateAction<BannerProps & { values?: Record<string, string> }>
SetStateAction<BannerProps & { values?: Record<string, string>; }>
>
) => {
if (!res?.data) {
Expand All @@ -16,9 +16,10 @@ export const handleSetBanner = (
});
return;
}
const { station, uptime, os } = res.data;
const { station, uptime, os, disk } = res.data;
const { uuid, name } = station;
const { arch, distro } = os;
const { percent } = disk;
stateFn({
title: "views.home.banner.success.title",
content: "views.home.banner.success.content",
Expand All @@ -29,6 +30,7 @@ export const handleSetBanner = (
os: distro,
uuid,
arch,
disk: (100 - percent).toFixed(2),
},
});
};

0 comments on commit 67a28d4

Please sign in to comment.