Skip to content

Commit

Permalink
Fix bug with missing days
Browse files Browse the repository at this point in the history
  • Loading branch information
starscouts committed Nov 6, 2024
1 parent 305af50 commit 8f3a6d4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .idea/forwardedPorts.xml

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

10 changes: 9 additions & 1 deletion client/src/breakdown.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
function fillBreakdown() {
let breakdownStartDay = new Date(Object.keys(statusData.breakdown)[0]).getTime() / 86400000;
let breakdownEndDay = new Date(Object.keys(statusData.breakdown)[Object.keys(statusData.breakdown).length - 1]).getTime() / 86400000;
let breakdown = [];

for (let i = breakdownStartDay; i <= breakdownEndDay; i++) {
let date = new Date(i * 86400000).toISOString().split("T")[0];
breakdown.push(statusData.breakdown[date] ?? [100, 0, 0, 0]);
}

document.getElementById("sp-app-global-box-text-uptime").innerText = `${(Object.values(statusData['breakdown']).reduce((a, b) => a + b[0], 0) / Object.values(statusData['breakdown']).length).toFixed(3)}% uptime`;
let breakdown = Object.values(window.statusData['breakdown']);

function buildSVG() {
let width = document.getElementById("sp-app-global-box").clientWidth;
Expand Down
2 changes: 1 addition & 1 deletion client/src/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const VERSION = "4.1.0";
const VERSION = "4.1.1";
const URL = "https://d6gd1hq6b89h1s1v.public.blob.vercel-storage.com/public/status.dat";

const CATEGORIES = [
Expand Down
2 changes: 1 addition & 1 deletion statusng/Cargo.lock

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

2 changes: 1 addition & 1 deletion statusng/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "statusng"
version = "4.1.0"
version = "4.1.1"
edition = "2021"

[dependencies]
Expand Down

0 comments on commit 8f3a6d4

Please sign in to comment.