device matching via mac instead of ip address
This commit is contained in:
@@ -228,8 +228,10 @@
|
||||
|
||||
/* Router Management Modal */
|
||||
.tt-scope .router-info-header { display: flex; align-items: center; gap: 12px; padding: 20px 24px; margin: -14px -24px 12px -16px; background: linear-gradient(135deg, #e3f0f8 0%, #cce4f5 100%); border-bottom: 2px solid #b8d9f0; }
|
||||
.tt-scope .router-info-header i { font-size: 28px; color: var(--accent); flex-shrink: 0; }
|
||||
.tt-scope .router-info-header > i { font-size: 28px; color: var(--accent); flex-shrink: 0; }
|
||||
.tt-scope .router-header-text { flex-grow: 1; min-height: 39px; }
|
||||
.tt-scope .refresh-btn { padding: 8px; border-radius: 6px; flex-shrink: 0; }
|
||||
.tt-scope .refresh-btn i { font-size: 16px; margin: 0; }
|
||||
.tt-scope .router-title { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: 0.3px; line-height: 1.375; }
|
||||
.tt-scope .router-subtitle { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-top: 2px; line-height: 1.25; }
|
||||
.tt-scope .router-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; margin-right: -8px; }
|
||||
|
||||
@@ -32,6 +32,9 @@ const RadiusRouterManager = {
|
||||
<span v-else>{{ routerDevice.username || userItem.username }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<button class="ghost-btn refresh-btn" @click="refreshDevice" :disabled="routerLoading || refreshLoading" title="Daten aktualisieren">
|
||||
<i class="fa-duotone fa-arrows-rotate" :class="{ 'fa-spin': refreshLoading }"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Router Information Grid -->
|
||||
@@ -40,7 +43,7 @@ const RadiusRouterManager = {
|
||||
<tt-info-card icon="fa-code-branch" label="Software Version" :value="routerDevice?.deviceInfo?.softwareVersion" :loading="routerLoading" />
|
||||
<tt-info-card icon="fa-barcode" label="CWMP Account" :value="routerDevice?.deviceInfo?.serialNumber" :loading="routerLoading" />
|
||||
<tt-info-card icon="fa-fingerprint" label="ACS ID" :value="routerDevice?.deviceId" :loading="routerLoading" />
|
||||
<tt-info-card icon="fa-globe" label="Externe IP" :value="routerDevice?.ip" :loading="routerLoading" />
|
||||
<tt-info-card icon="fa-globe" label="Externe IP" :value="routerDevice?.externalIp" :loading="routerLoading" />
|
||||
<tt-info-card icon="fa-network-wired" label="Management IP" :value="routerDevice?.managementIp" :loading="routerLoading" />
|
||||
</div>
|
||||
|
||||
@@ -239,7 +242,8 @@ const RadiusRouterManager = {
|
||||
|
||||
showEventLogModal: false,
|
||||
eventLogLoading: false,
|
||||
eventLogData: null
|
||||
eventLogData: null,
|
||||
refreshLoading: false
|
||||
}),
|
||||
watch: {
|
||||
show: {
|
||||
@@ -265,18 +269,12 @@ const RadiusRouterManager = {
|
||||
this.speedtestLoading = false;
|
||||
|
||||
try {
|
||||
const { data: radacct } = await axios.get(`${window.TT_CONFIG.BASE_PATH}/Radius/proxyUnsecureHTTPRequestToRadius`, {
|
||||
params: { action2: 'fetchRadacct', username: this.userItem.username }
|
||||
const { data: deviceData } = await axios.get(`${window.TT_CONFIG.BASE_PATH}/Radius/genieacsGetDeviceByMac`, {
|
||||
params: { mac: this.userItem.username }
|
||||
});
|
||||
|
||||
if (radacct?.ip) {
|
||||
const { data: deviceData } = await axios.get(`${window.TT_CONFIG.BASE_PATH}/Radius/genieacsGetDeviceByIp`, {
|
||||
params: { ip: radacct.ip }
|
||||
});
|
||||
|
||||
if (deviceData?.success) {
|
||||
this.routerDevice = deviceData;
|
||||
}
|
||||
if (deviceData?.success) {
|
||||
this.routerDevice = deviceData;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching router:', error);
|
||||
@@ -284,6 +282,25 @@ const RadiusRouterManager = {
|
||||
}
|
||||
this.routerLoading = false;
|
||||
},
|
||||
async refreshDevice() {
|
||||
if (!this.routerDevice?.deviceId) return;
|
||||
this.refreshLoading = true;
|
||||
try {
|
||||
const { data } = await axios.post(`${window.TT_CONFIG.BASE_PATH}/Radius/genieacsRefreshDevice`, {
|
||||
deviceId: this.routerDevice.deviceId
|
||||
});
|
||||
if (data?.success) {
|
||||
this.routerDevice.deviceInfo = data.deviceInfo;
|
||||
this.routerDevice.externalIp = data.externalIp;
|
||||
this.routerDevice.managementIp = data.managementIp;
|
||||
window.notify('success', 'Daten aktualisiert');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error refreshing device:', error);
|
||||
window.notify('error', 'Fehler beim Aktualisieren');
|
||||
}
|
||||
this.refreshLoading = false;
|
||||
},
|
||||
async rebootRouter() {
|
||||
if (!this.routerDevice || !this.routerDevice.deviceId) return;
|
||||
if (!confirm('Möchten Sie den Router wirklich neu starten?')) return;
|
||||
|
||||
Reference in New Issue
Block a user