180 lines
7.6 KiB
HTML
180 lines
7.6 KiB
HTML
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title></title>
|
|
<!-- these 4 files always have to be included -->
|
|
<link rel="stylesheet" type="text/css" href="../../lib/css/themes/jquery-ui/redmond/jquery-ui.min.css"/>
|
|
<script type="text/javascript" src="../../lib/js/jquery-1.11.1.min.js"></script>
|
|
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
|
|
<script type="text/javascript" src="../../lib/js/jquery-ui-1.10.3.full.min.js"></script>
|
|
|
|
<!-- these three files have to be always included -->
|
|
<link rel="stylesheet" type="text/css" href="../../css/adapter.css"/>
|
|
<script type="text/javascript" src="../../js/translate.js"></script>
|
|
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
|
|
<script type="text/javascript" src="words.js"></script>
|
|
|
|
<!-- you have to define 2 functions in the global scope: -->
|
|
<script type="text/javascript">
|
|
var convertComma = null;
|
|
function setValue(id, value, onChange) {
|
|
var $value = $('#' + id + '.value');
|
|
if ($value.attr('type') === 'checkbox') {
|
|
$value.prop('checked', value).change(function () {
|
|
onChange();
|
|
});
|
|
} else {
|
|
$value.val(value).change(function() {
|
|
onChange();
|
|
}).keyup(function() {
|
|
// Check that only numbers entered
|
|
if ($(this).hasClass('number')) {
|
|
var val = $(this).val();
|
|
if (val) {
|
|
var newVal = '';
|
|
for (var i = 0; i < val.length; i++) {
|
|
if ((val[i] >= '0' && val[i] <= '9') || val[i] === '-' || val[i] === '+' || val[i] === '.' || val[i] === ',') {
|
|
if (val[i] === '.' && convertComma === true) val[i] = ',';
|
|
if (val[i] === ',' && convertComma === false) val[i] = '.';
|
|
newVal += val[i];
|
|
}
|
|
}
|
|
|
|
if (val != newVal) {
|
|
$(this).val(newVal);
|
|
}
|
|
}
|
|
}
|
|
$(this).trigger('change');
|
|
});
|
|
}
|
|
}
|
|
|
|
function load(settings, onChange) {
|
|
$('#tabs').tabs();
|
|
|
|
// works only with newest admin adapter
|
|
if (typeof systemConfig !== 'undefined') {
|
|
convertComma = systemConfig.common.isFloatComma;
|
|
}
|
|
|
|
if (settings.saveLastValue === undefined) settings.saveLastValue = false;
|
|
if (settings.writeNulls === undefined) settings.writeNulls = true;
|
|
|
|
for (var key in settings) {
|
|
if (settings.hasOwnProperty(key)) {
|
|
setValue(key, settings[key], onChange);
|
|
}
|
|
}
|
|
|
|
onChange(false);
|
|
}
|
|
|
|
function save(callback) {
|
|
var settings = {};
|
|
$('.value').each(function () {
|
|
var $this = $(this);
|
|
var id = $this.attr('id');
|
|
|
|
if ($this.attr('type') === 'checkbox') {
|
|
settings[id] = $this.prop('checked');
|
|
} else {
|
|
settings[id] = $this.val();
|
|
}
|
|
});
|
|
callback(settings);
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="adapter-container">
|
|
<table>
|
|
<tr>
|
|
<td><img src="history.png"></td>
|
|
<td style="padding-top: 20px;padding-left: 10px"><h3 class="translate">History adapter settings</h3></td>
|
|
</tr>
|
|
</table>
|
|
<div id="tabs">
|
|
<ul>
|
|
<li><a href="#tab-main" class="translate">Storage settings</a></li>
|
|
<li><a href="#tab-default" class="translate">Default settings</a></li>
|
|
</ul>
|
|
<div id="tab-main">
|
|
<table>
|
|
<tr>
|
|
<td colspan="3">
|
|
<h4 style="width: calc(100% - 10px)" class="translate">Storage settings:</h4>
|
|
<div class="translate" style="margin:20px">note</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="storeDir" class="translate">storeDir</label></td>
|
|
<td><input id="storeDir" class="value"/></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="storeFrom" class="translate">storeFrom</label></td>
|
|
<td><input id="storeFrom" type="checkbox" class="value"/></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="storeAck" class="translate">storeAck</label></td>
|
|
<td><input id="storeAck" type="checkbox" class="value"/></td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div id="tab-default">
|
|
<table>
|
|
<tr>
|
|
<td colspan="3"><h4 class="translate">Default settings:</h4></td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="maxLength" class="translate">maxLength</label></td>
|
|
<td><input id="maxLength" size="5" class="value number"/></td>
|
|
<td class="translate"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="debounce" class="translate">debounce</label></td>
|
|
<td><input id="debounce" size="5" class="value number"/></td>
|
|
<td class="translate"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="changesRelogInterval" class="translate">log changes interval(s)</label></td>
|
|
<td><input id="changesRelogInterval" size="5" class="value number"/></td>
|
|
<td class="translate">0 = disable</td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="changesMinDelta" class="translate">log changes minimal delta</label></td>
|
|
<td><input id="changesMinDelta" size="5" class="value number"/></td>
|
|
<td class="translate">0 = disable delta check</td>
|
|
</tr>
|
|
<tr>
|
|
<td><label class="translate" for="retention">retention</label></td>
|
|
<td><select id="retention" class="value">
|
|
<option value="0" class="translate">keep forever</option>
|
|
<option value="63072000" class="translate">2 years</option>
|
|
<option value="31536000" class="translate">1 year</option>
|
|
<option value="15811200" class="translate">6 months</option>
|
|
<option value="7948800" class="translate">3 months</option>
|
|
<option value="2678400" class="translate">1 months</option>
|
|
<option value="1209600" class="translate">2 weeks</option>
|
|
<option value="604800" class="translate">1 week</option>
|
|
<option value="432000" class="translate">5 days</option>
|
|
<option value="259200" class="translate">3 days</option>
|
|
<option value="86400" class="translate">1 day</option>
|
|
</select></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td><label class="translate" for="writeNulls">Write NULL values on start/stop boundaries:</label></td>
|
|
<td><input id="writeNulls" type="checkbox" class="value"/></td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|