This commit is contained in:
bee0005 2016-09-04 05:37:33 +00:00
parent 5a23f7c056
commit 6716f426e9
2 changed files with 6 additions and 9 deletions

View File

@ -10,11 +10,7 @@ class HomeController < ApplicationController
def make_directory
current_dir = params[:current_dir]
directory_name = params[:directory_name]
# `cd /#{current_dir}`
# `cd /#{current_dir} & mkdir #{directory_name}`
puts "mkdir #{current_dir}/#{directory_name}"
`mkdir #{current_dir}/#{directory_name}`
#output = `sshpass -p#{@config["host_password"]} ssh #{@config["host_port"]} #{@config["host_user"]}@#{@config["host_ip"]} gluster volume delete #{volume_name}`
redirect_to '/home/index'
redirect_to '/home/index'
end
end

View File

@ -93,13 +93,12 @@
<div class="x_content">
<div class="col-md-12 col-sm-12 col-xs-12" id="table_div">
<p> Current directory : <%=@current_dir%></p>
<p class="text-muted font-13 m-b-30"> <code> Current directory : <%=@current_dir%></code></p>
<p>
<form style="text-align:right;" action="/home/mkdir" method="post">
<input type="text" name="directory_name" placeholder="Directory name" style="padding:6px 12px; vertical-align:middle;"/>
<input type="hidden" name="current_dir" value="<%=@current_dir%>"/>
<button class="btn btn-default" type="submit">
<i class="fa fa-plus"></i> Make Directory
<button class="btn btn-default" type="submit"><i class="fa fa-plus"></i> Make Directory
</button>
</form>
</p>
@ -135,7 +134,7 @@
<% end %>
<td><%=t["auth"]%></td>
<td><%=t["size"]%></td>
<td><%=t["date"]%></td>
<td><%=t["date"]%></td>
</tr>
<%end%>
</tbody>
@ -185,6 +184,8 @@
</script>
<script type="text/javascript">
/* right click */
$(document).ready(function() {
$('#datatable').dataTable();
});