Revision fb1c2da8 snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_create_view.js

b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_create_view.js
1197 1197
            var create_view = this.parent;
1198 1198
            if (!this.ips_view) {
1199 1199
              this.ips_view = new views.CreateColumnSelectListView({
1200
                collection: synnefo.storage.public_ips,
1200
                collection: synnefo.storage.floating_ips,
1201 1201
                extra_class: 'public-ips',
1202 1202
                update_collection: true,
1203 1203
                title: 'IP addresses <span class="create-ip-address"><a href="#">manage ip\'s</a></span>',
......
1206 1206
                empty_msg: 'No IP addresses available. <span><a href="">Create a new IP address.</a></span>',
1207 1207
                select_first_as_default: true,
1208 1208
                filter_items: function(model) { 
1209
                  return !(model.get_vm() || model.get('state'))
1209
                  return !(model.get('port_id'))
1210 1210
                },
1211 1211
                init_events: function() {
1212 1212
                  var msg = this.$(".empty span a");
1213
                  this.$(".create-ip-address").click(function() {
1214
                      snf.ui.main.public_ips_view.show(create_view);
1215
                  });
1216 1213
                  this.$(".empty a").bind('click', function(e) {
1217 1214
                      e.preventDefault();
1218 1215
                      msg.text("Creating...");
1219
                      synnefo.storage.public_ips.create({address:undefined, pool: undefined}, {
1216
                      synnefo.storage.floating_ips.create({
1217
                        address:undefined, pool: undefined
1218
                      }, {
1220 1219
                        error: function() {
1221 1220
                          alert("Cannot create new ip address");
1222 1221
                        },

Also available in: Unified diff