<commit_before>define('app/views/backend_add', ['app/views/templated', 'ember'],
    //
    //  Add Backend View
    //
    //  @returns Class
    //
    function(TemplatedView) {

        'use strict';

        return TemplatedView.extend({


            //
            //
            //  Properties
            //
            //


            firstFieldLabel: 'API Key',
            secondFieldLabel: 'API Secret',


            //
            //
            //  Methods
            //
            //


            updateAddButton: function() {
                if (Mist.backendsController.addingBackend || !Mist.backendAddController.formReady) {
                    $('#new-backend-ok').addClass('ui-state-disabled');
                } else {
                    $('#new-backend-ok').removeClass('ui-state-disabled');
                }
            },


            clear: function () {

                $('#gce-bundle').hide();
                $('#non-hp-cloud').hide();
                $('#baremetal-bundle').hide();
                $('#openstack-bundle').hide();
                $('#new-backend-provider').collapsible('collapse');
                $('#new-backend-second-field').attr('type', 'password');
                $('#gce-bundle a').removeClass('ui-icon-check')
                    .addClass('ui-icon-carat-u');

                Ember.run.next(function () {
                    $('#add-backend-panel').trigger('create');
                });
            },


            //
            //
            //  Actions
            //
            //


            actions: {

                selectProvider: function(provider) {

                    Mist.backendAddController._clear();
                    this.clear();

                    $('#new-backend-second-field').attr('type', 'password');
                    $('#new-backend-provider').collapsible('collapse');
                    $('#opentack-advanced-wrapper').hide();
                    $('#openstack-bundle').hide();
                    $('#baremetal-bundle').hide();
                    $('#non-hp-cloud').hide();

                    if (provider.provider.indexOf('rackspace') > -1 || provider.provider.indexOf('linode') > -1) {
                        this.set('firstFieldLabel', 'Username');
                        this.set('secondFieldLabel', 'API Key');
                    } else if (provider.provider.indexOf('nephoscale') > -1) {
                        this.set('firstFieldLabel', 'Username');
                        this.set('secondFieldLabel', 'Password');
                    } else if (provider.provider.indexOf('digitalocean') > -1) {
                        this.set('firstFieldLabel', 'Client ID');
                        this.set('secondFieldLabel', 'API Key');
                    } else if (provider.provider.indexOf('gce') > -1) {
                        this.set('firstFieldLabel', 'Email address');
                        this.set('secondFieldLabel', '');
                        $('#gce-bundle').show();
                    } else if (provider.provider.indexOf('openstack') > -1) {
                        this.set('firstFieldLabel', 'Username');
                        this.set('secondFieldLabel', 'Password');

                        //This is for HP Cloud specific
                        if (provider.provider.indexOf('region-') > -1) {
                            Mist.backendAddController.set('newBackendOpenStackURL', 'https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens');
                        } else {
                            $('#opentack-advanced-wrapper').show();
                        }
                        $('#openstack-bundle').show();

                    } else if (provider.provider.indexOf('bare_metal') > -1) {
                        this.set('firstFieldLabel', 'Hostname');
                        this.set('secondFieldLabel', 'User');
                        Mist.backendAddController.set('newBackendSecondField', 'root');
                        Mist.backendAddController.set('newBackendPort', 22);
                        $('#new-backend-key .ui-listview').listview('refresh');
                        $('#new-backend-second-field').attr('type', '');
                        $('#baremetal-bundle').show();

                    } else {
                        this.set('firstFieldLabel', 'API Key');
                        this.set('secondFieldLabel', 'API Secret');
                    }

                    Mist.backendAddController.set('newBackendProvider', provider);
                    $('#new-backend-provider').collapsible('option', 'collapsedIcon', 'check');

                    // Autocomplete credentials
                    Mist.backendsController.content.some(function(backend) {
                        if ((provider.provider.split('_')[0] == 'ec2' && backend.provider.split('_')[0] == 'ec2') ||
                            (provider.provider.substr(0,9) == 'rackspace' && backend.provider.substr(0,9) == 'rackspace')) {
                                Mist.backendAddController.set('newBackendFirstField', backend.apikey);
                                Mist.backendAddController.set('newBackendSecondField', 'getsecretfromdb');
                                return true;
                            }
                    });
                },

<commit_msg>Delay baremetal form rendering<commit_after>define('app/views/backend_add', ['app/views/templated', 'ember'],
    //
    //  Add Backend View
    //
    //  @returns Class
    //
    function(TemplatedView) {

        'use strict';

        return TemplatedView.extend({


            //
            //
            //  Properties
            //
            //


            firstFieldLabel: 'API Key',
            secondFieldLabel: 'API Secret',


            //
            //
            //  Methods
            //
            //


            updateAddButton: function() {
                if (Mist.backendsController.addingBackend || !Mist.backendAddController.formReady) {
                    $('#new-backend-ok').addClass('ui-state-disabled');
                } else {
                    $('#new-backend-ok').removeClass('ui-state-disabled');
                }
            },


            clear: function () {

                $('#gce-bundle').hide();
                $('#non-hp-cloud').hide();
                $('#baremetal-bundle').hide();
                $('#openstack-bundle').hide();
                $('#new-backend-provider').collapsible('collapse');
                $('#new-backend-second-field').attr('type', 'password');
                $('#gce-bundle a').removeClass('ui-icon-check')
                    .addClass('ui-icon-carat-u');

                Ember.run.next(function () {
                    $('#add-backend-panel').trigger('create');
                });
            },


            //
            //
            //  Actions
            //
            //


            actions: {

                selectProvider: function(provider) {

                    Mist.backendAddController._clear();
                    this.clear();

                    $('#new-backend-second-field').attr('type', 'password');
                    $('#new-backend-provider').collapsible('collapse');
                    $('#opentack-advanced-wrapper').hide();
                    $('#openstack-bundle').hide();
                    $('#baremetal-bundle').hide();
                    $('#non-hp-cloud').hide();

                    if (provider.provider.indexOf('rackspace') > -1 || provider.provider.indexOf('linode') > -1) {
                        this.set('firstFieldLabel', 'Username');
                        this.set('secondFieldLabel', 'API Key');
                    } else if (provider.provider.indexOf('nephoscale') > -1) {
                        this.set('firstFieldLabel', 'Username');
                        this.set('secondFieldLabel', 'Password');
                    } else if (provider.provider.indexOf('digitalocean') > -1) {
                        this.set('firstFieldLabel', 'Client ID');
                        this.set('secondFieldLabel', 'API Key');
                    } else if (provider.provider.indexOf('gce') > -1) {
                        this.set('firstFieldLabel', 'Email address');
                        this.set('secondFieldLabel', '');
                        $('#gce-bundle').show();
                    } else if (provider.provider.indexOf('openstack') > -1) {
                        this.set('firstFieldLabel', 'Username');
                        this.set('secondFieldLabel', 'Password');

                        //This is for HP Cloud specific
                        if (provider.provider.indexOf('region-') > -1) {
                            Mist.backendAddController.set('newBackendOpenStackURL', 'https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/tokens');
                        } else {
                            $('#opentack-advanced-wrapper').show();
                        }
                        $('#openstack-bundle').show();

                    } else if (provider.provider.indexOf('bare_metal') > -1) {
                        this.set('firstFieldLabel', 'Hostname');
                        this.set('secondFieldLabel', 'User');
                        Mist.backendAddController.set('newBackendSecondField', 'root');
                        Mist.backendAddController.set('newBackendPort', 22);
                        Ember.run.next(function () {
                            $('#new-backend-key .ui-listview').listview('refresh');
                            $('#new-backend-second-field').attr('type', '');
                            $('#baremetal-bundle').show();
                        });

                    } else {
                        this.set('firstFieldLabel', 'API Key');
                        this.set('secondFieldLabel', 'API Secret');
                    }

                    Mist.backendAddController.set('newBackendProvider', provider);
                    $('#new-backend-provider').collapsible('option', 'collapsedIcon', 'check');

                    // Autocomplete credentials
                    Mist.backendsController.content.some(function(backend) {
                        if ((provider.provider.split('_')[0] == 'ec2' && backend.provider.split('_')[0] == 'ec2') ||
                            (provider.provider.substr(0,9) == 'rackspace' && backend.provider.substr(0,9) == 'rackspace')) {
                                Mist.backendAddController.set('newBackendFirstField', backend.apikey);
                                Mist.backendAddController.set('newBackendSecondField', 'getsecretfromdb');
                                return true;
                            }
                    });
                },


{'fraction_non_alphanumeric': 0.15232342007434943, 'fraction_numerical': 0.0048327137546468404, 'mean_word_length': 1.2664279696714407, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3305621', 'n_tokens_mistral': 2669, 'n_tokens_neox': 2513, 'n_words': 326}