From a2acb203651b3e1b87b61fd0128a9e5b83d36b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Gac=C3=ADas?= Date: Sat, 10 Sep 2022 18:08:22 +0200 Subject: [PATCH] format macs --- usr/share/migasfree-play/app/app.js | 10 ++++++++++ usr/share/migasfree-play/templates/information.html | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/usr/share/migasfree-play/app/app.js b/usr/share/migasfree-play/app/app.js index 003875e..b356acb 100644 --- a/usr/share/migasfree-play/app/app.js +++ b/usr/share/migasfree-play/app/app.js @@ -1572,6 +1572,16 @@ function getGlobalData() { global.computer.machine="" ; } + // Format MACs + if (global.computer.mac_address) { + global.computer.mac_list = global.computer.mac_address.match(/.{1,12}/g) + global.computer.mac_list.forEach((element, index) => { + global.computer.mac_list[index] = element.replace(/(.{2})/g,"$1:").slice(0, -1); + }); + } else { + global.computer.mac_list = []; + } + labelDone(); if (! global.sync) { diff --git a/usr/share/migasfree-play/templates/information.html b/usr/share/migasfree-play/templates/information.html index 6751cdc..a17508b 100644 --- a/usr/share/migasfree-play/templates/information.html +++ b/usr/share/migasfree-play/templates/information.html @@ -91,7 +91,11 @@
{{app_name}} {{app_version}}
- {{computer.mac_address}} +
    + {{#computer.mac_list}} +
  • mac: {{.}}
  • + {{/computer.mac_list}} +