iobroker.gsmsms
Version:
Send and recieve SMS with GSM-hardware
241 lines (216 loc) • 8.29 kB
HTML
<html>
<head>
<!-- Load ioBroker scripts and styles-->
<link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
<link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">
<script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
<script type="text/javascript" src="../../js/translate.js"></script>
<script type="text/javascript" src="../../lib/js/materialize.js"></script>
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
<!-- Load our own files -->
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="words.js"></script>
<script type="text/javascript">
// This will be called by the admin adapter when the settings page loads
function load(settings, onChange) {
// example: select elements with id=key and class=value and insert value
if (!settings) return;
$('.value').each(function() {
var $key = $(this);
var id = $key.attr('id');
if ($key.attr('type') === 'checkbox') {
// do not call onChange direct, because onChange could expect some arguments
$key.prop('checked', settings[id])
.on('change', () => onChange());
} else {
// do not call onChange direct, because onChange could expect some arguments
$key.val(settings[id])
.on('change', () => onChange())
.on('keyup', () => onChange());
}
});
onChange(false);
// reinitialize all the Materialize labels on the page if you are dynamically adding inputs:
if (M) M.updateTextFields();
}
// This will be called by the admin adapter when the user presses the save button
function save(callback) {
// example: select elements with class=value and build settings object
var obj = {};
$('.value').each(function() {
var $this = $(this);
if ($this.attr('type') === 'checkbox') {
obj[$this.attr('id')] = $this.prop('checked');
} else if ($this.attr('type') === 'number') {
obj[$this.attr('id')] = parseFloat($this.val());
} else {
obj[$this.attr('id')] = $this.val();
}
});
callback(obj);
}
</script>
</head>
<body>
<div class="m adapter-container">
<div class="main-page row">
<div class="col s12">
<ul class="tabs">
<li class="tab col s4"><a href="#tab-main" class="translate active">basic</a></li>
<li class="tab col s4"><a href="#tab-gsm" class="translate">gsm</a></li>
<li class="tab col s4"><a href="#tab-serialport" class="translate">serialport</a></li>
</ul>
</div>
<div id="tab-main" class="col s12 page">
<div class="row">
<div class="col s12 m4 l2">
<img src="gsmsms.png" class="logo">
</div>
</div>
<!-- Put your content here -->
<h6 class="translate sub-title">portConnection</h6>
<!-- For example columns with settings: -->
<div class="row">
<div class="col s6 input-field">
<input type="text" class="value" id="port" />
<label for="port" class="translate">port</label>
</div>
</div>
<div class="row">
<div class="col s6 input-field">
<input type="text" class="value" id="pin" />
<label for="pin" class="translate">pin</label>
</div>
</div>
<!--
<div class="row">
<div class="input-field col s12 m6 l2">
<select class="value" id="connectionMode">
<option value="alwaysopen" class="translate">alwaysopen</option>
<option value="polling" class="translate">polling</option>
<option value="sendonly" class="translate">sendonly</option>
</select>
<label for="parity" class="translate">connectionMode</label>
</div>
<div class="col s6 input-field">
<input type="text" class="value" id="pollinginterval" />
<label for="pollinginterval" class="translate">pollinginterval</label>
</div>
</div>
-->
</div>
<div id="tab-gsm" class="col s12 page">
<div class="row">
<div class="col s12 m4 l2">
<img src="gsmsms.png" class="logo">
</div>
</div>
<!-- Put your content here -->
<h6 class="translate sub-title">gsmsettings</h6>
<!-- For example columns with settings: -->
<div class="row">
<div class="col s6 input-field">
<input type="checkbox" class="value" id="incomingSMSIndication" />
<label for="incomingSMSIndication" class="translate">incomingSMSIndication</label>
</div>
<div class="col s6 input-field">
<input type="checkbox" class="value" id="autoDeleteOnReceive" />
<label for="autoDeleteOnReceive" class="translate">autoDeleteOnReceive</label>
</div>
<div class="col s6 input-field">
<input type="checkbox" class="value" id="enableConcatenation" />
<label for="enableConcatenation" class="translate">enableConcatenation</label>
</div>
</div>
<!--
<div class="row">
<div class="col s6 input-field">
<input type="checkbox" class="value" id="incomingCallIndication" />
<label for="incomingCallIndication" class="translate">incomingCallIndication</label>
</div>
</div>
-->
<div class="row">
<div class="col s6 input-field">
<input type="checkbox" class="value" id="getSignalQuality" />
<label for="getSignalQuality" class="translate">getSignalQuality</label>
</div>
<div class="col s6 input-field">
<input type="number" class="value" id="pollinginterval" />
<label for="pollinginterval" class="translate">pollinginterval</label>
</div>
</div>
<div class="row">
<div class="col s6 input-field">
<input type="text" class="value" id="customInitCommand" />
<label for="customInitCommand" class="translate">customInitCommand</label>
</div>
</div>
<div class="row">
<div class="col s6 input-field">
<input type="text" class="value" id="cnmiModemOpen" />
<label for="cnmiModemOpen" class="translate">cnmiModemOpen</label>
</div>
<div class="col s6 input-field">
<input type="text" class="value" id="cnmiModemClosed" />
<label for="cnmiModemClosed" class="translate">cnmiModemClosed</label>
</div>
</div>
</div>
<div id="tab-serialport" class="col s12 page">
<div class="row">
<div class="col s12 m4 l2">
<img src="gsmsms.png" class="logo">
</div>
</div>
<!-- Put your content here -->
<!-- For example columns with settings: -->
<h6 class="translate sub-title">serialportsettings</h6>
<div class="row">
<div class="col s6 input-field">
<input type="number" class="value" id="baudRate" />
<label for="baudRate" class="translate">baudRate</label>
</div>
<div class="col s6 input-field">
<input type="number" class="value" id="dataBits" />
<label for="dataBits" class="translate">dataBits</label>
</div>
<div class="col s6 input-field">
<input type="number" class="value" id="stopBits" />
<label for="stopBits" class="translate">stopBits</label>
</div>
<div class="input-field col s12 m6 l2">
<select class="value" id="parity">
<option value="none" class="translate">none</option>
<option value="odd" class="translate">odd</option>
<option value="even" class="translate">even</option>
<option value="mark" class="mark">mark</option>
<option value="space" class="space">space</option>
</select>
<label for="parity" class="translate">parity</label>
</div>
</div>
<div class="row">
<div class="col s6 input-field">
<input type="checkbox" class="value" id="rtscts" />
<label for="rtscts" class="translate">rtscts</label>
</div>
<div class="col s6 input-field">
<input type="checkbox" class="value" id="xon" />
<label for="xon" class="translate">xon</label>
</div>
<div class="col s6 input-field">
<input type="checkbox" class="value" id="xoff" />
<label for="xoff" class="translate">xoff</label>
</div>
<div class="col s6 input-field">
<input type="checkbox" class="value" id="xany" />
<label for="xany" class="translate">xany</label>
</div>
</div>
</div>
</div>
</div>
</body>
</html>