LNVPS is a trading name of Apex Strata Ltd, a company registered in Ireland.
diff --git a/src/pages/layout.tsx b/src/pages/layout.tsx
index 1f70c73..75c6a64 100644
--- a/src/pages/layout.tsx
+++ b/src/pages/layout.tsx
@@ -5,7 +5,7 @@ export default function Layout() {
return (
- LNVPS
+ LNVPS
diff --git a/src/pages/status.tsx b/src/pages/status.tsx
new file mode 100644
index 0000000..aadedd2
--- /dev/null
+++ b/src/pages/status.tsx
@@ -0,0 +1,49 @@
+
+import Markdown from "../components/markdown";
+import Status from "../status.json";
+
+export function StatusPage() {
+ const totalDowntime = Status.events.reduce((acc, v) => {
+ if (v.end_time) {
+ const end = new Date(v.end_time);
+ const start = new Date(v.start_time);
+ const duration = end.getTime() - start.getTime();
+ acc += duration;
+ }
+ return acc;
+ }, 0);
+ const birth = new Date(Status.birth);
+ const now = new Date();
+ const age = now.getTime() - birth.getTime();
+ const uptime = 1 - (totalDowntime / age);
+
+ function formatDuration(n: number) {
+ if (n > 3600) {
+ return `${(n / 3600).toFixed(0)}h ${((n % 3600) / 60).toFixed(0)}m`;
+ } else if (n > 60) {
+ return `${(n % 60).toFixed(0)}m`;
+ } else {
+ return `${n.toFixed(0)}s`;
+ }
+ }
+
+ return
+
Uptime: {(100 * uptime).toFixed(5)}%
+
+
Incidents:
+ {Status.events.map(e => {
+ const end = e.end_time ? new Date(e.end_time) : undefined;
+ const start = new Date(e.start_time);
+ const duration = end ? end.getTime() - start.getTime() : undefined;
+
+ return
+
+
{e.title}
+
{new Date(e.start_time).toLocaleString()}
+
+ {duration &&
Duration: {formatDuration(duration / 1000)}
}
+
+
+ })}
+
+}
\ No newline at end of file
diff --git a/src/pages/terms.tsx b/src/pages/terms.tsx
index a2ea219..de1fee5 100644
--- a/src/pages/terms.tsx
+++ b/src/pages/terms.tsx
@@ -1,5 +1,5 @@
import Markdown from "../components/markdown";
-import TOS from "../../tos.md?raw";
+import TOS from "../tos.md?raw";
export function TosPage() {
return
diff --git a/src/status.json b/src/status.json
new file mode 100644
index 0000000..af1ba8e
--- /dev/null
+++ b/src/status.json
@@ -0,0 +1,11 @@
+{
+ "birth": "2024-06-05T00:00:00Z",
+ "events":[
+ {
+ "start_time": "2025-02-10T05:00:00Z",
+ "end_time": "2025-02-10T10:08:00Z",
+ "title": "VPS outage",
+ "description": "Primary disk full, causing system to halt"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tos.md b/src/tos.md
similarity index 100%
rename from tos.md
rename to src/tos.md