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

48
assets/app.templates.js Normal file
View file

@ -0,0 +1,48 @@
var App = Vue.createApp({
data() {
return {
templateList: [],
templateIndex: null
}
},
methods: {
EditTemplate(templateIndex)
{
document.location.href = `/template/${this.templateList[templateIndex].id}`;
},
async CreateTemplate()
{
await LabelApi.POST('medium', {
name: "new template",
width: 10,
height: 10
});
await GetTemplateList();
},
async DeleteTemplate(templateIndex, finaly = false)
{
if (finaly) {
$('#DeleteTemplateModal').modal('hide');
await LabelApi.DELETE('template', {
templateId: this.templateList[templateIndex].id
});
this.templateIndex = null;
await GetTemplateList();
} else {
this.templateIndex = templateIndex;
$('#DeleteTemplateModal').modal('show');
}
}
}
}).mount('main');
async function GetTemplateList() {
let templateList = await LabelApi.GET(`templates`);
App.templateList = templateList;
console.log(templateList);
}
GetTemplateList();