diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index ed4fcb82ab..632da3de92 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -59,6 +59,7 @@ min-height: 40px; } +.Form-title--is_smartinventory, .Form-title--is_superuser, .Form-title--is_system_auditor, .Form-title--is_ldap_user, @@ -665,6 +666,19 @@ input[type='radio']:checked:before { .noselect; } +.Form-textInput--variableHeight { + height: inherit; + min-height: 30px; +} + +.Form-variableHeightButtonGroup { + height: 100%; +} + +.Form-lookupButton--variableHeight { + height: 100%; +} + @media only screen and (max-width: 650px) { .Form-formGroup { flex: 1 0 auto; diff --git a/awx/ui/client/src/credential-types/credential-types.form.js b/awx/ui/client/src/credential-types/credential-types.form.js index 417abbb926..289ed260d1 100644 --- a/awx/ui/client/src/credential-types/credential-types.form.js +++ b/awx/ui/client/src/credential-types/credential-types.form.js @@ -56,7 +56,7 @@ export default ['i18n', function(i18n) { 'used by Projects.') + '\n' + '
" + - i18n._("Indicates if a host is available and should be included in running jobs.") + - "
" + - i18n._("For hosts that are part of an external inventory, this" + - " flag cannot be changed. It will be set by the inventory" + - " sync process.") + - "
", - dataTitle: i18n._('Host Enabled'), - ngDisabled: 'host.has_inventory_sources' - } - }, - fields: { - name: { - label: i18n._('Host Name'), - type: 'text', - - value: '{{name}}', - awPopOver: "" + - i18n._("Provide a host name, ip address, or ip address:port. Examples include:") + - "
" + - "myserver.domain.com", - dataTitle: i18n._('Host Name'), - dataPlacement: 'right', - dataContainer: 'body' - }, - description: { - label: i18n._('Description'), - type: 'text', - }, - variables: { - label: i18n._('Variables'), - type: 'textarea', - rows: 6, - class: 'modal-input-xlarge Form-textArea Form-formGroup--fullWidth', - dataTitle: i18n._('Host Variables'), - dataPlacement: 'right', - dataContainer: 'body', - default: '---', - awPopOver: "
" + - "127.0.0.1
" + - "10.1.0.140:25
" + - "server.example.com:25" + - "
" + i18n._("Enter inventory variables using either JSON or YAML syntax. Use the radio button to toggle between the two.") + "
" + - "JSON:{\n" + - "YAML:
\"somevar\": \"somevalue\",
\"password\": \"magic\"
}
---\n" + - '
somevar: somevalue
password: magic
' + i18n.sprintf(i18n._('View JSON examples at %s'), 'www.json.org') + '
' + - '' + i18n.sprintf(i18n._('View YAML examples at %s'), 'docs.ansible.com') + '
', - } - }, - buttons: { - cancel: { - ngClick: 'formCancel()' - }, - save: { - ngClick: 'formSave()', //$scope.function to call on click, optional - ngDisabled: "host_form.$invalid"//true //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons - } - } - }; -}]; diff --git a/awx/ui/client/src/home/dashboard/hosts/dashboard-hosts.list.js b/awx/ui/client/src/home/dashboard/hosts/dashboard-hosts.list.js deleted file mode 100644 index fefc0fe834..0000000000 --- a/awx/ui/client/src/home/dashboard/hosts/dashboard-hosts.list.js +++ /dev/null @@ -1,75 +0,0 @@ -/************************************************* -* Copyright (c) 2015 Ansible, Inc. -* -* All Rights Reserved -*************************************************/ - - -export default [ 'i18n', function(i18n){ - return { - name: 'hosts', - iterator: 'host', - selectTitle: i18n._('Add Existing Hosts'), - editTitle: i18n._('HOSTS'), - listTitle: i18n._('HOSTS'), - index: false, - hover: true, - well: true, - emptyListText: i18n._('NO HOSTS FOUND'), - fields: { - status: { - basePath: 'unified_jobs', - label: '', - iconOnly: true, - nosort: true, - icon: 'icon-job-{{ host.active_failures }}', - awToolTip: '{{ host.badgeToolTip }}', - awTipPlacement: 'right', - dataPlacement: 'right', - awPopOver: '{{ host.job_status_html }}', - dataTitle: '{{host.job_status_title}}', - ngClick:'viewHost(host.id)', - columnClass: 'col-lg-1 col-md-1 col-sm-2 col-xs-2 List-staticColumn--smallStatus' - }, - name: { - key: true, - label: i18n._('Name'), - columnClass: 'col-lg-5 col-md-5 col-sm-5 col-xs-8 ellipsis List-staticColumnAdjacent', - ngClick: 'editHost(host.id)' - }, - inventory_name: { - label: i18n._('Inventory'), - sourceModel: 'inventory', - sourceField: 'name', - columnClass: 'col-lg-5 col-md-4 col-sm-4 hidden-xs elllipsis', - linkTo: "{{ '/#/inventories/' + host.inventory_id }}" - }, - enabled: { - label: i18n._('Status'), - columnClass: 'List-staticColumn--toggle', - type: 'toggle', - ngClick: 'toggleHostEnabled(host)', - nosort: true, - awToolTip: "" + i18n._("Indicates if a host is available and should be included in running jobs.") + "
" + i18n._("For hosts that are part of an external inventory, this flag cannot be changed. It will be set by the inventory sync process.") + "
", - dataTitle: i18n._('Host Enabled'), - ngDisabled: 'host.has_inventory_sources' - } - }, - - fieldActions: { - - columnClass: 'col-lg-2 col-md-3 col-sm-3 col-xs-4', - edit: { - label: i18n._('Edit'), - ngClick: 'editHost(host.id)', - icon: 'icon-edit', - awToolTip: i18n._('Edit host'), - dataPlacement: 'top' - } - }, - - actions: { - - } - }; -}]; diff --git a/awx/ui/client/src/home/dashboard/hosts/dashboard-hosts.service.js b/awx/ui/client/src/home/dashboard/hosts/dashboard-hosts.service.js deleted file mode 100644 index 997167b90a..0000000000 --- a/awx/ui/client/src/home/dashboard/hosts/dashboard-hosts.service.js +++ /dev/null @@ -1,30 +0,0 @@ -export default - ['$rootScope', 'Rest', 'GetBasePath', 'ProcessErrors', function($rootScope, Rest, GetBasePath, ProcessErrors){ - return { - - setHostStatus: function(host, enabled){ - var url = GetBasePath('hosts') + host.id; - Rest.setUrl(url); - return Rest.put({enabled: enabled, name: host.name}) - .success(function(data){ - return data; - }) - .error(function(data, status) { - ProcessErrors($rootScope, data, status, null, { hdr: 'Error!', - msg: 'Call to ' + url + '. GET returned: ' + status }); - }); - }, - putHost: function(host){ - var url = GetBasePath('hosts') + host.id; - Rest.setUrl(url); - return Rest.put(host) - .success(function(data){ - return data; - }) - .error(function(data, status) { - ProcessErrors($rootScope, data, status, null, { hdr: 'Error!', - msg: 'Call to ' + url + '. GET returned: ' + status }); - }); - } - }; - }]; \ No newline at end of file diff --git a/awx/ui/client/src/home/dashboard/hosts/main.js b/awx/ui/client/src/home/dashboard/hosts/main.js deleted file mode 100644 index e68efc7300..0000000000 --- a/awx/ui/client/src/home/dashboard/hosts/main.js +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************* - * Copyright (c) 2016 Ansible, Inc. - * - * All Rights Reserved - *************************************************/ - -import list from './dashboard-hosts.list'; -import form from './dashboard-hosts.form'; -import listController from './dashboard-hosts-list.controller'; -import editController from './dashboard-hosts-edit.controller'; -import service from './dashboard-hosts.service'; -import { N_ } from '../../../i18n'; - -export default -angular.module('dashboardHosts', []) - .service('DashboardHostService', service) - .factory('DashboardHostsList', list) - .factory('DashboardHostsForm', form) - .config(['$stateProvider', 'stateDefinitionsProvider', - function($stateProvider, stateDefinitionsProvider) { - let stateDefinitions = stateDefinitionsProvider.$get(); - - $stateProvider.state({ - name: 'dashboardHosts', - url: '/home/hosts', - lazyLoad: () => stateDefinitions.generateTree({ - urls: { - list: '/home/hosts' - }, - parent: 'dashboardHosts', - modes: ['edit'], - list: 'DashboardHostsList', - form: 'DashboardHostsForm', - controllers: { - list: listController, - edit: editController - }, - resolve: { - edit: { - host: ['Rest', '$stateParams', 'GetBasePath', - function(Rest, $stateParams, GetBasePath) { - let path = GetBasePath('hosts') + $stateParams.host_id; - Rest.setUrl(path); - return Rest.get(); - } - ] - } - }, - data: { - activityStream: true, - activityStreamTarget: 'host' - }, - ncyBreadcrumb: { - parent: 'dashboard', - label: N_("HOSTS") - }, - }) - }); - } - ]); diff --git a/awx/ui/client/src/home/dashboard/main.js b/awx/ui/client/src/home/dashboard/main.js index bd0fd75743..80f27a1ff1 100644 --- a/awx/ui/client/src/home/dashboard/main.js +++ b/awx/ui/client/src/home/dashboard/main.js @@ -2,8 +2,7 @@ import dashboardCounts from './counts/main'; import dashboardGraphs from './graphs/main'; import dashboardLists from './lists/main'; import dashboardDirective from './dashboard.directive'; -import dashboardHosts from './hosts/main'; export default - angular.module('dashboard', [dashboardHosts.name, dashboardCounts.name, dashboardGraphs.name, dashboardLists.name]) + angular.module('dashboard', [dashboardCounts.name, dashboardGraphs.name, dashboardLists.name]) .directive('dashboard', dashboardDirective); diff --git a/awx/ui/client/src/inventories/adhoc/adhoc-credential.route.js b/awx/ui/client/src/inventories/adhoc/adhoc-credential.route.js index 457e6288bb..9ec32d6b04 100644 --- a/awx/ui/client/src/inventories/adhoc/adhoc-credential.route.js +++ b/awx/ui/client/src/inventories/adhoc/adhoc-credential.route.js @@ -1,6 +1,5 @@ export default { searchPrefix: 'credential', - name: 'inventories.edit.adhoc.credential', url: '/credential', data: { formChildState: true diff --git a/awx/ui/client/src/inventories/adhoc/adhoc.controller.js b/awx/ui/client/src/inventories/adhoc/adhoc.controller.js index fcff3cb3a1..f1b8db2d9b 100644 --- a/awx/ui/client/src/inventories/adhoc/adhoc.controller.js +++ b/awx/ui/client/src/inventories/adhoc/adhoc.controller.js @@ -22,7 +22,7 @@ function adhocController($q, $scope, $stateParams, var privateFn = {}; this.privateFn = privateFn; - var id = $stateParams.inventory_id, + var id = $stateParams.inventory_id ? $stateParams.inventory_id : $stateParams.smartinventory_id, hostPattern = $stateParams.pattern; // note: put any urls that the controller will use in here!!!! @@ -189,7 +189,7 @@ function adhocController($q, $scope, $stateParams, // launch the job with the provided form data $scope.launchJob = function () { - var adhocUrl = GetBasePath('inventory') + $stateParams.inventory_id + + var adhocUrl = GetBasePath('inventory') + id + '/ad_hoc_commands/', fld, data={}, html; html = '