update
This commit is contained in:
parent
1a3a9fc20d
commit
5a23f7c056
@ -1,8 +1,20 @@
|
||||
class HomeController < ApplicationController
|
||||
def index
|
||||
config = get_conf
|
||||
# @current_dir = config["project_path"]
|
||||
@current_dir = "~"
|
||||
#@current_dir = config["project_path"]
|
||||
@current_dir = "/mnt"
|
||||
file_directory(@current_dir)
|
||||
end
|
||||
|
||||
|
||||
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'
|
||||
end
|
||||
end
|
||||
|
@ -71,7 +71,7 @@
|
||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
<h2>Dash Board</h2>
|
||||
<h2>File Manager</h2>
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
|
||||
</li>
|
||||
@ -93,8 +93,16 @@
|
||||
<div class="x_content">
|
||||
|
||||
<div class="col-md-12 col-sm-12 col-xs-12" id="table_div">
|
||||
<p class="text-muted font-13 m-b-30"><code>File Manager</code></p>
|
||||
<p> Current directory : <%=@current_dir%></p></br>
|
||||
<p> Current directory : <%=@current_dir%></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>
|
||||
</form>
|
||||
</p>
|
||||
<table id="datatable" class="table table-striped table-bordered jambo_table">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
@ -210,6 +218,7 @@
|
||||
$("#table_div").empty();
|
||||
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>";
|
||||
new_table += "<p style='text-align:right;'><a class='btn btn-app' href='/home/mkdir/<%=@current_dir%>'><i class='fa fa-plus'></i>Make Directory</a></p>"
|
||||
new_table += "<table id='datatable' class='table table-striped table-bordered jambo_table'>";
|
||||
new_table += "<thead>";
|
||||
new_table += "<tr class='headings'>";
|
||||
@ -237,7 +246,7 @@
|
||||
else
|
||||
new_tr += "<a style='cursor: pointer' onclick='change_directory(" +'"' + "/" + result.file[i].name +'"'+ ")'>" + result.file[i].name + "</a></td>";
|
||||
}else{
|
||||
new_tr += "<td><i class='fa fa-file-o'></i><a style='cursor: pointer'>" + result.file[i].name + "</a></td>";
|
||||
new_tr += "<td><i class='fa fa-file-o'></i><a style='cursor: pointer'> " + result.file[i].name + "</a></td>";
|
||||
}
|
||||
new_tr += "<td>"+result.file[i].auth+"</td>";
|
||||
new_tr += "<td>"+result.file[i].size+"</td>";
|
||||
|
@ -12,6 +12,7 @@ Rails.application.routes.draw do
|
||||
|
||||
#Home
|
||||
get 'home/index' => 'home#index'
|
||||
post 'home/mkdir' => 'home#make_directory'
|
||||
|
||||
|
||||
#Volume
|
||||
|
Loading…
Reference in New Issue
Block a user