Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Web new #29

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 114 additions & 58 deletions server/web/templates/Index.html

Large diffs are not rendered by default.

Binary file added server/web/templates/assets/img/conditioner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified server/web/templates/assets/img/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added server/web/templates/assets/img/tx2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions server/web/templates/assets/js/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -2157,7 +2157,7 @@ function chartJSInit() {
label: '总在线设备数',
color: 'rgba(255,255,255, .98)',
formatter: function (w) {
w = 5
w = 169
return w
}
}
Expand All @@ -2178,11 +2178,11 @@ function chartJSInit() {
stops: [0, 100]
}
},
series: [98, 19.7, 70],
series: [5, 10, 76],
stroke: {
lineCap: 'round'
},
labels: ['全期抵御成功率', '正在遭受攻击率', '正在防御数'],
labels: ['移动性物联网终端', '非移动性小数据物联网终端', '非移动性大数据物联网终端'],
responsive: [{
breakpoint: 480,
options: {
Expand Down Expand Up @@ -2239,7 +2239,7 @@ function chartJSInit() {

dataLabels: {
name: {
show: false
show: true
},
value: {
formatter: function (val) {
Expand All @@ -2266,7 +2266,8 @@ function chartJSInit() {
stops: [0, 100]
}
},
series: [Math.random() * 100],
series: [92],
labels:["当前在线节点数"],
stroke: {
lineCap: 'round'
}
Expand Down Expand Up @@ -2339,7 +2340,7 @@ function chartJSInit() {

/* dateRangePicker */
if ($('#_DateRangeJS_min').length > 0) {
let start = moment().subtract(29, 'days'),
let start = moment(),
end = moment();

function cb(start, end) {
Expand Down
36 changes: 7 additions & 29 deletions server/web/templates/controller.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h5 class="title pe-a mb-0 d-inline">物联网设备状态概览</h5>
</div>
</td>
<td>空气净化器</td>
<td>219.217.199.12</td>
<td>112.32.197.79</td>
<td><a href="" class="btn btn-sm btn-outline-warning btn-round px-4"
id="test1">Run</a>
</td>
Expand All @@ -107,7 +107,7 @@ <h5 class="title pe-a mb-0 d-inline">物联网设备状态概览</h5>
</div>
</td>
<td>扫地机器人</td>
<td>219.217.199.13</td>
<td>112.32.197.80</td>
<td><a href="" class="btn btn-sm btn-outline-warning btn-round px-4"
id="test2">Run</a>
</td>
Expand All @@ -122,39 +122,17 @@ <h5 class="title pe-a mb-0 d-inline">物联网设备状态概览</h5>
</div>
</td>
</tr>

<tr>
<th scope="row">3</th>
<td>
<div class="d-flex align-items-center">
<small class="ml-3 small-2">2021003</small>
</div>
</td>
<td>智能灯具</td>
<td>219.217.199.14</td>
<td><a href="" class="btn btn-sm btn-outline-danger btn-round px-4"
id="test3">Run</a>
</td>
<td>
<div class="panel-dropdown-menu dropdown">
<button
class="btn text-warning dropdown-toggle no-carret bc-t p-0"
type="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false"><img
src="./img/svg/more.svg"
style="display:block;width:20px;height:20px" /></button>
</div>
</td>
</tr>
<tr>
<th scope="row">4</th>
<td>
<div class="d-flex align-items-center">
<small class="ml-3 small-2">2021004</small>
</div>
</td>
<td>智能微波炉</td>
<td>219.217.199.15</td>
<td><a href="" class="btn btn-sm btn-outline-warning btn-round px-4"
<td>112.32.197.81</td>
<td><a href="" class="btn btn-sm btn-outline-danger btn-round px-4"
id="test4">Under Attack</a>
</td>
<td>
Expand All @@ -169,14 +147,14 @@ <h5 class="title pe-a mb-0 d-inline">物联网设备状态概览</h5>
</td>
</tr>
<tr>
<th scope="row">5</th>
<th scope="row">4</th>
<td>
<div class="d-flex align-items-center">
<small class="ml-3 small-2">2021004</small>
</div>
</td>
<td>物联网空调</td>
<td>219.217.199.16</td>
<td>112.32.197.82</td>
<td><a href="" class="btn btn-sm btn-outline-success btn-round px-4"
id="test5">Offline</a>
</td>
Expand Down
42 changes: 35 additions & 7 deletions server/web/templates/devices.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h5 class="title pe-a mb-0 d-inline">实景图渲染</h5>
<i class="fas fa-circle text-warning small-5"></i><span class="small-3"><b>
设备名称:</b>扫地机器人</br></span>
<span class="small-3"><b>
&emsp;设备IP:</b>219.217.199.12</br></span>
&emsp;设备IP:</b>112.32.197.79</br></span>
<span class="small-3"><b>
&emsp;当前状态:</b>正常运行</span>
</div>
Expand All @@ -100,7 +100,7 @@ <h5 class="title pe-a mb-0 d-inline">实景图渲染</h5>
<i class="fas fa-circle text-warning small-5"></i><span class="small-3"><b>
设备名称:</b>空气净化器</br></span>
<span class="small-3"><b>
&emsp;设备IP:</b>219.217.199.14</br></span>
&emsp;设备IP:</b>112.32.197.80</br></span>
<span class="small-3"><b>
&emsp;当前状态:</b>正常运行</span>
</div>
Expand All @@ -112,11 +112,23 @@ <h5 class="title pe-a mb-0 d-inline">实景图渲染</h5>
<i class="fas fa-circle text-danger small-5"></i><span class="small-3"><b>
设备名称:</b>智能微波炉</br></span>
<span class="small-3"><b>
&emsp;设备IP:</b>219.217.199.15</br></span>
&emsp;设备IP:</b>112.32.197.81</br></span>
<span class="small-3"><b>
&emsp;当前状态:</b>检测到异常,等待其他节点进行验证</span>
</div>
</div>
<!-- 物联网空调 -->
<div class="text-white card border" id="conmenu"
style="display:none; position: absolute; z-index:9999; background-color: #060424;">
<div class="card-body">
<i class="fas fa-circle text-light small-5"></i><span class="small-3"><b>
设备名称:</b>物联网空调</br></span>
<span class="small-3"><b>
&emsp;设备IP:</b>112.32.197.82</br></span>
<span class="small-3"><b>
&emsp;当前状态:</b>已停运</span>
</div>
</div>
</div>
</div><!-- /.panel -->
</main>
Expand Down Expand Up @@ -215,6 +227,13 @@ <h5 class="title pe-a mb-0 d-inline">实景图渲染</h5>
node3.alarm = '发现异常流量';
scene.add(node3);

var node4 = new JTopo.Node("物联网空调");
node4.setLocation(530, 210);
node4.setImage('img/conditioner.png');
node4.alarm = '已停运';
node4.fontColor = "000000";
scene.add(node4);

setInterval(function () {
if (node3.alarm == '发现异常流量') {
node3.alarm = null;
Expand Down Expand Up @@ -252,12 +271,12 @@ <h5 class="title pe-a mb-0 d-inline">实景图渲染</h5>
$("#robotmenu").hide();
}
}
function handlery(event, id) {
function handlery(event, id,x) {
if (event.button == 0) {// 右键
// 当前位置弹出菜单(div)
$("#" + id).css({
top: event.pageY - 152.4 - 20,
left: event.pageX - 240 + 100
left: event.pageX - 240 + 100+x
}).show();
}
if (event.button == 2) {// 右键
Expand All @@ -273,13 +292,22 @@ <h5 class="title pe-a mb-0 d-inline">实景图渲染</h5>
node2.addEventListener('mouseup', function (event) {
currentNode = this;
var id = "airmenu";
handlery(event, id);
var x=0;
handlery(event, id,x);
});

node3.addEventListener('mouseup', function (event) {
currentNode = this;
var id = "ovenmenu";
handlery(event, id);
var x=0;
handlery(event, id,x);
});

node4.addEventListener('mouseup', function (event) {
currentNode = this;
var id = "conmenu";
var x=50;
handlery(event, id,x);
});

function newLink(nodeA, nodeZ, text, dashedPattern) {
Expand Down
87 changes: 48 additions & 39 deletions server/web/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,54 @@



<!-- header -->
<header class="main-header">
<!-- nav -->
<nav class="main-navbar navbar navbar-expand-lg navbar-light shadow-2">
<div class="lnav-box d-flex">
<div class="logo-wrapper px-3 d-none d-md-flex"><img src="/img/logo.png" alt="Logo"></div>
<div class="sidebar-toggler-wrapper ml-auto"><button
class="p-collapsing-sidebar-toggler sidebar-toggler-secondary transition rounded-circle"
data-collapsing="partially" data-collapsing-target="#adminNav" type="button"><img
src="./img/svg/home.svg" style="display:block;width:330px;height:240px" /></span></button>
</div>
<!-- header -->
<header class="main-header">
<!-- nav -->
<nav class="main-navbar navbar navbar-expand-lg navbar-light shadow-2">
<div class="lnav-box d-flex">
<div class="logo-wrapper px-3 d-none d-md-flex"><img src="/img/logo.png" alt="Logo"></div>
<div class="sidebar-toggler-wrapper ml-auto"><button
class="p-collapsing-sidebar-toggler sidebar-toggler-secondary transition rounded-circle"
data-collapsing="partially" data-collapsing-target="#adminNav" type="button"><img
src="./img/svg/home.svg" style="display:block;width:330px;height:240px" /></span></button>
</div>
<div class="d-none d-lg-block ml-0 mr-auto pl-4">
dDDos安全态势感知平台
</div>
<div class="pr-6">
<ul class="nav sec-nav navbar-nav flex-row">
<li class="user-item nav-item dropdown"><a
class="user-link nav-link d-inline-flex align-items-center h-100 small-1 pl-1 pl-sm-3 pr-0"
href="#" id="dropdownAdmin_02" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false"><img class="user-avatar rounded-circle mr-sm-3" src="/img/Hunter.jpg"
alt="Avatar">
<div class="d-none d-sm-block lh-1">
<div class="lh-5">Hello Admin</div><span class="small-3">Online</span>
</div>
</a>
<div class="dropdown-menu dropdown-menu-right shadow-1 py-3 position-absolute mt-2"
aria-labelledby="dropdownAdmin"><a class="dropdown-item" href="#"><span
class="icon-messenger-user-avatar mr-2"></span>My Profile</a><a
class="dropdown-item" href="#"><span
class="icon-closed-envelope-email mr-2"></span>Messages</a><a class="dropdown-item"
href="#"><span class="icon-options-gear mr-2"></span>Settings</a>
<a class="dropdown-item" href="#"><span class="icon-power-on-buton mr-2"></span>Logout</a>
</div>
<div class="d-none d-lg-block ml-0 mr-auto pl-4">
dDDos安全态势感知平台
</div>
<div class="pr-6">
<ul class="nav sec-nav navbar-nav flex-row">
<li class="user-item nav-item dropdown"><a
class="user-link nav-link d-inline-flex align-items-center h-100 small-1 pl-1 pl-sm-3 pr-0"
href="#" id="dropdownAdmin_02" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false"><img id="avator" class="user-avatar rounded-circle mr-sm-3"
src="/img/Hunter.jpg" alt="Avatar">
<div class="d-none d-sm-block lh-1">
<div class="lh-5" id="user">Hello,Admin!</div><span class="small-3"><span class="small-3"><i
class="fas fa-circle text-warning small-5"></i> Online</span>
</div>
</li>
</ul>
</div>
</nav>
<!-- /.nav -->
</header>
<!-- /.header -->
</a>
<div class="dropdown-menu dropdown-menu-right shadow-1 py-3 position-absolute mt-2"
aria-labelledby="dropdownAdmin">
<a class="dropdown-item" href="#"><span class="icon-closed-envelope-email mr-2"></span>消息</a>
<a class="dropdown-item" href="#"><span class="icon-options-gear mr-2"></span>设置</a>
<a class="dropdown-item" href="#"><span class="icon-power-on-buton mr-2"></span>登出</a>
<a class="dropdown-item" href="/logg"><span class="icon-messenger-user-avatar mr-2"></span>切换账户</a>
</div>
</li>
</ul>
</div>
</nav>
<!-- /.nav -->
</header>
<!-- /.header -->
<script>
$(function () {
var path = window.location.pathname.split("/");
if (path[1] == "logg") {
$("img#avator").attr("src", "/img/tx2.jpg");
$("div#user").text("Hello,Windy!");
}
})
</script>
{{end}}
Loading