Merge remote-tracking branch 'origin/maintenance' into maintenance
This commit is contained in:
commit
ef81702219
3 files changed
+14
-7
No files matched your search
@@ -574,15 +574,15 @@ function formatFilament(filament) {
|
||||
return _.sprintf(result, {length: filament["length"] / 1000, volume: filament["volume"]});
|
||||
}
|
||||
|
||||
function cleanTemperature(temp) {
|
||||
function cleanTemperature(temp, offThreshold) {
|
||||
if (temp === undefined || !_.isNumber(temp)) return "-";
|
||||
if (temp < 10) return gettext("off");
|
||||
if (offThreshold !== undefined && temp < offThreshold) return gettext("off");
|
||||
return temp;
|
||||
}
|
||||
|
||||
function formatTemperature(temp, showF) {
|
||||
function formatTemperature(temp, showF, offThreshold) {
|
||||
if (temp === undefined || !_.isNumber(temp)) return "-";
|
||||
if (temp < 10) return gettext("off");
|
||||
if (offThreshold !== undefined && temp < offThreshold) return gettext("off");
|
||||
if (showF) {
|
||||
return _.sprintf("%.1f°C (%.1f°F)", temp, temp * 9 / 5 + 32);
|
||||
} else {
|
||||
|
||||
@@ -401,7 +401,7 @@ $(function() {
|
||||
}
|
||||
|
||||
var actualTemp = actuals && actuals.length ? formatTemperature(actuals[actuals.length - 1][1], showFahrenheit) : "-";
|
||||
var targetTemp = targets && targets.length ? formatTemperature(targets[targets.length - 1][1], showFahrenheit) : "-";
|
||||
var targetTemp = targets && targets.length ? formatTemperature(targets[targets.length - 1][1], showFahrenheit, 1) : "-";
|
||||
|
||||
data.push({
|
||||
label: gettext("Actual") + " " + heaterOptions[type].name + ": " + actualTemp,
|
||||
@@ -703,7 +703,14 @@ $(function() {
|
||||
self._replaceLegendLabel = function(index, series, value, emph) {
|
||||
var showFahrenheit = self._shallShowFahrenheit();
|
||||
|
||||
var temp = formatTemperature(value, showFahrenheit);
|
||||
var temp;
|
||||
if (index % 2 === 0) {
|
||||
// actual series
|
||||
temp = formatTemperature(value, showFahrenheit);
|
||||
} else {
|
||||
// target series
|
||||
temp = formatTemperature(value, showFahrenheit, 1);
|
||||
}
|
||||
if (emph) {
|
||||
temp = "<em>" + temp + "</em>";
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<form class="form-inline" style="margin:0" data-bind="submit: function(element) { $root.setTarget($data, element) }">
|
||||
<div class="input-prepend input-append">
|
||||
<button type="button" class="btn btn-input-dec" data-bind="click: $root.decrementTarget, enable: $root.isOperational() && $root.loginState.isUser()" title="{{ _('Fine adjust: -1°C') }}"><i class="fa fa-minus"></i></button>
|
||||
<input type="number" min="0" max="999" class="input-mini input-nospin" style="width: 30px" data-bind="attr: {placeholder: cleanTemperature(target())}, value: newTarget, valueUpdate: 'input', enable: $root.isOperational() && $root.loginState.isUser(), event: { focus: function(d, e) {$root.handleFocus(e, 'target', $data) } }">
|
||||
<input type="number" min="0" max="999" class="input-mini input-nospin" style="width: 30px" data-bind="attr: {placeholder: cleanTemperature(target(), 1)}, value: newTarget, valueUpdate: 'input', enable: $root.isOperational() && $root.loginState.isUser(), event: { focus: function(d, e) {$root.handleFocus(e, 'target', $data) } }">
|
||||
<span class="add-on">°C</span>
|
||||
<button type="button" class="btn btn-input-inc" data-bind="click: $root.incrementTarget, enable: $root.isOperational() && $root.loginState.isUser()" title="{{ _('Fine adjust: +1°C') }}"><i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user