mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-03 09:05:49 +00:00
Compare commits
1 Commits
feature/co
...
master
Author | SHA1 | Date | |
---|---|---|---|
6abe35ef8c |
@ -266,7 +266,7 @@
|
|||||||
|
|
||||||
table.on("check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table", _ => {
|
table.on("check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table", _ => {
|
||||||
if (packageRemoveButton) {
|
if (packageRemoveButton) {
|
||||||
packageRemoveButton.disabled = !getSelection().length;
|
packageRemoveButton.disabled = !table.bootstrapTable("getSelections").length;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
table.on("click-row.bs.table", (self, data, row, cell) => {
|
table.on("click-row.bs.table", (self, data, row, cell) => {
|
||||||
|
@ -19,8 +19,6 @@
|
|||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.4/dist/chart.umd.min.js" crossorigin="anonymous" type="application/javascript"></script>
|
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.4/dist/chart.umd.min.js" crossorigin="anonymous" type="application/javascript"></script>
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/js-cookie@3.0.5/dist/js.cookie.min.js" crossorigin="anonymous" type="application/javascript"></script>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
async function copyToClipboard(text, button) {
|
async function copyToClipboard(text, button) {
|
||||||
await navigator.clipboard.writeText(text);
|
await navigator.clipboard.writeText(text);
|
||||||
@ -146,7 +144,6 @@
|
|||||||
interval = intervalSelector.querySelector(".active")?.dataset?.interval; // find active element
|
interval = intervalSelector.querySelector(".active")?.dataset?.interval; // find active element
|
||||||
}
|
}
|
||||||
|
|
||||||
let intervalId = null;
|
|
||||||
if (interval) {
|
if (interval) {
|
||||||
if (toggle.checked) {
|
if (toggle.checked) {
|
||||||
// refresh UI
|
// refresh UI
|
||||||
@ -155,15 +152,13 @@
|
|||||||
});
|
});
|
||||||
intervalSelector.querySelector(`a[data-interval="${interval}"]`)?.classList?.add("active");
|
intervalSelector.querySelector(`a[data-interval="${interval}"]`)?.classList?.add("active");
|
||||||
// finally create timer task
|
// finally create timer task
|
||||||
intervalId = setInterval(callback, interval);
|
return setInterval(callback, interval);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
toggle.checked = false; // no active interval found, disable toggle
|
toggle.checked = false; // no active interval found, disable toggle
|
||||||
}
|
}
|
||||||
|
|
||||||
Cookies.set(`ahriman-${toggle.id}-refresh-enabled`, toggle.checked);
|
return null; // return null to assign to keep method sane
|
||||||
Cookies.set(`ahriman-${toggle.id}-refresh-interval`, interval);
|
|
||||||
return intervalId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Date.prototype.toISOStringShort = function() {
|
Date.prototype.toISOStringShort = function() {
|
||||||
|
@ -72,8 +72,8 @@ class SyncHttpClient(LazyLogging):
|
|||||||
"""
|
"""
|
||||||
session = requests.Session()
|
session = requests.Session()
|
||||||
python_version = ".".join(map(str, sys.version_info[:3])) # just major.minor.patch
|
python_version = ".".join(map(str, sys.version_info[:3])) # just major.minor.patch
|
||||||
session.headers["User-Agent"] = f"ahriman/{__version__}" \
|
session.headers["User-Agent"] = f"ahriman/{__version__} " \
|
||||||
f"{requests.utils.default_user_agent()}" \
|
f"{requests.utils.default_user_agent()} " \
|
||||||
f"python/{python_version}"
|
f"python/{python_version}"
|
||||||
|
|
||||||
return session
|
return session
|
||||||
|
Reference in New Issue
Block a user