修改字节数
This commit is contained in:
parent
81191b59c2
commit
634408363e
|
@ -52,6 +52,10 @@ module ApplicationHelper
|
||||||
"avatars"
|
"avatars"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def replace_bytes_to_b(size_string)
|
||||||
|
return size_string.gsub("Bytes", "B").gsub("bytes", "B").gsub("字节", "B")
|
||||||
|
end
|
||||||
|
|
||||||
def storage_path
|
def storage_path
|
||||||
File.join(Rails.root, "public", "images", relative_path)
|
File.join(Rails.root, "public", "images", relative_path)
|
||||||
end
|
end
|
||||||
|
|
|
@ -29,7 +29,7 @@ json.fork_info do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
json.size number_to_human_size(@result['size'].to_i)
|
json.size replace_bytes_to_b(number_to_human_size(@result['size'].to_i*1024))
|
||||||
json.ssh_url @result['ssh_url']
|
json.ssh_url @result['ssh_url']
|
||||||
json.clone_url @result['clone_url']
|
json.clone_url @result['clone_url']
|
||||||
json.default_branch @result['default_branch']
|
json.default_branch @result['default_branch']
|
||||||
|
|
Loading…
Reference in New Issue