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
3f3bbd83
Commit
3f3bbd83
authored
Nov 06, 2012
by
Kostas Papadimitriou
Browse files
Configurable grouped public network view name
parent
82a59426
Changes
4
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/app_settings/default/ui.py
View file @
3f3bbd83
...
@@ -149,6 +149,12 @@ UI_NETWORK_ALLOW_DUPLICATE_VM_NICS = False
...
@@ -149,6 +149,12 @@ UI_NETWORK_ALLOW_DUPLICATE_VM_NICS = False
# virtual machines from the network.
# virtual machines from the network.
UI_NETWORK_STRICT_DESTROY
=
True
UI_NETWORK_STRICT_DESTROY
=
True
# Whether or not to group public networks nics in a single network view
UI_GROUP_PUBLIC_NETWORKS
=
True
# The name of the grouped network view
UI_GROUPED_NETWORK_NAME
=
'Internet'
###############
###############
# UI EXTENSIONS
# UI EXTENSIONS
...
...
snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_networks_view.js
View file @
3f3bbd83
...
@@ -1011,6 +1011,12 @@
...
@@ -1011,6 +1011,12 @@
remove
:
function
()
{
remove
:
function
()
{
$
(
this
.
el
).
remove
();
$
(
this
.
el
).
remove
();
},
},
get_name
:
function
()
{
var
net_name
=
this
.
network
.
get
(
'
name
'
);
if
(
net_name
==
"
public
"
)
{
net_name
=
"
Internet
"
};
return
net_name
;
},
update_layout
:
function
()
{
update_layout
:
function
()
{
// has vms ???
// has vms ???
...
@@ -1022,8 +1028,7 @@
...
@@ -1022,8 +1028,7 @@
//
//
this
.
$
(
"
.machines-count
"
).
text
(
this
.
get_nics
().
length
);
this
.
$
(
"
.machines-count
"
).
text
(
this
.
get_nics
().
length
);
var
net_name
=
this
.
network
.
get
(
"
name
"
);
var
net_name
=
this
.
get_name
();
if
(
net_name
==
"
public
"
)
{
net_name
=
"
Internet
"
}
this
.
$
(
"
.name-div span.name
"
).
text
(
net_name
);
this
.
$
(
"
.name-div span.name
"
).
text
(
net_name
);
if
(
this
.
rename_view
)
{
if
(
this
.
rename_view
)
{
...
@@ -1123,7 +1128,11 @@
...
@@ -1123,7 +1128,11 @@
network
,
network
,
view
);
view
);
},
},
get_name
:
function
()
{
return
synnefo
.
config
.
grouped_network_name
||
views
.
GroupedPublicNetworkView
.
__super__
.
get_name
.
call
(
this
);
},
nic_in_network
:
function
(
nic
)
{
nic_in_network
:
function
(
nic
)
{
var
nic_net
=
nic
.
get_network
();
var
nic_net
=
nic
.
get_network
();
return
_
.
filter
(
this
.
networks
,
function
(
n
)
{
return
_
.
filter
(
this
.
networks
,
function
(
n
)
{
...
...
snf-cyclades-app/synnefo/ui/templates/home.html
View file @
3f3bbd83
...
@@ -627,6 +627,7 @@
...
@@ -627,6 +627,7 @@
synnefo
.
config
.
network_strict_destroy
=
{{
network_strict_destroy
}};
synnefo
.
config
.
network_strict_destroy
=
{{
network_strict_destroy
}};
synnefo
.
config
.
network_allow_multiple_destory
=
{{
network_allow_multiple_destroy
}};
synnefo
.
config
.
network_allow_multiple_destory
=
{{
network_allow_multiple_destroy
}};
synnefo
.
config
.
group_public_networks
=
{{
group_public_networks
}};
synnefo
.
config
.
group_public_networks
=
{{
group_public_networks
}};
synnefo
.
config
.
grouped_network_name
=
{{
grouped_network_name
|
safe
}};
synnefo
.
auth_client
=
new
synnefo
.
auth
.
AstakosClient
({
synnefo
.
auth_client
=
new
synnefo
.
auth
.
AstakosClient
({
login_url
:
synnefo
.
config
.
login_redirect
,
login_url
:
synnefo
.
config
.
login_redirect
,
...
...
snf-cyclades-app/synnefo/ui/views.py
View file @
3f3bbd83
...
@@ -137,6 +137,7 @@ NETWORK_STRICT_DESTROY = getattr(settings,
...
@@ -137,6 +137,7 @@ NETWORK_STRICT_DESTROY = getattr(settings,
NETWORK_ALLOW_MULTIPLE_DESTROY
=
getattr
(
settings
,
NETWORK_ALLOW_MULTIPLE_DESTROY
=
getattr
(
settings
,
'UI_NETWORK_ALLOW_MULTIPLE_DESTROY'
,
False
)
'UI_NETWORK_ALLOW_MULTIPLE_DESTROY'
,
False
)
GROUP_PUBLIC_NETWORKS
=
getattr
(
settings
,
'UI_GROUP_PUBLIC_NETWORKS'
,
True
)
GROUP_PUBLIC_NETWORKS
=
getattr
(
settings
,
'UI_GROUP_PUBLIC_NETWORKS'
,
True
)
GROUPED_NETWORK_NAME
=
getattr
(
settings
,
'UI_GROUPED_NETWORK_NAME'
,
'Internet'
)
def
template
(
name
,
request
,
context
):
def
template
(
name
,
request
,
context
):
template_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"templates/"
)
template_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"templates/"
)
...
@@ -196,6 +197,7 @@ def home(request):
...
@@ -196,6 +197,7 @@ def home(request):
'network_allow_duplicate_vm_nics'
:
json
.
dumps
(
NETWORK_DUPLICATE_NICS
),
'network_allow_duplicate_vm_nics'
:
json
.
dumps
(
NETWORK_DUPLICATE_NICS
),
'network_strict_destroy'
:
json
.
dumps
(
NETWORK_STRICT_DESTROY
),
'network_strict_destroy'
:
json
.
dumps
(
NETWORK_STRICT_DESTROY
),
'network_allow_multiple_destroy'
:
json
.
dumps
(
NETWORK_ALLOW_MULTIPLE_DESTROY
),
'network_allow_multiple_destroy'
:
json
.
dumps
(
NETWORK_ALLOW_MULTIPLE_DESTROY
),
'grouped_network_name'
:
json
.
dumps
(
GROUPED_NETWORK_NAME
),
'group_public_networks'
:
json
.
dumps
(
GROUP_PUBLIC_NETWORKS
),
'group_public_networks'
:
json
.
dumps
(
GROUP_PUBLIC_NETWORKS
),
'diagnostics_update_interval'
:
json
.
dumps
(
DIAGNOSTICS_UPDATE_INTERVAL
)
'diagnostics_update_interval'
:
json
.
dumps
(
DIAGNOSTICS_UPDATE_INTERVAL
)
}
}
...
...
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