Skip to content

Commit

Permalink
test add config link of device
Browse files Browse the repository at this point in the history
  • Loading branch information
zoic21 authored Sep 19, 2024
1 parent 263c3e1 commit 2ad9793
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
23 changes: 13 additions & 10 deletions desktop/js/z2m.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,23 @@ if ($('.eqLogicAttr[data-l1key=id]').value() in devices_attr) {
});

$('#bt_z2mNetwork').off('click').on('click', function () {
$('#md_modal').dialog({title: "{{Configuration du réseau}}"}).load('index.php?v=d&plugin=z2m&modal=network').dialog('open');
$('#md_modal').dialog({title: "{{Configuration du réseau}}"}).load('index.php?v=d&plugin=z2m&modal=network').dialog('open');
});

function printEqLogic(_eqLogic) {
$('#img_device').attr("src", $('.eqLogicDisplayCard.active img').attr('src'));
if ($('.eqLogicAttr[data-l1key=id]').value() in devices_attr){
console.log(devices_attr[$('.eqLogicAttr[data-l1key=id]').value()])
if ('multipleEndpoints' in devices_attr[$('.eqLogicAttr[data-l1key=id]').value()] && devices_attr[$('.eqLogicAttr[data-l1key=id]').value()]['multipleEndpoints']==1){
$('.childCreate').show();
} else {
$('.childCreate').hide();
$('#img_device').attr("src", $('.eqLogicDisplayCard.active img').attr('src'));
if ($('.eqLogicAttr[data-l1key=id]').value() in devices_attr){
if ('multipleEndpoints' in devices_attr[$('.eqLogicAttr[data-l1key=id]').value()] && devices_attr[$('.eqLogicAttr[data-l1key=id]').value()]['multipleEndpoints']==1){
$('.childCreate').show();
} else {
$('.childCreate').hide();
}
}
}
return _eqLogic;
$('#span_z2mLinkToDeviceConfig').empty()
if(_eqLogic.configuration.device && _eqLogic.configuration.device != ''){
$('#span_z2mLinkToDeviceConfig').html('<a href="https://www.zigbee2mqtt.io/devices/'+_eqLogic.configuration.device+'.html" target="_blank">{{Info}}</a>');
}
return _eqLogic;
}

$('.changeIncludeStateEnable').off('click').on('click', function () {
Expand Down
7 changes: 5 additions & 2 deletions desktop/php/z2m.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,11 @@
<legend><i class="fas fa-info"></i> {{Informations}}</legend>
<div class="form-group">
<label class="col-sm-3 control-label">{{Modèle}}</label>
<div class="col-sm-7">
<span class="eqLogicAttr label label-info" data-l1key="configuration" data-l2key="device" />
<div class="col-sm-6">
<span class="eqLogicAttr label label-info" data-l1key="configuration" data-l2key="device" ></span>
</div>
<div class="col-sm-3">
<span id="span_z2mLinkToDeviceConfig" ></span>
</div>
</div>
<div class="form-group">
Expand Down

0 comments on commit 2ad9793

Please sign in to comment.