Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Commit

Permalink
format macs
Browse files Browse the repository at this point in the history
  • Loading branch information
agacias committed Sep 10, 2022
1 parent 9b29a2e commit a2acb20
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions usr/share/migasfree-play/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 5 additions & 1 deletion usr/share/migasfree-play/templates/information.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ <h5>{{app_name}} {{app_version}}</h5>
</div>
<div class="row">
<div class="col s12 m12">
{{computer.mac_address}}
<ul>
{{#computer.mac_list}}
<li>mac: {{.}}</li>
{{/computer.mac_list}}
</ul>
</div>
</div>
</div>
Expand Down

0 comments on commit a2acb20

Please sign in to comment.