-
Notifications
You must be signed in to change notification settings - Fork 318
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
2 changed files
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<div class="cmd cmd-widget #history#" data-type="info" data-subtype="string" data-template="badge" data-cmd_id="#id#" data-cmd_uid="#uid#" data-version="#version#" data-eqLogic_id="#eqLogic_id#"> | ||
<div class="title #hide_name#"> | ||
<div class="cmdName">#name_display#</div> | ||
</div> | ||
<div class="content"> | ||
<div class="label label-info state"><span class="value"></span></div> | ||
</div> | ||
<div class="timeCmd label label-default #history#" data-type="info"></div> | ||
<template> | ||
<div>color : rgb(20,20,20) ({{Couleur de fond}})</div> | ||
<div>fontcolor : rgb(20,20,20) ({{Couleur du texte}})</div> | ||
<div>time : duration|date ({{Affiche durée ou date de la valeur}})</div> | ||
</template> | ||
<script> | ||
jeedom.cmd.addUpdateFunction('#id#', function(_options) { | ||
if (is_object(cmd = document.querySelector('.cmd[data-cmd_uid="#uid#"]'))) { | ||
cmd.querySelector('.content').setAttribute('title', '{{Date de valeur}}: ' + _options.valueDate + '<br>{{Date de collecte}}: ' + _options.collectDate) | ||
if ('#time#' == 'duration' || '#time#' == 'date') { | ||
jeedom.cmd.displayDuration(_options.valueDate, cmd.querySelector('.timeCmd'), '#time#') | ||
} | ||
cmd.querySelector('.value').innerHTML = _options.display_value | ||
if (_options.alertLevel == 'warning') { | ||
cmd.querySelector('.value').innerHTML = '<span class="label label-warning"><i class="fas fa-bell"></i> ' + _options.value + '</span>' | ||
} else if (_options.alertLevel == 'danger') { | ||
cmd.querySelector('.value').innerHTML = '<span class="label label-danger"><i class="fas fa-exclamation"></i> ' + _options.value + '</span>' | ||
} | ||
} | ||
}) | ||
|
||
jeedom.cmd.refreshValue([{ cmd_id: '#id#', value: '#value#', display_value: '#state#', valueDate: '#valueDate#', collectDate: '#collectDate#', alertLevel: '#alertLevel#', unit: '#unite#' }]) | ||
|
||
if (domUtils.issetWidgetOptParam('#color#', 'color')) { | ||
document.querySelector('.cmd[data-cmd_uid="#uid#"] .label').style.setProperty('background-color', '#color#', 'important') | ||
} | ||
if (domUtils.issetWidgetOptParam('#fontcolor#', 'fontcolor')) { | ||
document.querySelector('.cmd[data-cmd_uid="#uid#"] .label').style.setProperty('color', '#fontcolor#', 'important') | ||
} | ||
</script> | ||
</div> | ||
|
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,8 @@ | ||
<span class="cmd cmd-widget" data-type="info" data-subtype="string" data-template="badge" data-version="#version#" data-eqLogic_id="#eqLogic_id#" data-cmd_id="#id#" data-cmd_uid="#uid#"> | ||
<span class='ui-bar ui-bar-a state label-info'>#state#</span> | ||
<script> | ||
jeedom.cmd.addUpdateFunction('#id#',function(_options) { | ||
$('.cmd[data-cmd_id=#id#] .state').empty().append(_options.display_value) | ||
}); | ||
</script> | ||
</span> |