nvsconfig.js 1.39 KB



//获取div的高度
function getHt(){
   var all_height=$(window).height();
   var div_height = all_height -  $("#headFrames").height()-4 ;
    $("#config_control").css("height",div_height+"px");
}

var layer = null;

$(function(){
	getHt();
	
	layui.use('layer', function(){
		layer = layui.layer; 
		
    });
	
	layui.use('form', function(){
		var form = layui.form;
		
		var audio = getAlarmPopAudio();
		var txt = getAlarmPopText();
		var video = getAlarmPopWindow();
		var loop = getVideoLoopTimer();
		var nettime = getNetTimeout();
		var stream = getStreamProtocol();
		var player = getStreamPlayer();
		
		form.val('system_config_value', {
		   "loop_video_time": loop
		  ,"switch_alarm_pop":video
		  ,"switch_alarm_audio":audio
		  ,"switch_alarm_text": txt 
		});
		
		form.val('net_config_value', {
		    "message_time_out": nettime 
		   ,"stream_media_protocol":stream
		   ,"stream_media_player":player
		});

	});
});

function handleSystemConfigSave(){
	var form = layui.form;
	var data = form.val('system_config_value');
    setSystemConfig(JSON.stringify(data));
	
	layer.msg('保存成功',{icon: 1, title:'系统参数',time: 2000,skin: 'layer-ext-moon' });

}

function handleNetConfigSave(){
	var form = layui.form;
	var data = form.val('net_config_value');
    setNetConfig(JSON.stringify(data));
	
	layer.msg('保存成功',{icon: 1, title:'网络参数',time: 2000,skin: 'layer-ext-moon' });
}