// Function to calculate similarity percentage between two strings function calculateSimilarity(str1, str2) { // Normalize strings by converting them to lowercase str1 = str1.toLowerCase(); str2 = str2.toLowerCase(); let matchCount = 0; // Check how many characters in str1 exist in str2 for (let char of str1) { if (str2.includes(char)) { matchCount++; } } // Calculate similarity percentage return (matchCount / str1.length) * 100; } function validateData(strasse, plz, stadt, info) { const thresholds = 90; // Similarity threshold in percentage // Validate each field against the info string return !(calculateSimilarity(strasse, info) < thresholds || calculateSimilarity(plz, info) < thresholds || calculateSimilarity(stadt, info) < thresholds); } Vue.component('radius-ont-parser', { template: `
| {{ header.label }} | ONT SN | |||
|---|---|---|---|---|
| {{ row[selectedColumns.kundennummer] }} | {{ row[selectedColumns.anschlussstrasse] }} | {{ row[selectedColumns.anschlussplz] }} | {{ row[selectedColumns.anschlusscity] }} | {{ row.ont_sn }} |
| Kundennummer | Username | Info | Status | Aktionen |
|---|---|---|---|---|
| {{ user.customerNumber }} | {{ user.username }} | {{ user.info }} |
|
|
| Username | Info |
|---|---|
| {{ user.username }} | {{ user.info }} |
| Username | Info |
|---|---|
| {{ user.username }} | {{ user.info }} |
| Status: | {{ radacctData.online ? 'Online' : 'Offline' }} |
|---|---|
| IP: | {{ radacctData.ip }} |
| Username: | {{ radacctData.username }} |
| Customer Number: | {{ radacctData.customerNumber }} |
| Customer Name: | {{ radacctData.customerName }} |
| Info: | {{ radacctData.info }} |
| WLAN Password: | {{ radacctData.wlanPassword }} |
| Bandbreite: | {{ radacctData.actualBandwidth }} |
Bitte laden Sie eine XLSX-Datei hoch, die mindestens eine Spalte mit dem Header 'Serial' für die ONT-Seriennummern enthält. Optional kann eine 'MAC' Spalte für eine alternative Suche verwendet werden.
| {{ header }} | Username | Kundennummer | Kundenname | Info |
|---|---|---|---|---|
| {{ row[header] }} | {{ row.fetched_username }} | {{ row.fetched_customerNumber }} | {{ row.fetched_customerName }} | {{ row.fetched_info }} |