"feat: Implement debug fix in static files

This commit is contained in:
2025-05-29 20:17:53 +02:00
parent b078eefb4d
commit ff83dd186d
5 changed files with 631 additions and 1 deletions

View File

@@ -641,6 +641,80 @@
paginationEl.innerHTML = paginationHTML;
}
/**
* Neuen Job erstellen
*/
async createNewJob(formData) {
try {
console.log('📝 Erstelle neuen Job...');
const response = await fetch('/api/jobs', {
method: 'POST',
headers: {
'X-CSRFToken': this.getCSRFToken()
},
body: formData
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
const result = await response.json();
this.showToast('Job erfolgreich erstellt', 'success');
// Jobs neu laden
await this.loadJobs();
// Formular zurücksetzen
const form = document.getElementById('new-job-form');
if (form) {
form.reset();
}
return result;
} catch (error) {
console.error('❌ Fehler beim Erstellen des Jobs:', error);
this.showToast('Fehler beim Erstellen des Jobs', 'error');
throw error;
}
}
/**
* Job aktualisieren
*/
async updateJob(jobId, formData) {
try {
console.log(`📝 Aktualisiere Job ${jobId}...`);
const response = await fetch(`/api/jobs/${jobId}`, {
method: 'PUT',
headers: {
'X-CSRFToken': this.getCSRFToken()
},
body: formData
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
const result = await response.json();
this.showToast('Job erfolgreich aktualisiert', 'success');
// Jobs neu laden
await this.loadJobs();
return result;
} catch (error) {
console.error('❌ Fehler beim Aktualisieren des Jobs:', error);
this.showToast('Fehler beim Aktualisieren des Jobs', 'error');
throw error;
}
}
}
// JobManager global verfügbar machen