-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
125 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
let oldFilter = ''; | ||
let bkpArray; | ||
|
||
function filterFunc(field, value) { | ||
|
||
if (oldFilter == field) { | ||
addrsArray = bkpArray; | ||
} | ||
|
||
switch (field) { | ||
case 'iface': | ||
addrsArray = addrsArray.filter((item) => item.Iface == value); | ||
break; | ||
case 'known': | ||
addrsArray = addrsArray.filter((item) => item.Known == value); | ||
break; | ||
case 'line': | ||
addrsArray = addrsArray.filter((item) => item.Now == value); | ||
break; | ||
default: | ||
console.log("Filter error"); | ||
} | ||
|
||
oldFilter = field; | ||
|
||
displayArrayData(addrsArray); | ||
} | ||
|
||
function resetFilter() { | ||
addrsArray = bkpArray; | ||
displayArrayData(addrsArray); | ||
} | ||
|
||
function searchFunc() { | ||
const s = document.getElementById('search').value; | ||
|
||
if (s != "") { | ||
|
||
const sl = s.toLowerCase(); | ||
|
||
let newArray = []; | ||
|
||
for (let item of addrsArray) { | ||
|
||
if (searchItem(item, sl)) { | ||
newArray.push(item); | ||
} | ||
} | ||
addrsArray = newArray; | ||
} else { | ||
addrsArray = bkpArray; | ||
} | ||
|
||
displayArrayData(addrsArray); | ||
} | ||
|
||
function searchItem(item, sl) { | ||
|
||
const name = item.Name.toLowerCase(); | ||
const hw = item.Hw.toLowerCase(); | ||
const mac = item.Mac.toLowerCase(); | ||
|
||
if ((name.includes(sl)) || (item.Iface.includes(sl)) || (item.IP.includes(sl)) || (mac.includes(sl)) || (hw.includes(sl)) || (item.Date.includes(sl))) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters