Revision 1e882dd7 snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_icon_view.js

b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_icon_view.js
721 721
        
722 722
        // vm specific event handlers
723 723
        set_vm_handlers: function(vm) {
724
            var el = this.vm(vm);
725

  
726 724
        },
727 725

  
728 726
        check_terminated_is_empty: function() {
......
753 751
            this.$("div.machine-container:last-child").find("div.separator").hide();
754 752
            fix_v6_addresses();
755 753
        },
754
  
755
        update_status_message: function(vm) {
756
            var el = this.vm(vm);
757
            var message = vm.get_status_message();
758
            if (message) {
759
                // update bulding progress
760
                el.find("div.machine-ips").hide();
761
                el.find("div.build-progress").show();
762
                el.find("div.build-progress .message").text(message);
763
                if (vm.in_error_state()) {
764
                    el.find("div.build-progress .btn").show();
765
                } else {
766
                    el.find("div.build-progress .btn").hide();
767
                }
768
            } else {
769
                // hide building progress
770
                el.find("div.machine-ips").show()
771
                el.find("div.build-progress").hide();
772
                el.find("div.build-progress .btn").hide();
773
            }
774
        },
756 775

  
757 776
        // update vm details
758 777
        update_details: function(vm) {
......
777 796
            
778 797
            var status = vm.get("status");
779 798
            var state = vm.get("state");
780

  
781
            if (status == 'BUILD') {
782
                // update bulding progress
783
                el.find("div.machine-ips").hide();
784
                el.find("div.build-progress").show().text(vm.get('progress_message'));
785
            } else {
786
                // hide building progress
787
                el.find("div.machine-ips").show()
788
                el.find("div.build-progress").hide();
789
            }
790

  
791
            if (state == "DESTROY") {
792
                el.find("div.machine-ips").hide();
793
                el.find("div.build-progress").show().text("Terminating...");
794
            }
799
            
800
            this.update_status_message(vm);
795 801

  
796 802
            icon_state = vm.is_active() ? "on" : "off";
797 803
            set_machine_os_image(el, "icon", icon_state, this.get_vm_icon_os(vm));

Also available in: Unified diff