Workorder mph/improve

This commit is contained in:
Luca Haid
2025-12-13 21:27:43 +00:00
parent 1435923200
commit 0755df5408
19 changed files with 658 additions and 122 deletions
+73 -4
View File
@@ -71,6 +71,10 @@ const RadiusRouterManager = {
<i class="fa-duotone fa-sitemap"></i>
<span>Netzwerkstruktur</span>
</button>
<button class="ghost-btn action-btn" @click="openEventLog" :disabled="routerLoading || routerActionLoading || speedtestLoading">
<i class="fa-duotone fa-list-timeline"></i>
<span>Ereignisprotokoll</span>
</button>
</div>
</div>
</div>
@@ -157,6 +161,12 @@ const RadiusRouterManager = {
</div>
</div>
</div>
<div class="mt-4 pt-3" style="border-top: 1px solid var(--border);">
<button class="ghost-btn" @click="runRemoteAccess(true)" :disabled="remoteAccessLoading">
<i class="fa-duotone fa-rotate"></i>
<span>Zugangsdaten neu erstellen</span>
</button>
</div>
</div>
<div v-else class="table-placeholder" style="height: 200px;">Ein Fehler ist aufgetreten.</div>
</tt-dialog>
@@ -173,6 +183,34 @@ const RadiusRouterManager = {
<div v-else class="table-placeholder" style="min-height: 300px;">Keine Daten verfügbar.</div>
</tt-dialog>
<!-- Event Log Modal -->
<tt-dialog :show="showEventLogModal" title="Ereignisprotokoll" @close="showEventLogModal = false" size="wide">
<tt-loading-indicator v-if="eventLogLoading" text="Lade Ereignisprotokoll..." style="min-height: 300px;" />
<div v-else-if="eventLogData && eventLogData.length > 0">
<div class="table-wrap" style="max-height: 500px; overflow-y: auto;">
<table class="tt-table compact">
<thead>
<tr>
<th style="width: 100px;">Datum</th>
<th style="width: 80px;">Uhrzeit</th>
<th style="width: 120px;">Gruppe</th>
<th>Nachricht</th>
</tr>
</thead>
<tbody>
<tr v-for="(event, idx) in eventLogData" :key="idx">
<td class="mono small">{{ event.date }}</td>
<td class="mono small">{{ event.time }}</td>
<td class="small">{{ event.group }}</td>
<td class="small">{{ event.msg }}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div v-else class="table-placeholder" style="min-height: 300px;">Keine Ereignisse verfügbar.</div>
</tt-dialog>
</div>
`,
data: () => ({
@@ -197,7 +235,11 @@ const RadiusRouterManager = {
showNetworkStructureModal: false,
networkStructureLoading: false,
rootDevice: null
rootDevice: null,
showEventLogModal: false,
eventLogLoading: false,
eventLogData: null
}),
watch: {
show: {
@@ -353,20 +395,24 @@ const RadiusRouterManager = {
};
poll();
},
async runRemoteAccess() {
async runRemoteAccess(forceRecreate = false) {
if (!this.routerDevice || !this.routerDevice.deviceId) return;
this.showRemoteAccessModal = true;
this.remoteAccessLoading = true;
this.remoteAccessStep = 'Konfiguriere Zugriff...';
this.remoteAccessStep = forceRecreate ? 'Erstelle neue Zugangsdaten...' : 'Konfiguriere Zugriff...';
this.remoteAccessResult = null;
try {
const { data } = await axios.post(`${window.TT_CONFIG.BASE_PATH}/Radius/genieacsRemoteAccess`, {
deviceId: this.routerDevice.deviceId
deviceId: this.routerDevice.deviceId,
forceRecreate: forceRecreate
});
if (data.success) {
this.remoteAccessResult = data;
if (forceRecreate) {
window.notify('success', 'Neue Zugangsdaten erstellt');
}
} else {
throw new Error(data.message || "Unbekannter Fehler");
}
@@ -396,6 +442,29 @@ const RadiusRouterManager = {
} finally {
this.networkStructureLoading = false;
}
},
async openEventLog() {
if (!this.routerDevice || !this.routerDevice.deviceId) return;
this.showEventLogModal = true;
this.eventLogLoading = true;
this.eventLogData = null;
try {
const { data } = await axios.post(`${window.TT_CONFIG.BASE_PATH}/Radius/genieacsEventLog`, {
deviceId: this.routerDevice.deviceId
});
if (data.success && data.events) {
this.eventLogData = data.events;
} else {
throw new Error(data.message || "Keine Ereignisse gefunden");
}
} catch (error) {
console.error(error);
window.notify('error', error.response?.data?.message || 'Fehler beim Laden des Ereignisprotokolls');
} finally {
this.eventLogLoading = false;
}
}
}
};