Update
This commit is contained in:
@@ -72,8 +72,16 @@ class VolumeController < ApplicationController
|
||||
mnt_dest = mnt_dir + "/" + file.original_filename
|
||||
|
||||
puts "upload start"
|
||||
u = AvatarUploader.new
|
||||
u.store_path(:dir)
|
||||
# get permission
|
||||
# dir_left = mnt_dir[0..mnt_dir.rindex('/')]
|
||||
# dir_right = mnt_dir.split(dir_left)[1]
|
||||
# pe = `ls -al #{dir_left} | grep #{dir_right}`.split(" ")[0]
|
||||
|
||||
# puts "111" + dir_left
|
||||
# puts "222" + dir_right
|
||||
# puts "333" + pe
|
||||
|
||||
u = AvatarUploader.new(mnt_dir)
|
||||
u.store!(file)
|
||||
puts "upload end"
|
||||
|
||||
|
||||
@@ -9,10 +9,17 @@ class AvatarUploader < CarrierWave::Uploader::Base
|
||||
# Choose what kind of storage to use for this uploader:
|
||||
storage :file
|
||||
# storage :fog
|
||||
@path
|
||||
|
||||
def initialize(dest = "/mnt/dir")
|
||||
super
|
||||
@path = dest
|
||||
end
|
||||
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
def cache_dir
|
||||
@path
|
||||
end
|
||||
|
||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||
|
||||
@@ -230,7 +230,10 @@
|
||||
new_tr += "<td style='color:#0d8ade;' class='sorting_1'><i class='fa fa-folder-open-o'></i> ";
|
||||
new_tr += "<a style='cursor: pointer' onclick='change_directory(" +'"' + cur + "/" + result.file[i].name +'"'+ ")'>" + result.file[i].name + "</a></td>";
|
||||
new_tr += "<td>"+result.file[i].auth+"</td>";
|
||||
new_tr += "<td><button class='btn btn-primary pull-right'>select</botton></td>";
|
||||
new_tr += "<td><form data-parsley-validate>";
|
||||
new_tr += "<input type='hidden' value='" + cur + "/" + result.file[i].name + "'>";
|
||||
new_tr += "<button type='submit' class='btn btn-primary pull-right'>select</botton>";
|
||||
new_tr += "</form></td>"
|
||||
new_tr += "</tr>";
|
||||
}
|
||||
$("#datatable_body").append(new_tr);
|
||||
@@ -241,7 +244,6 @@
|
||||
<!-- Mount overlay functions -->
|
||||
<script>
|
||||
$("#popup_mount #datatable_body form").submit(function(){
|
||||
var mnt_point = $(this).find("input").val();
|
||||
var url = window.location + '';
|
||||
var vol_name = url.match(/volume_name=([^#]+)/)[1];
|
||||
$.ajax({
|
||||
|
||||
Reference in New Issue
Block a user