Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'days since last Hubris bug' to website subfolder #1918

Merged
merged 1 commit into from
Nov 15, 2024
Merged
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
118 changes: 118 additions & 0 deletions website/bugs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Days since the last Hubris kernel bug</title>
<link rel="preload" href="https://oxide.computer/fonts/NeueHaasGrotDisp-Roman.woff2" as="font" type="font/woff2" crossorigin="true">
<link rel="stylesheet" href="/style.css">
<style>
td {
padding: 5px;
}
td.delta {
color: #7e8385;
}
td.bar {
position: relative;
}
/* Vertical line */
td.bar::before {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 7%;
width: 2px;
height: 10px;
background-color: #7e8385;
}
p#days {
font-size: 4.5rem;
line-height: 1.05;
letter-spacing: 0.02em;
font-weight: 300;
margin: 0px;
color: #F5B944;
}

hr {
border: 1px solid #2D3335;
}
</style>
</head>

<body>

<p>It has been</p>
<p id="days"></p>
<p>since the last Hubris kernel bug:</p>
<table id="bugs"></table>
<hr>
<p><a href="/">Back</a></p>

<script>
const bugs = [
["issues/1876", "2024-09-20T13:54Z", "Stack scribbling does not work for tasks with pow2 stack"],
["issues/1672", "2024-04-20T18:41Z", "Leases cannot span MPU regions"],
["issues/1193", "2023-03-08T17:41Z", "Hard fault during MPU configuration"],
["issues/1134", "2023-02-08T17:31Z", "Stack overflow on SVC entry performs SVC from the wrong task"],
["issues/1017", "2022-12-22T14:58Z", "Off-by-one in ARMv8 MPU RLAR programming"],
["pull/569/commits/023e4eaa0", "2022-05-25T17:57Z", "Incorrect task pointer in context saving sequence"],
["issues/367", "2022-01-18T12:51Z", "Can't use IRQ #0 on ARMv7M"],
]
const prefix = "https://github.com/oxidecomputer/hubris"

let now = new Date();
let days = document.getElementById("days");
function update() {
const dt = daysBetween(new Date(), new Date(bugs[0][1]));
const p = document.getElementById("days");
p.innerHTML = `${dt} days`
setTimeout(update, 60 * 1000);
}
update();

// Function to calculate the difference in days between two dates
function daysBetween(date1, date2) {
const oneDay = 1000 * 60 * 60 * 24;
const diffInTime = new Date(date1) - new Date(date2);
return Math.round(diffInTime / oneDay);
}

const bugsContainer = document.getElementById("bugs");
const barElement = document.createElement("tr");
barElement.innerHTML = `<td><td class="bar">`

// Loop through the bugs array and add each bug and the days between to the div
for (let i = 0; i < bugs.length; i++) {
const bugLink = bugs[i][0];
const bugDate = bugs[i][1];
const bugDesc = bugs[i][2];
let daysSinceLastBug = "";

// Calculate days between this bug and the previous one, if applicable
if (i > 0) {
const deltaElement = document.createElement("tr");
const previousBugDate = bugs[i - 1][1];
const daysDiff = daysBetween(previousBugDate, bugDate);
deltaElement.innerHTML = `<td><td class="delta">${daysDiff} days`;

bugsContainer.appendChild(barElement.cloneNode(true));
bugsContainer.appendChild(deltaElement);
bugsContainer.appendChild(barElement.cloneNode(true));
}

const etcElement = document.createElement("tr");
etcElement.innerHTML = `<td>${new Date(bugDate).toLocaleDateString()}<td><a href="https://github.com/oxidecomputer/hubris/${bugLink}">${bugDesc}</a>`
bugsContainer.appendChild(etcElement);
}

bugsContainer.appendChild(barElement);
const bugElement = document.createElement("tr");
bugElement.innerHTML = `<td><td class="delta">...and so on`;
bugsContainer.appendChild(bugElement);

</script>

</body>
</html>
43 changes: 2 additions & 41 deletions website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,7 @@
<meta charset="utf-8">
<title>Hubris</title>
<link rel="preload" href="https://oxide.computer/fonts/NeueHaasGrotDisp-Roman.woff2" as="font" type="font/woff2" crossorigin="true">

<style>
@font-face {
font-family: "Neue Haas Grotesk Display";
src: url("https://oxide.computer/fonts/NeueHaasGrotDisp-Roman.woff2");
}
body {
font-family: Neue Haas Grotesk Display, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
background-color: #0b1418;
color: #FFFFFF;
font-size: 1.1rem;
line-height: 1.4;
letter-spacing: 0.03em;
font-weight: 400;

max-width: 1080px;
margin: 0 auto !important;
float: none !important;
}
.green {
color: #48D597;
}
.yellow {
color: #F5CF65;
}
h1 {
font-size: 4.5rem;
line-height: 1.05;
letter-spacing: 0.02em;
font-weight: 300;
}
h2 {
font-size: 1.6rem;
line-height: 1.3;
letter-spacing: 0.03em;
font-weight: 300;
}
a {
color: #48D597;
}
</style>
<link rel="stylesheet" href="/style.css">
</head>

<body>
Expand All @@ -69,6 +29,7 @@ <h2 class="yellow">A small open-source operating system for deeply-embedded comp
<ul><a href="https://github.com/oxidecomputer/hubris">Hubris source code</a></ul>
<ul><a href="reference/">Hubris reference documentation</a></ul>
<ul><a href="https://github.com/oxidecomputer/humility">Humility source code</a></ul>
<ul><a href="bugs/">Days since the last kernel bug</a></ul>
</p>
</body>
</html>
38 changes: 38 additions & 0 deletions website/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@font-face {
font-family: "Neue Haas Grotesk Display";
src: url("https://oxide.computer/fonts/NeueHaasGrotDisp-Roman.woff2");
}
body {
font-family: Neue Haas Grotesk Display, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
background-color: #0b1418;
color: #E7E7E8;
font-size: 1.1rem;
line-height: 1.4;
letter-spacing: 0.03em;
font-weight: 400;

max-width: 1080px;
margin: 0 auto !important;
float: none !important;
}
.green {
color: #48D597;
}
.yellow {
color: #F5CF65;
}
h1 {
font-size: 4.5rem;
line-height: 1.05;
letter-spacing: 0.02em;
font-weight: 300;
}
h2 {
font-size: 1.6rem;
line-height: 1.3;
letter-spacing: 0.03em;
font-weight: 300;
}
a {
color: #48D597;
}