Commit b4acbe2b by x

store: Minimized laborgui page

parent ddb2d75b
......@@ -16,22 +16,6 @@ function getCookie(name) {
}
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({
crossDomain: false, // obviates need for sameOrigin test
beforeSend: function(xhr, settings) {
......
......@@ -3,21 +3,9 @@
<head>
<title>Store Gui</title>
<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>
<body>
EZ LESZ A GUI JOL!
<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>
<p>Személyes adattár csatolása...</p>
</body>
</html>
......@@ -185,11 +185,14 @@ def gui(request):
lab_key_decoded = base64.b64decode(request.POST['KEY'])
key_list.append(lab_key_decoded)
except:
pass
if not StoreApi.updateauthorizationinfo(user, password, key_list):
return HttpResponse('Can not update authorization information!')
if StoreApi.updateauthorizationinfo(user, password, key_list):
return HttpResponse('Keys resetted succesfully!')
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:
return HttpResponse('Updated key information!')
return HttpResponse('Can not update authorization information!')
else:
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