mirror of
https://github.com/neocities/neocities.git
synced 2025-05-29 17:00:05 +02:00
add drag and drop file upload
This commit is contained in:
parent
541b7ebba3
commit
c6a9f20cff
6 changed files with 100 additions and 14 deletions
|
@ -109,9 +109,17 @@ class Site < Sequel::Model
|
|||
space = Dir.glob(File.join(file_path, '*')).collect {|p| File.size(p)}.inject {|sum,x| sum += x}
|
||||
space.nil? ? 0 : space
|
||||
end
|
||||
|
||||
def total_space_in_megabytes
|
||||
(total_space.to_f / 2**20).round(2)
|
||||
end
|
||||
|
||||
def available_space
|
||||
remaining = MAX_SPACE - total_space
|
||||
remaining < 0 ? 0 : remaining
|
||||
end
|
||||
|
||||
def available_space_in_megabytes
|
||||
(available_space.to_f / 2**20).round(2)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue