Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
26dcab81
Commit
26dcab81
authored
Dec 10, 2013
by
Kostas Papadimitriou
Browse files
ui: Public keys quota reached handling
parent
da351e2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_public_keys_view.js
View file @
26dcab81
...
...
@@ -259,7 +259,6 @@
var
error
=
_
.
bind
(
function
()
{
this
.
generating
=
false
;
this
.
generate_action
.
removeClass
(
"
in-progress
"
);
this
.
generate_progress
.
hide
();
this
.
private_key
=
undefined
;
this
.
show_error
();
},
this
);
...
...
@@ -316,7 +315,25 @@
collection
:
storage
.
keys
,
collection_name
:
'
keys
'
,
model_view_cls
:
views
.
PublicKeyView
,
create_view_cls
:
views
.
PublicKeyCreateView
create_view_cls
:
views
.
PublicKeyCreateView
,
initialize
:
function
()
{
views
.
PublicKeysCollectionView
.
__super__
.
initialize
.
apply
(
this
,
arguments
);
this
.
collection
.
bind
(
"
add
"
,
_
.
bind
(
this
.
update_quota
,
this
));
this
.
collection
.
bind
(
"
remove
"
,
_
.
bind
(
this
.
update_quota
,
this
));
this
.
collection
.
bind
(
"
reset
"
,
_
.
bind
(
this
.
update_quota
,
this
));
},
update_quota
:
function
()
{
var
quota
=
synnefo
.
config
.
userdata_keys_limit
;
var
available
=
quota
-
this
.
collection
.
length
;
if
(
available
>
0
)
{
this
.
create_button
.
removeClass
(
"
disabled
"
);
this
.
create_button
.
attr
(
"
title
"
,
this
.
quota_limit_message
||
"
Quota limit reached
"
)
}
else
{
this
.
create_button
.
addClass
(
"
disabled
"
);
this
.
create_button
.
attr
(
"
title
"
,
""
);
}
}
});
views
.
PublicKeysPaneView
=
views
.
ext
.
PaneView
.
extend
({
...
...
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