-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html.grid-missing-detail
More file actions
127 lines (119 loc) · 5.19 KB
/
index.html.grid-missing-detail
File metadata and controls
127 lines (119 loc) · 5.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="10">
<style>
.grid-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 10px;
padding: 20px;
}
.service-box {
padding: 15px;
border-radius: 8px;
color: white;
}
.red { background-color: red; }
.green { background-color: green; }
a { color: white; text-decoration: underline; }
</style>
<script>
document.addEventListener("DOMContentLoaded", function () {
function checkStatus(endpoint, box) {
fetch(endpoint.href)
.then(response => {
if (response.status === 200 || response.status === 529) {
box.classList.add("green");
box.classList.remove("red");
} else {
box.classList.add("red");
box.classList.remove("green");
}
})
.catch(() => {
box.classList.add("red");
box.classList.remove("green");
});
}
function checkGithubWorkflow(endpoint, box) {
fetch(endpoint.href)
.then(response => response.json())
.then(data => {
if (data['workflow_runs'][0]['conclusion'] === 'success') {
box.classList.add("green");
box.classList.remove("red");
} else {
box.classList.add("red");
box.classList.remove("green");
}
})
.catch(() => {
box.classList.add("red");
box.classList.remove("green");
});
}
function checkDiskSpace(endpoint, box) {
fetch(endpoint.href)
.then(response => response.json())
.then(data => {
if (data['free'] >= 5000000000) {
box.classList.add("green");
box.classList.remove("red");
} else {
box.classList.add("red");
box.classList.remove("green");
}
})
.catch(() => {
box.classList.add("red");
box.classList.remove("green");
});
}
document.querySelectorAll(".service-box").forEach(box => {
let endpoint = box.querySelector(".endpoint");
if (endpoint) {
checkStatus(endpoint, box);
}
let githubEndpoint = box.querySelector(".endpoint-github-workflow-badge");
if (githubEndpoint) {
checkGithubWorkflow(githubEndpoint, box);
}
let diskEndpoint = box.querySelector(".endpoint-disk-space");
if (diskEndpoint) {
checkDiskSpace(diskEndpoint, box);
}
});
});
</script>
</head>
<body>
<div class="grid-container">
<div class="service-box red">
<h3>ecw-to-tiff-converter</h3>
<p>Address: <a href="https://ecw-to-tiff-converter.anotherwebservice.com" class="endpoint">https://ecw-to-tiff-converter.anotherwebservice.com</a></p>
<p>Code: <a href="https://github.com/KarmaComputing/ecw-to-tiff-conversion">GitHub Repo</a></p>
</div>
<div class="service-box red">
<h3>balance</h3>
<p>Address: <a href="https://balance.karmacomputing.co.uk/" class="endpoint">https://balance.karmacomputing.co.uk/</a></p>
<p>Code: <a href="https://github.com/KarmaComputing/balance">GitHub Repo</a></p>
</div>
<div class="service-box red">
<h3>Subscribie</h3>
<p>Address: <a href="https://subscribie.co.uk/" class="endpoint">https://subscribie.co.uk/</a></p>
<p>Code: <a href="https://github.com/Subscribie/subscribie">GitHub Repo</a></p>
</div>
<div class="service-box red">
<h3>Container Hosting Service</h3>
<p>Address: <a href="https://container-hosting.anotherwebservice.com/" class="endpoint">https://container-hosting.anotherwebservice.com/</a></p>
<p>Code: <a href="https://github.com/KarmaComputing/container-hosting">GitHub Repo</a></p>
<p>Healthcheck: <a href="https://api.github.com/repos/subscribie/subscribie/actions/workflows/verify-prod-onboarding.yml/runs?per_page=1" class="endpoint-github-workflow-badge">GitHub Workflow</a></p>
</div>
<div class="service-box red">
<h3>Dokku</h3>
<p>Disk Space: <a href="https://dokku.karmacomputing.co.uk/disk_space" class="endpoint-disk-space">Check Status</a></p>
</div>
</div>
</body>
</html>