<style type="text/css">div.signal-note{width:300px;margin:30px auto}p.signal-str{width:274px;font-size:14px;word-break:break-all;width:300px;color:#767d82}</style>

<script type="text/javascript">
(function(){
	<%
		local para = {
			signal_set = {config = {}}
		}

		local result = tpl_get_data(para)
		local signalInfo = result[K_MODULE].signal_set.config
	-%>
	var power = '<%=signalInfo.power%>';
	var enable;

	//初始状态为开启一键穿墙（1），但默认按钮状态应为0（健康节能关闭）
	if ("1" == power){
		enable = "0";
	}else{
		enable = "1";
	}

	initSwitch("SignalSwitch", enable, onSwitchClick)

	function onSwitchClick(state, init){
		if(!init){
			var data = {};
			var para = {};
			para.signal_set = {};
			para.signal_set.config = data;

			if("0" == $("#SignalSwitch").attr("data-value")){
				data.power= "1";
			}else{
				data.power= "0";
			}

			showLoading(label.saving);
			apiSet(para, function(ret){
				var code = ret[ERR_CODE];
				handleError(code, showNote)?closeLoading():closeLoading(2);
			});
		}
	}
})();
</script>
<div class="help hidden">
	<ul class="help-content">
		<li class="help-head">
			<img class="app-icon" src="/luci-static/images/app-icon/signal.png?_=20191016014108" />
			<span class="help-title">{%label.signalSet%}</span>
		</li>
		<li class="summary">{%helpStr.signal%}</li>
	</ul>
</div>
<div class="head-con">
	<img class="app-icon" src="/luci-static/images/app-icon/signal.png?_=20191016014108" />
	<a href="javascript:history.go(-1);" class="head-btn-l">
		<i class="head-btn icon icon_back"></i>
		<span class="head-title">{%label.signalSet%}</span>
	</a>
</div>
<div class="set-con below-head">
	<ul class="set-con">
		<li class="text-con">
			<label class="desc-lbl">{%label.signalSet%}</label>
			<span class="set-con-middle">
				<span id="SignalSwitch" class="switch">
					<i class="switch-circle icon_select_off"></i>
				</span>
			</span>
		</li>
	</ul>
	<div class="err-note hidden">
		<i class="err-icon icon_remind_line"></i>
		<p class="note-str"></p>
	</div>
	<div class="signal-note">
		<p class="signal-str">{%label.keyWall%}</p>
	</div>
</div>