File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 11[consts]
22MAX_CONTENT_LENGTH =16
3- MAX_SYSTEM_STORAGE =2000
3+ MAX_SYSTEM_STORAGE =5000
44PASSBACK_TIMER =60
Original file line number Diff line number Diff line change @@ -493,6 +493,19 @@ def profile(username):
493493 abort (403 )
494494
495495
496+ @app .route ("/capacity" , methods = ["GET" ])
497+ def system_capacity ():
498+ units = {'b' : 1 , 'mb' :1024 ** 2 , 'gb' : 1024 ** 3 }
499+ unit = units .get (request .args .get ('unit' , 'gb' ).lower (), units ['gb' ])
500+ current_size = data .get_storage ()
501+ ratio = current_size / app .config ['MAX_SYSTEM_STORAGE' ]
502+ return {
503+ 'size' : current_size / unit ,
504+ 'max_size' : app .config ['MAX_SYSTEM_STORAGE' ] / unit ,
505+ 'ratio' : ratio
506+ }
507+
508+
496509# Handle exceptions
497510
498511@app .errorhandler (413 )
You can’t perform that action at this time.
0 commit comments