initial upload

This commit is contained in:
Kai Waggeling 2025-05-17 16:23:48 +02:00
parent ac114da487
commit 7c1cfdff51
63 changed files with 6883 additions and 0 deletions

100
assets/app.queues.js Normal file
View file

@ -0,0 +1,100 @@
var App = Vue.createApp({
data() {
return {
queueList: [],
printerList: [],
queueEditor: {
id: null,
name: "",
printerId: null
}
}
},
methods: {
EditQueue(QueueID, ShowModal = true)
{
let QueueData = this.queueList.find((_Queue) => {
return _Queue.id == QueueID;
});
this.queueEditor.id = QueueData.id;
this.queueEditor.name = QueueData.name;
this.queueEditor.printerId = QueueData.printerId;
if (ShowModal) {
$('#QueueSettingsModal').modal('show');
}
},
CreateQueue()
{
this.queueEditor.id = null;
this.queueEditor.name = "";
this.queueEditor.printerId = null;
$('#QueueSettingsModal').modal('show');
},
async SaveQueue()
{
if (this.queueEditor.id == null)
{
await LabelApi.POST('queue', {
name: this.queueEditor.name,
printerId: this.queueEditor.printerId,
});
GetQueueList();
}
else
{
await LabelApi.PUT('queue', {
id: this.queueEditor.id,
name: this.queueEditor.name,
printerId: this.queueEditor.printerId,
});
GetQueueList();
}
$('#QueueSettingsModal').modal('hide');
},
async DeleteQueue(QueueID, Confirm = false)
{
this.EditQueue(QueueID, false);
if (Confirm) {
$('#QueueDeleteModal').modal('hide');
await LabelApi.DELETE('queue', {
id: QueueID
});
GetQueueList();
} else {
$('#QueueDeleteModal').modal('show');
}
},
GetPrinterById(PrinterID) {
if (PrinterID != null) {
return this.printerList.find((Printer) => {
return Printer.id == PrinterID;
}).name;
} else {
return "Kein Drucker";
}
}
}
}).mount('main');
async function GetQueueList() {
let QueueList = await LabelApi.GET('queues');
App.queueList = QueueList;
}
async function GetPrinterList() {
let PrinterList = await LabelApi.GET('printers');
App.printerList = PrinterList;
}
GetPrinterList();
GetQueueList();