mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-21 01:39:56 +00:00
Add support of changes generation. Changes will be generated (unless explicitly asked not to) automatically during check process (i.e. `repo-update --dry-run` and aliases) and uploaded to the remote server. Changes can be reviewed either by web interface or by special subcommands. Changes will be automatically cleared during next successful build
98 lines
5.5 KiB
Django/Jinja
98 lines
5.5 KiB
Django/Jinja
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js" integrity="sha384-1H217gwSVyLSIfaLxHbE7dRb3v4mYCKbpQvzx0cegeju1MVsGrX5xXxAvs/HgeFs" crossorigin="anonymous" type="application/javascript"></script>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/moment@2.29.4/moment.min.js" integrity="sha384-8hHkOkbWN1TLWwet/jpbJ0zbx3FJDeYJgQ8dX1mRrv/vfCfHCqFSFZYCgaMML3z9" crossorigin="anonymous" type="application/javascript"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/daterangepicker@3.1.0/daterangepicker.min.js" integrity="sha384-u4eJN1VWrTf/FnYYQJo2kqJyVxEQf5UmWY4iUcNAoLenOEtEuCkfwc5bKvZOWBi5" crossorigin="anonymous" type="application/javascript"></script>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/tableexport.jquery.plugin@1.28.0/tableExport.min.js" integrity="sha384-1Rz4Kz/y1rSWw+ZsjTcxB684XgofbO8iizY+UFIzCwFeQ+QUyhBNWBMh/STOyomI" crossorigin="anonymous" type="application/javascript"></script>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/jquery-resizable-columns@0.2.3/dist/jquery.resizableColumns.min.js" integrity="sha384-IazMVNyYoUNx6357fWJoqtHYUWWCNHIXxFVtbpVgvImQNWuRP2WbHPaIb3QF8j97" crossorigin="anonymous" type="application/javascript"></script>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous" type="application/javascript"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous" type="application/javascript"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap-table@1.22.1/dist/bootstrap-table.min.js" integrity="sha384-GVLHfbEvuGA/RFiQ3MK2ClEJkWYJXABg55t9LpoDPZFGIsSq8xhFlQydm5poV2jW" crossorigin="anonymous" type="application/javascript"></script>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap-table@1.22.1/dist/extensions/export/bootstrap-table-export.min.js" integrity="sha384-g9OAB1Moamcy8+l1Q/tajHlMf6NTkS79ehKLTYbA80aQRbRhFCjrSuezv+FE2Kwe" crossorigin="anonymous" type="application/javascript"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap-table@1.22.1/dist/extensions/resizable/bootstrap-table-resizable.js" integrity="sha384-wd8Vc6Febikdnsnk9vthRWRvMwffw246vhqiqNO3aSNe1maTEA07Vh3zAQiSyDji" crossorigin="anonymous" type="application/javascript"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap-table@1.22.1/dist/extensions/filter-control/bootstrap-table-filter-control.js" integrity="sha384-NIqcjpr/3eZI1iNzz7hgT5rgp70qFUzkZffeCgVva9gi80B5vqcm7gn+8QvlWxko" crossorigin="anonymous" type="application/javascript"></script>
|
|
|
|
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js" integrity="sha384-F/bZzf7p3Joyp5psL90p/p89AZJsndkSoGwRpXcZhleCWhd8SnRuoYo4d0yirjJp" crossorigin="anonymous" type="application/javascript"></script>
|
|
|
|
<script>
|
|
async function copyToClipboard(text, button) {
|
|
if (navigator.clipboard === undefined) {
|
|
const input = document.createElement("textarea");
|
|
input.innerHTML = text;
|
|
document.body.appendChild(input);
|
|
input.select();
|
|
document.execCommand("copy");
|
|
document.body.removeChild(input);
|
|
} else {
|
|
await navigator.clipboard.writeText(text);
|
|
}
|
|
|
|
button.html("<i class=\"bi bi-clipboard-check\"></i> copied");
|
|
setTimeout(()=> {
|
|
button.html("<i class=\"bi bi-clipboard\"></i> copy");
|
|
}, 2000);
|
|
}
|
|
|
|
function extractDataList(data, column) {
|
|
const elements = data.flatMap(row => row[column].split("<br>")).filter(v => v); // remove empty elements from array
|
|
return Array.from(new Set(elements)).sort();
|
|
}
|
|
|
|
function extractListProperties(description, property) {
|
|
return Object.values(description.packages)
|
|
.map(pkg => pkg[property])
|
|
.reduce((left, right) => left.concat(right), []);
|
|
}
|
|
|
|
function filterContains(text, value) {
|
|
return value.includes(text.toLowerCase().trim());
|
|
}
|
|
|
|
function filterDateRange(text, value) {
|
|
const asOfStartOfDay = date => date.setUTCHours(0, 0, 0, 0);
|
|
|
|
const [minDate, maxDate] = text.split(" - ");
|
|
const buildDate = asOfStartOfDay(new Date(value));
|
|
|
|
return (buildDate >= new Date(minDate)) && (buildDate <= new Date(maxDate));
|
|
}
|
|
|
|
function filterList(index, value, field, data) {
|
|
const dataList = extractDataList(data, field);
|
|
// the library removes all symbols from string, so it is just string
|
|
return value.includes(dataList[index].toLowerCase());
|
|
}
|
|
|
|
function listToTable(data) {
|
|
return Array.from(new Set(data))
|
|
.sort()
|
|
.map(entry => safe(entry))
|
|
.join("<br>");
|
|
}
|
|
|
|
function safe(string) {
|
|
return String(string)
|
|
.replace(/&/g, "&")
|
|
.replace(/</g, "<")
|
|
.replace(/>/g, ">")
|
|
.replace(/"/g, """);
|
|
}
|
|
|
|
// because I'm tired of safe element generation
|
|
function safeLink(url, text, title) {
|
|
const element = document.createElement("a");
|
|
element.href = url;
|
|
element.innerText = text;
|
|
if (title) element.title = title;
|
|
return element;
|
|
}
|
|
|
|
Date.prototype.toISOStringShort = function() {
|
|
const pad = number => String(number).padStart(2, "0");
|
|
return `${this.getFullYear()}-${pad(this.getMonth() + 1)}-${pad(this.getDate())} ${pad(this.getHours())}:${pad(this.getMinutes())}:${pad(this.getSeconds())}`;
|
|
}
|
|
</script>
|