1835 lines
60 KiB
HTML
Executable File
1835 lines
60 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<title id="webtitle"></title>
|
|
<link href="css/styles.css" rel="stylesheet" media="screen">
|
|
<script src="js/auth.js"></script>
|
|
<script src="js/jquery.js"></script>
|
|
<script src="js/dashboard.js"></script>
|
|
|
|
<script>
|
|
var time_sec_cnt=0;
|
|
var lastTime = new Date().getTime();
|
|
var currentTime = new Date().getTime();
|
|
var timeOut = 20 * 60 * 1000; // 20 min
|
|
var upgrade_imx_flg = 0;
|
|
var remot_local_ctrl = 0; // 0 remote 1 local
|
|
var g_old_adpc_status = 0;
|
|
var g_old_adpc = 0;
|
|
var g_key_tsoip_valid = 0;
|
|
var g_key_eas_valid = 0;
|
|
var g_old_ntp_ip1 = 0;
|
|
var g_old_ntp_ip2 = 0;
|
|
var g_old_ntp_ip3 = 0;
|
|
var g_old_ntp_ip4 = 0;
|
|
var g_old_ntp_switch = 0;
|
|
var g_time_note_sec=0;
|
|
|
|
$(function(){
|
|
// Listen to multiple types of user activity to prevent timeout
|
|
$(document).on('mousemove keydown click scroll touchstart', function(){
|
|
lastTime = new Date().getTime();
|
|
});
|
|
});
|
|
|
|
function testTime(){
|
|
currentTime = new Date().getTime();
|
|
if(currentTime - lastTime > timeOut){
|
|
window.location.href="login.cgi?logout=1"
|
|
}
|
|
|
|
time_sec_cnt=time_sec_cnt+1;
|
|
if(time_sec_cnt%3==0){
|
|
if(upgrade_imx_flg==1)
|
|
return;
|
|
update_dpd_state();
|
|
get_ntp_server_state();
|
|
refreshDashboard();
|
|
}
|
|
}
|
|
|
|
function update_dpd_state() {
|
|
var queryData = "sys_dpd_state=&";
|
|
$.get("atsc_status_cfg.cgi?"+queryData,function(data, status) {
|
|
// Handle case where data is a JSON object (e.g., session expired)
|
|
if (typeof data === 'object' && data !== null) {
|
|
if (data.error === 'session_expired' && data.redirect) {
|
|
window.location.href = data.redirect;
|
|
return;
|
|
}
|
|
console.error('Received JSON error response:', data);
|
|
return;
|
|
}
|
|
|
|
var table = data.split("|");
|
|
var form = table[0].split("#");
|
|
// var cf = document.forms[0]; // Not used in original logic, strictly string parsing
|
|
var str_state = "";
|
|
var num_state = Number(form[0]);
|
|
var dpd_phase = Number(form[1]);
|
|
var dpd_tsnr = Number(form[2]);
|
|
var dpd_maxp = Number(form[3]);
|
|
var save_load_data_percent = Number(form[4]);
|
|
var flash_get_err_num = Number(form[5]);
|
|
var final_stage = Number(form[6]);
|
|
|
|
if(num_state == 0){
|
|
if(final_stage != 0xff){
|
|
str_state = "Waiting... "+final_stage;
|
|
} else{
|
|
str_state = "OK";
|
|
}
|
|
if(g_old_adpc_status==1){
|
|
g_old_adpc_status=0;
|
|
SetFormDefaults();
|
|
}
|
|
}else if(num_state == 1){
|
|
str_state = "ADPC Stopped, PA Protection![1]";
|
|
if(g_old_adpc_status==1){ g_old_adpc_status=0; SetFormDefaults(); }
|
|
}else if(num_state == 2){
|
|
str_state = "ADPC Failed, Feedback High![2]";
|
|
if(g_old_adpc_status==1){ g_old_adpc_status=0; SetFormDefaults(); }
|
|
}else if(num_state == 3){
|
|
str_state = "ADPC Failed, Feedback Low![3]";
|
|
if(g_old_adpc_status==1){ g_old_adpc_status=0; SetFormDefaults(); }
|
|
}else if(num_state == 4){
|
|
str_state = "ADPC Failed, Feedback High![4]";
|
|
if(g_old_adpc_status==1){ g_old_adpc_status=0; SetFormDefaults(); }
|
|
}else if(num_state == 5){
|
|
str_state = "ADPC Failed, Feedback Low![5]";
|
|
if(g_old_adpc_status==1){ g_old_adpc_status=0; SetFormDefaults(); }
|
|
}else if(num_state == 6){
|
|
str_state = "ADPC Stopped, Over Distortion![6]";
|
|
if(g_old_adpc_status==1){ g_old_adpc_status=0; SetFormDefaults(); }
|
|
}else if(num_state == 7){
|
|
str_state = "ADPC Stopped, PA Protection![7]";
|
|
if(g_old_adpc_status==1){ g_old_adpc_status=0; SetFormDefaults(); }
|
|
}else if(num_state == 8){
|
|
str_state = "ADPC Data Saving Error![8]";
|
|
if(g_old_adpc_status==1){ g_old_adpc_status=0; SetFormDefaults(); }
|
|
}else if(num_state == 9){
|
|
str_state = "ADPC Data Loading Error![9]";
|
|
if(g_old_adpc_status==1){ g_old_adpc_status=0; SetFormDefaults(); }
|
|
}else if(num_state == 10){
|
|
str_state = "ADPC Failed, Sync Time Out![10]";
|
|
if(g_old_adpc_status==1){ g_old_adpc_status=0; SetFormDefaults(); }
|
|
}else if(num_state == 0xff){
|
|
if(final_stage==0xff)
|
|
str_state = "Updating...("+dpd_phase+") SNR="+(dpd_tsnr/100).toFixed(1)+" MAXP="+dpd_maxp;
|
|
else
|
|
str_state = "Waiting... "+final_stage;
|
|
if(g_old_adpc_status==0) g_old_adpc_status = 1;
|
|
}else if(num_state == 0xaa)
|
|
str_state = "Saving Data... "+save_load_data_percent+"% "+flash_get_err_num;
|
|
else if(num_state == 0xbb){
|
|
str_state = "Loading Data... "+save_load_data_percent+"%";
|
|
if(g_old_adpc_status==0) g_old_adpc_status = 1;
|
|
}
|
|
$('#adpc_sta').val(str_state);
|
|
});
|
|
}
|
|
|
|
window.setInterval(testTime, 1000);
|
|
refreshDashboard();
|
|
|
|
function cmd_confirm() {
|
|
return confirm("Please choose to confirm or cancel!");
|
|
}
|
|
|
|
$(document).ready(function(){
|
|
SetFormDefaults();
|
|
get_license();
|
|
update_dpd_state();
|
|
});
|
|
|
|
function SetFormDefaults(){
|
|
if(upgrade_imx_flg == 1) return;
|
|
|
|
// 1. DISABLE BUTTONS START (only in Remote mode)
|
|
if(remot_local_ctrl == 1) {
|
|
// Local mode: just fetch data, don't change button text
|
|
var queryData = "sys_cfg=&sysnet=&imxsystime=&web_title=&system_a1_key=&ntp_server=&imx_timezone=&";
|
|
} else {
|
|
// Remote mode: show LOADING indicator
|
|
$('#para_set_id, #net_set_id, #sys_rtc_id, #sysreset_bt_id, #upgrade_imx_id, #key_set_id, #ntp_set_id, #timezone_set_id')
|
|
.attr("disabled", true)
|
|
.val("Loading...");
|
|
var queryData = "sys_cfg=&sysnet=&imxsystime=&web_title=&system_a1_key=&ntp_server=&imx_timezone=&";
|
|
}
|
|
$.get("atsc_status_cfg.cgi?"+queryData,function(data, status) {
|
|
// Handle case where data is a JSON object (e.g., session expired)
|
|
if (typeof data === 'object' && data !== null) {
|
|
if (data.error === 'session_expired' && data.redirect) {
|
|
window.location.href = data.redirect;
|
|
return;
|
|
}
|
|
console.error('Received JSON error response:', data);
|
|
return;
|
|
}
|
|
|
|
var table = data.split("|");
|
|
var syspara = table[0].split("#");
|
|
var sysnet = table[1].split("#");
|
|
var systime = table[2].split("#");
|
|
var ntp_para = table[3].split("#");
|
|
var timezone_para = table[4].split("#");
|
|
var key_para = table[6].split("#");
|
|
|
|
var cf0 = document.forms[0];
|
|
var cf1 = document.forms[1];
|
|
var rtcfom = document.forms[2];
|
|
var keyfom = document.forms[4];
|
|
var ntpfom = document.forms[3];
|
|
var i = 1;
|
|
|
|
// sys-para form0
|
|
i=1;
|
|
cf0.asi.value = syspara[i++];
|
|
cf0.gps.value = syspara[i++];
|
|
cf0.adp.value = syspara[i++];
|
|
g_old_adpc = syspara[3];
|
|
i++;
|
|
cf0.ctl.value = syspara[i++];
|
|
remot_local_ctrl = Number(cf0.ctl.value);
|
|
|
|
document.title = syspara[i++];
|
|
cf0.ltitle.value = document.title;
|
|
document.getElementById('webtitle').textContent = cf0.ltitle.value;
|
|
document.getElementById('webtitle_header').textContent = cf0.ltitle.value;
|
|
|
|
cf0.fwd_cal.value= syspara[i++];
|
|
cf0.pa_crf.value = syspara[i++];
|
|
cf0.sys_reset.value = 0;
|
|
cf0.tst.value = syspara[i++];
|
|
cf0.roll_off.value = syspara[i++];
|
|
cf0.ab_mode.value = syspara[i++];
|
|
cf0.gainlimit.value = syspara[i++];
|
|
i++;
|
|
cf0.agc_att.value = Number(syspara[i++])*(-0.5);
|
|
cf0.adrv9009_att.value = syspara[i++];
|
|
cf0.orx_manu_gain.value = syspara[i++];
|
|
|
|
// sysnet form1
|
|
i = 1;
|
|
cf1.ip1.value = sysnet[i++];
|
|
cf1.ip2.value = sysnet[i++];
|
|
cf1.ip3.value = sysnet[i++];
|
|
cf1.ip4.value = sysnet[i++];
|
|
|
|
cf1.gt1.value = sysnet[i++];
|
|
cf1.gt2.value = sysnet[i++];
|
|
cf1.gt3.value = sysnet[i++];
|
|
cf1.gt4.value = sysnet[i++];
|
|
|
|
cf1.mk1.value = sysnet[i++];
|
|
cf1.mk2.value = sysnet[i++];
|
|
cf1.mk3.value = sysnet[i++];
|
|
cf1.mk4.value = sysnet[i++];
|
|
|
|
// rtc time form2
|
|
i=1;
|
|
rtcfom.imx_year.value = systime[i++];
|
|
rtcfom.imx_mon.value = systime[i++];
|
|
rtcfom.imx_day.value = systime[i++];
|
|
rtcfom.imx_hour.value = systime[i++];
|
|
rtcfom.imx_min.value = systime[i++];
|
|
rtcfom.imx_sec.value = systime[i++];
|
|
|
|
i=1;
|
|
// Convert server timezone value (-12 to +12) to select value (0 to 24)
|
|
var serverTimezone = Number(timezone_para[i++]);
|
|
var selectValue = serverTimezone + 12; // -12 becomes 0, 0 becomes 12, +12 becomes 24
|
|
rtcfom.timezone.value = selectValue;
|
|
|
|
// system key form4
|
|
var str_key = key_para[1];
|
|
keyfom.eas_key.value = Number(str_key).toString(16).toUpperCase().padStart(8, '0');
|
|
str_key = key_para[2];
|
|
// keyfom.tsoip_key.value = Number(str_key).toString(16).toUpperCase().padStart(8, '0');
|
|
str_key = key_para[3];
|
|
keyfom.psip_key.value = Number(str_key).toString(16).toUpperCase().padStart(8, '0');
|
|
|
|
// ntp form5
|
|
i = 1;
|
|
ntpfom.ntp_ip1.value = ntp_para[i++];
|
|
ntpfom.ntp_ip2.value = ntp_para[i++];
|
|
ntpfom.ntp_ip3.value = ntp_para[i++];
|
|
ntpfom.ntp_ip4.value = ntp_para[i++];
|
|
ntpfom.ntp_switch.value = ntp_para[i++];
|
|
|
|
// save old ntp values for change detection
|
|
g_old_ntp_ip1 = Number(ntpfom.ntp_ip1.value);
|
|
g_old_ntp_ip2 = Number(ntpfom.ntp_ip2.value);
|
|
g_old_ntp_ip3 = Number(ntpfom.ntp_ip3.value);
|
|
g_old_ntp_ip4 = Number(ntpfom.ntp_ip4.value);
|
|
g_old_ntp_switch = Number(ntpfom.ntp_switch.value);
|
|
|
|
// Enable/disable NTP sync button based on current NTP switch state
|
|
if(Number(ntpfom.ntp_switch.value) == 1 && g_time_note_sec==0) {
|
|
$('#ntp_sync_id').attr("disabled", false);
|
|
} else {
|
|
$('#ntp_sync_id').attr("disabled", true);
|
|
}
|
|
|
|
// 2. RE-ENABLE BUTTONS END (check form's current ctl value)
|
|
// Allow user to click Set if they changed Control from Local to Remote
|
|
var currentCtlValue = Number(cf0.ctl.value);
|
|
if(currentCtlValue == 1) {
|
|
// Local mode: keep buttons disabled
|
|
$('#para_set_id, #net_set_id, #sys_rtc_id, #sysreset_bt_id, #upgrade_imx_id, #key_set_id, #ntp_set_id, #timezone_set_id')
|
|
.attr("disabled", true)
|
|
.val("Local Mode");
|
|
} else {
|
|
// Remote mode: enable buttons
|
|
$('#para_set_id, #net_set_id, #sys_rtc_id, #sysreset_bt_id, #upgrade_imx_id, #key_set_id, #ntp_set_id, #timezone_set_id')
|
|
.attr("disabled", false)
|
|
.val("Set");
|
|
}
|
|
if (typeof setFormSnapshotUpdate === 'function') setFormSnapshotUpdate();
|
|
}).fail(function() {
|
|
// If the connection fails, show error but don't disable buttons permanently
|
|
console.error("SetFormDefaults failed - connection error");
|
|
// Only show "Load Failed" if not in the middle of NTP sync countdown
|
|
// During NTP sync countdown (g_time_note_sec > 0), buttons are managed by ntp_cfg_button_disable()
|
|
if (g_time_note_sec === 0) {
|
|
// Only update buttons that are not currently disabled by other operations
|
|
$('#para_set_id, #net_set_id, #sys_rtc_id, #sysreset_bt_id, #ntp_set_id, #timezone_set_id').each(function() {
|
|
if (!$(this).prop('disabled')) {
|
|
$(this).val("Load Failed");
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
// ----- SET (unsaved) reminder: per-form, vanilla JS -----
|
|
var setFormSnapshots = {};
|
|
var setFormConfig = [
|
|
{ formId: 'form_para', buttonId: 'para_set_id' },
|
|
{ formId: 'form_net', buttonId: 'net_set_id' },
|
|
{ formId: 'form_rtc', buttonId: 'sys_rtc_id', fields: ['imx_year', 'imx_mon', 'imx_day', 'imx_hour', 'imx_min', 'imx_sec'] },
|
|
{ formId: 'form_reset', buttonId: 'sysreset_bt_id' },
|
|
{ formId: 'form_key', buttonId: 'key_set_id' },
|
|
{ formId: 'form_ntp', buttonId: 'ntp_set_id' },
|
|
{ formId: 'form_rtc', buttonId: 'timezone_set_id', fields: ['timezone'] }
|
|
];
|
|
function getFormSnapshot(formId, fieldNames) {
|
|
var f = document.getElementById(formId);
|
|
if (!f) return [];
|
|
var out = [], els, i, el, v;
|
|
|
|
// If specific fields are provided, only snapshot those fields
|
|
if (fieldNames && fieldNames.length > 0) {
|
|
for (i = 0; i < fieldNames.length; i++) {
|
|
el = f.querySelector('[name="' + fieldNames[i] + '"], #' + fieldNames[i]);
|
|
if (!el) continue;
|
|
v = el.tagName === 'SELECT' ? (el.options[el.selectedIndex] ? el.options[el.selectedIndex].value : '') : (el.value || '');
|
|
out.push({ name: el.name || el.id, value: String(v) });
|
|
}
|
|
} else {
|
|
// Otherwise, snapshot all fields in the form
|
|
els = f.querySelectorAll('select, input:not([type="button"])');
|
|
for (i = 0; i < els.length; i++) {
|
|
el = els[i];
|
|
if (el.id === 'adpc_sta' || el.name === 'adpc_sta') continue; // status display, not user-editable
|
|
v = el.tagName === 'SELECT' ? (el.options[el.selectedIndex] ? el.options[el.selectedIndex].value : '') : (el.value || '');
|
|
out.push({ name: el.name || el.id, value: String(v) });
|
|
}
|
|
}
|
|
return out;
|
|
}
|
|
function isFormDirty(formId, snapshot, fieldNames) {
|
|
var current = getFormSnapshot(formId, fieldNames);
|
|
if (current.length !== snapshot.length) return true;
|
|
for (var i = 0; i < current.length; i++) {
|
|
if (current[i].name !== snapshot[i].name || current[i].value !== snapshot[i].value) return true;
|
|
}
|
|
return false;
|
|
}
|
|
function setSetButtonState(btnId, unsaved) {
|
|
var btn = document.getElementById(btnId);
|
|
if (!btn || btn.disabled) return;
|
|
btn.value = unsaved ? 'Set (unsaved)' : 'Set';
|
|
if (unsaved) btn.classList.add('is-unsaved'); else btn.classList.remove('is-unsaved');
|
|
}
|
|
function setFormSectionSaved(formId, btnId) {
|
|
// Find the config entry for this button to get field list
|
|
var config = null;
|
|
for (var i = 0; i < setFormConfig.length; i++) {
|
|
if (setFormConfig[i].buttonId === btnId) {
|
|
config = setFormConfig[i];
|
|
break;
|
|
}
|
|
}
|
|
var f = document.getElementById(formId);
|
|
if (f) {
|
|
var key = btnId; // Use buttonId as unique key instead of formId
|
|
setFormSnapshots[key] = getFormSnapshot(formId, config ? config.fields : null);
|
|
}
|
|
if (btnId) setSetButtonState(btnId, false);
|
|
}
|
|
function setFormSnapshotUpdate() {
|
|
for (var i = 0; i < setFormConfig.length; i++) {
|
|
var c = setFormConfig[i];
|
|
var f = document.getElementById(c.formId);
|
|
if (f) {
|
|
var key = c.buttonId; // Use buttonId as unique key
|
|
setFormSnapshots[key] = getFormSnapshot(c.formId, c.fields);
|
|
}
|
|
setSetButtonState(c.buttonId, false);
|
|
}
|
|
}
|
|
function updateSetButtonForForm(formId, changedFieldName) {
|
|
for (var i = 0; i < setFormConfig.length; i++) {
|
|
if (setFormConfig[i].formId !== formId) continue;
|
|
var c = setFormConfig[i];
|
|
|
|
// If specific fields are defined for this button, check if the changed field is in the list
|
|
if (c.fields && c.fields.length > 0 && changedFieldName) {
|
|
var fieldInList = false;
|
|
for (var j = 0; j < c.fields.length; j++) {
|
|
if (c.fields[j] === changedFieldName) {
|
|
fieldInList = true;
|
|
break;
|
|
}
|
|
}
|
|
// Skip this button if the changed field is not in its field list
|
|
if (!fieldInList) continue;
|
|
}
|
|
|
|
var key = c.buttonId; // Use buttonId as unique key
|
|
var snap = setFormSnapshots[key];
|
|
var dirty = !snap || snap.length === 0 || isFormDirty(c.formId, snap, c.fields);
|
|
setSetButtonState(c.buttonId, dirty);
|
|
}
|
|
}
|
|
function attachSetFormUnsavedListeners() {
|
|
for (var i = 0; i < setFormConfig.length; i++) {
|
|
var f = document.getElementById(setFormConfig[i].formId);
|
|
if (!f) continue;
|
|
f.addEventListener('change', function(e) {
|
|
var fieldName = e.target.name || e.target.id;
|
|
updateSetButtonForForm(this.id, fieldName);
|
|
});
|
|
f.addEventListener('input', function(e) {
|
|
var fieldName = e.target.name || e.target.id;
|
|
updateSetButtonForForm(this.id, fieldName);
|
|
});
|
|
}
|
|
// Special handler: enable para_set_id button when Control is changed to Remote
|
|
var ctlSelect = document.getElementById('ctl');
|
|
if (ctlSelect) {
|
|
ctlSelect.addEventListener('change', function() {
|
|
if (this.value === '0') { // Remote mode
|
|
var btn = document.getElementById('para_set_id');
|
|
btn.disabled = false;
|
|
btn.value = 'Set';
|
|
}
|
|
});
|
|
}
|
|
}
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', attachSetFormUnsavedListeners);
|
|
} else {
|
|
attachSetFormUnsavedListeners();
|
|
}
|
|
|
|
function set_syspara() {
|
|
var postData = "sys_cfg=";
|
|
var cf = document.forms[0];
|
|
|
|
postData += "#"+cf.asi.value;
|
|
postData += "#"+cf.gps.value;
|
|
postData += "#"+cf.adp.value;
|
|
postData += "#"+cf.ctl.value;
|
|
|
|
postData += "#"+cf.fwd_cal.value;
|
|
postData += "#"+cf.pa_crf.value;
|
|
postData += "#"+cf.sys_reset.value;
|
|
postData += "#"+cf.tst.value;
|
|
postData += "#"+cf.ltitle.value;
|
|
postData += "#"+cf.roll_off.value;
|
|
postData += "#"+cf.ab_mode.value;
|
|
postData += "#"+cf.gainlimit.value;
|
|
postData += "#"+cf.agc_att.value;
|
|
postData += "#"+cf.adrv9009_att.value;
|
|
postData += "#"+cf.orx_manu_gain.value;
|
|
|
|
if(cf.ab_mode.value == "1" && Number(cf.adp.value) > 0) {
|
|
alert("The ADPC can't be set to Hold or Update or UpdateLIN/UpdateNLIN mode when 'FSSI Refresh' switch 'On' !!! Please change 'FSSI Refresh' to 'Off'.");
|
|
return;
|
|
} else {
|
|
var bak_adpc = Number(g_old_adpc);
|
|
var now_adpc = Number(cf.adp.value);
|
|
if(cmd_confirm()){
|
|
$.post("atsc_status_cfg.cgi?",postData,function(data, status){
|
|
if(status=="success"){
|
|
if(now_adpc==0){
|
|
SetFormDefaults();
|
|
} else
|
|
SetFormDefaults();
|
|
} else{
|
|
alert("post val err");
|
|
}
|
|
});
|
|
|
|
if(bak_adpc > 0 && now_adpc==0 && remot_local_ctrl==0){
|
|
var timerid = setTimeout(function() {
|
|
SetFormDefaults();
|
|
}, 2000);
|
|
}
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|
|
function setsysnet() {
|
|
var postData = "sysnet=";
|
|
var cf = document.forms[1];
|
|
|
|
postData += "#"+cf.ip1.value;
|
|
postData += "#"+cf.ip2.value;
|
|
postData += "#"+cf.ip3.value;
|
|
postData += "#"+cf.ip4.value;
|
|
|
|
postData += "#"+cf.gt1.value;
|
|
postData += "#"+cf.gt2.value;
|
|
postData += "#"+cf.gt3.value;
|
|
postData += "#"+cf.gt4.value;
|
|
|
|
postData += "#"+cf.mk1.value;
|
|
postData += "#"+cf.mk2.value;
|
|
postData += "#"+cf.mk3.value;
|
|
postData += "#"+cf.mk4.value;
|
|
|
|
if(cmd_confirm()){
|
|
$.post("atsc_status_cfg.cgi?",postData,function(data, status){
|
|
if(status=="success"){
|
|
SetFormDefaults();
|
|
} else{
|
|
alert("post val err");
|
|
}
|
|
});
|
|
} else{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function sysresetff() {
|
|
var postData = "sysreset=";
|
|
var cf = document.getElementById("form_reset");
|
|
var prog_val = 1;
|
|
|
|
if(cf.sysreset.value == "0"){
|
|
return;
|
|
}
|
|
|
|
postData += "#"+cf.sysreset.value;
|
|
|
|
if(cmd_confirm()){
|
|
upgrade_imx_flg = 1;
|
|
|
|
$.post("atsc_status_cfg.cgi?",postData,function(data, status){
|
|
if(status=="success"){
|
|
var t = setInterval(function() {
|
|
$('#rst_tb').hide();
|
|
$('#rst_progid').show();
|
|
$('#rst_note').text("System is now reseting. Please don't power off during the reseting. Wait for a minute and the page will automatically refreshed.");
|
|
|
|
var rst_prog_num = document.getElementById("rst_progid");
|
|
rst_prog_num.value = prog_val;
|
|
var t2 = setInterval(function() {
|
|
if(prog_val >= 100){
|
|
clearInterval(t2);
|
|
rst_progsval.innerText='100% ';
|
|
window.location.href="login.html"
|
|
return;
|
|
} else{
|
|
prog_val = prog_val+1;
|
|
rst_prog_num.value = prog_val;
|
|
rst_progsval.innerText=prog_val+'%';
|
|
}
|
|
}, 500);
|
|
clearInterval(t);
|
|
}, 1000);
|
|
} else{
|
|
alert("post val err");
|
|
}
|
|
});
|
|
} else{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function setrtc() {
|
|
var postData = "imxsystime=";
|
|
var cf = document.forms[2];
|
|
|
|
postData += "#"+cf.imx_year.value;
|
|
postData += "#"+cf.imx_mon.value;
|
|
postData += "#"+cf.imx_day.value;
|
|
postData += "#"+cf.imx_hour.value;
|
|
postData += "#"+cf.imx_min.value;
|
|
postData += "#"+cf.imx_sec.value;
|
|
postData += "#"+cf.timezone.value;
|
|
|
|
if(cmd_confirm()){
|
|
$.post("atsc_status_cfg.cgi?",postData,function(data, status){
|
|
if(status=="success"){
|
|
if (typeof setFormSectionSaved === 'function') setFormSectionSaved('form_rtc', 'sys_rtc_id');
|
|
} else{
|
|
alert("post val err");
|
|
}
|
|
});
|
|
} else{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function uploadfile(){
|
|
if(remot_local_ctrl==1){
|
|
alert("System work in Local mode. Can't upgrade! Please change mode then do upgrade!");
|
|
return;
|
|
}
|
|
|
|
var result=document.getElementById('result');
|
|
$('#upgrade_imx_id').attr("disabled",true);
|
|
$('#formupgrade').attr("disabled",true);
|
|
$('#net_set_id').attr("disabled",true);
|
|
$('#para_set_id').attr("disabled",true);
|
|
$('#sys_rtc_id').attr("disabled",true);
|
|
$('#sysreset_bt_id').attr("disabled",true);
|
|
$('#timezone_set_id').attr("disabled",true);
|
|
|
|
var file = document.getElementById('Upgrade').files[0];
|
|
if (!file) {
|
|
alert('Please select a file');
|
|
$('#upgrade_imx_id').attr("disabled",false); // undo the disables above
|
|
$('#formupgrade').attr("disabled",false);
|
|
return
|
|
}
|
|
|
|
// Suppress the 3 s dashboard polling for the duration of the upload -- see the note in
|
|
// uploadFpgaFile(). Set it only after the file check, otherwise an empty-selection early
|
|
// return leaves polling permanently dead until the page is reloaded.
|
|
upgrade_imx_flg = 1;
|
|
var widthddd = 1;
|
|
var params = new FormData();
|
|
params.append('file', file);
|
|
params.append('otherParams', 'xxx');
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
xhr.onerror = function () {
|
|
alert('Request Failed');
|
|
}
|
|
xhr.onreadystatechange = function () {
|
|
if (xhr.readyState == 4) {
|
|
if (xhr.status == 200) {
|
|
console.log(xhr.responseText);
|
|
} else {
|
|
console.error(xhr.status)
|
|
}
|
|
}
|
|
}
|
|
xhr.upload.onprogress = function (e) {
|
|
var percent = Math.round(e.loaded / e.total * 100);
|
|
|
|
// 1. Update the Text (You already have this)
|
|
result.innerHTML = "Uploading package ... " + percent + '%';
|
|
|
|
// 2. ADD THIS LINE to update the Green Bar visual
|
|
document.getElementById('progress').value = percent;
|
|
|
|
if(e.loaded == e.total){
|
|
var t = setInterval(function() {
|
|
$('#formupgrade').hide();
|
|
$('#prog_id').show();
|
|
$("#progress").hide();
|
|
$('#retnote').text("Code package has been uploaded successfully. System is now upgrading and reboot. Please don't power off the system during the upgrade. Wait for a minute and the page will automatically refreshed.");
|
|
SetFormDefaults();
|
|
var prog_num = document.getElementById("prog_id");
|
|
prog_num.value = widthddd;
|
|
var t2 = setInterval(function() {
|
|
if(widthddd >= 100){
|
|
clearInterval(t2);
|
|
result.innerHTML='100% ';
|
|
window.location.href="login.html"
|
|
return;
|
|
}else{
|
|
widthddd = widthddd+1;
|
|
prog_num.value = widthddd;
|
|
result.innerHTML=widthddd+'%';
|
|
}
|
|
}, 500);
|
|
clearInterval(t);
|
|
}, 1000);
|
|
}
|
|
}
|
|
xhr.open('POST', 'upload.cgi', true);
|
|
xhr.send(params);
|
|
}
|
|
|
|
// FPGA .mcs remote upgrade (separate endpoint from the imx6 package upgrade)
|
|
function uploadFpgaFile(){
|
|
if(remot_local_ctrl==1){
|
|
alert("System works in Local mode. Can't upgrade FPGA! Please change to Remote mode first.");
|
|
return;
|
|
}
|
|
var file = document.getElementById('FpgaMcs').files[0];
|
|
if(!file){ alert('Please select a .mcs file'); return; }
|
|
if(!/\.mcs$/i.test(file.name)){ alert('Please select a .mcs file (quickboot _update.mcs)'); return; }
|
|
if(!confirm("Flash FPGA with '"+file.name+"'?\n\nThis takes several minutes. Do NOT power off during the update. When done, the FPGA reloads and the RF chain re-establishes automatically — no power cycle or reboot needed.")){
|
|
return;
|
|
}
|
|
|
|
var result = document.getElementById('fpga_result');
|
|
document.getElementById('upgrade_fpga_id').disabled = true;
|
|
|
|
// The .mcs is ~23 MB and takes ~10 min to land on the board's flash. The board runs a
|
|
// small forking httpd; if testTime() keeps firing update_dpd_state/get_ntp_server_state/
|
|
// refreshDashboard every 3 s for that whole window (~200 rounds, each forking
|
|
// atsc_status_cfg.cgi and talking to the app over a socket) it starves the server and the
|
|
// upload connection stalls and never completes. uploadfile() has always set this flag for
|
|
// the imx6 package; the FPGA path was missing it, which is why large .mcs uploads never
|
|
// finished from the browser while a scripted POST (no background polling) did.
|
|
upgrade_imx_flg = 1;
|
|
|
|
var params = new FormData();
|
|
params.append('file', file);
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
xhr.onerror = function(){
|
|
alert('FPGA upload request failed');
|
|
document.getElementById('upgrade_fpga_id').disabled = false;
|
|
upgrade_imx_flg = 0; // let the dashboard resume
|
|
};
|
|
xhr.onabort = xhr.ontimeout = function(){
|
|
document.getElementById('upgrade_fpga_id').disabled = false;
|
|
upgrade_imx_flg = 0;
|
|
};
|
|
xhr.upload.onprogress = function(e){
|
|
var percent = Math.round(e.loaded / e.total * 100);
|
|
result.innerHTML = "Uploading .mcs ... " + percent + '%';
|
|
document.getElementById('fpga_progress').value = percent;
|
|
if(e.loaded == e.total){
|
|
// upload done -> the board now erases+writes the flash; track its progress
|
|
result.innerHTML = "Upload complete. Flashing FPGA... DO NOT power off.";
|
|
document.getElementById('fpga_progress').value = 0;
|
|
startFpgaFlashPoll();
|
|
}
|
|
};
|
|
xhr.open('POST', 'fpga_upload.cgi', true);
|
|
xhr.send(params);
|
|
}
|
|
|
|
// Poll the board for real-time FPGA flash progress (erase/write %) until done/error.
|
|
function startFpgaFlashPoll(){
|
|
var result = document.getElementById('fpga_result');
|
|
var bar = document.getElementById('fpga_progress');
|
|
var note = document.getElementById('fpga_retnote');
|
|
var btn = document.getElementById('upgrade_fpga_id');
|
|
var errAfterProgress = 0;
|
|
var sawProgress = false;
|
|
var poll = setInterval(function(){
|
|
$.ajax({ url:'fpga_up_status.cgi', cache:false, dataType:'text',
|
|
success:function(data){
|
|
errAfterProgress = 0;
|
|
var p = (data||'').trim().split(/\s+/);
|
|
var phase = p[0]||'PENDING';
|
|
var pct = parseInt(p[1]||'0',10)||0;
|
|
var ret = parseInt(p[2]||'0',10)||0;
|
|
if(phase==='PENDING'){ result.innerHTML = "Preparing (stopping DPD)..."; bar.value = 0; }
|
|
else if(phase==='ERASE'){ result.innerHTML = "Erasing flash (~30s)..."; bar.value = 0; }
|
|
else if(phase==='WRITE'){ sawProgress = true; result.innerHTML = "Writing FPGA image ... " + pct + "%"; bar.value = pct; }
|
|
else if(phase==='DONE'){
|
|
bar.value = 100;
|
|
result.innerHTML = "FPGA flash complete (100%). System is rebooting.";
|
|
note.innerText = "Done. FPGA reloaded + RF re-established automatically (no power cycle needed).";
|
|
clearInterval(poll); if(btn) btn.disabled = false;
|
|
}
|
|
else if(phase==='ERROR'){
|
|
result.innerHTML = "<span style='color:#d00;font-weight:bold'>FPGA flash FAILED (code " + ret + "). Aborted — check the device log. The board falls back to golden on cold boot.</span>";
|
|
clearInterval(poll); if(btn) btn.disabled = false;
|
|
}
|
|
},
|
|
error:function(){
|
|
// the board reboots on success and drops the connection; if we had
|
|
// already seen write progress, treat a sustained drop as done-then-reboot
|
|
errAfterProgress++;
|
|
if(sawProgress && errAfterProgress >= 4){
|
|
bar.value = 100;
|
|
result.innerHTML = "FPGA flashed; board is rebooting (connection lost). Cold-restart it when it returns.";
|
|
note.innerText = "Done. FPGA reloaded + RF re-established automatically (no power cycle needed).";
|
|
clearInterval(poll); if(btn) btn.disabled = false;
|
|
}
|
|
}
|
|
});
|
|
}, 1000);
|
|
}
|
|
|
|
// Modal Logic - Open and close account modal
|
|
function openAccountModal() {
|
|
// Fetch current username from server
|
|
$.get("login.cgi?action=get_user", function(data) {
|
|
var trimmedData = (data || "").trim();
|
|
if (trimmedData && trimmedData !== "UNAUTHORIZED") {
|
|
document.getElementById('current_user').value = trimmedData;
|
|
}
|
|
document.getElementById('accountModal').style.display = 'block';
|
|
setTimeout(function() { document.getElementById('current_pwd').focus(); }, 100);
|
|
}).fail(function() {
|
|
// On error, modal still opens but current_user remains empty
|
|
document.getElementById('accountModal').style.display = 'block';
|
|
setTimeout(function() { document.getElementById('current_pwd').focus(); }, 100);
|
|
});
|
|
}
|
|
|
|
function closeAccountModal() {
|
|
document.getElementById('accountModal').style.display = 'none';
|
|
// Clear sensitive fields
|
|
document.getElementById('current_pwd').value = '';
|
|
document.getElementById('new_pwd').value = '';
|
|
document.getElementById('confirm_pwd').value = '';
|
|
}
|
|
|
|
// Check if string contains only valid printable characters (ASCII 33-126, no spaces)
|
|
function isValidPrintableString(str) {
|
|
// Empty check
|
|
if (!str || str.length === 0) return false;
|
|
|
|
// Check each character is in valid range (33-126, no spaces)
|
|
for (var i = 0; i < str.length; i++) {
|
|
var code = str.charCodeAt(i);
|
|
// Allow only printable characters from 33 to 126 (no space 32)
|
|
if (code < 33 || code > 126) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
// Validate Account Form - All required fields must be filled
|
|
function validateAccountForm() {
|
|
var currentPwd = document.getElementById('current_pwd').value;
|
|
var newPwd = document.getElementById('new_pwd').value;
|
|
var confirmPwd = document.getElementById('confirm_pwd').value;
|
|
var newUser = document.getElementById('new_user').value;
|
|
|
|
// Current password is required (cannot be empty)
|
|
if (!currentPwd || currentPwd.trim() === "") {
|
|
alert("Current password is required");
|
|
return false;
|
|
}
|
|
|
|
// Check current password for valid printable characters (no spaces)
|
|
if (!isValidPrintableString(currentPwd)) {
|
|
alert("Current password contains invalid characters");
|
|
return false;
|
|
}
|
|
|
|
// New password is required (cannot be empty)
|
|
if (!newPwd || newPwd.trim() === "") {
|
|
alert("New password is required");
|
|
return false;
|
|
}
|
|
|
|
// Check new password for valid printable characters (no spaces)
|
|
if (!isValidPrintableString(newPwd)) {
|
|
alert("New password cannot contain spaces or control characters");
|
|
return false;
|
|
}
|
|
|
|
// Validate new password length
|
|
if (newPwd.length < 6) {
|
|
alert("New password must be at least 6 characters");
|
|
return false;
|
|
}
|
|
|
|
// Confirm password must match new password
|
|
if (newPwd !== confirmPwd) {
|
|
alert("New passwords do not match");
|
|
return false;
|
|
}
|
|
|
|
// Check confirm password for valid printable characters (no spaces)
|
|
if (!isValidPrintableString(confirmPwd)) {
|
|
alert("Confirm password cannot contain spaces or control characters");
|
|
return false;
|
|
}
|
|
|
|
// If new username is provided, validate it
|
|
if (newUser) {
|
|
if (!isValidPrintableString(newUser)) {
|
|
alert("New username cannot contain spaces or control characters");
|
|
return false;
|
|
}
|
|
if (newUser.length > 16) {
|
|
alert("Username must be 16 characters or less");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// Validate current password length
|
|
if (currentPwd.length > 16) {
|
|
alert("Current password must be 16 characters or less");
|
|
return false;
|
|
}
|
|
|
|
// Validate new password length
|
|
if (newPwd.length > 16) {
|
|
alert("New password must be 16 characters or less");
|
|
return false;
|
|
}
|
|
|
|
// Validate confirm password length
|
|
if (confirmPwd.length > 16) {
|
|
alert("Confirm password must be 16 characters or less");
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
// Form submission handler using fetch API
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
var accountForm = document.getElementById('accountForm');
|
|
if (accountForm) {
|
|
accountForm.addEventListener('submit', function(e) {
|
|
e.preventDefault();
|
|
|
|
if (!validateAccountForm()) return;
|
|
|
|
var formData = new URLSearchParams({
|
|
Username: document.getElementById('current_user').value,
|
|
OldPassword: document.getElementById('current_pwd').value,
|
|
NewUsername: document.getElementById('new_user').value,
|
|
NewPassword: document.getElementById('new_pwd').value,
|
|
ConfirmPassword: document.getElementById('confirm_pwd').value
|
|
});
|
|
|
|
fetch('login.cgi?action=change_account', {
|
|
method: 'POST',
|
|
body: formData
|
|
})
|
|
.then(r => r.json())
|
|
.then(data => {
|
|
if (data.success) {
|
|
alert("Update successful! Please login again.");
|
|
closeAccountModal();
|
|
// Redirect to login page after 1.5 seconds
|
|
setTimeout(function() {
|
|
window.location.href = 'login.cgi?logout=1';
|
|
}, 1500);
|
|
} else {
|
|
alert(data.error || "Update failed");
|
|
}
|
|
})
|
|
.catch(function(err) {
|
|
alert("Network error: " + err);
|
|
});
|
|
});
|
|
}
|
|
});
|
|
|
|
function get_license() {
|
|
var queryData = "sn_license=&";
|
|
$.get("atsc_status_cfg.cgi?"+queryData, function(data, status) {
|
|
// Handle case where data is a JSON object (e.g., session expired)
|
|
if (typeof data === 'object' && data !== null) {
|
|
if (data.error === 'session_expired' && data.redirect) {
|
|
window.location.href = data.redirect;
|
|
return;
|
|
}
|
|
console.error('Received JSON error response:', data);
|
|
return;
|
|
}
|
|
|
|
var table = data.split("|");
|
|
var licence_para = table[0].split("#");
|
|
$('#asi option[value="0"]').show();
|
|
$('#asi option[value="3"]').show();
|
|
|
|
g_key_eas_valid = Number(licence_para[4]);
|
|
if(g_key_eas_valid == 1) {
|
|
$('#asi option[value="2"]').show();
|
|
} else {
|
|
$('#asi option[value="2"]').hide();
|
|
}
|
|
});
|
|
}
|
|
|
|
function set_system_key() {
|
|
if(remot_local_ctrl) {
|
|
cmd_confirm();
|
|
SetFormDefaults();
|
|
return;
|
|
}
|
|
|
|
var postData = "system_a1_key=";
|
|
postData += "#"+$("#eas_key").val();
|
|
postData += "#"+"0";// postData += "#"+$("#tsoip_key").val();
|
|
postData += "#"+$("#psip_key").val();
|
|
|
|
if(cmd_confirm()) {
|
|
$.ajaxSettings.async = false;
|
|
$.post("atsc_status_cfg.cgi", postData, function(data, status) {
|
|
if(status=="success") {
|
|
SetFormDefaults();
|
|
} else {
|
|
alert("post val err");
|
|
}
|
|
});
|
|
$.ajaxSettings.async = true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function validateHex(element) {
|
|
element.value = element.value.replace(/[^0-9A-Fa-f]/g, '').toUpperCase();
|
|
}
|
|
|
|
/* NTP Server functions */
|
|
function set_ntp_server() {
|
|
if(remot_local_ctrl == 1) {
|
|
cmd_confirm();
|
|
SetFormDefaults();
|
|
return;
|
|
}
|
|
|
|
var ppppp_changed = 0;
|
|
var postData = "ntp_server=";
|
|
var cf = document.forms[3]; // form_ntp
|
|
|
|
postData += "#"+cf.ntp_ip1.value;
|
|
postData += "#"+cf.ntp_ip2.value;
|
|
postData += "#"+cf.ntp_ip3.value;
|
|
postData += "#"+cf.ntp_ip4.value;
|
|
postData += "#"+cf.ntp_switch.value;
|
|
manual_ntp_sync = 0;
|
|
postData += "#"+manual_ntp_sync;
|
|
|
|
if(g_old_ntp_ip1!=(Number(cf.ntp_ip1.value))||g_old_ntp_ip2!=(Number(cf.ntp_ip2.value))
|
|
||g_old_ntp_ip3!=(Number(cf.ntp_ip3.value))||g_old_ntp_ip4!=(Number(cf.ntp_ip4.value))
|
|
||(g_old_ntp_switch==0&&Number(cf.ntp_switch.value)==1)){
|
|
ppppp_changed = 1;
|
|
}
|
|
|
|
if(ppppp_changed){
|
|
ntp_cfg_button_disable(1);
|
|
var note_sec = 15;
|
|
label_ntp_sync.textContent = note_sec+" s";
|
|
|
|
var set_tnote_intv2 = setInterval(function() {
|
|
if(note_sec == 0) {
|
|
clearInterval(set_tnote_intv2);
|
|
label_ntp_sync.textContent = '';
|
|
ntp_cfg_button_disable(0);
|
|
SetFormDefaults();
|
|
return;
|
|
}else{
|
|
note_sec = note_sec-1;
|
|
label_ntp_sync.textContent = note_sec+" s";
|
|
}
|
|
}, 2000);
|
|
}
|
|
|
|
if(cmd_confirm()) {
|
|
$.post("atsc_status_cfg.cgi?", postData, function(data, status) {
|
|
if(status == "success") {
|
|
if (typeof setFormSectionSaved === 'function') setFormSectionSaved('form_ntp', 'ntp_set_id');
|
|
} else {
|
|
alert("post val err");
|
|
}
|
|
});
|
|
$.ajaxSettings.async = true;
|
|
} else {
|
|
if(ppppp_changed){
|
|
ntp_cfg_button_disable(0);
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function ntp_cfg_button_disable(a)
|
|
{
|
|
if(a==1){
|
|
$('#ntp_set_id').attr("disabled",true);
|
|
$('#ntp_sync_id').attr("disabled",true);
|
|
$('#ntp_switch').attr("disabled",true);
|
|
$('#ntp_ip1').attr("readOnly",true);
|
|
$('#ntp_ip2').attr("readOnly",true);
|
|
$('#ntp_ip3').attr("readOnly",true);
|
|
$('#ntp_ip4').attr("readOnly",true);
|
|
}
|
|
else{
|
|
$('#ntp_set_id').attr("disabled",false);
|
|
$('#ntp_sync_id').attr("disabled",false);
|
|
$('#ntp_switch').attr("disabled",false);
|
|
$('#ntp_ip1').attr("readOnly",false);
|
|
$('#ntp_ip2').attr("readOnly",false);
|
|
$('#ntp_ip3').attr("readOnly",false);
|
|
$('#ntp_ip4').attr("readOnly",false);
|
|
}
|
|
}
|
|
|
|
function get_ntp_server_state()
|
|
{
|
|
var queryData = "ntp_server=&";
|
|
$.get("atsc_status_cfg.cgi?"+queryData,function(data, status) {
|
|
// Handle case where data is a JSON object (e.g., session expired)
|
|
if (typeof data === 'object' && data !== null) {
|
|
if (data.error === 'session_expired' && data.redirect) {
|
|
window.location.href = data.redirect;
|
|
return;
|
|
}
|
|
console.error('Received JSON error response:', data);
|
|
return;
|
|
}
|
|
|
|
var table = data.split("|");
|
|
|
|
var ntp_para = table[0].split("#");
|
|
|
|
ntp_state = Number(ntp_para[6]);
|
|
if(ntp_state==1){
|
|
label_ntp_state.textContent = '( Sync )';
|
|
}
|
|
else{
|
|
label_ntp_state.textContent = '( Not Sync )';
|
|
}
|
|
});
|
|
}
|
|
|
|
function manual_sync_ntp()
|
|
{
|
|
var ppppp_changed = 0;
|
|
var manual_ntp_sync = 1;
|
|
|
|
if(remot_local_ctrl){
|
|
SetFormDefaults();
|
|
return;
|
|
}
|
|
|
|
var postData = "ntp_server=";
|
|
var cf = document.forms[3];
|
|
postData += "#"+cf.ntp_ip1.value;
|
|
postData += "#"+cf.ntp_ip2.value;
|
|
postData += "#"+cf.ntp_ip3.value;
|
|
postData += "#"+cf.ntp_ip4.value;
|
|
postData += "#"+cf.ntp_switch.value;
|
|
manual_ntp_sync = 1;
|
|
postData += "#"+manual_ntp_sync;
|
|
|
|
if(g_old_ntp_switch==1){
|
|
ppppp_changed = 1;
|
|
}
|
|
else{
|
|
return;
|
|
}
|
|
|
|
if(cmd_confirm()){
|
|
var note_sec = 10;
|
|
g_time_note_sec=10;
|
|
if(ppppp_changed){
|
|
// Disable the button during countdown to prevent multiple clicks
|
|
$('#ntp_sync_id').attr("disabled", true);
|
|
ntp_cfg_button_disable(1);
|
|
label_ntp_sync.textContent = note_sec+" s";
|
|
}
|
|
|
|
if(ppppp_changed){
|
|
var set_tnote_intv = setInterval(function() {
|
|
if(note_sec == 0) {
|
|
g_time_note_sec=note_sec;
|
|
clearInterval(set_tnote_intv);
|
|
label_ntp_sync.textContent = '';
|
|
// Re-enable NTP buttons after countdown is complete
|
|
$('#ntp_sync_id').attr("disabled", false);
|
|
ntp_cfg_button_disable(0);
|
|
|
|
// Only refresh NTP data, don't call full SetFormDefaults to avoid affecting other buttons
|
|
$.get("atsc_status_cfg.cgi?ntp_server=&", function(data, status) {
|
|
if (typeof data === 'object' && data !== null) {
|
|
if (data.error === 'session_expired' && data.redirect) {
|
|
window.location.href = data.redirect;
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
var table = data.split("|");
|
|
var ntp_para = table[0].split("#");
|
|
var ntpfom = document.forms[3];
|
|
|
|
// Update only NTP form data
|
|
var i = 1;
|
|
ntpfom.ntp_ip1.value = ntp_para[i++];
|
|
ntpfom.ntp_ip2.value = ntp_para[i++];
|
|
ntpfom.ntp_ip3.value = ntp_para[i++];
|
|
ntpfom.ntp_ip4.value = ntp_para[i++];
|
|
ntpfom.ntp_switch.selectedIndex = Number(ntp_para[i++]);
|
|
|
|
g_old_ntp_ip1 = ntpfom.ntp_ip1.value;
|
|
g_old_ntp_ip2 = ntpfom.ntp_ip2.value;
|
|
g_old_ntp_ip3 = ntpfom.ntp_ip3.value;
|
|
g_old_ntp_ip4 = ntpfom.ntp_ip4.value;
|
|
g_old_ntp_switch = ntpfom.ntp_switch.selectedIndex;
|
|
|
|
// Update only NTP form snapshot
|
|
if (typeof setFormSectionSaved === 'function') {
|
|
setFormSectionSaved('form_ntp', 'ntp_set_id');
|
|
}
|
|
}).fail(function() {
|
|
console.error("NTP data refresh failed after sync - buttons remain enabled");
|
|
// Don't change button states - they're already correctly enabled
|
|
});
|
|
return;
|
|
}else{
|
|
note_sec = note_sec-1;
|
|
g_time_note_sec=note_sec;
|
|
label_ntp_sync.textContent = note_sec+" s";
|
|
}
|
|
}, 2000);
|
|
}
|
|
|
|
$.post("atsc_status_cfg.cgi?",postData,function(data, status){
|
|
if(status=="success"){
|
|
SetFormDefaults();
|
|
}else{
|
|
alert("post val err");
|
|
}
|
|
});
|
|
$.ajaxSettings.async = true;
|
|
}
|
|
else{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
/* Time Zone function */
|
|
function set_timezone() {
|
|
if(remot_local_ctrl == 1) {
|
|
cmd_confirm();
|
|
SetFormDefaults();
|
|
return;
|
|
}
|
|
|
|
var postData = "imx_timezone=";
|
|
var cf = document.forms[2]; // form_rtc
|
|
|
|
// Convert select value (0 to 24) to server timezone value (-12 to +12)
|
|
var selectValue = Number(cf.timezone.value);
|
|
var serverTimezone = selectValue - 12; // 0 becomes -12, 12 becomes 0, 24 becomes +12
|
|
|
|
postData += "#" + serverTimezone;
|
|
|
|
if(cmd_confirm()) {
|
|
$.post("atsc_status_cfg.cgi?", postData, function(data, status) {
|
|
if(status == "success") {
|
|
if (typeof setFormSectionSaved === 'function') setFormSectionSaved('form_rtc', 'timezone_set_id');
|
|
} else {
|
|
alert("post val err");
|
|
}
|
|
});
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="app-layout">
|
|
<aside class="app-sidebar">
|
|
<ul class="items">
|
|
<li><a href="status_info.html" title="Status">Status</a></li>
|
|
<li class="active"><a href="sys_set.html" title="Settings">Settings</a></li>
|
|
<li><a href="sys_rf.html" title="RF Control">RF Control</a></li>
|
|
<li><a href="sys_psip.html" title="TSID&PSIP">TSID&PSIP</a></li>
|
|
<li><a href="sys_ts.html" title="TSoIP">TSoIP</a></li>
|
|
<li><a href="sys_spectrum.html" title="Spectrum">Spectrum</a></li>
|
|
<li><a href="log_output.html" title="Log">Log</a></li>
|
|
</ul>
|
|
<div class="sidebar-footer">
|
|
<h4>Anywave Broadcast Inc.</h4>
|
|
<p>Copyright 2026<br><br><span class="redbox-label">Technical Support</span><br>+1 847 415 2258<br><a href="mailto:support@anywaveus.com">support@anywaveus.com</a></p>
|
|
</div>
|
|
</aside>
|
|
<div class="sidebar-overlay" onclick="toggleSidebar()"></div>
|
|
|
|
<header class="app-header">
|
|
<button class="menu-toggle" onclick="toggleSidebar()" aria-label="Toggle menu">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<line x1="3" y1="12" x2="21" y2="12"></line>
|
|
<line x1="3" y1="6" x2="21" y2="6"></line>
|
|
<line x1="3" y1="18" x2="21" y2="18"></line>
|
|
</svg>
|
|
</button>
|
|
<h1><a href="https://anywavecom.net/" class="logo-bg" title="Anywave Broadcast Inc."></a></h1>
|
|
<h2 id="webtitle_header"><span></span></h2>
|
|
<h3>
|
|
<div class="dropdown">
|
|
<button class="dropbtn-modern">Admin ▾</button>
|
|
<div class="dropdown-content">
|
|
<a href="#" onclick="openAccountModal(); return false;">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<circle cx="12" cy="12" r="3"></circle>
|
|
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06-.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06-.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06-.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
|
|
</svg>
|
|
Account Settings
|
|
</a>
|
|
<a href="login.cgi?logout=1">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
|
|
<polyline points="16 17 21 12 16 7"></polyline>
|
|
<line x1="21" y1="12" x2="9" y2="12"></line>
|
|
</svg>
|
|
Logout
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</h3>
|
|
</header>
|
|
|
|
<!-- Fixed Dashboard Summary - Top of page, under header -->
|
|
<div class="dashboard-fixed">
|
|
<div class="summary-dashboard">
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-neutral" id="dot_freq" aria-hidden="true"></span>
|
|
<span class="summary-label">Frequency</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-neutral" id="sum_freq">--</span>
|
|
<span class="summary-unit">MHz</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-ok" id="dot_snr" aria-hidden="true"></span>
|
|
<span class="summary-label">SNR</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-ok" id="sum_snr">--</span>
|
|
<span class="summary-unit">dB</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-ok" id="dot_uimd" aria-hidden="true"></span>
|
|
<span class="summary-label">UIMD</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-ok" id="sum_uimd">--</span>
|
|
<span class="summary-unit">dBc</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-ok" id="dot_limd" aria-hidden="true"></span>
|
|
<span class="summary-label">LIMD</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-ok" id="sum_limd">--</span>
|
|
<span class="summary-unit">dBc</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-off" id="dot_rf" aria-hidden="true"></span>
|
|
<span class="summary-label">RF Switch</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-muted" id="sum_rf">--</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-ok" id="dot_outpow" aria-hidden="true"></span>
|
|
<span class="summary-label">Output Power</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-ok" id="sum_outpow">--</span>
|
|
<span class="summary-unit">dBm</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-neutral" id="dot_input" aria-hidden="true"></span>
|
|
<span class="summary-label">Input Source</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-neutral" id="sum_input">--</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-neutral" id="dot_input_status" aria-hidden="true"></span>
|
|
<span class="summary-label">Input Status</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-neutral" id="sum_input_status">--</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-neutral" id="dot_bitrate" aria-hidden="true"></span>
|
|
<span class="summary-label">Bitrate</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-neutral" id="sum_bitrate">--</span>
|
|
<span class="summary-unit">Mbps</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-ok" id="dot_temp" aria-hidden="true"></span>
|
|
<span class="summary-label">Temperature</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-ok" id="sum_temp">--</span>
|
|
<span class="summary-unit">°F</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-off" id="dot_agc" aria-hidden="true"></span>
|
|
<span class="summary-label">AGC</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-muted" id="sum_agc">--</span>
|
|
</div>
|
|
</div>
|
|
<div class="summary-card">
|
|
<div class="summary-label-row">
|
|
<span class="status-dot status-neutral" id="dot_control" aria-hidden="true"></span>
|
|
<span class="summary-label">Control</span>
|
|
</div>
|
|
<div class="summary-value-wrapper">
|
|
<span class="summary-value value-neutral" id="sum_control">--</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<main class="app-main">
|
|
<h2>Settings</h2>
|
|
<div class="box">
|
|
<form id="form_para">
|
|
<table>
|
|
<tr>
|
|
<td>Input</td>
|
|
<td>
|
|
<select name="asi" id="asi">
|
|
<option value="0">Tuner
|
|
<option value="1">ASI
|
|
<option value="2">EAS
|
|
<option value="3">TSoIP
|
|
<option value="4">SMPTE
|
|
</select>
|
|
</td>
|
|
<td>GPS</td>
|
|
<td>
|
|
<select name="gps" id="gps">
|
|
<option value="0">External
|
|
<option value="1">Internal
|
|
<option value="2">Auto
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>ADPC</td>
|
|
<td>
|
|
<select name="adp" id="adp">
|
|
<option value="0">Off
|
|
<option value="1">Hold
|
|
<option value="2">Update
|
|
<option value="3">UpdateLIN
|
|
<option value="4">UpdateNLIN
|
|
</select>
|
|
</td>
|
|
<td>ADPC Status</td>
|
|
<td>
|
|
<input type="text" style="max-width: 250px;" readonly name="adpc_sta" id="adpc_sta" value="" class="adpc-status-field">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Control</td>
|
|
<td>
|
|
<select name="ctl" id="ctl">
|
|
<option value="0">Remote
|
|
<option value="1">Local
|
|
</select>
|
|
</td>
|
|
<td>Mode</td>
|
|
<td>
|
|
<select name="mod" id="mod">
|
|
<option value="0">ATSC1.0
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Web Title</td>
|
|
<td>
|
|
<input type="text" maxlength="15" size="15" name="ltitle" id="ltitle" value="">
|
|
</td>
|
|
<td>Fwd Cal</td>
|
|
<td>
|
|
<select name="fwd_cal" id="fwd_cal">
|
|
<option value="0">Calculate
|
|
<option value="1">OK
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr id="tr_id_sn" style="display:none">
|
|
<td>SN</td>
|
|
<td>
|
|
<input type="text" maxlength="13" size="15" name="sn" id="sn" value="">
|
|
</td>
|
|
<td>PDT</td>
|
|
<td>
|
|
<input type="text" maxlength="3" size="3" name="pdt" id="pdt" value="">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>PA Link RF Protect</td>
|
|
<td>
|
|
<select name="pa_crf" id="pa_crf">
|
|
<option value="0">Off
|
|
<option value="1">On
|
|
</select>
|
|
</td>
|
|
|
|
<td>FSSI Refresh</td>
|
|
<td>
|
|
<select name="ab_mode" id="ab_mode" style="width:100px">
|
|
<option value="0">Off</option>
|
|
<option value="1">On</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Gain Limit</td>
|
|
<td><input type="text" maxlength="6" size="6" name="gainlimit" id="gainlimit" value=""></td>
|
|
<td>Roll Off</td>
|
|
<td>
|
|
<select name="roll_off" id="roll_off" style="width:100px">
|
|
<option value="0">New
|
|
<option value="1">Original
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr style="display: none" >
|
|
<td>System Reset</td>
|
|
<td>
|
|
<select name="sys_reset" id="sys_reset">
|
|
<option value="0">No
|
|
<option value="1">Yes
|
|
</select>
|
|
</td>
|
|
<td>DPD Tst</td>
|
|
<td><input type="text" maxlength="5" size="5" name="tst" id="tst" value=""></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>
|
|
<input type="hidden" name="agc_att" value="">
|
|
<input type="hidden" name="adrv9009_att" value="">
|
|
ORX_Manu_Gain
|
|
</td>
|
|
<td>
|
|
<input maxlength="3" size="5" name="orx_manu_gain" value="">(195~255)
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><input type="button" class="btn-modern" disabled id="para_set_id" alt="Set" value="Set" onclick="return set_syspara();"></td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
<br>
|
|
|
|
<h2>Management (IP2) Configuration</h2>
|
|
<div class="box">
|
|
<form id="form_net">
|
|
<table>
|
|
<tr>
|
|
<td>IP</td>
|
|
<td><fieldset>
|
|
<input style="width:40px" maxlength="3" size="3" name="ip1" id="ip1" value="">.
|
|
<input style="width:40px" maxlength="3" size="3" name="ip2" id="ip2" value="">.
|
|
<input style="width:40px" maxlength="3" size="3" name="ip3" id="ip3" value="">.
|
|
<input style="width:40px" maxlength="3" size="3" name="ip4" id="ip4" value="">
|
|
</fieldset></td>
|
|
<td>Netmask</td>
|
|
<td><fieldset>
|
|
<input style="width:40px" maxlength="3" size="3" name="mk1" id="mk1" value="">.
|
|
<input style="width:40px" maxlength="3" size="3" name="mk2" id="mk2" value="">.
|
|
<input style="width:40px" maxlength="3" size="3" name="mk3" id="mk3" value="">.
|
|
<input style="width:40px" maxlength="3" size="3" name="mk4" id="mk4" value="">
|
|
</fieldset></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Gateway</td>
|
|
<td><fieldset>
|
|
<input style="width:40px" maxlength="3" size="3" name="gt1" id="gt1" value="">.
|
|
<input style="width:40px" maxlength="3" size="3" name="gt2" id="gt2" value="">.
|
|
<input style="width:40px" maxlength="3" size="3" name="gt3" id="gt3" value="">.
|
|
<input style="width:40px" maxlength="3" size="3" name="gt4" id="gt4" value="">
|
|
</fieldset></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<input type="button" class="btn-modern" disabled id="net_set_id" alt="Set" value="Set" onclick="return setsysnet();">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
|
|
<br>
|
|
<h2>RTC Configuration</h2>
|
|
<div class="box">
|
|
<form id="form_rtc">
|
|
<table>
|
|
<tr>
|
|
<td>RTC-Date</td>
|
|
<td style="width:500px">
|
|
<fieldset>
|
|
<input style="width:50px" maxlength="4" size="4" name="imx_year" id="imx_year" value="">YY
|
|
<input style="width:40px" maxlength="2" size="3" name="imx_mon" id="imx_mon" value="">MM
|
|
<input style="width:40px" maxlength="2" size="3" name="imx_day" id="imx_day" value="">DD
|
|
</fieldset>
|
|
</td>
|
|
|
|
<td>RTC-Time</td>
|
|
<td style="width:500px">
|
|
<fieldset>
|
|
<input style="width:40px" maxlength="2" size="3" name="imx_hour" id="imx_hour" value="">HH
|
|
<input style="width:40px" maxlength="2" size="3" name="imx_min" id="imx_min" value="">MM
|
|
<input style="width:40px" maxlength="2" size="3" name="imx_sec" id="imx_sec" value="">SS
|
|
</fieldset>
|
|
</td>
|
|
<td>
|
|
<input type="button" class="btn-modern" alt="Set" value="Set" disabled id="sys_rtc_id" onclick="return setrtc();">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Time Zone</td>
|
|
<td style="width:500px">
|
|
<select name="timezone" id="timezone-selector">
|
|
<option value="0">UTC-12</option>
|
|
<option value="1">UTC-11</option>
|
|
<option value="2">UTC-10</option>
|
|
<option value="3">UTC-9</option>
|
|
<option value="4">UTC-8</option>
|
|
<option value="5">UTC-7</option>
|
|
<option value="6">UTC-6</option>
|
|
<option value="7">UTC-5</option>
|
|
<option value="8">UTC-4</option>
|
|
<option value="9">UTC-3</option>
|
|
<option value="10">UTC-2</option>
|
|
<option value="11">UTC-1</option>
|
|
<option value="12" selected>UTC+0</option>
|
|
<option value="13">UTC+1</option>
|
|
<option value="14">UTC+2</option>
|
|
<option value="15">UTC+3</option>
|
|
<option value="16">UTC+4</option>
|
|
<option value="17">UTC+5</option>
|
|
<option value="18">UTC+6</option>
|
|
<option value="19">UTC+7</option>
|
|
<option value="20">UTC+8</option>
|
|
<option value="21">UTC+9</option>
|
|
<option value="22">UTC+10</option>
|
|
<option value="23">UTC+11</option>
|
|
<option value="24">UTC+12</option>
|
|
</select>
|
|
</td>
|
|
<td ></td><td style="width:500px"></td>
|
|
<td>
|
|
<input type="button" class="btn-modern" alt="Set" value="Set" disabled id="timezone_set_id" onclick="return set_timezone();">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
|
|
<br>
|
|
<h2>NTP Server Configuration</h2>
|
|
<div class="box">
|
|
<form id="form_ntp">
|
|
<table>
|
|
<tr>
|
|
<td>Server IP</td>
|
|
<td style="width:500px">
|
|
<fieldset>
|
|
<input style="width:40px" maxlength="3" size="3" name="ntp_ip1" id="ntp_ip1" value="">.
|
|
<input style="width:40px" maxlength="3" size="3" name="ntp_ip2" id="ntp_ip2" value="">.
|
|
<input style="width:40px" maxlength="3" size="3" name="ntp_ip3" id="ntp_ip3" value="">.
|
|
<input style="width:40px" maxlength="3" size="3" name="ntp_ip4" id="ntp_ip4" value="">
|
|
<span id="label_ntp_state" style="margin-left:10px;"></span>
|
|
</fieldset>
|
|
</td>
|
|
<td>NTP Switch</td>
|
|
<td style="width:500px">
|
|
<select name="ntp_switch" id="ntp_switch">
|
|
<option value="0">Disable</option>
|
|
<option value="1">Enable</option>
|
|
</select>
|
|
</td>
|
|
<td>
|
|
<input type="button" class="btn-modern" alt="MANUAL SYNC" value="MANUAL SYNC" disabled id="ntp_sync_id" onclick="return manual_sync_ntp();">
|
|
<span id="label_ntp_sync" style="margin-left:10px;"></span>
|
|
<input type="button" class="btn-modern" alt="Set" value="Set" disabled id="ntp_set_id" onclick="return set_ntp_server();">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
|
|
<br>
|
|
<h2>SYSTEM KEY</h2>
|
|
<div class="box">
|
|
<form id="form_key">
|
|
<table>
|
|
<tr>
|
|
<td>PSIP KEY</td>
|
|
<td style="width:500px"><fieldset>
|
|
<input style="width:100px" maxlength="8" size="9" name="psip_key" id="psip_key" value="" oninput="validateHex(this)">
|
|
</fieldset></td>
|
|
<td>EAS KEY</td>
|
|
<td style="width:500px"><fieldset>
|
|
<input style="width:100px" maxlength="8" size="9" name="eas_key" id="eas_key" value="" oninput="validateHex(this)">
|
|
</fieldset></td>
|
|
<td>
|
|
<input type="button" class="btn-modern" disabled id="key_set_id" alt="SET" value="Set" onclick="return set_system_key();">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
|
|
<br>
|
|
<h2>System Reset Configuration</h2>
|
|
<div class="box">
|
|
<form id="form_reset">
|
|
<table id="rst_tb">
|
|
<tr>
|
|
<td>System Reset</td>
|
|
<td>
|
|
<select name="sysreset" id="sysreset">
|
|
<option value="0">No
|
|
<option value="1">Yes
|
|
</select>
|
|
</td>
|
|
<td><input type="button" class="btn-modern" disabled id="sysreset_bt_id" alt="Set" value="Set" onclick="return sysresetff();"> </td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
|
|
<div><span id="rst_note" style="color:#0B77B7; font-size:14px" ></span></div>
|
|
<br><br>
|
|
<div>
|
|
<progress id="rst_progid" style="width:100%; margin-left:1px; display:none; color:#0bb710;" value="0" max="100"></progress>
|
|
<span id='rst_progsval' style="color:#0B77B7; font-size:18px;"></span>
|
|
</div>
|
|
|
|
<br>
|
|
<h2>Remote Update</h2>
|
|
<div class="box">
|
|
<form id="formupgrade" target="myIframe" name="formupgrade" method="post" action="upload.cgi" enctype="multipart/form-data">
|
|
<div id="divupgrade" style="padding: 20px;">
|
|
<span id="LUpgrade" ></span>
|
|
<input name="Upgrade" type="file" id="Upgrade"/>
|
|
<input type="button" class="btn-modern" alt="UPGRADE" value="Upgrade" disabled id="upgrade_imx_id" onclick='uploadfile("imx")'>
|
|
</div>
|
|
</form>
|
|
<iframe name="myIframe" id="myIframe" style="display: none;"></iframe>
|
|
</div>
|
|
|
|
<div><span id="retnote" style="color:#0B77B7; font-size:14px" ></span></div>
|
|
<br><br>
|
|
<div>
|
|
<progress id="prog_id" style="width:100%; margin-left:1px; display:none; color:#0bb710;" value="0" max="100"></progress>
|
|
<br><br>
|
|
<span id='result' style="color: #0B77B7 ;font-size:18px"></span>
|
|
<progress id='progress' style="width:100%; margin-left:1px; color:#0B77B7; font-size:18px" value="0" max="100"></progress>
|
|
</div>
|
|
|
|
<br>
|
|
<h2>FPGA Update (.mcs)</h2>
|
|
<div class="box">
|
|
<form id="formfpga" target="myIframeFpga" name="formfpga" method="post" action="fpga_upload.cgi" enctype="multipart/form-data">
|
|
<div id="divfpga" style="padding: 20px;">
|
|
<span id="LFpga"></span>
|
|
<input name="FpgaMcs" type="file" id="FpgaMcs" accept=".mcs"/>
|
|
<input type="button" class="btn-modern" alt="FPGA UPGRADE" value="Upgrade FPGA" id="upgrade_fpga_id" onclick='uploadFpgaFile()'>
|
|
</div>
|
|
</form>
|
|
<iframe name="myIframeFpga" id="myIframeFpga" style="display: none;"></iframe>
|
|
</div>
|
|
<div><span id="fpga_retnote" style="color:#0B77B7; font-size:14px"></span></div>
|
|
<br>
|
|
<div>
|
|
<span id='fpga_result' style="color: #0B77B7 ;font-size:18px"></span>
|
|
<progress id='fpga_progress' style="width:100%; margin-left:1px; color:#0B77B7; font-size:18px" value="0" max="100"></progress>
|
|
</div>
|
|
|
|
</main>
|
|
</div>
|
|
|
|
<div id="accountModal" class="modal">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h3>Account Settings</h3>
|
|
<span class="close" onclick="closeAccountModal()">×</span>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form id="accountForm" method="post" action="login.cgi?action=change_account" onsubmit="return validateAccountForm()">
|
|
<table class="modal-table">
|
|
<tr>
|
|
<td>Current Username</td>
|
|
<td><input type="text" id="current_user" name="current_user" readonly></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Current Password</td>
|
|
<td><input type="password" id="current_pwd" name="current_pwd" required></td>
|
|
</tr>
|
|
<tr>
|
|
<td>New Username</td>
|
|
<td><input type="text" id="new_user" name="new_user"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>New Password</td>
|
|
<td><input type="password" id="new_pwd" name="new_pwd"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Confirm Password</td>
|
|
<td><input type="password" id="confirm_pwd" name="confirm_pwd"></td>
|
|
</tr>
|
|
</table>
|
|
<div class="modal-footer">
|
|
<input type="button" class="btn-modern" style="background-color: #64748b;" value="Cancel" onclick="closeAccountModal()">
|
|
<input type="submit" class="btn-modern" value="Save Changes">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function toggleSidebar(){
|
|
document.querySelector('.app-sidebar').classList.toggle('sidebar-open');
|
|
document.querySelector('.sidebar-overlay').classList.toggle('active');
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|