add directory
This commit is contained in:
parent
cbfa6976c7
commit
883f6fcd39
@ -37,3 +37,20 @@
|
|||||||
//= require flash.js
|
//= require flash.js
|
||||||
//= require js/knob/jquery.knob.min.js
|
//= require js/knob/jquery.knob.min.js
|
||||||
//= require js/dropzone/dropzone.js
|
//= require js/dropzone/dropzone.js
|
||||||
|
|
||||||
|
// Datatables
|
||||||
|
|
||||||
|
//= require js/datatables/jquery.dataTables.min.js
|
||||||
|
//= require js/datatables/dataTables.bootstrap.js
|
||||||
|
//= require js/datatables/dataTables.buttons.min.js
|
||||||
|
//= require js/datatables/buttons.bootstrap.min.js
|
||||||
|
//= require js/datatables/jszip.min.js
|
||||||
|
//= require js/datatables/pdfmake.min.js
|
||||||
|
//= require js/datatables/vfs_fonts.js
|
||||||
|
//= require js/datatables/buttons.html5.min.js
|
||||||
|
//= require js/datatables/buttons.print.min.js
|
||||||
|
//= require js/datatables/dataTables.fixedHeader.min.js
|
||||||
|
//= require js/datatables/dataTables.keyTable.min.js
|
||||||
|
//= require js/datatables/dataTables.responsive.min.js
|
||||||
|
//= require js/datatables/responsive.bootstrap.min.js
|
||||||
|
//= require js/datatables/dataTables.scroller.min.js
|
@ -29,3 +29,11 @@
|
|||||||
@import "css/ion.rangeSlider.skinFlat";
|
@import "css/ion.rangeSlider.skinFlat";
|
||||||
@import "css/colorpicker/bootstrap-colorpicker.min";
|
@import "css/colorpicker/bootstrap-colorpicker.min";
|
||||||
@import "pace";
|
@import "pace";
|
||||||
|
|
||||||
|
//DataTable
|
||||||
|
|
||||||
|
@import "js/datatables/jquery.dataTables.min";
|
||||||
|
@import "js/datatables/buttons.bootstrap.min";
|
||||||
|
@import "js/datatables/responsive.bootstrap.min";
|
||||||
|
@import "js/datatables/scroller.bootstrap.min";
|
||||||
|
@import "js/datatables/fixedHeader.bootstrap.min";
|
@ -1,9 +1,11 @@
|
|||||||
class VolumeController < ApplicationController
|
class VolumeController < ApplicationController
|
||||||
def info
|
def info
|
||||||
|
|
||||||
|
file_directory('/home/ubuntu')
|
||||||
|
|
||||||
@volumes = Array.new
|
@volumes = Array.new
|
||||||
volume = Hash.new
|
volume = Hash.new
|
||||||
i = 0
|
i = 0
|
||||||
|
|
||||||
if get_info.blank?
|
if get_info.blank?
|
||||||
flash[:danger] = "Check Server"
|
flash[:danger] = "Check Server"
|
||||||
else
|
else
|
||||||
@ -33,4 +35,29 @@ class VolumeController < ApplicationController
|
|||||||
uploader.store!(file_name)
|
uploader.store!(file_name)
|
||||||
redirect_to '/volume/info'
|
redirect_to '/volume/info'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def file_directory(dir)
|
||||||
|
@current_dir = dir
|
||||||
|
dir_list = `ls #{@current_dir} -l`
|
||||||
|
parsing_list = dir_list.split("\n")
|
||||||
|
|
||||||
|
|
||||||
|
@files = Array.new
|
||||||
|
file = Hash.new
|
||||||
|
i = 0
|
||||||
|
@total_list = parsing_list[0]
|
||||||
|
for t in 1..(parsing_list.length-1)
|
||||||
|
puts "@@@@@@@@@@@" + parsing_list[t]
|
||||||
|
parsing_file = parsing_list[t].split(" ")
|
||||||
|
file["auth"] = parsing_file[0]
|
||||||
|
file["size"] = parsing_file[4]
|
||||||
|
file["date"] = parsing_file[5] + " " + parsing_file[6] + " "+ parsing_file[7]
|
||||||
|
file["name"] = parsing_file[8]
|
||||||
|
@files[i] = file
|
||||||
|
file = Hash.new
|
||||||
|
i+=1
|
||||||
|
end
|
||||||
|
puts @files
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
<div class="title_left">
|
<div class="title_left">
|
||||||
<h3>Volume Info </h3>
|
<h3>Volume Info </h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="title_right">
|
<div class="title_right">
|
||||||
<div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">
|
<div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@ -68,15 +67,93 @@
|
|||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||||
|
Current directory : <%=@current_dir%></br>
|
||||||
|
Numbers : <%=@total_list%></br>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||||
|
<p class="text-muted font-13 m-b-30"><code>File Manager</code></p>
|
||||||
|
<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>
|
||||||
|
|
||||||
</div>
|
<tbody>
|
||||||
</div>
|
<%@files.each do |t|%>
|
||||||
|
<tr>
|
||||||
|
<td><%=t["name"]%></td>
|
||||||
|
<td><%=t["auth"][0]%></td>
|
||||||
|
<td><%=t["size"]%></td>
|
||||||
|
<td><%=t["date"]%></td>
|
||||||
|
</tr>
|
||||||
|
<%end%>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /page content -->
|
<!-- /page content -->
|
||||||
|
|
||||||
|
<script>
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#datatable').dataTable();
|
||||||
|
$('#datatable-keytable').DataTable({
|
||||||
|
keys: true
|
||||||
|
});
|
||||||
|
$('#datatable-responsive').DataTable();
|
||||||
|
$('#datatable-scroller').DataTable({
|
||||||
|
ajax: "js/datatables/json/scroller-demo.json",
|
||||||
|
deferRender: true,
|
||||||
|
scrollY: 380,
|
||||||
|
scrollCollapse: true,
|
||||||
|
scroller: true
|
||||||
|
});
|
||||||
|
var table = $('#datatable-fixed-header').DataTable({
|
||||||
|
fixedHeader: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
TableManageButtons.init();
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user