<commit_before>define('app/views/machine_list_item', ['app/views/list_item'],
    /**
     *  Machine List Item View
     *
     *  @returns Class
     */
    function (ListItemComponent) {
        return App.MachineListItemComponent = ListItemComponent.extend({

            //
            //  Properties
            //
            layoutName: 'machine_list_item',
            machine: null,
            classNameBindings: ['machineState', 'monitoringState', 'monitoringTooltip'],


            //
            //  Computed Properties
            //

            machineState: function() {
                return this.machine.get('state');
            }.property('machine.state'),

            monitoringState: function() {
                if (this.machine.hasMonitoring){
                    if (this.machine.get('hasOpenIncident'))
                        return 'has-incident';
                    return 'has-monitoring';
                }
                return 'no-monitoring';
            }.property('machine.hasMonitoring', 'machine.hasOpenIncident'),

            monitoringTooltip: function() {
                if (this.machine.hasMonitoring){
                    if (this.machine.get('hasOpenIncident'))
                        return 'Machine has Incident'; 
                return 'Monitoring state is good';                    
                }
                return 'Monitoring not enabled';
            }.property('machine.hasMonitoring', 'machine.hasOpenIncident'),


            //
            //  Methods
            //

            updateCheckbox: function () {
                var element = $('#' + this.elementId + ' input.ember-checkbox');
                Ember.run.next(this, function () {
                    if (element.checkboxradio) {
                        element.checkboxradio()
                               .checkboxradio('refresh');
                    }
                });
            },


            //
            //  Actions
            //

            actions: {
                disassociateGhostMachine: function () {
                    // This method is called ONLY from inside the
                    // single key view. That is why we get the parent
                    // view to get "keyId"
                    var keyId = this.get('parentView').get('key').get('id');
                    var machine = this.machine;

                    Mist.dialogController.open({
                        type: DIALOG_TYPES.YES_NO,
                        head: 'Disassociate machine',
                        body: [
                            {
                                paragraph: 'Are you sure you want to disassociate ' +
                                    machine.name + ' ?'
                            }
                        ],
                        callback: function (didConfirm) {
                            if (didConfirm) {
                                Mist.keysController.disassociateKey(keyId, machine);
                            }
                        }
                    });
                }
            },


            //
            //  Observers
            //

            machineSelectedObserver: function () {
                Ember.run.once(this, 'updateCheckbox');
            }.observes('machine.selected')
        });
    }
);
<commit_msg>clean up spaces<commit_after>define('app/views/machine_list_item', ['app/views/list_item'],
    /**
     *  Machine List Item View
     *
     *  @returns Class
     */
    function (ListItemComponent) {
        return App.MachineListItemComponent = ListItemComponent.extend({

            //
            //  Properties
            //
            layoutName: 'machine_list_item',
            machine: null,
            classNameBindings: ['machineState', 'monitoringState', 'monitoringTooltip'],


            //
            //  Computed Properties
            //

            machineState: function() {
                return this.machine.get('state');
            }.property('machine.state'),

            monitoringState: function() {
                if (this.machine.hasMonitoring){
                    if (this.machine.get('hasOpenIncident'))
                        return 'has-incident';
                    return 'has-monitoring';
                }
                return 'no-monitoring';
            }.property('machine.hasMonitoring', 'machine.hasOpenIncident'),

            monitoringTooltip: function() {
                if (this.machine.hasMonitoring){
                    if (this.machine.get('hasOpenIncident'))
                        return 'Machine has Incident'; 
                    return 'Monitoring state is good';
                }
                return 'Monitoring not enabled';
            }.property('machine.hasMonitoring', 'machine.hasOpenIncident'),


            //
            //  Methods
            //

            updateCheckbox: function () {
                var element = $('#' + this.elementId + ' input.ember-checkbox');
                Ember.run.next(this, function () {
                    if (element.checkboxradio) {
                        element.checkboxradio()
                               .checkboxradio('refresh');
                    }
                });
            },


            //
            //  Actions
            //

            actions: {
                disassociateGhostMachine: function () {
                    // This method is called ONLY from inside the
                    // single key view. That is why we get the parent
                    // view to get "keyId"
                    var keyId = this.get('parentView').get('key').get('id');
                    var machine = this.machine;

                    Mist.dialogController.open({
                        type: DIALOG_TYPES.YES_NO,
                        head: 'Disassociate machine',
                        body: [
                            {
                                paragraph: 'Are you sure you want to disassociate ' +
                                    machine.name + ' ?'
                            }
                        ],
                        callback: function (didConfirm) {
                            if (didConfirm) {
                                Mist.keysController.disassociateKey(keyId, machine);
                            }
                        }
                    });
                }
            },


            //
            //  Observers
            //

            machineSelectedObserver: function () {
                Ember.run.once(this, 'updateCheckbox');
            }.observes('machine.selected')
        });
    }
);

{'fraction_non_alphanumeric': 0.1002710027100271, 'fraction_numerical': 0.0, 'mean_word_length': 0.9966937180643222, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5446303', 'n_tokens_mistral': 1549, 'n_tokens_neox': 1429, 'n_words': 278}