2016-08-30 11:22:26 +00:00
|
|
|
<!-- page content -->
|
|
|
|
<div class="right_col" role="main">
|
|
|
|
|
2016-08-20 06:58:04 +00:00
|
|
|
<div class="page-title">
|
|
|
|
<div class="title_left">
|
2016-08-30 11:22:26 +00:00
|
|
|
<h3>Volume</h3>
|
2016-08-20 06:58:04 +00:00
|
|
|
</div>
|
|
|
|
<div class="title_right">
|
2016-08-30 12:11:02 +00:00
|
|
|
<div class="col-md-5 col-sm-5 col-xs-12 pull-right">
|
|
|
|
<button class="btn btn-primary pull-right" onclick="volume_create">
|
|
|
|
Create
|
|
|
|
</button>
|
2016-08-20 06:58:04 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-08-22 08:35:24 +00:00
|
|
|
|
2016-08-20 06:58:04 +00:00
|
|
|
<div class="clearfix"></div>
|
|
|
|
|
2016-08-30 11:22:26 +00:00
|
|
|
<div class="row">
|
2016-08-20 12:02:16 +00:00
|
|
|
<%@volumes.each do |t|%>
|
2016-08-22 09:41:25 +00:00
|
|
|
<div class="col-md-12 col-sm-12 col-xs-12">
|
2016-08-22 08:35:24 +00:00
|
|
|
<div class="x_panel">
|
|
|
|
<div class="x_title">
|
|
|
|
<h2>Infomation <small><%=t["Volume Name"]%></small></h2>
|
|
|
|
<ul class="nav navbar-right panel_toolbox">
|
2016-08-30 11:22:26 +00:00
|
|
|
<li><a class="collapse-link"><i <%if t!=@volumes[0]%> class="fa fa-chevron-down" <%else%> class="fa fa-chevron-up" <%end%> ></i></a>
|
2016-08-22 08:35:24 +00:00
|
|
|
</li>
|
|
|
|
<li class="dropdown">
|
2016-08-30 12:11:02 +00:00
|
|
|
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
|
2016-08-22 08:35:24 +00:00
|
|
|
<ul class="dropdown-menu" role="menu">
|
|
|
|
<li><a href="#">Settings 1</a>
|
|
|
|
</li>
|
|
|
|
<li><a href="#">Settings 2</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2016-08-30 12:11:02 +00:00
|
|
|
<li><a class="close-link" style="display:none;"><i class="fa fa-close"></i></a>
|
2016-08-22 08:35:24 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
</div>
|
|
|
|
|
2016-08-30 11:22:26 +00:00
|
|
|
<div class="x_content" <%if t!=@volumes[0]%> style="display: none;" <%end%> >
|
2016-08-22 08:35:24 +00:00
|
|
|
|
2016-08-22 09:41:25 +00:00
|
|
|
<div class="col-md-4 col-sm-4 col-xs-4">
|
2016-08-30 11:22:26 +00:00
|
|
|
<p class="text-muted font-13 m-b-30"><code>Volume Info</code></p>
|
2016-08-20 12:02:16 +00:00
|
|
|
Type : <%=t["Type"]%> <br>
|
|
|
|
Volume ID : <%=t["Volume ID"]%> <br>
|
|
|
|
Status : <%=t["Status"]%> <br>
|
|
|
|
Number of Bricks : <%=t["Number of Bricks"]%> <br>
|
|
|
|
Transport-type : <%=t["Transport-type"]%> <br>
|
|
|
|
Bricks : <%=t["Bricks"]%> <br>
|
|
|
|
Bricks1 : <%=t["Brick1"]%> <br>
|
|
|
|
Options Reconfigured : <%=t["Options Reconfigured"]%> <br>
|
2016-08-31 14:42:14 +00:00
|
|
|
performance.readdir-ahead : <%=t["performance.readdir-ahead"]%>
|
|
|
|
<br><br><br>
|
|
|
|
<% if t["Status"] == " start" %>
|
|
|
|
<a class="btn btn-round btn-success btn-lg" href="/volume/start/<%=t['Volume Name']%>">
|
|
|
|
<i class="fa fa-play"></i> Start
|
|
|
|
</a>
|
2016-09-01 09:02:00 +00:00
|
|
|
<a class="btn btn-app" href="/volume/delete/<%=t['Volume Name']%>">
|
|
|
|
<i class="fa fa-trash"></i> Delete
|
|
|
|
</a>
|
2016-08-31 14:42:14 +00:00
|
|
|
<% else %>
|
|
|
|
<a class="btn btn-round btn-danger btn-lg" href="/volume/stop/<%=t['Volume Name']%>">
|
|
|
|
<i class="fa fa-pause"></i> Stop
|
|
|
|
</a>
|
|
|
|
<a class="btn btn-app" href="/volume/mount/<%=t['Volume Name']%>">
|
2016-08-31 12:29:16 +00:00
|
|
|
<i class="fa fa-upload"></i> Mount
|
2016-08-31 14:42:14 +00:00
|
|
|
</a>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2016-08-22 08:35:24 +00:00
|
|
|
|
2016-08-22 09:41:25 +00:00
|
|
|
<div class="col-md-8 col-sm-8 col-xs-8">
|
2016-08-28 14:19:04 +00:00
|
|
|
<p>Drag multiple files to the box below for multi upload or click to select files.</p>
|
|
|
|
<form action="/file_upload" method="post" enctype="multipart/form-data" class="dropzone" style="border: 1px solid #e5e5e5; height: 300px; overflow:auto;">
|
2016-08-22 09:00:01 +00:00
|
|
|
</form>
|
2016-08-22 09:41:25 +00:00
|
|
|
<br/>
|
2016-08-22 08:35:24 +00:00
|
|
|
</div>
|
|
|
|
|
2016-08-27 13:21:08 +00:00
|
|
|
<div class="col-md-12 col-sm-12 col-xs-12" id="table_div">
|
2016-08-30 11:22:26 +00:00
|
|
|
<p class="text-muted font-13 m-b-30"><code>File Manager</code></p>
|
|
|
|
<p> Current directory : <%=@current_dir%></p></br>
|
|
|
|
<table id="datatable" class="table table-striped table-bordered jambo_table">
|
|
|
|
<thead>
|
|
|
|
<tr class="headings">
|
|
|
|
<th>Name</th>
|
|
|
|
<th>auth</th>
|
|
|
|
<th>Size</th>
|
|
|
|
<th>Date</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
2016-08-25 10:22:48 +00:00
|
|
|
|
2016-08-30 11:22:26 +00:00
|
|
|
<tbody id="tbody_volume1">
|
|
|
|
<tr>
|
|
|
|
<td><i class="fa fa-reply"></i>
|
|
|
|
<a onclick="change_upper('<%=@current_dir%>')"> ..</a>
|
|
|
|
</td>
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
<%@files.each do |t|%>
|
2016-08-27 13:21:08 +00:00
|
|
|
<tr>
|
2016-08-30 11:22:26 +00:00
|
|
|
<% if t["auth"][0]=='d'%>
|
|
|
|
<td style="color:#0d8ade;"><i class="fa fa-folder-open-o"></i>
|
|
|
|
<a style="cursor: pointer" onclick="change_directory('<%=@current_dir + "/" + t["name"]%>')"><%=t["name"]%></a>
|
|
|
|
</td>
|
|
|
|
<% else %>
|
|
|
|
<td><i class="fa fa-file-o"></i>
|
|
|
|
<a style="cursor: pointer"><%=t["name"]%></a>
|
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
<td><%=t["auth"]%></td>
|
|
|
|
<td><%=t["size"]%></td>
|
|
|
|
<td><%=t["date"]%></td>
|
2016-08-27 13:21:08 +00:00
|
|
|
</tr>
|
2016-08-30 11:22:26 +00:00
|
|
|
<%end%>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2016-08-25 10:22:48 +00:00
|
|
|
</div>
|
2016-08-20 06:58:04 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-08-22 08:35:24 +00:00
|
|
|
</div>
|
2016-08-20 12:02:16 +00:00
|
|
|
<%end%>
|
2016-08-20 06:58:04 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-08-30 11:22:26 +00:00
|
|
|
<!-- /page content -->
|
2016-08-25 10:22:48 +00:00
|
|
|
|
2016-08-30 12:11:02 +00:00
|
|
|
|
|
|
|
<!-- data table handler -->
|
2016-08-25 10:22:48 +00:00
|
|
|
<script>
|
2016-08-30 11:22:26 +00:00
|
|
|
var handleDataTableButtons = function() {
|
|
|
|
"use strict";
|
|
|
|
0 !== $("#datatable-buttons").length && $("#datatable-buttons").DataTable({
|
|
|
|
dom: "Bfrtip",
|
|
|
|
buttons: [{
|
|
|
|
extend: "copy",
|
|
|
|
className: "btn-sm"
|
|
|
|
}, {
|
|
|
|
extend: "csv",
|
|
|
|
className: "btn-sm"
|
|
|
|
}, {
|
|
|
|
extend: "excel",
|
|
|
|
className: "btn-sm"
|
|
|
|
}, {
|
|
|
|
extend: "pdf",
|
|
|
|
className: "btn-sm"
|
|
|
|
}, {
|
|
|
|
extend: "print",
|
|
|
|
className: "btn-sm"
|
|
|
|
}],
|
|
|
|
responsive: !0
|
|
|
|
})
|
|
|
|
},
|
|
|
|
TableManageButtons = function() {
|
|
|
|
"use strict";
|
|
|
|
return {
|
|
|
|
init: function() {
|
|
|
|
handleDataTableButtons()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}();
|
2016-08-25 10:22:48 +00:00
|
|
|
</script>
|
2016-08-30 11:22:26 +00:00
|
|
|
|
2016-08-25 10:22:48 +00:00
|
|
|
<script type="text/javascript">
|
2016-08-30 11:22:26 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
$('#datatable').dataTable();
|
|
|
|
});
|
|
|
|
TableManageButtons.init();
|
2016-08-27 13:21:08 +00:00
|
|
|
</script>
|
|
|
|
|
2016-08-30 12:11:02 +00:00
|
|
|
<!-- file manager functions -->
|
2016-08-27 13:21:08 +00:00
|
|
|
<script>
|
|
|
|
function change_upper(directory){
|
|
|
|
if(directory != "/"){
|
|
|
|
var path = directory.split("/");
|
|
|
|
var upper_path = "";
|
|
|
|
if(path.length == 2){
|
|
|
|
change_directory("/");
|
|
|
|
} else {
|
|
|
|
for(var i = 1; i < path.length - 1 ; i++){
|
|
|
|
if(path[i] != "")
|
|
|
|
upper_path += "/" + path[i];
|
|
|
|
}
|
|
|
|
change_directory(upper_path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function change_directory(directory){
|
2016-08-28 10:12:08 +00:00
|
|
|
$.ajax({
|
2016-08-27 13:21:08 +00:00
|
|
|
method: "POST",
|
|
|
|
url: "/volume/changeDir",
|
|
|
|
data: { path: directory },
|
|
|
|
success : function(result){
|
|
|
|
$("#table_div").empty();
|
2016-08-28 10:12:08 +00:00
|
|
|
var new_table = "<p class='text-muted font-13 m-b-30'><code>File Manager</code></p>";
|
|
|
|
new_table += "<p>Current directory : " + directory + "</p></br>";
|
2016-08-27 13:21:08 +00:00
|
|
|
new_table += "<table id='datatable' class='table table-striped table-bordered jambo_table'>";
|
|
|
|
new_table += "<thead>";
|
|
|
|
new_table += "<tr class='headings'>";
|
|
|
|
new_table += "<th>Name</th>";
|
|
|
|
new_table += "<th>Auth</th>";
|
|
|
|
new_table += "<th>Size</th>";
|
|
|
|
new_table += "<th>Date</th>";
|
|
|
|
new_table += "</tr>";
|
|
|
|
new_table += "</thead>";
|
2016-08-28 10:12:08 +00:00
|
|
|
new_table += "<tbody id='tbody_volume1'>";
|
2016-08-27 13:21:08 +00:00
|
|
|
|
|
|
|
var new_tr = "<tr role='row' class='odd'> <td><i class='fa fa-reply'></i>";
|
2016-08-28 10:12:08 +00:00
|
|
|
new_tr += "<a onclick='change_upper(" + '"' + directory + '"' +")'> ..</a>";
|
|
|
|
new_tr += "</td><td> </td><td> </td><td> </td></tr>";
|
|
|
|
|
2016-08-27 13:21:08 +00:00
|
|
|
for( var i = 0; i < result.file.length; i++){
|
|
|
|
if(i % 2 == 0)
|
|
|
|
new_tr += "<tr role='row' class='odd'>";
|
|
|
|
else
|
|
|
|
new_tr += "<tr role='row' class='even'>";
|
|
|
|
if(result.file[i].auth[0] == "d"){
|
|
|
|
new_tr += "<td style='color:#0d8ade;' class='sorting_1'><i class='fa fa-folder-open-o'></i> ";
|
|
|
|
if(result.current != "/")
|
2016-08-28 10:12:08 +00:00
|
|
|
new_tr += "<a style='cursor: pointer' onclick='change_directory(" +'"' + result.current + "/" + result.file[i].name +'"'+ ")'>" + result.file[i].name + "</a></td>";
|
2016-08-27 13:21:08 +00:00
|
|
|
else
|
2016-08-28 10:12:08 +00:00
|
|
|
new_tr += "<a style='cursor: pointer' onclick='change_directory(" +'"' + "/" + result.file[i].name +'"'+ ")'>" + result.file[i].name + "</a></td>";
|
2016-08-27 13:21:08 +00:00
|
|
|
}else{
|
2016-08-28 10:12:08 +00:00
|
|
|
new_tr += "<td><i class='fa fa-file-o'></i><a style='cursor: pointer'>" + result.file[i].name + "</a></td>";
|
2016-08-27 13:21:08 +00:00
|
|
|
}
|
|
|
|
new_tr += "<td>"+result.file[i].auth+"</td>";
|
|
|
|
new_tr += "<td>"+result.file[i].size+"</td>";
|
|
|
|
new_tr += "<td>"+result.file[i].date+"</td>";
|
|
|
|
new_tr += "</tr>";
|
|
|
|
}
|
|
|
|
|
|
|
|
new_table += new_tr;
|
|
|
|
new_table += "</tbody></table>"
|
|
|
|
$("#table_div").append(new_table);
|
|
|
|
|
|
|
|
$('#datatable').dataTable();
|
|
|
|
TableManageButtons.init();
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
</script>
|
2016-08-30 12:11:02 +00:00
|
|
|
|
|
|
|
<!-- volume functions -->
|
|
|
|
<script>
|
|
|
|
function volume_create() {
|
|
|
|
|
|
|
|
}
|
2016-08-31 13:34:09 +00:00
|
|
|
</script>
|