Skip to content

Commit ba310e8

Browse files
authored
Add deployment and Slack status widgets
Added custom API widgets for deployment and Slack status.
1 parent d04f0d8 commit ba310e8

File tree

1 file changed

+103
-1
lines changed

1 file changed

+103
-1
lines changed

cortado/apps/misc/glance.yaml

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,106 @@ spec:
171171
- url: https://mcorbin.fr/feed.xml
172172
- url: https://arthi-chaud.github.io/feed.xml
173173
- url: https://ersei.net/en/blog.atom
174-
174+
- name: RSS
175+
columns:
176+
- size: small
177+
widgets:
178+
- type: custom-api
179+
hide-header: true
180+
title: Should I deploy today
181+
cache: 1h
182+
url: https://shouldideploy.today/api?tz=Europe%2FParis
183+
method: GET
184+
template: |
185+
<div class="deploy-card {{ if .JSON.Bool "shouldideploy" }}deploy-yes{{ else }}deploy-no{{ end }}">
186+
<style>
187+
.deploy-card {
188+
width: 100%;
189+
max-width: unset;
190+
margin: 0;
191+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
192+
transition: transform 0.2s ease, box-shadow 0.2s ease;
193+
border-radius: 12px;
194+
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
195+
padding: 24px 20px 18px 20px;
196+
text-align: left;
197+
}
198+
.deploy-card.deploy-yes {
199+
background: #9FC87E;
200+
}
201+
.deploy-card.deploy-no {
202+
background: #FF3F33;
203+
}
204+
.deploy-card h1 {
205+
font-size: 24px;
206+
margin: 0 0 16px;
207+
line-height: 1.3;
208+
color: #FFE6E1;
209+
}
210+
.deploy-message {
211+
font-size: 20px;
212+
font-weight: 600;
213+
margin: 12px 0 8px 0;
214+
color: #232634;
215+
}
216+
.deploy-date {
217+
font-size: 14px;
218+
color: #232634;
219+
margin-bottom: 4px;
220+
}
221+
.deploy-tz {
222+
font-size: 13px;
223+
color: #075B5E;
224+
}
225+
@media (max-width: 600px) {
226+
.deploy-card {
227+
padding: 16px;
228+
}
229+
.deploy-card h1 {
230+
font-size: 20px;
231+
}
232+
.deploy-message {
233+
font-size: 16px;
234+
}
235+
}
236+
</style>
237+
<h1>Should I deploy today?</h1>
238+
<div class="deploy-message">{{ .JSON.String "message" }}</div>
239+
<div class="deploy-tz">Timezone: {{ .JSON.String "timezone" }}</div>
240+
</div>
241+
- type: custom-api
242+
title: Slack Status
243+
cache: 1m
244+
url: https://slack-status.com/api/v2.0.0/current
245+
template: |
246+
<div class="flex items-center gap-15">
247+
<svg class="monitor-site-icon flat-icon" alt="Slack Logo" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg>
248+
<div class="grow min-width-0">
249+
<a class="size-h3 color-highlight text-truncate block" href="https://slack-status.com/" target="_blank" rel="noreferrer" title="Slack Status">Slack</a>
250+
<ul class="list-horizontal-text">
251+
{{ if eq (.JSON.String "status") "ok" }}
252+
<ul class="list-horizontal-text">
253+
<li>OK</li>
254+
<li title="Time since last outage" {{ .JSON.String "date_updated" | parseTime "rfc3339" | toRelativeTime }}></li>
255+
</ul>
256+
{{ else }}
257+
<ul class="list-horizontal-text">
258+
<li class="color-negative">OUTAGE</li>
259+
<li title="Time outage was last updated" {{ .JSON.String "date_updated" | parseTime "rfc3339" | toRelativeTime }}></li>
260+
</ul>
261+
{{ end }}
262+
</ul>
263+
</div>
264+
265+
<div class="monitor-site-status-icon">
266+
{{ if eq (.JSON.String "status") "ok" }}
267+
<svg fill="var(--color-positive)" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
268+
<path fill-rule="evenodd" d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z" clip-rule="evenodd" />
269+
</svg>
270+
{{ else }}
271+
<svg fill="var(--color-negative)" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
272+
<path fill-rule="evenodd" d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" clip-rule="evenodd"></path>
273+
</svg>
274+
{{ end }}
275+
</div>
276+
</div>

0 commit comments

Comments
 (0)