chore: remove old code
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 17s
Python / lint-format (pull_request) Successful in 31s
Python / test (pull_request) Successful in 39s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m31s
C++ / build (pull_request) Successful in 2m17s
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 17s
Python / lint-format (pull_request) Successful in 31s
Python / test (pull_request) Successful in 39s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m31s
C++ / build (pull_request) Successful in 2m17s
This commit is contained in:
@@ -10,62 +10,21 @@ Singleton {
|
|||||||
property bool active: false
|
property bool active: false
|
||||||
readonly property list<NetworkDevice> devices: Networking.devices.values
|
readonly property list<NetworkDevice> devices: Networking.devices.values
|
||||||
readonly property list<Network> knownNetworks: networks.filter(n => n.known)
|
readonly property list<Network> knownNetworks: networks.filter(n => n.known)
|
||||||
|
|
||||||
// Original code
|
|
||||||
|
|
||||||
readonly property list<NetworkDevice> netDevice: Networking.devices.values
|
|
||||||
readonly property string networkName: getNetworkName()
|
|
||||||
readonly property list<Network> networks: {
|
readonly property list<Network> networks: {
|
||||||
const list = [];
|
const list = [];
|
||||||
for (const d of wifiDevices)
|
for (const d of wifiDevices)
|
||||||
list.push(...d.networks.values);
|
list.push(...d.networks.values);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
readonly property list<string> nicNames: networkInterfaceCardNames()
|
|
||||||
property bool scanning: false
|
property bool scanning: false
|
||||||
readonly property list<Network> unknownNetworks: networks.filter(n => !n.known)
|
readonly property list<Network> unknownNetworks: networks.filter(n => !n.known)
|
||||||
readonly property list<WifiDevice> wifiDevices: devices.filter(d => wifiDevice(d))
|
readonly property list<WifiDevice> wifiDevices: devices.filter(d => wifiDevice(d))
|
||||||
readonly property bool wifiEnabled: Networking.wifiEnabled
|
readonly property bool wifiEnabled: Networking.wifiEnabled
|
||||||
|
|
||||||
// Useless will prob remove
|
|
||||||
function getConnectedDevices() {
|
|
||||||
let connectedDevices = [];
|
|
||||||
|
|
||||||
for (var i = 0; i < netDevice.length; i++) {
|
|
||||||
if (netDevice[i].connected === true) {
|
|
||||||
connectedDevices.push(netDevice[i].name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return connectedDevices;
|
|
||||||
}
|
|
||||||
|
|
||||||
// SHOULD retrieve network names of connected devices
|
|
||||||
// Currently only gives connected nic name
|
|
||||||
function getNetworkName() {
|
|
||||||
const devices = netDevice.filter(device => device.connected === true);
|
|
||||||
for (var i = 0; i < devices.length; i++) {
|
|
||||||
return devices[i].name;
|
|
||||||
}
|
|
||||||
return "Failed network name";
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
function isSecure(security): bool {
|
function isSecure(security): bool {
|
||||||
return (security === WifiSecurityType.WpaPsk || security === WifiSecurityType.Wpa2Psk || security === WifiSecurityType.Sae);
|
return (security === WifiSecurityType.WpaPsk || security === WifiSecurityType.Wpa2Psk || security === WifiSecurityType.Sae);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Searches wired/wireless devices and sets them in a list
|
|
||||||
function networkInterfaceCardNames() {
|
|
||||||
let nicList = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < netDevice.length; ++i) {
|
|
||||||
nicList.push(netDevice[i].name);
|
|
||||||
}
|
|
||||||
|
|
||||||
return nicList;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setScan(value: bool): void {
|
function setScan(value: bool): void {
|
||||||
for (const d of wifiDevices) {
|
for (const d of wifiDevices) {
|
||||||
d.scannerEnabled = value;
|
d.scannerEnabled = value;
|
||||||
|
|||||||
Reference in New Issue
Block a user