整理文件夹及架构,加入打印机页面,octo反代有问题

This commit is contained in:
2026-04-14 00:11:00 +08:00
parent 1de35f21d7
commit 570af7c225
54 changed files with 939 additions and 292 deletions

View File

@@ -84,8 +84,13 @@
<script>
function sendCmd(cmd) {
if(cmd === 'cancel' && !confirm("{{ _('Are you sure you want to cancel the print?') }}")) return;
if(cmd === 'cancel') {
window.customConfirm("{{ _('Are you sure you want to cancel the print?') }}", () => doSendCmd(cmd));
} else {
doSendCmd(cmd);
}
}
function doSendCmd(cmd) {
fetch('{{ url_for("printer.api_command") }}', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
@@ -96,7 +101,7 @@ function sendCmd(cmd) {
if(data.success) {
window.location.reload();
} else {
alert("Error: " + data.error);
window.customAlert("Error: " + data.error);
}
});
}