Revision 3635e7ac

b/snf-cyclades-app/synnefo/app_settings/default/ui.py
149 149
# virtual machines from the network.
150 150
UI_NETWORK_STRICT_DESTROY = True
151 151

  
152
# Whether or not to group public networks nics in a single network view
153
UI_GROUP_PUBLIC_NETWORKS = True
154

  
155
# The name of the grouped network view
156
UI_GROUPED_NETWORK_NAME = 'Internet'
157

  
152 158

  
153 159
###############
154 160
# UI EXTENSIONS
b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_networks_view.js
1011 1011
        remove: function() {
1012 1012
            $(this.el).remove();
1013 1013
        },
1014
        
1015
        get_name: function() {
1016
          var net_name = this.network.get('name');
1017
          if (net_name == "public") { net_name = "Internet" };
1018
          return net_name;
1019
        },
1014 1020

  
1015 1021
        update_layout: function() {
1016 1022
            // has vms ???
......
1022 1028
            //
1023 1029
            this.$(".machines-count").text(this.get_nics().length);
1024 1030

  
1025
            var net_name = this.network.get("name");
1026
            if (net_name == "public") { net_name = "Internet" }
1031
            var net_name = this.get_name();
1027 1032
            this.$(".name-div span.name").text(net_name);
1028 1033

  
1029 1034
            if (this.rename_view) {
......
1123 1128
                                                                   network, 
1124 1129
                                                                   view);
1125 1130
        },
1126
        
1131
          
1132
        get_name: function() {
1133
          return synnefo.config.grouped_network_name || views.GroupedPublicNetworkView.__super__.get_name.call(this);
1134
        },
1135

  
1127 1136
        nic_in_network: function(nic) {
1128 1137
          var nic_net  = nic.get_network();
1129 1138
          return _.filter(this.networks, function(n) { 
b/snf-cyclades-app/synnefo/ui/templates/home.html
627 627
            synnefo.config.network_strict_destroy = {{ network_strict_destroy }};
628 628
            synnefo.config.network_allow_multiple_destory = {{ network_allow_multiple_destroy }};
629 629
            synnefo.config.group_public_networks = {{ group_public_networks }};
630
            synnefo.config.grouped_network_name = {{ grouped_network_name|safe }};
630 631
            
631 632
            synnefo.auth_client = new synnefo.auth.AstakosClient({
632 633
                login_url: synnefo.config.login_redirect,
b/snf-cyclades-app/synnefo/ui/views.py
137 137
NETWORK_ALLOW_MULTIPLE_DESTROY = getattr(settings,
138 138
                    'UI_NETWORK_ALLOW_MULTIPLE_DESTROY', False)
139 139
GROUP_PUBLIC_NETWORKS = getattr(settings, 'UI_GROUP_PUBLIC_NETWORKS', True)
140
GROUPED_NETWORK_NAME = getattr(settings, 'UI_GROUPED_NETWORK_NAME', 'Internet')
140 141

  
141 142
def template(name, request, context):
142 143
    template_path = os.path.join(os.path.dirname(__file__), "templates/")
......
196 197
               'network_allow_duplicate_vm_nics': json.dumps(NETWORK_DUPLICATE_NICS),
197 198
               'network_strict_destroy': json.dumps(NETWORK_STRICT_DESTROY),
198 199
               'network_allow_multiple_destroy': json.dumps(NETWORK_ALLOW_MULTIPLE_DESTROY),
200
               'grouped_network_name': json.dumps(GROUPED_NETWORK_NAME),
199 201
               'group_public_networks': json.dumps(GROUP_PUBLIC_NETWORKS),
200 202
               'diagnostics_update_interval': json.dumps(DIAGNOSTICS_UPDATE_INTERVAL)
201 203
    }

Also available in: Unified diff