Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The atrribute of hosts have changed in new version of floodlight #2

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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#Floodlight Controller webui - ZH

Translate and fix bugs caused by Floodlight API modification.


The Above is origin README.




#Email [email protected] for bug reports and help.

# floodlight-WebUI
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</script>
</head>
<body>
Go to <a href="pages/login.html">Enter The Application</a>
Go to <a href="pages/login.html">正在进入应用</a>
</body>
</html>
20 changes: 10 additions & 10 deletions js/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
*/
document.getElementById("navMenu").innerHTML =
'<ul class="nav" id="side-menu">'+
'<li><a href="index.html"><i class="fa fa-home fa-fw"></i> Controller (Home) </a></li>'+
'<li><a href="switches.html"><i class="fa fa-exchange"></i> Switches</a></li>'+
'<li><a href="hosts.html"><i class="fa fa-desktop fa-fw"></i> Hosts</a></li>'+
'<li><a href="links.html"><i class="fa fa-expand fa-fw"></i> Links</a></li>'+
'<li><a href="index.html"><i class="fa fa-home fa-fw"></i>控制器状态</a></li>'+
'<li><a href="switches.html"><i class="fa fa-exchange"></i>交换机</a></li>'+
'<li><a href="hosts.html"><i class="fa fa-desktop fa-fw"></i>主机</a></li>'+
'<li><a href="links.html"><i class="fa fa-expand fa-fw"></i> 链路</a></li>'+
//'<li><a href="routes.html"><i class="fa fa-link fa-fw"></i> Routes</a></li>'+
'<li><a href="topology.html"><i class="fa fa-sitemap fa-fw"></i> Topology</a></li>'+
'<li><a href="firewall.html"><i class="fa fa-warning fa-fw"></i> Firewall</a></li>'+
'<li><a href="acl.html"><i class="fa fa-warning fa-fw"></i> Access Control Lists</a></li>'+
'<li><a href="statistics.html"><i class="fa fa-bar-chart-o fa-fw"></i> Statistics</a></li>'+
'<li><a data-toggle="modal" href="#login-modal"><i class="fa fa-sign-out"></i> Change Controllers</a></li>'+
'<li><a href="topology.html"><i class="fa fa-sitemap fa-fw"></i>拓扑</a></li>'+
'<li><a href="firewall.html"><i class="fa fa-warning fa-fw"></i>防火墙</a></li>'+
'<li><a href="acl.html"><i class="fa fa-warning fa-fw"></i>ACL</a></li>'+
'<li><a href="statistics.html"><i class="fa fa-bar-chart-o fa-fw"></i>统计</a></li>'+
'<li><a data-toggle="modal" href="#login-modal"><i class="fa fa-sign-out"></i>修改控制器</a></li>'+
'</ul>';

var ipaddress = $.cookie('cip');
if (ipaddress == null || ipaddress == "") window.location.href = "login.html";
var restport = $.cookie('cport');
if (restport == null || restport == "") window.location.href = "login.html";

document.getElementById("home-button-title").innerHTML = "Floodlight OpenFlow Controller - " + ipaddress + ":" + restport;
document.getElementById("home-button-title").innerHTML = "Floodlight控制器 - " + ipaddress + ":" + restport;
79 changes: 40 additions & 39 deletions pages/acl.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Floodlight OpenFlow Controller - Access Control List</title>
<title>ACL控制</title>
<!-- Bootstrap Core CSS -->
<link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- MetisMenu CSS -->
Expand Down Expand Up @@ -43,7 +43,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html" id="home-button-title">Floodlight OpenFlow Controller </a>
<a class="navbar-brand" href="index.html" id="home-button-title">SDN控制器</a>
</div>
<!-- /.navbar-top-links -->
<div class="navbar-default sidebar" role="navigation">
Expand All @@ -58,18 +58,18 @@
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h3 class="page-header">Access Control Lists </h3>
<h3 class="page-header">ACL</h3>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->

<div class="row">
<div class="col-md-1">
<a href="#" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#addRuleModal">Add New</a>
<a href="#" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#addRuleModal">新规则</a>
</div>
<div class="col-md-1">
<a href="#" class="btn btn-sm btn-danger" data-toggle="modal" id="btnDeleteAll">Delete All</a>
<a href="#" class="btn btn-sm btn-danger" data-toggle="modal" id="btnDeleteAll">删除所有</a>
</div>
<br/><br/>
</div>
Expand All @@ -79,7 +79,7 @@ <h3 class="page-header">Access Control Lists </h3>
<div class="col-lg-12">
<div class="panel panel-primary">
<div class="panel-heading">
<i class="fa fa-table fa-fw"></i>Control List
<i class="fa fa-table fa-fw"></i>规则列表
</div>
<!-- /.panel-heading -->
<div class="panel-body">
Expand All @@ -89,16 +89,16 @@ <h3 class="page-header">Access Control Lists </h3>
<thead>
<tr>
<th>ID</th>
<th>Source</th>
<th>Dest</th>
<th>Source IP</th>
<th>Mask</th>
<th>Dest IP</th>
<th>Mask</th>
<th>Prot.</th>
<th>Dest TP</th>
<th>Act.</th>
<th>Delete</th>
<th></th>
<th>目的</th>
<th> IP</th>
<th>掩码</th>
<th>目的 IP</th>
<th>掩码</th>
<th>端口.</th>
<th>目的 TP</th>
<th>动作.</th>
<th>是否删除</th>
</tr>
</thead>
<tbody></tbody>
Expand All @@ -119,11 +119,11 @@ <h3 class="page-header">Access Control Lists </h3>
aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel2">Create Rule</h4>
<h4 class="modal-title" id="myModalLabel2">新规则</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label>Protocol</label>
<label>协议</label>
<div class="radio">
<label>
<input type="radio" id="rbTCP" name="check3" checked="checked"/> TCP
Expand All @@ -146,22 +146,22 @@ <h4 class="modal-title" id="myModalLabel2">Create Rule</h4>
<label>Dest TP</label>
<input class="form-control" type="text" id="tp-dst" placeholder="Dest Tp">

<label>Action</label>
<label>行为</label>
<div class="radio">
<label>
<input type="radio" id="rbAllow" name="check1" checked="checked"/> ALLOW
<input type="radio" id="rbAllow" name="check1" checked="checked"/> 允许
</label>
<label>
<input type="radio" id="rbDeny" name="check1"> DENY
<input type="radio" id="rbDeny" name="check1"> 阻断
</label>
</div>

</div>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Cancel</button>
<button type="button" id="btnAddRule" class="btn btn-sm btn-primary">Create</button>
<button type="button" class="btn btn-sm btn-default" data-dismiss="modal">取消</button>
<button type="button" id="btnAddRule" class="btn btn-sm btn-primary">新建</button>
</div>
</div>
</div>
Expand Down Expand Up @@ -204,6 +204,7 @@ <h4 class="modal-title" id="myModalLabel2">Create Rule</h4>

<script>
var ipaddress = $.cookie('cip');
var port = $.cookie('cport')
if (ipaddress == null || ipaddress == "") window.location.href = "login.html";

$("#btnAddRule").click(function () {
Expand Down Expand Up @@ -248,14 +249,14 @@ <h4 class="modal-title" id="myModalLabel2">Create Rule</h4>
$.ajax({
type : "POST",
dataType: 'json',
url : "http://" + ipaddress + ":8080/wm/acl/rules/json",
url : "http://" + ipaddress + ":" + port + "/wm/acl/rules/json",
data : postData,
success : function (data) {

if (data["status"] == "Success! New rule added.") {
new PNotify({
title: 'Rule Added!',
text : 'Rule successfully added.',
title: '规则添加!',
text : '规则添加成功',
type : 'success',
hide : true
});
Expand All @@ -265,7 +266,7 @@ <h4 class="modal-title" id="myModalLabel2">Create Rule</h4>
else {

new PNotify({
title: 'Error occured.',
title: '错误.',
text : data["status"],
type : 'error',
hide : true
Expand All @@ -274,7 +275,7 @@ <h4 class="modal-title" id="myModalLabel2">Create Rule</h4>

},
error : function (jqXHR, textStatus, errorThrown) {
alert('Error: ' + " " + jqXHR.responseText + " \n Status: " + textStatus + " \n Error Thrown: " + errorThrown);
alert('错误: ' + " " + jqXHR.responseText + " \n 状态: " + textStatus + " \n 异常: " + errorThrown);
}
});

Expand All @@ -284,7 +285,7 @@ <h4 class="modal-title" id="myModalLabel2">Create Rule</h4>

function GetRules() {

var url = "http://" + ipaddress + ":8080/wm/acl/rules/json";
var url = "http://" + ipaddress + ":" + port + "/wm/acl/rules/json";

$(document).ready(function () {

Expand All @@ -305,7 +306,7 @@ <h4 class="modal-title" id="myModalLabel2">Create Rule</h4>
// `data` option, which defaults to the column being worked with, in
// this case `data: 0`.
"render" : function (data, type, row) {
return "<a class='btn btn-xs btn-danger' onclick='DeleteRule(" + data + ")' >Delete</<a>";
return "<a class='btn btn-xs btn-danger' onclick='DeleteRule(" + data + ")' >删除</<a>";
},
"targets": 10
}],
Expand All @@ -330,18 +331,18 @@ <h4 class="modal-title" id="myModalLabel2">Create Rule</h4>

function DeleteRule(ruleId) {

if (confirm("Rule will be deleted. To continue press 'OK' !")) {
if (confirm("规则即将删除,按确定按钮继续")) {

$.ajax({
type : "DELETE",
dataType: 'json',
url : "http://" + ipaddress + ":8080/wm/acl/rules/json",
url : "http://" + ipaddress + ":" + port + "/wm/acl/rules/json",
data : '{ "ruleid":' + "\"" + ruleId + "\"" + '}',
success : function (data) {

new PNotify({
title: 'Rule is deleted!',
text : 'Rule successfully deleted.',
title: '规则已删除',
text : '规则删除成功',
type : 'success',
hide : true
});
Expand All @@ -350,7 +351,7 @@ <h4 class="modal-title" id="myModalLabel2">Create Rule</h4>

},
error : function (jqXHR, textStatus, errorThrown) {
alert('Error: ' + " " + jqXHR.responseText + " \n Status: " + textStatus + " \n Error Thrown: " + errorThrown);
alert('错误: ' + " " + jqXHR.responseText + " \n 状态: " + textStatus + " \n 抛出的错误: " + errorThrown);
}
});
}
Expand All @@ -370,12 +371,12 @@ <h4 class="modal-title" id="myModalLabel2">Create Rule</h4>
$.ajax({
type : "GET",
dataType: "json",
url : "http://" + ipaddress + ":8080/wm/acl/clear/json",
url : "http://" + ipaddress + ":" + port + "/wm/acl/clear/json",
success : function (data) {

new PNotify({
title: 'All rules are deleted!',
text : 'Rules successfully deleted.',
title: '所有的规则都已删除',
text : '规则删除成功',
type : 'success',
hide : true
});
Expand All @@ -384,7 +385,7 @@ <h4 class="modal-title" id="myModalLabel2">Create Rule</h4>

},
error : function (jqXHR, textStatus, errorThrown) {
alert('Error: ' + " " + jqXHR.responseText + " \n Status: " + textStatus + " \n Error Thrown: " + errorThrown);
alert('错误: ' + " " + jqXHR.responseText + " \n 状态: " + textStatus + " \n 抛出的错误: " + errorThrown);
}
});
}
Expand Down
Loading