|
@@ -28,6 +28,43 @@
|
|
|
<input type="submit" class="btn btn-success-inverted" onclick="checkChangePWD(); return false;" value="Отправить">
|
|
|
</form>
|
|
|
</div>
|
|
|
+ <div id='uploadCertificate'>
|
|
|
+ <div class="section group">
|
|
|
+ <label for="dev_update_method" class="col span_1_of_2">Способ обновления</label>
|
|
|
+ <div class="col span_1_of_2">
|
|
|
+ <select class="form-control" id="dev_update_method" name="dev_update_method">
|
|
|
+ <option value="ftp">FTP</option>
|
|
|
+ <option value="manual">Вручную</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div id="ftp_settings" style="display: none;">
|
|
|
+ <form name="ftp_settings">
|
|
|
+ <label for="ftp_server" class="col span_1_of_2">Сервер FTP</label>
|
|
|
+ <div class="col span_1_of_2">
|
|
|
+ <input type="text" class="form-control" id="ftp_server" name="ftp_server">
|
|
|
+ </div>
|
|
|
+ <label for="ftp_port" class="col span_1_of_2">Порт FTP</label>
|
|
|
+ <div class="col span_1_of_2">
|
|
|
+ <input type="text" class="form-control" id="ftp_port" name="ftp_port">
|
|
|
+ </div>
|
|
|
+ <label for="ftp_login" class="col span_1_of_2">Логин</label>
|
|
|
+ <div class="col span_1_of_2">
|
|
|
+ <input type="text" class="form-control" id="ftp_login" name="ftp_login">
|
|
|
+ </div>
|
|
|
+ <label for="ftp_password" class="col span_1_of_2">Пароль</label>
|
|
|
+ <div class="col span_1_of_2">
|
|
|
+ <input type="password" class="form-control" id="ftp_password" name="ftp_password">
|
|
|
+ </div>
|
|
|
+ <label for="ftp_path" class="col span_1_of_2">Путь к файлу ПО <i style="color: #ADADAD">/dir/fw.bin</i></label>
|
|
|
+ <div class="col span_1_of_2">
|
|
|
+ <input type="text" class="form-control" id="ftp_path" name="ftp_path">
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <input type="button" id="close_fw_update" class="btn btn-danger-inverted" value="Отмена">
|
|
|
+ <input type="button" id="start_fw_update" class="btn btn-success-inverted" value="Отправить">
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="navbar navbar-default navbar-fixed-top">
|
|
|
<div class="navbar-header">
|
|
@@ -308,7 +345,7 @@
|
|
|
<h4 class="col span_2_of_2">Контроллер мониторинга</h4>
|
|
|
<button type="button" class="btn btn-default" id="change_pass">Смена пароля</button>
|
|
|
<button type="button" class="btn btn-default" id="dev-reboot">Перезагрузка</button>
|
|
|
- <button type="button" class="btn btn-default" id="dev-update">Обновление ПО</button>
|
|
|
+ <button type="button" class="btn btn-default" id="dev-update_">Обновление ПО</button>
|
|
|
</div>
|
|
|
<div class="col span_1_of_3">
|
|
|
<h4 class="col span_2_of_2">Нагрузка</h4>
|
|
@@ -447,18 +484,23 @@ settingsGET();
|
|
|
// $('count-wrap').style.display = 'block';
|
|
|
// $('checkUpdatePass').style.display = 'block';
|
|
|
// };
|
|
|
-$('dev-update').onclick = function(){
|
|
|
- if( confirm('Перевести контроллер в режим обновления ПО?') ){
|
|
|
- loadXMLDoc('fw_update.cgi', 'GET');
|
|
|
- checkPWD();
|
|
|
- };
|
|
|
-};
|
|
|
+// $('dev-update').onclick = function(){
|
|
|
+// if( confirm('Перевести контроллер в режим обновления ПО?') ){
|
|
|
+// loadXMLDoc('fw_update.cgi', 'GET');
|
|
|
+// checkPWD();
|
|
|
+// };
|
|
|
+// };
|
|
|
|
|
|
$('change_pass').onclick = function(){
|
|
|
$('count-wrap').style.display = 'block';
|
|
|
$('changePassword').style.display = 'block';
|
|
|
};
|
|
|
|
|
|
+$('dev-update_').onclick = function(){
|
|
|
+ $('count-wrap').style.display = 'block';
|
|
|
+ $('uploadCertificate').style.display = 'block';
|
|
|
+};
|
|
|
+
|
|
|
$('close-pass-change').onclick = function(){
|
|
|
$('changePasswordUser').value = '';
|
|
|
$('oldpwd').value = '';
|
|
@@ -467,6 +509,35 @@ $('close-pass-change').onclick = function(){
|
|
|
$('count-wrap').style.display = 'none';
|
|
|
$('changePassword').style.display = 'none';
|
|
|
};
|
|
|
+$('close_fw_update').onclick = function(){
|
|
|
+ $('count-wrap').style.display = 'none';
|
|
|
+ $('uploadCertificate').style.display = 'none';
|
|
|
+};
|
|
|
+$('dev_update_method').onchange = ftpSettings;
|
|
|
+
|
|
|
+function ftpSettings() {
|
|
|
+ if ($('dev_update_method').value == 'manual') {
|
|
|
+ $('ftp_settings').style.display = 'none';
|
|
|
+ $('start_fw_update').onclick = function() {
|
|
|
+ if( confirm('Перевести контроллер в режим обновления ПО?') ){
|
|
|
+ $('uploadCertificate').style.display = 'none';
|
|
|
+ loadXMLDoc('fw_update.cgi', 'GET');
|
|
|
+ checkPWD();
|
|
|
+ };
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $('ftp_settings').style.display = 'block';
|
|
|
+ $('start_fw_update').onclick = function() {
|
|
|
+ var f1 = new FormData(document.forms.ftp_settings);
|
|
|
+ var fArr = [];
|
|
|
+ f1.forEach(function(a, b) {fArr.push(b+'='+a)});
|
|
|
+ loadXMLDoc('ftp_fw_update.cgi', 'POST', function() {
|
|
|
+ alert(this.responseText)
|
|
|
+ }, fArr.join('&'));
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+ftpSettings();
|
|
|
|
|
|
$('dev-reset').onclick = function(){
|
|
|
function foo(){window.location.href = '/settings.html';}
|