From ed63ea433a1e9047419b80257019588a3d818528 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Thu, 20 Mar 2014 19:10:07 -0400 Subject: [PATCH] Fixed refresh of inventory tree after a group refresh initiates. Fixed group add js error caused by source_vars == null when ec2 source selected. --- awx/ui/static/js/helpers/Groups.js | 2 +- awx/ui/static/js/helpers/JobSubmission.js | 22 ++-- awx/ui/static/less/ansible-ui.less | 6 +- .../static/sample/data/jobs/running/data.json | 112 ------------------ 4 files changed, 18 insertions(+), 124 deletions(-) diff --git a/awx/ui/static/js/helpers/Groups.js b/awx/ui/static/js/helpers/Groups.js index ee9393f1bd..b0b0fc90a8 100644 --- a/awx/ui/static/js/helpers/Groups.js +++ b/awx/ui/static/js/helpers/Groups.js @@ -220,10 +220,10 @@ angular.module('GroupsHelper', ['RestServices', 'Utilities', 'ListGenerator', 'G list: CredentialList, field: 'credential' }); - if ($('#group_tabs .active a').text() === 'Source' && scope.source.value === 'ec2') { callback = function(){ Wait('stop'); }; Wait('start'); + scope.source_vars = (Empty(scope.source_vars)) ? "---" : scope.source_vars; ParseTypeChange({ scope: scope, variable: 'source_vars', parse_variable: form.fields.source_vars.parseTypeName, field_id: 'source_source_vars', onReady: callback }); } diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index d5ed796493..67b12dbc31 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -386,7 +386,7 @@ angular.module('JobSubmissionHelper', ['RestServices', 'Utilities', 'CredentialF ]) -// Sumbit Inventory Update request +// Submit Inventory Update request .factory('InventoryUpdate', ['PromptPasswords', '$compile', 'Rest', '$location', 'GetBasePath', 'ProcessErrors', 'Alert', 'GroupForm', 'BuildTree', 'Wait', function (PromptPasswords, $compile, Rest, $location, GetBasePath, ProcessErrors, Alert, GroupForm, BuildTree, Wait) { @@ -413,16 +413,18 @@ angular.module('JobSubmissionHelper', ['RestServices', 'Utilities', 'CredentialF scope.removeUpdateSubmitted(); } scope.removeUpdateSubmitted = scope.$on('UpdateSubmitted', function (e, action) { - if (action === 'started') { - if (scope.refreshGroups) { - scope.selected_tree_id = tree_id; - scope.selected_group_id = group_id; - scope.refreshGroups(); - } else if (scope.refresh) { - scope.refresh(); + setTimeout(function() { + if (action === 'started') { + if (scope.refreshGroups) { + scope.selected_tree_id = tree_id; + scope.selected_group_id = group_id; + scope.refreshGroups(); + } else if (scope.refresh) { + scope.refresh(); + } + scope.$emit('HostReloadComplete'); } - scope.$emit('HostReloadComplete'); - } + }, 2000); }); if (scope.removeInventorySubmit) { diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index 7b3a821edd..5f5e54a6a3 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -1007,11 +1007,14 @@ input[type="checkbox"].checkbox-no-label { padding-left: 8px; } .title { + font-size: 14px; padding-left: 8px; font-weight: bold; margin-bottom: 6px; + color: @black; } - thead >tr >th, tbody >tr >td, .page-row, .title { + thead >tr >th, tbody >tr >td, .page-row { + font-size: 12.5px; color: #666; } .pagination li a { @@ -1374,6 +1377,7 @@ tr td button i { .modal { border: 1px solid @black; + z-index: 2050; } .close { diff --git a/awx/ui/static/sample/data/jobs/running/data.json b/awx/ui/static/sample/data/jobs/running/data.json index be5f5f6588..4f07496bd8 100644 --- a/awx/ui/static/sample/data/jobs/running/data.json +++ b/awx/ui/static/sample/data/jobs/running/data.json @@ -3,118 +3,6 @@ "next": null, "previous": null, "results": [ - { - "id": 20, - "url": "/api/v1/jobs/1/", - "related": { - "job_host_summaries": "/api/v1/jobs/1/job_host_summaries/", - "activity_stream": "/api/v1/jobs/1/activity_stream/", - "job_events": "/api/v1/jobs/1/job_events/", - "job_template": "/api/v1/job_templates/3/", - "inventory": "/api/v1/inventories/4/", - "project": "/api/v1/projects/1/", - "credential": "/api/v1/credentials/8/", - "start": "/api/v1/jobs/1/start/", - "cancel": "/api/v1/jobs/1/cancel/" - }, - "summary_fields": { - "credential": { - "name": "ssh", - "description": "machine creds", - "kind": "ssh", - "cloud": false - }, - "job_template": { - "name": "Hello World", - "description": "" - }, - "project": { - "name": "Examples", - "description": "Ansible example project", - "status": "successful" - }, - "inventory": { - "name": "Rackspace", - "description": "", - "has_active_failures": true, - "total_hosts": 20, - "hosts_with_active_failures": 20, - "total_groups": 3, - "groups_with_active_failures": 3, - "has_inventory_sources": true, - "total_inventory_sources": 1, - "inventory_sources_with_failures": 1 - } - }, - "created": "2014-03-06T16:51:04.557Z", - "modified": "2014-03-06T16:51:14.272Z", - "job_template": 3, - "job_type": "playbook_run", - "inventory": 4, - "project": 1, - "playbook": "lamp_simple/site.yml", - "credential": 8, - "cloud_credential": null, - "forks": 0, - "limit": "", - "verbosity": 0, - "extra_vars": "{\n\t\"variable1\": \"some value\",\n\t\"variable2\": \"another value\"\n}", - "job_tags": "", - "launch_type": "manual", - "status": "pending", - "failed": false, - "result_traceback": "", - "passwords_needed_to_start": [], - "job_args": "[\"ssh-agent\", \"sh\", \"-c\", \"ssh-add /tmp/tmp5N437j && ansible-playbook -i /vagrant/ansible-commander/awx/plugins/inventory/awxrest.py -u vagrant -e '{\\\"variable1\\\": \\\"some value\\\", \\\"variable2\\\": \\\"another value\\\"}' lamp_simple/site.yml\"]", - "job_cwd": "/vagrant/ansible-commander/awx/projects/_1__examples", - "job_env": { - "CELERY_LOG_REDIRECT_LEVEL": "WARNING", - "ANSIBLE_PARAMIKO_RECORD_HOST_KEYS": "False", - "DJANGO_LIVE_TEST_SERVER_ADDRESS": "localhost:9013-9199", - "LESSOPEN": "|/usr/bin/lesspipe.sh %s", - "_MP_FORK_LOGFILE_": "", - "SSH_CLIENT": "10.0.2.2 61378 22", - "CVS_RSH": "ssh", - "LOGNAME": "vagrant", - "USER": "vagrant", - "HOME": "/home/vagrant", - "PATH": "/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/vagrant/bin", - "REST_API_TOKEN": "**********************************", - "CALLBACK_CONSUMER_PORT": "tcp://127.0.0.1:5557", - "ANSIBLE_CALLBACK_PLUGINS": "/vagrant/ansible-commander/awx/plugins/callback", - "LANG": "en_US.UTF-8", - "HISTCONTROL": "ignoredups", - "TERM": "xterm", - "SHELL": "/bin/bash", - "TZ": "America/New_York", - "_MP_FORK_LOGFORMAT_": "[%(asctime)s: %(levelname)s/%(processName)s] %(message)s", - "SHLVL": "1", - "G_BROKEN_FILENAMES": "1", - "HISTSIZE": "1000", - "CELERY_LOG_FILE": "", - "DJANGO_PROJECT_DIR": "/vagrant/ansible-commander", - "ANSIBLE_HOST_KEY_CHECKING": "False", - "JOB_ID": "1", - "PYTHONPATH": "/vagrant/ansible-commander/awx/lib/site-packages:", - "CELERY_LOADER": "djcelery.loaders.DjangoLoader", - "_MP_FORK_LOGLEVEL_": "10", - "ANSIBLE_NOCOLOR": "1", - "JOB_CALLBACK_DEBUG": "1", - "REST_API_URL": "http://127.0.0.1:8013", - "_": "/usr/bin/nohup", - "SSH_CONNECTION": "10.0.2.2 61378 10.0.2.15 22", - "INVENTORY_HOSTVARS": "True", - "SSH_TTY": "/dev/pts/0", - "CELERY_LOG_LEVEL": "10", - "HOSTNAME": "vagrant-centos64.vagrantup.com", - "INVENTORY_ID": "4", - "PWD": "/home/vagrant", - "CELERY_LOG_REDIRECT": "1", - "DJANGO_SETTINGS_MODULE": "awx.settings.development", - "MAIL": "/var/spool/mail/vagrant", - "LS_COLORS": "rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:" - } - }, { "id": 21, "url": "/api/v1/jobs/2/",