Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8347df83
authored
Feb 04, 2013
by
x
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Api for quotas
parent
0066cfc7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
store/api.py
+8
-0
store/templates/store/list.html
+5
-1
store/views.py
+2
-1
No files found.
store/api.py
View file @
8347df83
...
...
@@ -129,6 +129,14 @@ class StoreApi:
else
:
return
False
@staticmethod
def
requestquota
(
neptun
):
url
=
settings
[
'store_url'
]
+
'/'
+
neptun
r
=
StoreApi
.
get_request
(
url
)
if
r
.
status_code
==
requests
.
codes
.
ok
:
return
json
.
loads
(
r
.
content
)
else
:
return
False
@staticmethod
def
userexist
(
neptun
):
url
=
settings
[
'store_url'
]
+
'/'
+
neptun
r
=
StoreApi
.
get_request
(
url
)
...
...
store/templates/store/list.html
View file @
8347df83
...
...
@@ -8,7 +8,11 @@
<input
type=
"hidden"
name=
"auth"
value=
"True"
>
</form>
</td>
<td></td>
<td>
{% for k,v in quota.items %}
{{ k }} : {{ v }}
{% endfor %}
</td>
<td></td>
<td>
<form
action=
"/store/"
method=
"POST"
...
...
store/views.py
View file @
8347df83
...
...
@@ -79,7 +79,8 @@ def index(request):
#Normalize path (Need double dirname /folder/ -> /folder -> /
backpath
=
os
.
path
.
normpath
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
path
)))
file_list
=
StoreApi
.
listfolder
(
user
,
path
)
return
render_to_response
(
'store/list.html'
,
RequestContext
(
request
,
{
'file_list'
:
file_list
,
'path'
:
path
,
'backpath'
:
backpath
,
'username'
:
user
}))
quota
=
StoreApi
.
requestquota
(
user
)
return
render_to_response
(
'store/list.html'
,
RequestContext
(
request
,
{
'file_list'
:
file_list
,
'path'
:
path
,
'backpath'
:
backpath
,
'username'
:
user
,
'quota'
:
quota
}))
@login_required
def
ajax_listfolder
(
request
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment