Revision bfb11987

b/snf-cyclades-app/synnefo/ui/static/snf/css/main.css
4127 4127
    position: relative;
4128 4128
    top: -2px;
4129 4129
}
4130
div.state .connect, tbody.machines .connect {
4131
    background-image: url("../images/icons/actions/medium/connect.png");
4132
}
4133
div.state .disconnect, tbody.machines .disconnect {
4134
    background-image: url("../images/icons/actions/medium/disconnect.png");
4135
}
4130 4136
div.state .destroy, tbody.machines .destroy {
4131 4137
    background-image: url("../images/icons/actions/medium/destroy.png");
4132 4138
}
......
6704 6710
  background-color: #A1C8DB;
6705 6711
}
6706 6712

  
6713
.pane-view .collection-list-view .model-view .main-content.inner .state-indicator {
6714
  top: 5px;
6715
}
6716

  
6717
.pane-view .collection-list-view .model-view .main-content .state-indicator {
6718
  width: 50px;
6719
  position: absolute;
6720
  top: 30px;
6721
  right: 5px;
6722
}
6723

  
6707 6724
.pane-view .collection-list-view .model-view .main-content .title {
6708 6725
  font-weight: normal;
6709 6726
}
......
6733 6750
  float: left;
6734 6751
}
6735 6752

  
6753
.pane-view .collection-list-view .model-view .main-content .entry-right {
6754
  position: relative;
6755
}
6756

  
6736 6757
.pane-view .collection-list-view .model-view .main-content .entry {
6737 6758
  width: 290px;
6738 6759
  padding-top: 5px;
......
6798 6819
}
6799 6820

  
6800 6821
.model-item .status-indicator {
6822
  width: 110px;
6823
  float: right;
6801 6824
}
6802 6825

  
6803 6826
.model-item .actions-content {
......
6973 6996
/* end vm sprites */
6974 6997

  
6975 6998
/* ips */
6976
.ip-port-view .vm-logo {
6977
  width: 
6999
.ip-port-view .title {
7000
  width: 100%;
6978 7001
}
6979 7002

  
6980 7003
.model-item .vm-name {
b/snf-cyclades-app/synnefo/ui/static/snf/js/models.js
2266 2266
          this.reset_pending();
2267 2267
        }
2268 2268
        this.set(data);
2269
        this.trigger("set-pending", action);
2269 2270
      },
2270 2271
      
2271 2272
      reset_pending: function() {
......
2274 2275
          data[action] = this.status.INACTIVE;
2275 2276
        }, this);
2276 2277
        this.set(data);
2278
        this.trigger("reset-pending");
2277 2279
      }
2278 2280
    });
2279 2281

  
b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_networks_view.js
290 290
          this.firewall_visible = this.firewall_toggler.hasClass("open");
291 291
          if (!this.firewall_visible) {
292 292
            this.firewall_apply.fadeOut(50);
293
          } else {
294
            this.model.actions.reset_pending();
293 295
          }
294 296
          this.update_firewall();
295 297
      },
b/snf-cyclades-app/synnefo/ui/static/snf/js/views_ext.js
453 453
        }
454 454
      },
455 455
      
456
      action_cls_map: {
457
        'remove': 'destroy'
458
      },
459

  
460
      _set_confirm: function(action) {
461
        this.pending_action = action;
462
        this.set_action_indicator(action);
463
      },
464

  
465
      _unset_confirm: function(action) {
466
        this.pending_action = undefined;
467
        this.reset_action_indicator(action);
468
      },
469

  
470
      set_action_indicator: function(action) {
471
        action = this.action_cls_map[action] || action;
472
        var indicator = this.el.find(".action-indicator");
473
        indicator = $(indicator[indicator.length - 1]);
474
        indicator.attr("class", "").addClass("state action-indicator " + action);
475
      },
476

  
477
      reset_action_indicator: function() {
478
        var indicator = this.el.find(".action-indicator");
479
        indicator = $(indicator[indicator.length - 1]);
480
        indicator.attr("class", "").addClass("state action-indicator");
481
        if (this.pending_action) {
482
          this.set_action_indicator(this.pending_action);
483
        }
484
      },
485

  
456 486
      set_confirm: function() {},
457 487
      unset_confirm: function() {},
458 488

  
459 489
      init_action_methods: function(actions) {
490
        var self = this;
491
        if (this.model && this.model.actions) {
492
          this.model.actions.bind("reset-pending", function() {
493
            this._unset_confirm();
494
          }, this);
495
          this.model.actions.bind("set-pending", function(action) {
496
            console.log("ACTION", action);
497
            this._set_confirm(action)
498
          }, this);
499
        }
460 500
        _.each(actions.actions, function(action) {
501
          this.el.find(".action-container." + action).hover(function() {
502
            self.set_action_indicator(action);
503
          }, function() {
504
            self.reset_action_indicator();
505
          });
461 506
          var method;
462 507
          method = 'set_{0}_confirm'.format(action);
463 508
          if (this[method]) { return }
464 509
          this[method] = _.bind(function(model, ev) {
465 510
            if (ev) { ev.stopPropagation() }
466 511
            var data = {};
512
            this._set_confirm(action);
467 513
            this.set_confirm(action);
468 514
            this.model.actions.set_pending_action(action);
469 515
          }, this);
......
472 518
          this[method] = _.bind(function(model, ev) {
473 519
            if (ev) { ev.stopPropagation() }
474 520
            var data = {};
521
            this._unset_confirm(action);
475 522
            this.unset_confirm(action);
476 523
            this.model.actions.unset_pending_action(action);
477 524
          }, this);
b/snf-cyclades-app/synnefo/ui/templates/partials/ips.html
42 42
              <div class="indicator indicator3"></div>
43 43
              <div class="indicator indicator4"></div>
44 44
            </div>
45
            <div class="state state-indicator">
46
              <div class="action-indicator"></div>
47
            </div>
45 48
            <div data-show="model.status|in_progress" class="status-progress"></div>
46 49
          </div>
47 50
        </div>
b/snf-cyclades-app/synnefo/ui/templates/partials/networks.html
73 73
  <div class="collection">
74 74
    <div class="empty-list item-list hidden nested">
75 75
      <div class="border">
76
        <i class="add" data-rv-on-click="view.show_connect_vms_overlay">+</i>
76
        <i class="add icon-action connect"
77
           data-rv-on-click="view.show_connect_vms_overlay">+</i>
77 78
      </div>
78 79
      <div class="border2"></div>
79 80
    </div>
......
87 88
  <div class="outer">
88 89
    <div class="border">
89 90
      <i data-rv-show="model.can_disconnect" 
90
         class="remove" 
91
         class="remove icon-action" 
91 92
         data-rv-on-click="view.set_disconnect_confirm">X</i>
92 93
      </div>
93 94
    <div class="border2"></div>
94 95
    <div class="inner clearfix main-content">
95 96
      <img class="model-logo" data-rv-src="model.vm.status|vm_logo_url" />
96 97
      <h5 class="title" data-rv-text="model.vm.name|truncate 35"></h5>
98
      <div class="state state-indicator">
99
        <div class="action-indicator"></div>
100
      </div>
97 101
      <ul class="ip-addresses">
98 102
        <li data-rv-each-item="model.fixed_ips">
99 103
          <span data-rv-text="item:ip_address|ip_type" class="type"></span>
......
124 128
          <input type="radio" class="checkboxes" 
125 129
                 value="ENABLED" 
126 130
                 data-rv-name="model.id|prefix firewall-" />
127
          <span class="checkbox-legends">Fully protecte mode (Firewall on)</span>
131
          <span class="checkbox-legends">Fully protected mode (Firewall on)</span>
128 132
          <br />
129 133
          <input type="radio" class="checkboxes" 
130 134
                 data-rv-name="model.id|prefix firewall-"
......
192 196
              <span data-rv-text="model.cidr|status_display">STATUS</span>
193 197
              <span data-rv-show="model.in_progress">...</span>
194 198
            </div>
199
            <div class="state state-indicator">
200
              <div class="action-indicator"></div>
201
            </div>
195 202
            <div class="status-indicator clearfix">
196 203
              <div class="indicator indicator1"></div>
197 204
              <div class="indicator indicator2"></div>
......
204 211
      </div>
205 212
    </div>
206 213
    <div class="actions-content">
207
      <div class="action-container" 
214
      <div class="action-container connect" 
208 215
           data-rv-class-isactive="model.can_connect"
209 216
           data-rv-on-click="view.show_connect_vms_overlay">
210 217
           <a>{% trans "Connect machine" %}</a>
b/snf-cyclades-app/synnefo/ui/templates/partials/public_keys.html
66 66
            </textarea>
67 67
          </div>
68 68
        </div>
69
        <div class="entry-right">
70
          <div class="state state-indicator">
71
            <div class="action-indicator"></div>
72
          </div>
73
        </div>
69 74
      </div>
70 75
    </div>
71 76
    <div class="actions-content">

Also available in: Unified diff