mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-30 23:03:03 -07:00
FE+BE: fake MAC standardization (FA:CE) #1344
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
@@ -144,7 +144,7 @@ function validateRegex(elem) {
|
||||
} else {
|
||||
iconSpan.html("<i class='fa fa-xmark'></i>");
|
||||
showModalOk('WARNING', getString("Gen_Invalid_Value"));
|
||||
inputElem.attr("data-is-valid", "0");
|
||||
inputElem.attr("data-is-valid", "0");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,10 +450,10 @@ function addOptionFromModalInput() {
|
||||
|
||||
|
||||
// --------------------------------------------------------
|
||||
// Generate a random MAC address starting 00:1A
|
||||
// Generate a random MAC address starting FA:CE
|
||||
function generate_NEWDEV_devMac() {
|
||||
const randomHexPair = () => Math.floor(Math.random() * 256).toString(16).padStart(2, '0').toUpperCase();
|
||||
$('#NEWDEV_devMac').val(`00:1A:${randomHexPair()}:${randomHexPair()}:${randomHexPair()}:${randomHexPair()}`.toLowerCase());
|
||||
$('#NEWDEV_devMac').val(`FA:CE:${randomHexPair()}:${randomHexPair()}:${randomHexPair()}:${randomHexPair()}`.toLowerCase());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user