@{
|
ViewBag.Title = "";
|
Layout = null;
|
}
|
<!DOCTYPE html>
|
<html lang="zh" style="height: 100%">
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta charset="utf-8" />
|
<link href="~/Theme/css/bootstrap-grid.min.css" rel="stylesheet" />
|
<link href="~/Theme/css/naranja.min.css" rel="stylesheet" />
|
<script src="~/Theme/Js/jquery-1.8.3.min.js"></script>
|
</head>
|
@*<frameset rows="40,*,30" cols="*" frameborder="no" border="0" framespacing="0">
|
|
顶部发104px,底部30px,中间部分自适应
|
<frame src="/Home/Top" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
|
<frameset cols="193,*" frameborder="no" border="0" framespacing="0" id="middenFram">
|
左侧193px,右侧q自适应
|
<frame src="/Home/Left" name="leftFrame" scrolling="No" noresize="noresize" id="leftFrame" title="leftFrame" />
|
<frame src="/Home/Right" name="mainFrame" id="mainFrame" title="mainFrame" /> /Home/Right
|
</frameset>
|
<frame src="/Content/Bootom.html" name="bootomFrame" scrolling="No" noresize="noresize" id="bootomFrame" title="topFrame" />
|
</frameset>*@
|
|
@*<noframes>
|
<body>
|
|
</body>
|
</noframes>*@
|
<body style="height: 100%">
|
<iframe src="/Home/HomeIframe" style="height: 100%; width: 100%; border: 0px; padding: 0px; margin: 0px; vertical-align: bottom;" frameborder="0" scrolling="no"></iframe>
|
|
@*<div class="container">
|
<div class="row" style="padding:2em 0">
|
<div class="col-md-2">
|
<button class="btn btn-error" onclick="narn('log')">默认(log)</button>
|
</div>
|
<div class="col-md-2"><button class="btn btn-success" onClick="narn('success')">成功(success)</button></div>
|
<div class="col-md-2"><button class="btn btn-warning" onclick="narn('warn')">警告(warn)</button></div>
|
<div class="col-md-2"><button class="btn btn-danger" onclick="narn('error')">危险(error)</button></div>
|
</div>
|
</div>*@
|
|
<script src="~/Theme/Js/naranja.js"></script>
|
<script type="text/javascript">
|
function narn(type, text) {
|
naranja()[type]({
|
title: '新消息提示',
|
text: text,
|
//src: '/Wcs/TaskMonitor/index',
|
timeout: '10000',//keep
|
//buttons: [{
|
// text: '接受',
|
// click: function (e) {
|
// naranja().success({
|
// title: '通知',
|
// text: '通知被接受'
|
// })
|
// }
|
//}, {
|
// text: '取消',
|
// click: function (e) {
|
// e.closeNotification()
|
// }
|
//}]
|
})
|
}
|
|
//narn('warn','测试提示!');
|
|
//console.log("ws://" + window.location.hostname + ":" + window.location.port + "/api/WSChat");
|
//var ws = new WebSocket("ws://" + window.location.hostname + ":" + window.location.port + "/api/WSChat/Get");
|
|
var webSocket;
|
|
function Connection() {
|
webSocket = new WebSocket("ws://" + window.location.hostname + ":" + window.location.port + "/api/WSChat/Get");
|
console.log("ws://" + window.location.hostname + ":" + window.location.port + "/api/WSChat/Get");
|
InitEventHandles();
|
}
|
|
function InitEventHandles() {
|
//建立成功
|
webSocket.onopen = function () {
|
console.log("socket opened");
|
}
|
//异常
|
webSocket.onerror = function () {
|
console.log("An exception hai occurred");
|
}
|
//服务端返回消息回调
|
webSocket.onmessage = function (event) {
|
|
if (event.data == "0") {
|
console.log(event.data);
|
narn('warn', event.data);
|
}
|
|
//Reload();
|
//location.reload('/WCS/TaskMonitor/index');
|
//var result = new Uint8Array(event.data);
|
//console.log(result);
|
}
|
//webSocket.reload = function () {
|
// console.log('跳转')
|
// //URL: '/WCS/TaskMonitor/index';
|
//}
|
//关闭连接回调
|
webSocket.onclose = function () {
|
console.log("socket closed");
|
}
|
}
|
|
function Reload() {
|
|
//location.click('Dialog') = '/WCS/TaskMonitor/index';
|
console.log('刷新:' + location.href);
|
console.log('子界面:' + parent.location)
|
//location.reload.console.log("");
|
//console.log(breadcrumb);
|
//location.replace("/WCS/TaskMonitor/index");
|
//$(document).ready(function () {
|
//TaskMonitorManager.ToolBar();
|
//});
|
}
|
|
function Send() {
|
//向服务器发送数据
|
webSocket.send("你好");
|
}
|
|
function Disconnect() {
|
webSocket.close();
|
}
|
|
Connection();
|
</script>
|
|
</body>
|
</html>
|