mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Add 'download unknown' link to the unknown IPs page.
This commit is contained in:
@@ -53,6 +53,7 @@ fn rocket() -> _ {
|
||||
unknown_devices::all_unknown_devices,
|
||||
unknown_devices::unknown_devices_count,
|
||||
unknown_devices::unknown_devices_range,
|
||||
unknown_devices::unknown_devices_csv,
|
||||
queue_info::raw_queue_by_circuit,
|
||||
queue_info::run_btest,
|
||||
queue_info::circuit_info,
|
||||
|
||||
@@ -22,3 +22,14 @@ pub fn unknown_devices_range(
|
||||
let result: Vec<IpStats> = reader.iter().skip(start).take(end).cloned().collect();
|
||||
NoCache::new(Json(result))
|
||||
}
|
||||
|
||||
#[get("/api/unknown_devices_csv")]
|
||||
pub fn unknown_devices_csv(_auth: AuthGuard) -> NoCache<String> {
|
||||
let mut result = String::new();
|
||||
let reader = UNKNOWN_DEVICES.read();
|
||||
|
||||
for unknown in reader.iter() {
|
||||
result += &format!("{}\n", unknown.ip_address);
|
||||
}
|
||||
NoCache::new(result)
|
||||
}
|
||||
@@ -56,6 +56,8 @@
|
||||
<div class="card-body">
|
||||
<h5 class="card-title"><i class="fa fa-address-card"></i> Unmapped IP Addresses (Most recently seen first)</h5>
|
||||
|
||||
<a id="btnDownloadCsv" class="btn btn-info"><i class="fa fa-download"></i> Download Text File of Unknown IP addresses.</a>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<th>IP</th>
|
||||
@@ -115,6 +117,9 @@
|
||||
console.log(devices);
|
||||
fillDeviceTable(devices);
|
||||
});
|
||||
$("#btnDownloadCsv").on('click', () => {
|
||||
window.location.href = "/api/unknown_devices_csv";
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(start);
|
||||
|
||||
Reference in New Issue
Block a user