Commit b4acbe2b by x

store: Minimized laborgui page

parent ddb2d75b
...@@ -16,22 +16,6 @@ function getCookie(name) { ...@@ -16,22 +16,6 @@ function getCookie(name) {
} }
var csrftoken = getCookie('csrftoken'); var csrftoken = getCookie('csrftoken');
function postKey(key) {
$.post("/store/gui/", { "KEY" : key },
function (respond) {
alert(respond);
}
)
.error(function (respond) { alert(JSON.stringify(respond)); });
}
function resetKey() {
$.post("/store/gui/", "",
function (respond) {
alert(respond);
}
);
}
$.ajaxSetup({ $.ajaxSetup({
crossDomain: false, // obviates need for sameOrigin test crossDomain: false, // obviates need for sameOrigin test
beforeSend: function(xhr, settings) { beforeSend: function(xhr, settings) {
......
...@@ -3,21 +3,9 @@ ...@@ -3,21 +3,9 @@
<head> <head>
<title>Store Gui</title> <title>Store Gui</title>
<script src="/static/jquery.min.js"></script> <script src="/static/jquery.min.js"></script>
<script type="text/javascript" src="/static/store/gui.js"></script> <script src="/static/store/gui.js"></script>
</head> </head>
<body> <body>
EZ LESZ A GUI JOL! <p>Személyes adattár csatolása...</p>
<form action="login:{{ username }}:{{ host }}">
<input type=submit name="login_button" id="login_button" value="login"/>
</form>
<form action="mount:true">
<input type=submit name="mount_button" id="mount_button" value="mount" hidden="true"/>
</form>
<form action="umount:true">
<input type=submit name="umount_button" id="umount_button" value="umount" hidden="true"/>
</form>
<form action="logout:{{ username }}:{{ host }}">
<input type=submit name="logout_button" id="logout_button" value="logout" hidden="true"/>
</form>
</body> </body>
</html> </html>
...@@ -185,11 +185,14 @@ def gui(request): ...@@ -185,11 +185,14 @@ def gui(request):
lab_key_decoded = base64.b64decode(request.POST['KEY']) lab_key_decoded = base64.b64decode(request.POST['KEY'])
key_list.append(lab_key_decoded) key_list.append(lab_key_decoded)
except: except:
pass if StoreApi.updateauthorizationinfo(user, password, key_list):
if not StoreApi.updateauthorizationinfo(user, password, key_list): return HttpResponse('Keys resetted succesfully!')
return HttpResponse('Can not update authorization information!') else:
return HttpResponse('Can not update authorization information!')
if StoreApi.updateauthorizationinfo(user, password, key_list):
return HttpResponse('https://cloud.ik.bme.hu/?neptun='+user+"&"+"host="+StoreApi.get_host())
else: else:
return HttpResponse('Updated key information!') return HttpResponse('Can not update authorization information!')
else: else:
return HttpResponse('Method not found!', status_code=404) return HttpResponse('Method not found!', status_code=404)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment