Skip to content

Commit

Permalink
fix(management): fix uptime not being able to extend past 24h
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenclaw900 committed Oct 31, 2021
1 parent 11dda26 commit d3e45d1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
Binary file not shown.
Binary file modified src/frontend/.yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"dependencies": {
"autosize": "^5.0.1",
"chart.js": "^3.6.0",
"humanize-duration": "^3.27.0",
"microlight": "^0.0.7",
"xterm": "^4.14.1",
"xterm-addon-attach": "^0.6.0",
Expand Down
6 changes: 4 additions & 2 deletions src/frontend/src/pages/Management.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import Card from "../components/Card.svelte";
import humanizeDuration from "humanize-duration";
export let socket;
export let socketData;
Expand All @@ -9,7 +10,8 @@
let msg = "";
$: socketData.uptime &&
((uptime = new Date(socketData.uptime * 1000)), (dialog = false));
((uptime = humanizeDuration(socketData.uptime * 1000)),
(dialog = false));
function sendData(data) {
socket.send(JSON.stringify({ cmd: data }));
Expand Down Expand Up @@ -64,7 +66,7 @@
class="even:bg-white odd:bg-gray-200 dark:even:bg-black dark:odd:bg-gray-800"
>
<td class="p-1 font-semibold">Uptime:</td>
<td class="p-1">{uptime.toISOString().substr(11, 8)}</td>
<td class="p-1">{uptime}</td>
</tr>
<tr
class="even:bg-white odd:bg-gray-200 dark:even:bg-black dark:odd:bg-gray-800"
Expand Down
8 changes: 8 additions & 0 deletions src/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ __metadata:
"@tsconfig/svelte": ^2.0.1
autosize: ^5.0.1
chart.js: ^3.6.0
humanize-duration: ^3.27.0
microlight: ^0.0.7
svelte: ^3.37.0
svelte-check: ^2.1.0
Expand Down Expand Up @@ -917,6 +918,13 @@ fsevents@~2.3.2:
languageName: node
linkType: hard

"humanize-duration@npm:^3.27.0":
version: 3.27.0
resolution: "humanize-duration@npm:3.27.0"
checksum: db34111b391056bd0da8d6a3cc965ee52c2de497892c85f16d5559529232924dfabd8f3c4210135fbd12d0cea7da34dade05accc14ef69f2cba758ff4b4bbd3d
languageName: node
linkType: hard

"humanize-ms@npm:^1.2.1":
version: 1.2.1
resolution: "humanize-ms@npm:1.2.1"
Expand Down

0 comments on commit d3e45d1

Please sign in to comment.