<commit_before>define('app/views/backend_add', [
    'app/models/backend',
    'text!app/templates/backend_add.html',
    'ember'],
    /**
     *
     * Add Backend Dialog
     *
     * @returns Class
     */
    function(Backend, backend_add_html) {

        return Ember.View.extend({

            template: Ember.Handlebars.compile(backend_add_html),
            
            pendingCreation: false,
            
            pendingCreationObserver: function() {
                if (this.pendingCreation) {
                    $('#create-backend-ok').addClass('ui-disabled');
                } else {
                    $('#create-backend-ok').removeClass('ui-disabled');
                }
            }.observes('pendingCreation'),
            
            keyDown: function(event) {
                if (event.keyCode == 13) { // Enter
                    if (event.preventDefault) {
                        event.preventDefault();
                    }
                    if (Mist.backendAddController.newBackendReady) {
                        warn('yeay!');
                        this.addButtonClick();
                    }
                } else if (event.keyCode == 27) { // Esc
                    this.backClicked();
                }
            },
            
            selectBackend: function(event) {
                if (event.target.title.indexOf("rackspace") != -1 || event.target.title.indexOf("linode") != -1 || event.target.title.indexOf("softlayer") !== -1) {
                    $('#addBackendInfo').show();                
                    $('#ApiKeylabel').text('2. Username:');
                    $('#ApiSecretlabel').text('3. API Key:');
                    $('#addBackendOpenstack').hide();
                    $('#addBackendBareMetal').hide();                    
                } else if (event.target.title.indexOf("nephoscale") !== -1) {
                    $('#addBackendInfo').show();                 
                    $('#ApiKeylabel').text('2. Username:');
                    $('#ApiSecretlabel').text('3. Password:');
                    $('#addBackendOpenstack').hide();
                    $('#addBackendBareMetal').hide();                    
                } else if (event.target.title.indexOf("digitalocean") !== -1) {
                    $('#addBackendInfo').show();                 
                    $('#ApiKeylabel').text('2. Client ID:');
                    $('#ApiSecretlabel').text('3. API Key:');
                    $('#addBackendOpenstack').hide();
                    $('#addBackendBareMetal').hide();                    
                } else if (event.target.title.indexOf("openstack") != -1) {
                    $('#addBackendInfo').show();                 
                    $('#ApiKeylabel').text('2. Username:');
                    $('#ApiSecretlabel').text('3. Password:');
                    $('#addBackendOpenstack').show();
                    $('#addBackendBareMetal').hide();                    
                } else if (event.target.title.indexOf("bare_metal") != -1) {
                    $('#addBackendInfo').hide();
                    $('#addBackendBareMetal').show();
                    $('#addBackendOpenstack').hide();                    
                } else {
                    $('#addBackendInfo').show();                 
                    $('#ApiKeylabel').text('2. API Key:');
                    $('#ApiSecretlabel').text('3. API Secret:');
                    $('#addBackendOpenstack').hide();
                    $('#addBackendBareMetal').hide();                    
                }
                $('.select-backend-collapsible').collapsible('option','collapsedIcon','check');
                $('.select-backend-collapsible span.ui-btn-text').text(event.target.text);
                Mist.backendAddController.set('newBackendProvider', 
                    {provider: $(event.target).attr('title'),
                     title: event.target.text 
                    }
                );
                $('.select-backend-collapsible').trigger('collapse');
                
                Mist.backendAddController.set('newBackendKey', '');<commit_msg>Auto type root as user when adding bare_metal server<commit_after>define('app/views/backend_add', [
    'app/models/backend',
    'text!app/templates/backend_add.html',
    'ember'],
    /**
     *
     * Add Backend Dialog
     *
     * @returns Class
     */
    function(Backend, backend_add_html) {

        return Ember.View.extend({

            template: Ember.Handlebars.compile(backend_add_html),
            
            pendingCreation: false,
            
            pendingCreationObserver: function() {
                if (this.pendingCreation) {
                    $('#create-backend-ok').addClass('ui-disabled');
                } else {
                    $('#create-backend-ok').removeClass('ui-disabled');
                }
            }.observes('pendingCreation'),
            
            keyDown: function(event) {
                if (event.keyCode == 13) { // Enter
                    if (event.preventDefault) {
                        event.preventDefault();
                    }
                    if (Mist.backendAddController.newBackendReady) {
                        warn('yeay!');
                        this.addButtonClick();
                    }
                } else if (event.keyCode == 27) { // Esc
                    this.backClicked();
                }
            },
            
            selectBackend: function(event) {
                if (event.target.title.indexOf("rackspace") != -1 || event.target.title.indexOf("linode") != -1 || event.target.title.indexOf("softlayer") !== -1) {
                    $('#addBackendInfo').show();                
                    $('#ApiKeylabel').text('2. Username:');
                    $('#ApiSecretlabel').text('3. API Key:');
                    $('#addBackendOpenstack').hide();
                    $('#addBackendBareMetal').hide();                    
                } else if (event.target.title.indexOf("nephoscale") !== -1) {
                    $('#addBackendInfo').show();                 
                    $('#ApiKeylabel').text('2. Username:');
                    $('#ApiSecretlabel').text('3. Password:');
                    $('#addBackendOpenstack').hide();
                    $('#addBackendBareMetal').hide();                    
                } else if (event.target.title.indexOf("digitalocean") !== -1) {
                    $('#addBackendInfo').show();                 
                    $('#ApiKeylabel').text('2. Client ID:');
                    $('#ApiSecretlabel').text('3. API Key:');
                    $('#addBackendOpenstack').hide();
                    $('#addBackendBareMetal').hide();                    
                } else if (event.target.title.indexOf("openstack") != -1) {
                    $('#addBackendInfo').show();                 
                    $('#ApiKeylabel').text('2. Username:');
                    $('#ApiSecretlabel').text('3. Password:');
                    $('#addBackendOpenstack').show();
                    $('#addBackendBareMetal').hide();                    
                } else if (event.target.title.indexOf("bare_metal") != -1) {
                    // TODO: Render keys...
                    $('#addBackendInfo').hide();
                    $('#addBackendBareMetal').show();
                    $('#addBackendOpenstack').hide();
                    Mist.backendAddController.set('newBareServerUser', 'root');       
                } else {
                    $('#addBackendInfo').show();                 
                    $('#ApiKeylabel').text('2. API Key:');
                    $('#ApiSecretlabel').text('3. API Secret:');
                    $('#addBackendOpenstack').hide();
                    $('#addBackendBareMetal').hide();                    
                }
                $('.select-backend-collapsible').collapsible('option','collapsedIcon','check');
                $('.select-backend-collapsible span.ui-btn-text').text(event.target.text);
                Mist.backendAddController.set('newBackendProvider', 
                    {provider: $(event.target).attr('title'),
                     title: event.target.text 
                    }
                );
                $('.select-backend-collapsible').trigger('collapse');
                
                Mist.backendAddController.set('newBackendKey', '');
{'fraction_non_alphanumeric': 0.15733772342427094, 'fraction_numerical': 0.004938852304797742, 'mean_word_length': 1.2673953612370035, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2393988', 'n_tokens_mistral': 2080, 'n_tokens_neox': 2035, 'n_words': 259}