zioinfo-mail/workspace/zioinfo-esn/restapi_lgit/target/ROOT/management/gateway.html
DESKTOP-TKLFCPR\ython 371f77e7ab
Some checks failed
GUARDiA CI / Python Lint & Import Test (push) Has been cancelled
GUARDiA CI / Validate Install Scripts (push) Has been cancelled
GUARDiA CI / PR Validation Summary (push) Has been cancelled
fix(enhance-v4): APK QR 버그 수정 + 웹메일 라우터 수정
2026-06-02 20:23:55 +09:00

1644 lines
60 KiB
HTML

<div style="height:350px;background-color:#f2f2f2;">
<table id="gateway_list" class="table table-classic table-hover">
<thead>
<tr>
<th width="25" id="gw_list_no">No</th>
<th width="145" id="gw_list_name">Name</th>
<th width="115" id="gw_list_did">Device ID</th>
<th width="40" id="gw_list_state">State</th>
<th width="90" id="gw_list_ip_address">IP Address</th>
<th width="*" id="gw_list_normal_tag_count">Normal Tag</th>
<th width="*" id="gw_list_invalid_tag_count">Invalid Tag</th>
<th width="*" id="gw_list_removed_tag_count">Removed Tag</th>
<th width="55" id="gw_list_interval">Alive<br />Interval</th>
<th width="55" id="gw_list_common_ch1">Common<br />Channel</th>
<th width="55" id="gw_list_common_ch2">Common<br />Channel</th>
<th width="50" id="gw_list_data_ch1">Data<br />Channel</th>
<th width="50" id="gw_list_data_ch2">Data<br />Channel</th>
<th width="65" id="gw_list_beacon_ch">Beacon<br />Channel</th>
<th width="90" id="gw_list_versoin">Version</th>
<th width="100" id="gw_list_fw_update_state">F/W Update State</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<script data-jui="#gateway_list" data-tpl="row" type="text/template">
<tr style="cursor:pointer;text-align:center;">
<td><!=no !></td>
<td><!=view_name !></td>
<td><!=device_id !></td>
<td><!=state !></td>
<td><!=ip !></td>
<td><!=normal_tag_count !></td>
<td><!=invalid_tag_count !></td>
<td><!=removed_tag_count !></td>
<td><!=aliveInterval !></td>
<td><!=commonChannel !></td>
<td><!=commonChannel2 !></td>
<td><!=dataChannel !></td>
<td><!=dataChannel2 !></td>
<td><!=beaconChannel !></td>
<td><!=version !></td>
<td><!=fwupdate_state !></td>
</tr>
</script>
<script data-jui="#gateway_list" data-tpl="none" type="text/template">
<tr>
<td colspan="16" class="none" style="text-align:center;height:320px;">&nbsp;</td>
</tr>
</script>
<div style="position:relative;left:0px;top:20px;"><i class="icon-help" style="color:gray;font-size: 20px; float: left;" id="icon_tooltip_gatewaylist"></i></div>
<div>
<p style="text-align:right; padding-top:5px;">
<!-- //<a class="btn btn-gray" id="btn_gateway_add">Add</a>//-->
<!-- <div class="" style="text-align:right;padding-top:5px;float:right">-->
<a class="btn btn-gray" id="btn_products_search">Products Search</a>
<a class="btn btn-gray" id="btn_gateway_edit">Edit</a>
<a class="btn btn-gray" id="btn_gateway_delete">Delete</a>
<a class="btn btn-gray" id="btn_gateway_refresh">Refresh</a>
</p>
</div>
<div id="gateway_contents" style="display:block;">
<ul id="gateway_tab" class="tab tab-top">
<li><a href="#Configuration" id="gw_config">Config</a></li>
<li><a href="#ChannelScan" id="gw_channel_scan">Channel Scan</a></li>
<li><a href="#AP" id="gw_ap">AP</a></li>
<li><a href="#Log" id="gw_log">Log</a></li>
</ul>
<div id="gateway_tab_contents">
<div id="Configuration">
<table width="100%" border="0">
<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>
<tr id="gatewayConfigurationChannelRow">
<td>
<div class="panel">
<div class="head" ><label id="gw_label_commonchannel">Common Channel</label>&nbsp;
<i class="icon-help" style="color:gray;font-size: 20px; vertical-align:middle;" id="icon_gw_commonchannel"></i></div>
<div class="body" style="height: 53px;">
<div>
<div class="group" style="margin-bottom: 5px;">
<label class="label label-small" style="width:100px;" id="gw_label_common_channel">Channel</label>
<input type="number" name="commonChannel" id="commonChannel" value="1" min="11" max="26" class="input input-small input-rect" style="width:50px;" />
&nbsp;
<label class="label label-small" style="width:100px;" id="gw_label_common_rf">RF Power</label>
<input type="number" name="commonChannelRF" id="commonChannelRF" value="1" min="0" max="19" class="input input-small input-rect" style="width:50px;" />
dBm
&nbsp;
<label id="commonChannelSPILabel" class="label label-small" style="width:100px;">SPI Display</label>
<input type="number" name="commonChannelSPI" id="commonChannelSPI" value="1" min="1" max="255" class="input input-small input-rect" style="width:70px;" />
<label id="commonChannelSPIText">&nbsp;&nbsp;ms</label>
</div><br/>
<div class="group" style="display: none;" id="div_common_channel2">
<label class="label label-small" style="width:100px;" id="gw_label_common_channel2">Channel2</label>
<input type="number" name="commonChannel2" id="commonChannel2" value="1" min="11" max="26" class="input input-small input-rect" style="width:50px;" />
&nbsp;
<label class="label label-small" style="width:100px;" id="gw_label_common_rf2">RF Power2</label>
<input type="number" name="commonChannelRF2" id="commonChannelRF2" value="1" min="0" max="19" class="input input-small input-rect" style="width:50px;" />
dBm
</div>
</div>
</div>
</div>
</td>
<td>
<div class="panel">
<div class="head" ><label id="gw_label_datachannel">Data Channel</label>&nbsp;
<i class="icon-help" style="color:gray;font-size: 20px; vertical-align:middle;" id="icon_gw_datachannel"></i></div>
<div class="body" style="height: 53px;">
<div>
<div class="group" style="margin-bottom: 5px;" >
<label class="label label-small" style="width:100px;" id="gw_label_data_channel">Channel</label>
<input type="number" name="dataChannel" id="dataChannel" value="11" min="11" max="26" class="input input-small input-rect" style="width:50px;" />
&nbsp;
<label class="label label-small" style="width:100px;" id="gw_label_data_rf">RF Power</label>
<input type="number" name="dataChannelRF" id="dataChannelRF" value="0" min="0" max="19" class="input input-small input-rect" style="width:50px;" />
dBm
&nbsp;
<label id="dataChannelSPILabel" class="label label-small" style="width:100px;">SPI Display</label>
<input type="number" name="dataChannelSPI" id="dataChannelSPI" value="1" min="1" max="255" class="input input-small input-rect" style="width:70px;" />
<label id="dataChannelSPIText">&nbsp;&nbsp;ms</label>
</div><br/>
<div class="group" style="display: none;" id="div_data_channel2">
<label class="label label-small" style="width:100px;" id="gw_label_data_channel2">Channel2</label>
<input type="number" name="dataChannel2" id="dataChannel2" value="11" min="11" max="26" class="input input-small input-rect" style="width:50px;" />
&nbsp;
<label class="label label-small" style="width:100px;" id="gw_label_data_rf2">RF Power2</label>
<input type="number" name="dataChannelRF2" id="dataChannelRF2" value="0" min="0" max="19" class="input input-small input-rect" style="width:50px;" />
dBm
</div>
</div>
</div>
</div>
</td>
</tr>
<tr style="display:none">
<td>
<div class="panel">
<div class="head">Channel</div>
<div class="body">
<div>
<div class="group">
<label class="label label-small" style="width:80px;">Mode</label>
<select name="channelMode" id="channelMode" style="width:100px;height:25px;">
<option value="Manual">Manual</option>
<option value="Auto">Auto</option>
</select>
&nbsp;
<label class="label label-small" style="width:80px;">Threshold</label>
<input type="number" name="channelThreshold" id="channelThreshold" value="1" min="1" max="255" class="input input-small input-rect" style="width:70px;" />
</div>
</div>
</div>
</div>
</td>
<td>
<div class="panel">
<div class="head">Retry</div>
<div class="body">
<div>
<div class="group">
<label class="label label-small" style="width:80px;">First</label>
<input type="number" name="retryFirst" id="retryFirst" value="1" min="1" max="255" class="input input-small input-rect" style="width:70px;" />
ms
&nbsp;
<label class="label label-small" style="width:80px;">Next</label>
<input type="number" name="retryNext" id="retryNext" value="1" min="1" max="255" class="input input-small input-rect" style="width:70px;" />
ms
</div>
</div>
</div>
</div>
</td>
</tr>
<tr id="gatewayHidden1">
<td>
<div class="panel">
<div class="head"><label id="gw_label_beaconchannel">Becon Channel</label></div>
<div class="body" style="height: 53px;">
<div>
<div class="group" style="display: none;" id="div_beacon_channel">
<label class="label label-small" style="width:100px;" id="gw_label_beacon_channel">Channel</label>
<input type="number" name="beaconChannel" id="beaconChannel" value="1" min="11" max="26" class="input input-small input-rect" style="width:50px;" />
&nbsp;
<label class="label label-small" style="width:100px;" id="gw_label_beacon_rf">RF Power</label>
<input type="number" name="beaconPower" id="beaconPower" value="1" min="0" max="19" class="input input-small input-rect" style="width:50px;" />
dBm
</div>
</div>
</div>
</div>
</td>
<td>
<div class="panel">
<div class="head">Timeout</div>
<div class="body">
<div>
<div class="group" style="margin-bottom: 5px;">
<label class="label label-small" style="width:140px;">Download to G/W</label>
<input type="number" name="timeoutGateway" id="timeoutGateway" value="1" min="1" max="6500" class="input input-small input-rect" style="width:80px;" />
10ms
&nbsp;&nbsp;
<label class="label label-small" style="width:100px;">Invalid Tag</label>
<input type="number" name="timeoutInvalidTag" id="timeoutInvalidTag" value="1" min="1" max="255" class="input input-small input-rect" style="width:70px;" />
</div><br/>
<div class="group">
<label class="label label-small" style="width:140px;">Download to MeT</label>
<input type="number" name="timeoutMeT" id="timeoutMeT" value="1" min="1" max="6500" class="input input-small input-rect" style="width:80px;" />
10ms
&nbsp;&nbsp;
<label class="label label-small" style="width:140px;">Download to HeT</label>
<input type="number" name="timeoutHeT" id="timeoutHeT" value="1" min="1" max="6500" class="input input-small input-rect" style="width:80px;" />
10ms
</div>
</div>
</div>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="panel">
<div class="body">
<div>
<div class="group">
<label class="label label-small" style="width:140px;" id="gw_config_alirve_interval">Alive Interval</label>
<input type="number" name="aliveInterval" id="aliveInterval" value="60" min="60" max="65530" class="input input-small input-rect" style="width:80px;" />
&nbsp;
<label id="gw_config_second">Seconds</label>
&nbsp;
<i class="icon-help" style="color:gray;font-size: 20px; vertical-align:middle;" id="icon_gw_aliveInterval"></i>
&nbsp;
<label id="scanDurationLabel" class="label label-small" style="width:100px;">Scan Duration</label>
<input type="number" name="scanDuration" id="scanDuration" value="1" min="1" max="10" class="input input-small input-rect" style="width:50px;" />
<label id="scanDurationText">&nbsp;&nbsp;Seconds</label>
&nbsp;
<label class="label label-small" style="width:180px;" id="maxTagCountLabel" >Max TAG Count</label>
<input type="number" name="maxTagCount" id="maxTagCount" value="1" min="1" max="10000" class="input input-small input-rect" style="width:80px;" />
&nbsp;
<label id="gw_config_ea">ea</label>
&nbsp;
<i class="icon-help" style="color:gray;font-size: 20px; vertical-align:middle;" id="icon_gw_maxTagCount"></i>
&nbsp;
<label id="downloadSpeedLabel" class="label label-small" style="width:140px;">Download Speed</label>
<input type="number" name="downloadSpeed" id="downloadSpeed" value="1" min="1" max="65535"class="input input-small input-rect" style="width:80px;" />
<label id="downloadSpeedText">&nbsp;&nbsp;us</label>
&nbsp;
<label id="rfSecurityLabel" class="label label-small" style="width:140px;">Security</label>
&nbsp;
<input type="checkbox" name="rfSecurity" id="rfSecurity" value="On" />
</div>
</div>
</div>
</div>
</td>
</table>
<div style="text-align:right;">
<a class="btn btn-gray" id="btn_configuration">Control</a>
<a class="btn btn-gray" id="btn_configuration_default">Default</a>
<a class="btn btn-gray" id="btn_configuration_refresh">Refresh</a>
</div>
</div>
<div id="ChannelScan">
<div class="panel">
<div class="body">
<div>
<div class="group">
<label class="label label-small" style="width:120px;" id="gw_list_scan_duration">Scan Duration</label>
<input type="number" name="channelScanDuration" id="channelScanDuration" value="5" min="1" max="10" class="input input-small input-rect" style="width:50px;" />
&nbsp;
<label id="gw_config_channel_second">Seconds</label>
&nbsp;
</div>
<a class="btn btn-gray" id="btn_scan_duration">Query</a>
&nbsp;<i class="icon-help" style="color:gray;font-size: 20px; vertical-align:middle;" id="icon_btn_scan_duration"></i>
<br />
<div id="scan_progressbar"></div>
</div>
</div>
</div>
</div>
<div id="AP">
<div class="panel">
<div class="body">
<div>
<div class="group">
<label class="label label-small" style="width:120px;" id="gw_list_ap">Gateway AP</label>
<select name="enableAP" id="enableAP" style="width:150px;height:25px;">
<option value="Enable" id="opt_enable_ap">Enable</option>
<option value="Disable" id="opt_disable_ap">Disable</option>
</select>
</div>
<a class="btn btn-gray" id="btn_gateway_ap">Control</a>
&nbsp;<i class="icon-help" style="color:gray;font-size: 20px; vertical-align:middle;" id="icon_btn_gateway_ap"></i>
</div>
</div>
</div>
<div class="panel">
<div class="body">
<div>
<div class="group" style="padding: 3px 0 0 3px;">
<label class="label label-small" style="width:120px;" id="gw_list_security_mode">Security Mode</label>
<select name="securityAP" id="securityAP" style="width:150px;height:25px;">
<option value="None">None</option>
<!-- <option value="Web">WEP</option> -->
<option value="WPA-Personal">WPA-Personal</option>
<option value="WPA2-Personal">WPA2-Personal</option>
</select>
</div>
&nbsp;<i class="icon-help" style="color:gray;font-size: 20px; vertical-align:middle;" id="icon_btn_ap"></i>
</div>
<div>
<div class="group" style="padding: 3px 0 0 3px;">
<label class="label label-small" style="width:120px;" id="gw_list_ap_channel">Channel</label>
<select name="channelAP" id="channelAP" style="width:150px;height:25px;">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
</select>
</div>
</div>
<div>
<div class="group" style="padding: 3px 0 0 3px;">
<label class="label label-small" style="width:120px;">SSID</label>
<input type="text" name="ssidAP" id="ssidAP" value="" maxlength="19" class="input input-small input-rect" style="width:150px;" />
</div>
</div>
<div>
<div class="group" style="padding: 3px 0 0 3px;">
<label class="label label-small" style="width:120px;">Password</label>
<input type="text" name="keyAP" id="keyAP" value="" maxlength="19" class="input input-small input-rect" style="width:150px;" />
</div>
</div>
<div>
<div class="group" style="padding: 3px 0 0 3px;">
<label class="label label-small" style="width:120px;" id="gw_list_ap_ip">IP Address</label>
<input type="text" name="ipAddressAP" id="ipAddressAP" value="" maxlength="12" class="input input-small input-rect" style="width:150px;" />
</div>
<a class="btn btn-gray" id="btn_ap">Control</a>
</div>
</div>
</div>
<div style="text-align:right;">
<a class="btn btn-gray" id="btn_ap_refresh">Refresh</a>
</div>
</div>
<div id="Log">
<div class="panel">
<div class="body">
<div>
<div class="group">
<label class="label label-small" style="width:120px;" id="gw_list_log_period">Logging Period</label>
<select name="logPeriod" id="logPeriod" style="width:150px;height:25px;">
<option value="00">00:00</option>
<option value="01">01:00</option>
<option value="02">02:00</option>
<option value="03">03:00</option>
<option value="04">04:00</option>
<option value="05">05:00</option>
<option value="06">06:00</option>
<option value="07">07:00</option>
<option value="08">08:00</option>
<option value="09">09:00</option>
<option value="10">10:00</option>
<option value="11">11:00</option>
<option value="12">12:00</option>
<option value="13">13:00</option>
<option value="14">14:00</option>
<option value="15">15:00</option>
<option value="16">16:00</option>
<option value="17">17:00</option>
<option value="18">18:00</option>
<option value="19">19:00</option>
<option value="20">20:00</option>
<option value="21">21:00</option>
<option value="22">22:00</option>
<option value="23">23:00</option>
</select>
</div>
<a class="btn btn-gray" id="btn_log_period">Control</a>
<a class="btn btn-gray" id="btn_log_immediately">Immediately</a>
&nbsp;<i class="icon-help" style="color:gray;font-size: 20px; vertical-align:middle;" id="icon_btn_log"></i>
</div>
<div>
<div class="group">
<label class="label label-small" style="width:120px;" id="gw_list_log_level">Logging Level</label>
<select name="logLevel" id="logLevel" style="width:150px;height:25px;">
<option value="Emergency">0-Emergency</option>
<option value="Alert">1-Alert</option>
<option value="Critical">2-Critical</option>
<option value="Error">3-Error</option>
<option value="Warning">4-Warning</option>
<option value="Notice">5-Notification</option>
<option value="Info">6-Infomation</option>
<option value="Debug">7-Debugging</option>
</select>
</div>
<a class="btn btn-gray" id="btn_log_level">Control</a>
</div>
</div>
</div>
<div style="text-align:right;">
<a class="btn btn-gray" id="btn_log_refresh">Refresh</a>
</div>
</div>
</div>
</div>
<div id="gateway_window" class="window window-white">
<div class="head">
<div class="left" id="win_gateway_head"></div>
<div class="right">
<a href="#" class="close"><i class="icon-exit"></i></a>
</div>
</div>
<div class="body">
<form name="frmGatewayReg" id="frmGatewayReg">
<input type="hidden" name="mode" id="mode" value="" />
<div style="padding-bottom:5px;">
<label class="label label-small" style="width:100px;" id="gw_edit_device_id">Device ID</label>
<input type="text" name="w_device_id" id="w_device_id" value="" maxlength="16" class="input input-small input-rect" style="width:200px;" /><br />
</div>
<div style="padding-bottom:5px;">
<label class="label label-small" style="width:100px;" id="gw_edit_name">Name</label>
<input type="text" name="w_name" id="w_name" value="" maxlength="40" class="input input-small input-rect" style="width:200px;" /><br />
</div>
<!--//<div>
<label class="label label-small" style="width:100px;">IP Address</label>//-->
<input type="hidden" name="w_ip" id="w_ip" value="" maxlength="15" class="input input-small input-rect" style="width:200px;" /><!-- //<br />
</div> //-->
</form>
</div>
<div class="foot" align="center">
<a href="#" class="btn btn-gray" id="btn_gateway_save">Save</a>
<a href="#" class="btn btn-gray" id="btn_gateway_close">Close</a>
</div>
</div>
<script type="text/javascript">
var gateway_list
, gateway_tab
, gateway_window
, device_id
, gateway_type
, gateway_tab_loading
, gateway_loading;
jui.ready([ "ui.modal" ], function(modal) {
gateway_loading = modal('#loading', {
target: '#gateway_list',
opacity: 0.1,
autoHide: false
});
gateway_tab_loading = modal('#loading', {
target: '#gateway_contents',
opacity: 0.1,
autoHide: false
});
});
jui.ready([ "ui.tooltip" ], function(tooltip) {
tooltip_gatewaylist = tooltip("#icon_tooltip_gatewaylist", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_gatewaylist
});
tooltip_gw_config = tooltip("#gw_config", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_gw_config
});
tooltip_gw_channel_scan = tooltip("#gw_channel_scan", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_gw_channel_scan
});
tooltip_gw_ap = tooltip("#gw_ap", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_gw_ap
});
tooltip_gw_log = tooltip("#gw_log", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_gw_log
});
tooltip_gw_commonchannel = tooltip("#icon_gw_commonchannel", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_gw_commonchannel
});
tooltip_gw_datachannel = tooltip("#icon_gw_datachannel", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_gw_datachannel
});
tooltip_gw_aliveInterval = tooltip("#icon_gw_aliveInterval", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_gw_aliveInterval
});
tooltip_gw_maxTagCount = tooltip("#icon_gw_maxTagCount", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_gw_maxTagCount
});
tooltip_btn_gateway_edit = tooltip("#btn_gateway_edit", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_gateway_edit
});
tooltip_btn_gateway_delete = tooltip("#btn_gateway_delete", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_gateway_delete
});
tooltip_btn_gateway_refresh = tooltip("#btn_gateway_refresh", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_gateway_refresh
});
tooltip_btn_configuration = tooltip("#btn_configuration", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_configuration
});
tooltip_btn_configuration_default = tooltip("#btn_configuration_default", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_configuration_default
});
tooltip_btn_configuration_refresh = tooltip("#btn_configuration_refresh", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_configuration_refresh
});
tooltip_btn_products_search = tooltip("#btn_products_search", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_products_search
});
tooltip_icon_btn_scan_duration = tooltip("#icon_btn_scan_duration", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_btn_scan_duration
});
tooltip_btn_gateway_ap = tooltip("#btn_gateway_ap", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_configuration
});
tooltip_btn_ap = tooltip("#btn_ap", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_configuration
});
tooltip_btn_log_period = tooltip("#btn_log_period", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_configuration
});
tooltip_btn_log_level = tooltip("#btn_log_level", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_configuration
});
tooltip_icon_btn_gateway_ap = tooltip("#icon_btn_gateway_ap", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_btn_gateway_ap
});
tooltip_icon_btn_ap = tooltip("#icon_btn_ap", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_btn_ap
});
tooltip_icon_btn_log = tooltip("#icon_btn_log", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_btn_log
});
tooltip_icon_btn_log_immediately = tooltip("#btn_log_immediately", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_btn_log_immediately
});
});
function HidePopupGatewayWindow(){
gateway_window.hide();
}
function fnGetQueryList() {
device_id = '';
$('#gateway_contents').hide();
common_loading.show();
$.ajax({
url : '/restapi/gateway/query_list'
, type : 'POST'
, data : {
}, success : function(json) {
var state;
common_loading.hide();
if(json.result.toLowerCase() == "invalid_token") {
document.location.replace('./index.html');
}else if(json.result.toLowerCase() == "success") {
json = json.data;
gateway_list.uncheckAll();
$.each(json, function(i, v) {
state = json[i].state;
switch(state.toLowerCase()) {
case 'disconnected':
json[i].state = '<span style="color:#7977C2;">'+ locale[state] +'</span>';
break;
case 'connected':
json[i].state = '<span style="color:#87BE66;">'+ locale[state] +'</span>';
break;
}
if(json[i].storage_box == 'used') {
json[i].view_name='<span style="color:#FF0000;font-weight:bold;">'+ json[i].name +'</span>';
}else {
json[i].view_name=json[i].name;
}
if(json[i].fwupdate_state != null && json[i].fwupdate_state != '') {
switch(json[i].fwupdate_state.toLowerCase()) {
case 'in progress':
json[i].fwupdate_state = locale['in_progress'];
break;
case 'at gateway':
json[i].fwupdate_state = locale['at_gateway'];
break;
case 'busy':
json[i].fwupdate_state = locale['busy'];
break;
case 'success':
json[i].fwupdate_state = locale['success'];
break;
case 'fail':
json[i].fwupdate_state = locale['fail'];
break;
}
}
});
gateway_list.update(json);
}
}, error:function(request,status,err){
common_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
}
function fnGetConfiguration(id, gwType) {
if(gwType == "Gateway-Advanced2" || gwType == "Gateway2") {
document.getElementById('div_data_channel2').style.display = "inline";
document.getElementById('div_common_channel2').style.display = "inline";
document.getElementById('div_beacon_channel').style.display = "inline";
}else if(gwType == "Gateway-Advanced"){
document.getElementById('div_data_channel2').style.display = "inline";
document.getElementById('div_common_channel2').style.display = "none";
document.getElementById('div_beacon_channel').style.display = "none";
}else {
document.getElementById('div_data_channel2').style.display = "none";
document.getElementById('div_common_channel2').style.display = "none";
document.getElementById('div_beacon_channel').style.display = "none";
}
common_loading.show();
$.ajax({
url: '/restapi/gateway/query_config'
, type: 'POST'
// , beforeSend: function(xhr) {
// xhr.setRequestHeader("nb-ajax-call", "true");
// }
, data: {
'device_id': id
}, success : function(json) {
common_loading.hide();
if(json.result.toLowerCase() == "invalid_token") {
document.location.replace('./index.html');
}else if(json.result.toLowerCase() == "success") {
json = json.data;
//alertify.success(json[0].result);
// alert(JSON.stringify(json));
$('#commonChannel').val(json[0].commonChannel);
$('#commonChannelRF').val(json[0].commonChannelRF);
$('#commonChannelSPI').val(json[0].commonChannelSPI);
$('#commonChannel2').val(json[0].commonChannel2);
$('#commonChannelRF2').val(json[0].commonChannelRF2);
$('#dataChannel').val(json[0].dataChannel);
$('#dataChannel2').val(json[0].dataChannel2);
$('#dataChannelRF').val(json[0].dataChannelRF);
$('#dataChannelRF2').val(json[0].dataChannelRF2);
$('#dataChannelSPI').val(json[0].dataChannelSPI);
$('#beaconChannel').val(json[0].beaconChannel);
$('#beaconPower').val(json[0].beaconPower);
$('#retryFirst').val(json[0].retryFirst);
$('#retryNext').val(json[0].retryNext);
$('#timeoutGateway').val(json[0].timeoutGateway);
$('#timeoutInvalidTag').val(json[0].timeoutInvalidTag);
$('#timeoutMeT').val(json[0].timeoutMeT);
$('#timeoutHeT').val(json[0].timeoutHeT);
$('#aliveInterval').val(json[0].aliveInterval);
$('#scanDuration').val(json[0].scanDuration);
$('#maxTagCount').val(json[0].maxTagCount);
$('#downloadSpeed').val(json[0].downloadSpeed);
$('#channelMode').val(json[0].channelMode);
$('#channelThreshold').val(json[0].channelThreshold);
if (json[0].rfSecurity == 'on') {
$('#rfSecurity').attr('checked', true);
} else {
$('#rfSecurity').removeAttr('checked');
}
}else {
alertify.error(locale[json.result.toLowerCase()]);
}
}, error:function(request,status,err){
common_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
}
function fnGetChannelScan(id, duration) {
$('#scan_progressbar').html('');
common_loading.show();
$.ajax({
url: '/restapi/gateway/query_channel'
, type: 'POST'
, data: {
'device_id': id
, 'scanDuration': duration
}, success : function(json) {
common_loading.hide();
if(json.result.toLowerCase() == "invalid_token") {
document.location.replace('./index.html');
}else if(json.result.toLowerCase() == "success") {
json = json.data;
var html = ''
, av
, lv
, c11
, c12
, c13
, c14
, c15
, c16
, c17
, c18
, c19
, c20
, c21
, c22
, c23
, c24
, c25
, c26;
$.each(json[0], function(k, v) {
if(k != 'device_id' && k != 'result') {
// v = -v;
av = 90 * v / 200;
lv = 90 - av;
if(k == 'channel 11') c11 = fnGetChannelScanHTML('Channel 11', av, lv, v);
if(k == 'channel 12') c12 = fnGetChannelScanHTML('Channel 12', av, lv, v);
if(k == 'channel 13') c13 = fnGetChannelScanHTML('Channel 13', av, lv, v);
if(k == 'channel 14') c14 = fnGetChannelScanHTML('Channel 14', av, lv, v);
if(k == 'channel 15') c15 = fnGetChannelScanHTML('Channel 15', av, lv, v);
if(k == 'channel 16') c16 = fnGetChannelScanHTML('Channel 16', av, lv, v);
if(k == 'channel 17') c17 = fnGetChannelScanHTML('Channel 17', av, lv, v);
if(k == 'channel 18') c18 = fnGetChannelScanHTML('Channel 18', av, lv, v);
if(k == 'channel 19') c19 = fnGetChannelScanHTML('Channel 19', av, lv, v);
if(k == 'channel 20') c20 = fnGetChannelScanHTML('Channel 20', av, lv, v);
if(k == 'channel 21') c21 = fnGetChannelScanHTML('Channel 21', av, lv, v);
if(k == 'channel 22') c22 = fnGetChannelScanHTML('Channel 22', av, lv, v);
if(k == 'channel 23') c23 = fnGetChannelScanHTML('Channel 23', av, lv, v);
if(k == 'channel 24') c24 = fnGetChannelScanHTML('Channel 24', av, lv, v);
if(k == 'channel 25') c25 = fnGetChannelScanHTML('Channel 25', av, lv, v);
if(k == 'channel 26') c26 = fnGetChannelScanHTML('Channel 26', av, lv, v);
}
});
$('#scan_progressbar').html(c11 + c12 + c13 + c14 + c15 + c16 + c17 + c18 + c19 + c20 + c21 + c22 + c23 + c24 + c25 + c26);
}else {
alertify.error(locale[json.result.toLowerCase()]);
}
}, error:function(request,status,err){
common_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
}
function fnGetChannelScanHTML(k, av, lv, v) {
return '<div><div class="group" style="padding: 3px 3px 3px 0;"><label for="cb_svr_internal_port" class="label label-small" style="width:150px;" id="system_ntp_system_time">'
+ k + '</label> &nbsp;<input type="text" name="ntp_system_time" id="ntp_system_time" value="'+v+'" class="input input-small input-rect" style="width:150px;" />'
+ ' dBm </div></div>';
// return '<div class="bargraph bargraph-small" style="width: 100%;">\r\n'
// +' <div style="width:10%">\r\n'
// +' <div class="title">'+ k +'</div>\r\n'
// +' </div>\r\n'
// +' <div class="active" style="width:'+ av +'%">\r\n'
// +' <div class="title"></div>\r\n'
// +' <div class="info">\r\n'
// +' <div class="line"></div>\r\n'
// +' <div class="data">'+ v +'%</div>\r\n'
// +' </div>\r\n'
// +' </div>\r\n'
// +' <div style="width:'+ lv +'%">\r\n'
// +' <div class="title"></div>\r\n'
// +' </div>\r\n'
// +'</div>\r\n';
}
function fnGetAP(id) {
common_loading.show();
$.ajax({
url: '/restapi/gateway/query_ap'
, type: 'POST'
, data: {
'device_id': id
}, success : function(json) {
common_loading.hide();
if(json.result.toLowerCase() == "invalid_token") {
document.location.replace('./index.html');
}else if(json.result.toLowerCase() == "success") {
json = json.data;
//alertify.success(json[0].result);
$('#channelAP').val(json[0].channelAP);
$('#enableAP').val(json[0].enableAP);
$('#ssidAP').val(json[0].ssidAP);
$('#keyAP').val(json[0].keyAP);
$('#ipAddressAP').val(json[0].ipAddressAP);
$('#securityAP').val(json[0].securityAP);
securityAP = $('#securityAP').val();
if(securityAP == 'None'){
$('#keyAP').val('');
$('#keyAP').prop('disabled', true);
}
else{
$('#keyAP').prop('disabled', false);
}
}else {
alertify.error(locale[json.result.toLowerCase()]);
}
}, error:function(request,status,err){
common_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
}
function fnGetLog(id) {
common_loading.show();
$.ajax({
url: '/restapi/gateway/query_log'
, type: 'POST'
, data: {
'device_id': id
}, success : function(json) {
common_loading.hide();
if(json.result.toLowerCase() == "invalid_token") {
document.location.replace('./index.html');
}else if(json.result.toLowerCase() == "success") {
json = json.data;
//alertify.success(json[0].result);
$('#logLevel').val(json[0].logLevel);
$('#logPeriod').val(json[0].logPeriod);
}else {
alertify.error(locale[json.result.toLowerCase()]);
}
}, error:function(request,status,err){
common_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
}
jui.ready(['uix.table'], function(table) {
gateway_list = table('#gateway_list', {
scroll: true
, fields: ['no','view_name','device_id','state','ip','normal_tag_count','invalid_tag_count','removed_tag_count','aliveInterval','commonChannel','commonChannel2'
,'dataChannel','dataChannel2','beaconChannel','version','fwupdate_state']
, scrollHeight: 320
, resize: true
, sort: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
, event: {
sort: function(column, e) {
var className = {
"desc": "icon-arrow1",
"asc": "icon-arrow3"
}[column.order];
$(column.element).children("i").remove();
$(column.element).append("<i class='" + className + "'></i>");
},
click: function(row, e) {
gateway_window.hide();
device_id = row.data.device_id;
gateway_type = row.data.gw_type
if(authObj.gatewayAuthRowClick(device_id, gateway_type)) {
this.uncheckAll();
this.check(row.index);
}
}
}
});
fnGetQueryList();
});
jui.ready([ "uix.tab" ], function(tab) {
gateway_tab = tab("#gateway_tab", {
event: {
change: function(data) {
switch(data.index) {
case 0:
fnGetConfiguration(device_id, gateway_type);
break;
case 1:
$('#scan_progressbar').html('');
break;
case 2:
fnGetAP(device_id);
break;
case 3:
fnGetLog(device_id);
break;
}
}
},
target: "#gateway_tab_contents",
index: 0
});
});
jui.ready(['uix.window'], function(win) {
gateway_window = win('#gateway_window', {
width: 350
, height: 200
, modal: false
, resize: false
, top: '35%'
, left: '40%'
});
});
$(function() {
$('#frmGatewayReg').validate({
rules: {
w_device_id: 'required'
, w_name: 'required'
, w_ip: 'required'
}, messages: {
w_device_id: 'Invalid Device ID.'
, w_name: 'Invalid Name.'
, w_ip: 'Invalid IP Address.'
}
});
$('#btn_scan_duration').click(function() {
var scan_duration = $('#channelScanDuration').val();
fnGetChannelScan(device_id, scan_duration);
});
$('#btn_log_immediately').click(function() {
common_loading.show();
$.ajax({
url: '/restapi/gateway/period_log'
, type: 'POST'
, data: {
'device_id': device_id
, 'logPeriod': 'immediately'
}, success : function(json) {
common_loading.hide();
if(json.result.toLowerCase() == "invalid_token") {
document.location.replace('./index.html');
}else if(json.result.toLowerCase() == "success") {
alertify.success(locale[json.result.toLowerCase()]);
}else {
alertify.error(locale[json.result.toLowerCase()]);
}
}, error:function(request,status,err){
common_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
});
$('#btn_log_period').click(function() {
common_loading.show();
$.ajax({
url: '/restapi/gateway/period_log'
, type: 'POST'
, data: {
'device_id': device_id
, 'logPeriod': $('#logPeriod').val()
}, success : function(json) {
common_loading.hide();
if(json.result.toLowerCase() == "invalid_token") {
document.location.replace('./index.html');
}else if(json.result.toLowerCase() == "success") {
alertify.success(locale[json.result.toLowerCase()]);
}else {
alertify.error(locale[json.result.toLowerCase()]);
}
}, error:function(request,status,err){
common_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
});
$('#btn_log_level').click(function() {
common_loading.show();
$.ajax({
url: '/restapi/gateway/level_log'
, type: 'POST'
, data: {
'device_id': device_id
, 'logLevel': $('#logLevel').val()
}, success : function(json) {
common_loading.hide();
if(json.result.toLowerCase() == "invalid_token") {
document.location.replace('./index.html');
}else if(json.result.toLowerCase() == "success") {
alertify.success(locale[json.result.toLowerCase()]);
}else {
alertify.error(locale[json.result.toLowerCase()]);
}
}, error:function(request,status,err){
common_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
})
$('#btn_gateway_ap').click(function() {
common_loading.show();
$.ajax({
url: '/restapi/gateway/enable_ap'
, type: 'POST'
, data: {
'device_id': device_id
, 'enableAP': $('#enableAP').val()
}, success : function(json) {
common_loading.hide();
if(json.result.toLowerCase() == "invalid_token") {
document.location.replace('./index.html');
}else if(json.result.toLowerCase() == "success") {
alertify.success(locale[json.result.toLowerCase()]);
}else {
alertify.error(locale[json.result.toLowerCase()]);
}
}, error:function(request,status,err){
common_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
});
$('#securityAP').change(function() {
securityAP = $('#securityAP').val();
//alert(securityAP);
if(securityAP == 'None'){
$('#keyAP').val('');
$('#keyAP').prop('disabled', true);
}
else{
$('#keyAP').prop('disabled', false);
}
});
$('#btn_ap').click(function() {
if(!fnCheckIP($('#ipAddressAP').val())) {
//alert('Invalid IP Address!');
alertify.alert('Error','Invalid IP Address!');
return;
}
securityAP = $('#securityAP').val();
ssidAP = $('#ssidAP').val();
keyAP = $('#keyAP').val();
if(keyAP.length < 10 && securityAP != 'None')
{
//alert('Invalid Key length!');
alertify.alert('Error','Please insert password 10 to 19 characters in length');
return;
}
if(ssidAP.length < 1)
{
//alert('Invalid SSID length!');
alertify.alert('Error','Insert SSID');
return;
}
if(fnCheckSSIDKor(ssidAP))
{
alertify.alert('Error','Invalid SSID!(Please insert character in english)');
//alert('Invalid SSID!(Can\'t use character[ = , \\ , \' , " , ` , [ , ] ])');
return;
}
if(fnCheckSSID(ssidAP))
{
alertify.alert('Error','Invalid SSID!(Can not use characters [ `, =, backslash, quotation mark ])');
//alert('Invalid SSID!(Can\'t use character[ = , \\ , \' , " , ` , [ , ] ])');
return;
}
if(securityAP != 'None') {
if(fnCheckPWD(keyAP))
{
alertify.alert('Error','Invalid Password!(Can not use characters [ `, =, backslash, quotation mark ])');
//alert('Invalid Password!(Can\'t use character[ = , \\ , \' , " , ` , [ , ] ])');
return;
}
}
//if(!fnCheckSSID(ssidAP)))
//{
// alert('Invalid SSID!');
// return;
// }
if(securityAP == 'Web') {
if(keyAP.length != 10)
{
//alert('Invalid Key length!');
alertify.alert('Error','Invalid Key length!');
return;
}
if(!fnCheckHex($('#keyAP').val())) {
//alert('Invalid Password!');
alertify.alert('Error','Invalid Password!');
return;
}
}
common_loading.show();
$.ajax({
url: '/restapi/gateway/control_ap'
, type: 'POST'
, data: {
'device_id': device_id
, 'channelAP': $('#channelAP').val()
, 'ssidAP': $('#ssidAP').val()
, 'keyAP': $('#keyAP').val()
, 'ipAddressAP': $('#ipAddressAP').val()
, 'securityAP': $('#securityAP').val()
}, success : function(json) {
common_loading.hide();
if(json.result.toLowerCase() == "invalid_token") {
document.location.replace('./index.html');
}else if(json.result.toLowerCase() == "success") {
alertify.success(locale[json.result.toLowerCase()]);
}else {
alertify.error(locale[json.result.toLowerCase()]);
}
}, error:function(request,status,err){
common_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
});
$('#btn_configuration').click(function() {
var commonChannel = $('#commonChannel').val()
, commonChannelRF = $('#commonChannelRF').val()
, commonChannelSPI = $('#commonChannelSPI').val()
, commonChannel2 = $('#commonChannel2').val()
, commonChannelRF2 = $('#commonChannelRF2').val()
, dataChannel = $('#dataChannel').val()
, dataChannelRF = $('#dataChannelRF').val()
, dataChannelSPI = $('#dataChannelSPI').val()
, dataChannel2 = $('#dataChannel2').val()
, dataChannelRF2 = $('#dataChannelRF2').val()
, beaconChannel = $('#beaconChannel').val()
, beaconPower = $('#beaconPower').val()
, retryFirst = $('#retryFirst').val()
, retryNext = $('#retryNext').val()
, timeoutGateway = $('#timeoutGateway').val()
, timeoutInvalidTag = $('#timeoutInvalidTag').val()
, timeoutMeT = $('#timeoutMeT').val()
, timeoutHeT = $('#timeoutHeT').val()
, aliveInterval = $('#aliveInterval').val()
, scanDuration = $('#scanDuration').val()
, maxTagCount = $('#maxTagCount').val()
, downloadSpeed = $('#downloadSpeed').val()
, channelMode = $('#channelMode').val()
, channelThreshold = $('#channelThreshold').val()
, rfSecurity = $('#rfSecurity:checked').length > 0 ? 'on' : 'off'
, fieldlist = [
[commonChannel2, 11, 26, locale.common_channel]
, [commonChannelRF2, 0, 19, locale.common_channel + ' ' + 'RF Power']
, [beaconChannel, 11, 26, locale.gw_label_beaconchannel]
, [beaconPower, 0, 19, locale.data_channel + ' ' + 'RF Power']
, [dataChannel2, 11, 26, locale.data_channel]
, [dataChannelRF2, 0, 19, locale.data_channel + ' ' + 'RF Power']
, [commonChannel, 11, 26, locale.common_channel]
, [commonChannelRF, 0, 19, locale.common_channel + ' ' + 'RF Power']
, [commonChannelSPI, 1, 255, locale.common_channel + ' ' + 'SPI Display']
, [dataChannel, 11, 26, locale.data_channel]
, [dataChannelRF, 0, 19, locale.data_channel + ' ' + 'RF Power']
, [dataChannelSPI, 1, 255, locale.data_channel + ' ' + 'SPI Display']
, [channelThreshold, 1, 255, 'Channel Threshold']
, [retryFirst, 1, 255, 'Retry First']
, [retryNext, 1, 255, 'Retry Next']
, [timeoutGateway, 1, 6500, 'Download to G/W']
, [timeoutInvalidTag, 1, 255, 'Invalid Tag']
, [timeoutMeT, 1, 6500, 'Download to MeT']
, [timeoutHeT, 1, 6500, 'Download to HeT']
, [aliveInterval, 60, 65530, locale.alive_interval]
, [scanDuration, 1, 10, 'Scan Duration']
, [maxTagCount, 1, 10000, 'Max TAG Count']
, [downloadSpeed, 1, 65535, 'Download Speed']
/*[commonChannel, 11, 26, 'Common Channel']
, [commonChannelRF, 0, 19, 'Common RF Power']
, [commonChannelSPI, 1, 255, 'Common SPI Display']
, [dataChannel, 11, 26, 'Data Channel']
, [dataChannelRF, 0, 19, 'Data Channel RF Power']
, [dataChannelSPI, 1, 255, 'Data Channel SPI Display']
, [channelThreshold, 1, 255, 'Channel Threshold']
, [retryFirst, 1, 255, 'Retry First']
, [retryNext, 1, 255, 'Retry Next']
, [timeoutGateway, 1, 6500, 'Download to G/W']
, [timeoutInvalidTag, 1, 255, 'Invalid Tag']
, [timeoutMeT, 1, 6500, 'Download to MeT']
, [timeoutHeT, 1, 6500, 'Download to HeT']
, [aliveInterval, 60, 65530, 'Alive Interval']
, [scanDuration, 1, 10, 'Scan Duration']
, [maxTagCount, 1, 10000, 'Max TAG Count']
, [downloadSpeed, 1, 65535, 'Download Speed']*/
];
var i=0;
if(gateway_type == "Gateway-Advanced"){
i=4;
}else if(gateway_type == "Gateway"){
i=6;
}
for(i; i < fieldlist.length; i ++) {
if (fieldlist[i][0] < fieldlist[i][1] || fieldlist[i][0] > fieldlist[i][2]) {
//alert('Please enter a '+ fieldlist[i][3] +' value between '+ fieldlist[i][1] +' and '+ fieldlist[i][2] +'.');
//alertify.alert('Error','Please enter a '+ fieldlist[i][3] +' value between '+ fieldlist[i][1] +' and '+ fieldlist[i][2] +'.');
alertify.alert(locale.error, locale.invalid_range_header + '(' + fieldlist[i][3] + ' : ' + fieldlist[i][1] +'-' + fieldlist[i][2] +')');
return;
}
}
common_loading.show();
$.ajax({
url: '/restapi/gateway/control_config'
, type: 'POST'
, data: {
'device_id': device_id
, 'commonChannel': commonChannel
, 'commonChannelRF': commonChannelRF
, 'commonChannelSPI': commonChannelSPI
, 'commonChannel2': commonChannel2
, 'commonChannelRF2': commonChannelRF2
, 'dataChannel': dataChannel
, 'dataChannelRF': dataChannelRF
, 'dataChannelSPI': dataChannelSPI
, 'dataChannel2': dataChannel2
, 'dataChannelRF2': dataChannelRF2
, 'beaconChannel': beaconChannel
, 'beaconPower': beaconPower
, 'retryFirst': retryFirst
, 'retryNext': retryNext
, 'timeoutGateway': timeoutGateway
, 'timeoutInvalidTag': timeoutInvalidTag
, 'timeoutMeT': timeoutMeT
, 'timeoutHeT': timeoutHeT
, 'aliveInterval': aliveInterval
, 'scanDuration': scanDuration
, 'maxTagCount': maxTagCount
, 'downloadSpeed': downloadSpeed
, 'channelMode': channelMode
, 'channelThreshold': channelThreshold
, 'rfSecurity': rfSecurity
}, success : function(json) {
common_loading.hide();
if(json.result.toLowerCase() == "invalid_token") {
document.location.replace('./index.html');
}else if(json.result.toLowerCase() == "success") {
alertify.success(locale.gateway_control_success);
}else {
alertify.error(locale[json.result.toLowerCase()]);
}
}, error:function(request,status,err){
common_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
});
$('#btn_configuration_refresh').click(function() {
fnGetConfiguration(device_id, gateway_type);
});
$('#btn_gateway_add').click(function() {
gateway_window.hide();
$('#win_gateway_head').html('Gateway Add');
$('#mode').val('add');
$('#w_device_id').val('').removeAttr('readonly');
$('#w_name').val('');
$('#w_ip').val('');
gateway_window.show();
});
$('#btn_gateway_save').click(function() {
if($('#frmGatewayReg').valid()) {
var mode = $('#mode').val()
, url = (mode == 'add') ? '/restapi/gateway/add' : '/restapi/gateway/edit'
, obj = gateway_list.listChecked()[0]
, selected_name = $('#w_name').val()
, selected_index = obj.index
, cnt = 0;
$.each(gateway_list.listData(), function(i, v) {
if (i != selected_index) {
console.dir(gateway_list.listData()[i].name +":"+ selected_name);
if(gateway_list.listData()[i].name == selected_name) {
cnt ++;
}
}
});
if (cnt > 0) {
//alert('The same gateway name exists.');
alertify.alert('Error','The same gateway name exists.');
return;
}
common_loading.show();
$.ajax({
url: url
, type: 'POST'
, data: {
'device_id': $('#w_device_id').val()
, 'name': $('#w_name').val()
, 'ip': $('#w_ip').val()
}, success : function(json) {
common_loading.hide();
if(json.result.toLowerCase() == "invalid_token") {
document.location.replace('./index.html');
}else if(json.result.toLowerCase() == "success") {
alertify.success(locale[json.result.toLowerCase()]);
fnGetQueryList();
gateway_window.hide();
}else {
alertify.error(locale[json.result.toLowerCase()]);
}
}, error:function(request,status,err){
common_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
}
});
$('#btn_gateway_edit').click(function() {
gateway_window.hide();
if(gateway_list.listChecked().length <= 0) {
alertify.error(locale.no_selected);
return;
}
var obj = gateway_list.listChecked()[0].data;
$('#win_gateway_head').html(locale._gateway_edit);
$('#mode').val('edit');
$('#w_device_id').val(obj.device_id).attr('readonly', 'readonly');
$('#w_name').val(obj.name);
$('#w_ip').val(obj.ip);
gateway_window.show();
});
$('#btn_gateway_close').click(function() {
gateway_window.hide();
});
$('#btn_gateway_delete').click(function() {
gateway_window.hide();
if(gateway_list.listChecked().length <= 0) {
alertify.error(locale.no_selected);
return;
}
alertify.confirm(locale.confirm,locale.confirm_delete, function (e) {
if (e) {
common_loading.show();
$.ajax({
url: '/restapi/gateway/delete'
, type: 'POST'
, data: {
'device_id': gateway_list.listChecked()[0].data.device_id
}, success : function(json) {
common_loading.hide();
if(json.result.toLowerCase() == "invalid_token") {
document.location.replace('./index.html');
}else if(json.result.toLowerCase() == "success") {
alertify.success(locale[json.result.toLowerCase()]);
fnGetQueryList();
}else {
alertify.error(locale[json.result.toLowerCase()]);
}
}, error:function(request,status,err){
common_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
} else {
//alertify.error("취소");
return;
}
}, null).set('labels', {ok:locale.ok, cancel:locale.cancel});
//if(!confirm('Are you sure you want to delete the selected item?')) return;
});
$('#btn_gateway_refresh').click(function() {
gateway_window.hide();
fnGetQueryList();
});
$('#btn_products_search').click(function() {
if(device_id == '' || device_id == null) {
alertify.error(locale.no_gateway_selected);
}else {
select_gateway = device_id;
tabAdd('management/products.html', locale.menu_products);
}
});
$('#btn_ap_refresh').click(function() {
fnGetAP(device_id);
});
$('#btn_log_refresh').click(function() {
fnGetLog(device_id);
});
$('#btn_configuration_default').click(function() {
$('#commonChannel').val('25');
$('#commonChannelRF').val('7');
$('#commonChannelSPI').val('5');
$('#commonChannel2').val('25');
$('#commonChannelRF2').val('7');
$('#dataChannel').val('19');
$('#dataChannelRF').val('7');
$('#dataChannelSPI').val('12');
$('#dataChannel2').val('11');
$('#dataChannelRF2').val('7');
$('#beaconChannel').val('15');
$('#beaconPower').val('0');
$('#aliveInterval').val('300');
$('#scanDuration').val('1');
$('#maxTagCount').val('2000');
$('#downloadSpeed').val('130');
$('#rfSecurity').attr('checked', false);
$('#retryFirst').val('100');
$('#retryNext').val('35');
$('#channelMode').val('Manual');
$('#channelThreshold').val('30');
$('#timeoutGateway').val('500');
$('#timeoutInvalidTag').val('1');
$('#timeoutMeT').val('50');
$('#timeoutHeT').val('3000');
});
$('#gw_list_no').text(locale.number);
$('#gw_list_name').text(locale.name);
$('#gw_list_did').text(locale.device_id);
$('#gw_list_state').text(locale.status);
$('#gw_list_ip_address').text(locale.ip_address);
document.getElementById("gw_list_interval").innerHTML = locale.gw_list_interval;
document.getElementById("gw_list_common_ch1").innerHTML = locale.gw_list_common_ch+"1";
document.getElementById("gw_list_common_ch2").innerHTML = locale.gw_list_common_ch+"2";
document.getElementById("gw_list_data_ch1").innerHTML = locale.gw_list_data_ch+"1";
document.getElementById("gw_list_data_ch2").innerHTML = locale.gw_list_data_ch+"2";
document.getElementById("gw_list_beacon_ch").innerHTML = locale.gw_list_beacon_ch;
$('#gw_list_operation_mode').text(locale.gw_list_operation_mode);
$('#gw_list_versoin').text(locale.version);
document.getElementById("gw_list_fw_update_state").innerHTML = locale.fw_update_state;
$('#btn_gateway_edit').text(locale.edit);
$('#btn_gateway_delete').text(locale.delete);
$('#btn_gateway_refresh').text(locale.refresh);
$('#gw_config').text(locale.configure);
$('#gw_channel_scan').text(locale.channel_scan);
$('#gw_log').text(locale.log);
$('#gw_label_commonchannel').text(locale.common_channel);
$('#gw_label_common_channel').text(locale.channel);
$('#gw_label_common_channel2').text(locale.channel2);
$('#gw_label_common_rf').text(locale.rf_pwr);
$('#gw_label_datachannel').text(locale.data_channel);
$('#gw_label_data_channel').text(locale.channel);
$('#gw_label_data_channel2').text(locale.channel2);
$('#gw_label_data_rf').text(locale.rf_pwr);
$('#gw_config_alirve_interval').text(locale.alive_interval);
$('#gw_config_second').text(locale.second);
$('#gw_config_ea').text(locale.ea);
$('#gw_config_channel_second').text(locale.second);
$('#btn_scan_duration').text(locale.scan);
$('#btn_configuration').text(locale.apply);
$('#btn_configuration_default').text(locale.default);
$('#btn_configuration_refresh').text(locale.refresh);
$('#btn_products_search').text(locale.btn_products_search);
$('#opt_enable_ap').text(locale.enable);
$('#opt_disable_ap').text(locale.disable);
$('#btn_gateway_ap').text(locale.apply);
$('#btn_ap').text(locale.apply);
$('#btn_ap_refresh').text(locale.refresh);
$('#btn_log_period').text(locale.apply);
$('#btn_log_immediately').text(locale.immediately);
$('#btn_log_level').text(locale.apply);
$('#btn_log_refresh').text(locale.refresh);
$('#gw_list_ap').text(locale.gateway + " AP");
$('#gw_list_security_mode').text(locale.security + " " + locale.mode);
$('#gw_list_ap_channel').text(locale.channel);
$('#gw_list_ap_ip').text(locale.ip_address);
$('#gw_list_log_period').text(locale.logging + " " + locale.period);
$('#gw_list_log_level').text(locale.logging + " " + locale.level);
$('#gw_list_scan_duration').text(locale.scan_duration);
$('#maxTagCountLabel').text(locale.max_tag_count);
$('#gw_edit_device_id').text(locale.device_id);
$('#gw_edit_name').text(locale.name);
$('#btn_gateway_save').text(locale.save);
$('#btn_gateway_close').text(locale.close);
$('#gw_list_normal_tag_count').text(locale.connected);
$('#gw_list_invalid_tag_count').text(locale.disconnected);
$('#gw_list_removed_tag_count').text(locale.removed);
// document.getElementById("gw_list_normal_tag_count").innerHTML = locale.gw_list_normal_tag_count;
// document.getElementById("gw_list_invalid_tag_count").innerHTML = locale.gw_list_invalid_tag_count;
// document.getElementById("gw_list_removed_tag_count").innerHTML = locale.gw_list_removed_tag_count;
$('#gw_label_beaconchannel').text(locale.gw_label_beaconchannel);
$('#gw_label_beacon_channel').text(locale.channel);
$('#gw_label_beacon_rf').text(locale.rf_pwr);
});
// 메뉴 권한 설정
authObj.authMenuSet('management/gateway.html');
</script>