myws.onopen = function (evt) {
	message("提示:服务器链接成功!","success");
}
myws.onclose = function (evt) {
	message("提示:服务器链接错误!","danger");
	ws = null;
}
myws.onmessage = function (evt) {
	var obj = JSON.parse(evt.data);
	switch (obj.Code) {
	case "-1":
	outlogin();
	break
	case "0":
	if (obj.Data != null) {
		mytable.bootstrapTable('load', obj.Data);
		console.log(obj.Data);
	}
	break
	case "1":
	mytable.bootstrapTable('append', obj.Data);
	break
	case "2":
	mytable.bootstrapTable('removeByUniqueId', obj.Data);
	break
	case "3":
	mytable.bootstrapTable('updateByUniqueId', {id: obj.Id,row: {Task: obj.Data}}); 
	break 
	case "4":
	alert(obj.Data);
	break 
    case "5":
	if (obj.Data == "1"){
		kill=true;
        document.getElementById("killon").innerHTML="停止K马";
	}else{
		kill=false;
        document.getElementById("killon").innerHTML="自动K马";
	}
	break
         case "6":
	mytable.bootstrapTable('updateByUniqueId', {id: obj.Id,row: {Begin: obj.Data}}); 
	break
         case "7":
	mytable.bootstrapTable('updateByUniqueId', {id: obj.Id,row: {End: obj.Data}}); 
	break
	     case "8":
	mytable.bootstrapTable('updateByUniqueId', {id: obj.Id,row: {Remarks: obj.Data}}); 
	break
	case "100":
         document.getElementById("proxyport").value=obj.Data;
	break
	case "201":
	writeterm(obj.Data);
	break
	default:
	console.log(obj.Code);
	console.log(obj.Data);
	}


}
myws.onerror = function (evt) {
	console.log("错误" + evt.data);
}
