Removing csp console error (#2963)

* Removing csp console error

* Fixed activity page console error as well
This commit is contained in:
Alex Janousek
2025-10-01 19:50:35 -04:00
committed by GitHub
parent ce6eddd4e3
commit a4e1cc0d38
7 changed files with 78 additions and 39 deletions

View File

@@ -130,7 +130,9 @@
}
loadNotificationsTable() {
const url = `${window.location.href.split('?')[0]}?_=${Date.now()}`;
const url = `/services/${this.serviceId}/jobs/${this.jobId}/notifications-table`;
console.debug('Loading notifications table from:', url);
fetch(url, {
headers: {
@@ -138,20 +140,28 @@
'Pragma': 'no-cache'
}
})
.then(response => response.text())
.then(response => {
console.debug('Notifications table response status:', response.status);
if (response.status === 204) {
// No content yet, job still processing
console.debug('Job still processing, no notifications yet');
return null;
}
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
return response.text();
})
.then(html => {
const parser = new DOMParser();
const doc = parser.parseFromString(html, 'text/html');
const notificationsTable = doc.querySelector('.job-status-table');
if (!html) return;
if (notificationsTable) {
const insertPoint = document.querySelector('.notification-status');
if (insertPoint) {
insertPoint.insertAdjacentElement('afterend', notificationsTable);
} else {
window.location.reload();
}
console.debug('Received HTML length:', html.length);
const insertPoint = document.querySelector('[data-key="notifications"]');
if (insertPoint) {
console.debug('Inserting notifications table');
insertPoint.innerHTML = html;
} else {
console.error('Could not find [data-key="notifications"], reloading page');
window.location.reload();
}
})