mirror of
https://github.com/kmein/niveum
synced 2026-03-21 20:31:07 +01:00
Compare commits
3 Commits
0ae6397878
...
4b073323da
| Author | SHA1 | Date | |
|---|---|---|---|
| 4b073323da | |||
| bf35fb1020 | |||
| 3fa820a65a |
@@ -6,7 +6,7 @@
|
||||
}: let
|
||||
alacritty-cfg = theme:
|
||||
(pkgs.formats.yaml {}).generate "alacritty.yml" {
|
||||
window.opacity = 0.9;
|
||||
window.opacity = 0.95;
|
||||
font = {
|
||||
normal.family = "Monospace";
|
||||
size = 6;
|
||||
@@ -34,6 +34,7 @@
|
||||
colourPairs = lib.getAttrs colourNames theme;
|
||||
in {
|
||||
primary = {inherit (theme) background foreground;};
|
||||
cursor = {inherit (theme) cursor;};
|
||||
normal = lib.mapAttrs (_: colour: colour.dark) colourPairs;
|
||||
bright = lib.mapAttrs (_: colour: colour.bright) colourPairs;
|
||||
};
|
||||
|
||||
6
flake.lock
generated
6
flake.lock
generated
@@ -158,11 +158,11 @@
|
||||
"retiolum": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1653077783,
|
||||
"narHash": "sha256-GiL82w4BVSZZV5gIQSoEf+KoJaIkUv+29vZmmWlKb6I=",
|
||||
"lastModified": 1653484169,
|
||||
"narHash": "sha256-jb4DUq1+cdyLtvUP4T/B6uw9LaN+zFRdA8ViYv/fEic=",
|
||||
"owner": "krebs",
|
||||
"repo": "retiolum",
|
||||
"rev": "1b5154c3ed9f3cb751afc3e306a1b20e3358ffe5",
|
||||
"rev": "40c6e184cecaae4fe0b4973c6cb8027a66cccaae",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
const newsEndpoint = "http://prism.r:7999";
|
||||
const newsEndpoint = "http://radio-news.r";
|
||||
|
||||
function isoString(date) {
|
||||
return date.toISOString().slice(0, -5) + "Z";
|
||||
@@ -103,15 +103,28 @@
|
||||
request.open("POST", newsEndpoint, false); // synchronous
|
||||
request.send(
|
||||
JSON.stringify({
|
||||
from: isoString(new Date(formData.get("from"))),
|
||||
to: isoString(new Date(formData.get("to"))),
|
||||
from: formData.get("from") + ":00Z",
|
||||
to: formData.get("to") + ":00Z",
|
||||
text: formData.get("text"),
|
||||
})
|
||||
);
|
||||
location.reload();
|
||||
}
|
||||
|
||||
function setDate() {
|
||||
let now = new Date();
|
||||
document.getElementById("time-from").value = now
|
||||
.toISOString()
|
||||
.slice(0, 16);
|
||||
|
||||
now.setHours(now.getHours() + 1);
|
||||
document.getElementById("time-to").value = now
|
||||
.toISOString()
|
||||
.slice(0, 16);
|
||||
}
|
||||
|
||||
window.onload = () => {
|
||||
setDate();
|
||||
setNextNews();
|
||||
fetchNews();
|
||||
};
|
||||
@@ -122,10 +135,10 @@
|
||||
<section>
|
||||
<h1>Submit news</h1>
|
||||
<form onsubmit="sendNews(event)">
|
||||
<label>Start date</label>
|
||||
<input type="datetime-local" name="from" required />
|
||||
<label>End date</label>
|
||||
<input type="datetime-local" name="to" required />
|
||||
<label>Start date (UTC)</label>
|
||||
<input type="datetime-local" id="time-from" name="from" required />
|
||||
<label>End date (UTC)</label>
|
||||
<input type="datetime-local" id="time-to" name="to" required />
|
||||
<label>News text</label>
|
||||
<textarea name="text" rows="10" required></textarea>
|
||||
<input type="submit" />
|
||||
|
||||
@@ -27,7 +27,7 @@ in {
|
||||
${pkgs.git}/bin/git clone ${remote} "$stockholm"
|
||||
${pkgs.git}/bin/git --git-dir "$stockholm"/.git log --pretty='"%s" by %an, %ar.' --since "$(${pkgs.coreutils}/bin/date -I -d "yesterday")" \
|
||||
| ${pkgs.jq}/bin/jq -R '{text: ., from: now | todateiso8601, to: (now + (60 * 60)) | todateiso8601}' \
|
||||
| ${pkgs.curl}/bin/curl -Ssfd @- http://prism.r:7999/
|
||||
| ${pkgs.curl}/bin/curl -Ssfd @- http://radio-news.r/
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user