This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
AI流水线
Repositories
Datasets
Forum
实训
竞赛
大数据
AI开发
Register
Sign In
Gitlink
/
forgeplus
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
0
Code
Releases
16
Wiki
evaluate
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
HPC
Browse Source
修改字节数
tags/v1
sylor_huang@126.com
6 years ago
parent
81191b59c2
commit
634408363e
2 changed files
with
5 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+4
-0
app/helpers/application_helper.rb
+1
-1
app/views/repositories/show.json.jbuilder
+ 4
- 0
app/helpers/application_helper.rb
View File
@@ -52,6 +52,10 @@ module ApplicationHelper
"avatars"
end
def replace_bytes_to_b(size_string)
return size_string.gsub("Bytes", "B").gsub("bytes", "B").gsub("字节", "B")
end
def storage_path
File.join(Rails.root, "public", "images", relative_path)
end
+ 1
- 1
app/views/repositories/show.json.jbuilder
View File
@@ -29,7 +29,7 @@ json.fork_info do
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.clone_url @result['clone_url']
json.default_branch @result['default_branch']
Write
Preview
Loading…
Cancel
Save