Revision 681c9851

b/snf-cyclades-app/synnefo/ui/static/snf/js/models.js
1440 1440
          this.call('firewallProfile', success, error, data);
1441 1441
        },
1442 1442

  
1443
        connect_floating_ip: function(ip, cb) {
1443
        connect_floating_ip: function(ip, cb, error) {
1444
          var self = this;
1445
          var from_status = this.get('status');
1444 1446
          this.set({'status': 'CONNECTING'});
1445 1447
          synnefo.storage.ports.create({
1446 1448
            port: {
......
1448 1450
              device_id: this.id,
1449 1451
              fixed_ips: [{'ip_address': ip.get('floating_ip_address')}]
1450 1452
            }
1451
          }, {complete: cb, skip_api_error: false})
1453
          }, {
1454
            success: cb, 
1455
            error: function() { error && error() },
1456
            skip_api_error: false
1457
          });
1452 1458
        },
1453 1459

  
1454 1460
        // action helper
b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_ips_view.js
143 143
        var overlay = this.parent_view.connect_view;
144 144
        overlay.set_in_progress();
145 145
        _.each(vms, function(vm) {
146
          vm.connect_floating_ip(this.model, this.connect_complete);
146
          vm.connect_floating_ip(this.model, 
147
                                 _.bind(this.connect_complete,this),
148
                                 _.bind(this.connect_error, this));
147 149
        }, this);
148 150
      },
149 151

  
......
154 156
        this.model.set({'status': 'CONNECTING'});
155 157
      },
156 158

  
159
      connect_error: function() {
160
        var overlay = this.parent_view.connect_view;
161
        overlay.hide();
162
        overlay.unset_in_progress();
163
      },
164

  
157 165
      remove: function(model, e) {
158 166
        e && e.stopPropagation();
159 167
        this.model.do_destroy();
b/snf-cyclades-app/synnefo/ui/templates/partials/ips.html
10 10
        <img data-rv-show="model.in_progress" 
11 11
             src="{{ SYNNEFO_IMAGES_URL }}icons/indicators/small/progress.gif" 
12 12
             class="progress-indicator" />
13
        <span data-rv-show="model.device_id" class="key">MAC:</span>
14
        <span data-rv-show="model.device_id" class="value" data-rv-text="model.mac_address"></span>
15
        <span data-rv-hide="model.device_id" class="value no-device">
16
          No device assigned. 
17
          Detach IP, in order to be able to reattach it to a machine.
18
        </span>
13
        <div data-rv-hide="model.in_progress">
14
          <span data-rv-show="model.mac_address" class="key">MAC:</span>
15
          <span data-rv-show="model.mac_address" class="value" data-rv-text="model.mac_address"></span>
16
          <span data-rv-hide="model.device_id" class="value no-device">
17
            No device assigned. 
18
            Detach IP, in order to be able to reattach it to a machine.
19
          </span>
20
        </div>
19 21
      </h5>
20 22
    </div>
21 23
  </div>

Also available in: Unified diff