Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
899decd8
authored
Feb 20, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: reset keys
parent
9905d78d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
2 deletions
+35
-2
cloud/urls.py
+2
-0
one/static/script/cloud.js
+12
-1
one/static/style/box.less
+3
-0
one/templates/box/key/box.html
+6
-0
one/views.py
+12
-1
No files found.
cloud/urls.py
View file @
899decd8
...
...
@@ -101,4 +101,6 @@ urlpatterns = patterns('',
url
(
r'^key/add/$'
,
'one.views.key_add'
,
name
=
'key_add'
),
url
(
r'^ajax/key/delete/$'
,
'one.views.key_ajax_delete'
,
name
=
'key_ajax_delete'
),
url
(
r'^ajax/key/reset/$'
,
'one.views.key_ajax_reset'
,
name
=
'key_ajax_reset'
),
)
one/static/script/cloud.js
View file @
899decd8
...
...
@@ -29,7 +29,18 @@ $(function() {
});
});
});
$
(
'.entry .summary'
).
unbind
(
'click'
).
click
(
toggleDetails
);
$
(
'#reset-key'
).
click
(
function
(
e
){
vm_confirm_popup
(
gettext
(
'Are you sure about reseting store credentials'
),
gettext
(
'Reset'
),
function
(){
$
.
ajax
({
type
:
'POST'
,
url
:
'/ajax/key/reset/'
,
success
:
function
(){
window
.
location
.
reload
();
}
})
});
});
$
(
'.entry .summary'
).
click
(
toggleDetails
);
if
(
window
.
navigator
.
userAgent
.
indexOf
(
'cloud-gui'
)
>
-
1
)
{
$
(
'.connect-vm'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
...
...
one/static/style/box.less
View file @
899decd8
...
...
@@ -610,4 +610,7 @@ table {
#new-key .name {
background-image: url(/static/icons/key--plus.png);
}
#reset-key .name {
background-image: url(/static/icons/key--exclamation.png);
}
}
one/templates/box/key/box.html
View file @
899decd8
...
...
@@ -25,5 +25,11 @@
</form>
</div>
</li>
<li
class=
"entry small-row"
>
<div
class=
"summary"
id=
"reset-key"
>
<div
class=
"name"
>
{% trans "Reset key" %}
</div>
<div
class=
"clear"
></div>
</div>
</li>
</ul>
{% endblock content %}
one/views.py
View file @
899decd8
...
...
@@ -460,6 +460,17 @@ def key_ajax_delete(request):
key
.
delete
()
except
:
messages
.
error
(
request
,
_
(
'Failed to delete public key'
))
return
'OK'
return
HttpResponse
(
'OK'
)
@login_required
@require_POST
def
key_ajax_reset
(
request
):
try
:
det
=
UserCloudDetails
.
objects
.
get
(
user
=
request
.
user
)
det
.
reset_smb
()
det
.
reset_keys
()
except
:
messages
.
error
(
request
,
_
(
'Failed to reset keys'
))
return
HttpResponse
(
'OK'
)
# vim: et sw=4 ai fenc=utf8 smarttab :
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