http://git-wip-us.apache.org/repos/asf/ignite/blob/00d8c0af/modules/web-console/src/main/js/controllers/domains-controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/controllers/domains-controller.js b/modules/web-console/src/main/js/controllers/domains-controller.js index 467dc98..c709ebb 100644 --- a/modules/web-console/src/main/js/controllers/domains-controller.js +++ b/modules/web-console/src/main/js/controllers/domains-controller.js @@ -16,12 +16,10 @@ */ // Controller for Domain model screen. -import consoleModule from 'controllers/common-module'; - -consoleModule.controller('domainsController', [ - '$rootScope', '$scope', '$http', '$state', '$filter', '$timeout', '$modal', '$common', '$focus', '$confirm', '$confirmBatch', '$clone', '$loading', '$cleanup', '$unsavedChangesGuard', 'IgniteAgentMonitor', '$table', - function($root, $scope, $http, $state, $filter, $timeout, $modal, $common, $focus, $confirm, $confirmBatch, $clone, $loading, $cleanup, $unsavedChangesGuard, IgniteAgentMonitor, $table) { - $unsavedChangesGuard.install($scope); +export default ['domainsController', [ + '$rootScope', '$scope', '$http', '$state', '$filter', '$timeout', '$modal', 'IgniteLegacyUtils', 'IgniteMessages', 'IgniteFocus', 'IgniteConfirm', 'IgniteConfirmBatch', 'IgniteClone', '$loading', '$cleanup', 'IgniteUnsavedChangesGuard', 'IgniteAgentMonitor', 'IgniteLegacyTable', + function($root, $scope, $http, $state, $filter, $timeout, $modal, LegacyUtils, Messages, Focus, Confirm, ConfirmBatch, Clone, $loading, $cleanup, UnsavedChangesGuard, IgniteAgentMonitor, LegacyTable) { + UnsavedChangesGuard.install($scope); const emptyDomain = {empty: true}; @@ -32,7 +30,7 @@ consoleModule.controller('domainsController', [ // We need to initialize backupItem with empty object in order to properly used from angular directives. $scope.backupItem = emptyDomain; - $scope.ui = $common.formUI(); + $scope.ui = LegacyUtils.formUI(); $scope.ui.activePanels = [0, 1]; $scope.ui.topPanels = [0, 1, 2]; @@ -68,14 +66,14 @@ consoleModule.controller('domainsController', [ return !item.empty && (!item._id || _.find($scope.displayedRows, {_id: item._id})); }; - $scope.getModel = $common.getModel; - $scope.javaBuiltInClasses = $common.javaBuiltInClasses; - $scope.compactJavaName = $common.compactJavaName; - $scope.widthIsSufficient = $common.widthIsSufficient; - $scope.saveBtnTipText = $common.saveBtnTipText; + $scope.getModel = LegacyUtils.getModel; + $scope.javaBuiltInClasses = LegacyUtils.javaBuiltInClasses; + $scope.compactJavaName = LegacyUtils.compactJavaName; + $scope.widthIsSufficient = LegacyUtils.widthIsSufficient; + $scope.saveBtnTipText = LegacyUtils.saveBtnTipText; $scope.tableSave = function(field, index, stopEdit) { - if ($table.tableEditing({model: 'table-index-fields'}, $table.tableEditedRowIndex())) { + if (LegacyTable.tableEditing({model: 'table-index-fields'}, LegacyTable.tableEditedRowIndex())) { if ($scope.tableIndexItemSaveVisible(field, index)) return $scope.tableIndexItemSave(field, field.indexIdx, index, stopEdit); } @@ -83,8 +81,8 @@ consoleModule.controller('domainsController', [ switch (field.type) { case 'fields': case 'aliases': - if ($table.tablePairSaveVisible(field, index)) - return $table.tablePairSave($scope.tablePairValid, $scope.backupItem, field, index, stopEdit); + if (LegacyTable.tablePairSaveVisible(field, index)) + return LegacyTable.tablePairSave($scope.tablePairValid, $scope.backupItem, field, index, stopEdit); break; @@ -108,37 +106,37 @@ consoleModule.controller('domainsController', [ }; $scope.tableReset = (trySave) => { - const field = $table.tableField(); + const field = LegacyTable.tableField(); - if (trySave && $common.isDefined(field) && !$scope.tableSave(field, $table.tableEditedRowIndex(), true)) + if (trySave && LegacyUtils.isDefined(field) && !$scope.tableSave(field, LegacyTable.tableEditedRowIndex(), true)) return false; - $table.tableReset(); + LegacyTable.tableReset(); return true; }; $scope.tableNewItem = function(field) { if ($scope.tableReset(true)) - $table.tableNewItem(field); + LegacyTable.tableNewItem(field); }; - $scope.tableNewItemActive = $table.tableNewItemActive; + $scope.tableNewItemActive = LegacyTable.tableNewItemActive; $scope.tableStartEdit = function(item, field, index) { if ($scope.tableReset(true)) - $table.tableStartEdit(item, field, index, $scope.tableSave); + LegacyTable.tableStartEdit(item, field, index, $scope.tableSave); }; - $scope.tableEditing = $table.tableEditing; + $scope.tableEditing = LegacyTable.tableEditing; $scope.tableRemove = function(item, field, index) { if ($scope.tableReset(true)) - $table.tableRemove(item, field, index); + LegacyTable.tableRemove(item, field, index); }; - $scope.tablePairSave = $table.tablePairSave; - $scope.tablePairSaveVisible = $table.tablePairSaveVisible; + $scope.tablePairSave = LegacyTable.tablePairSave; + $scope.tablePairSaveVisible = LegacyTable.tablePairSaveVisible; $scope.queryFieldsTbl = { type: 'fields', @@ -160,7 +158,7 @@ consoleModule.controller('domainsController', [ save: $scope.tableSave }; - $scope.queryMetadataVariants = $common.mkOptions(['Annotations', 'Configuration']); + $scope.queryMetadataVariants = LegacyUtils.mkOptions(['Annotations', 'Configuration']); const INFO_CONNECT_TO_DB = 'Configure connection to database'; const INFO_SELECT_SCHEMAS = 'Select schemas to load tables from'; @@ -175,11 +173,11 @@ consoleModule.controller('domainsController', [ 'It may be a result of import tables from database without primary keys<br/>' + 'Key field for such key types should be configured manually'; - $scope.hidePopover = $common.hidePopover; + $scope.hidePopover = LegacyUtils.hidePopover; - const showPopoverMessage = $common.showPopoverMessage; + const showPopoverMessage = LegacyUtils.showPopoverMessage; - $scope.indexType = $common.mkOptions(['SORTED', 'FULLTEXT', 'GEOSPATIAL']); + $scope.indexType = LegacyUtils.mkOptions(['SORTED', 'FULLTEXT', 'GEOSPATIAL']); const _dbPresets = [ { @@ -269,8 +267,8 @@ consoleModule.controller('domainsController', [ localStorage.dbPresets = JSON.stringify(_dbPresets); } - catch (errMsg) { - $common.showError(errMsg); + catch (err) { + Messages.showError(err); } } @@ -304,9 +302,9 @@ consoleModule.controller('domainsController', [ $scope.ui.showValid = true; - $scope.supportedJdbcTypes = $common.mkOptions($common.SUPPORTED_JDBC_TYPES); + $scope.supportedJdbcTypes = LegacyUtils.mkOptions(LegacyUtils.SUPPORTED_JDBC_TYPES); - $scope.supportedJavaTypes = $common.mkOptions($common.javaBuiltInTypes); + $scope.supportedJavaTypes = LegacyUtils.mkOptions(LegacyUtils.javaBuiltInTypes); $scope.sortDirections = [ {value: true, label: 'ASC'}, @@ -319,7 +317,7 @@ consoleModule.controller('domainsController', [ const item = $scope.backupItem; if (item && item.keyType) - return $common.isJavaBuiltInClass(item.keyType); + return LegacyUtils.isJavaBuiltInClass(item.keyType); return false; }; @@ -331,7 +329,7 @@ consoleModule.controller('domainsController', [ }; $scope.selectSchema = function() { - if ($common.isDefined($scope.importDomain) && $common.isDefined($scope.importDomain.displayedSchemas)) + if (LegacyUtils.isDefined($scope.importDomain) && LegacyUtils.isDefined($scope.importDomain.displayedSchemas)) $scope.importDomain.allSchemasSelected = $scope.importDomain.displayedSchemas.length > 0 && _.every($scope.importDomain.displayedSchemas, 'use', true); }; @@ -344,7 +342,7 @@ consoleModule.controller('domainsController', [ }; $scope.selectTable = function() { - if ($common.isDefined($scope.importDomain) && $common.isDefined($scope.importDomain.displayedTables)) + if (LegacyUtils.isDefined($scope.importDomain) && LegacyUtils.isDefined($scope.importDomain.displayedTables)) $scope.importDomain.allTablesSelected = $scope.importDomain.displayedTables.length > 0 && _.every($scope.importDomain.displayedTables, 'use', true); }; @@ -378,9 +376,9 @@ consoleModule.controller('domainsController', [ * Show import domain models modal. */ $scope.showImportDomainModal = function() { - $table.tableReset(); + LegacyTable.tableReset(); - $common.confirmUnsavedChanges($scope.ui.inputForm.$dirty, function() { + LegacyUtils.confirmUnsavedChanges($scope.ui.inputForm.$dirty, function() { if ($scope.ui.inputForm.$dirty) $scope.backupItem = $scope.selectedItem ? angular.copy($scope.selectedItem) : prepareNewItem(); @@ -436,12 +434,12 @@ consoleModule.controller('domainsController', [ $scope.ui.selectedJdbcDriverJar = $scope.jdbcDriverJars[0].value; - $common.confirmUnsavedChanges($scope.ui.inputForm.$dirty, function() { + LegacyUtils.confirmUnsavedChanges($scope.ui.inputForm.$dirty, function() { importDomainModal.$promise.then(() => { $scope.importDomain.action = 'connect'; $scope.importDomain.tables = []; - $focus('jdbcUrl'); + Focus.move('jdbcUrl'); }); }); } @@ -489,12 +487,8 @@ consoleModule.controller('domainsController', [ $scope.importDomain.info = INFO_SELECT_SCHEMAS; }) - .catch(function(errMsg) { - $common.showError(errMsg); - }) - .finally(function() { - $loading.finish('importDomainFromDb'); - }); + .catch(Messages.showError) + .finally(() => $loading.finish('importDomainFromDb')); } const DFLT_PARTITIONED_CACHE = { @@ -621,7 +615,7 @@ consoleModule.controller('domainsController', [ tbl.cacheOrTemplate = DFLT_PARTITIONED_CACHE.value; tbl.label = tbl.schema + '.' + tbl.tbl; tbl.edit = false; - tbl.use = $common.isDefined(_.find(tbl.cols, function(col) { + tbl.use = LegacyUtils.isDefined(_.find(tbl.cols, function(col) { return col.key; })); }); @@ -630,12 +624,8 @@ consoleModule.controller('domainsController', [ $scope.importDomain.tables = tables; $scope.importDomain.info = INFO_SELECT_TABLES; }) - .catch(function(errMsg) { - $common.showError(errMsg); - }) - .finally(function() { - $loading.finish('importDomainFromDb'); - }); + .catch(Messages.showError) + .finally(() => $loading.finish('importDomainFromDb')); } $scope.applyDefaults = function() { @@ -678,7 +668,7 @@ consoleModule.controller('domainsController', [ $scope.importDomain.button = 'Save'; $scope.importDomain.info = INFO_SELECT_OPTIONS; - $focus('domainPackageName'); + Focus.move('domainPackageName'); } function _saveBatch(batch) { @@ -717,16 +707,14 @@ consoleModule.controller('domainsController', [ $scope.selectItem(lastItem); - $common.showInfo('Domain models imported from database.'); + Messages.showInfo('Domain models imported from database.'); $scope.ui.activePanels = [0, 1, 2]; $scope.ui.showValid = true; }) - .error(function(errMsg) { - $common.showError(errMsg); - }) - .finally(function() { + .error(Messages.showError) + .finally(() => { $loading.finish('importDomainFromDb'); importDomainModal.hide(); @@ -737,10 +725,10 @@ consoleModule.controller('domainsController', [ } function _saveDomainModel() { - if ($common.isEmptyString($scope.ui.packageName)) - return $common.showPopoverMessage(null, null, 'domainPackageName', 'Package could not be empty'); + if (LegacyUtils.isEmptyString($scope.ui.packageName)) + return LegacyUtils.showPopoverMessage(null, null, 'domainPackageName', 'Package could not be empty'); - if (!$common.isValidJavaClass('Package', $scope.ui.packageName, false, 'domainPackageName', true)) + if (!LegacyUtils.isValidJavaClass('Package', $scope.ui.packageName, false, 'domainPackageName', true)) return false; const batch = []; @@ -787,7 +775,7 @@ consoleModule.controller('domainsController', [ _.forEach(table.cols, function(col) { const colName = col.name; - const jdbcType = $common.findJdbcType(col.type); + const jdbcType = LegacyUtils.findJdbcType(col.type); const nullable = col.nullable; qryFields.push(queryField(colName, jdbcType)); @@ -835,7 +823,7 @@ consoleModule.controller('domainsController', [ caches: [] }; - if ($common.isDefined(domainFound)) { + if (LegacyUtils.isDefined(domainFound)) { newDomain._id = domainFound._id; newDomain.caches = domainFound.caches; newDomain.confirm = true; @@ -910,7 +898,7 @@ consoleModule.controller('domainsController', [ if (!_.includes(checkedCaches, cacheId)) { const cache = _.find($scope.caches, {value: cacheId}).cache; - const change = $common.autoCacheStoreConfiguration(cache, [newDomain]); + const change = LegacyUtils.autoCacheStoreConfiguration(cache, [newDomain]); if (change) newDomain.cacheStoreChanges = [{cacheId, change}]; @@ -941,9 +929,9 @@ consoleModule.controller('domainsController', [ function checkOverwrite() { if (itemsToConfirm.length > 0) { - $confirmBatch.confirm(overwriteMessage, itemsToConfirm) + ConfirmBatch.confirm(overwriteMessage, itemsToConfirm) .then(() => _saveBatch(_.filter(batch, (item) => !item.skip))) - .catch(() => $common.showError('Importing of domain models interrupted by user.')); + .catch(() => Messages.showError('Importing of domain models interrupted by user.')); } else _saveBatch(batch); @@ -952,7 +940,7 @@ consoleModule.controller('domainsController', [ if (containKey) checkOverwrite(); else { - $confirm.confirm('Some tables have no primary key.<br/>' + + Confirm.confirm('Some tables have no primary key.<br/>' + 'You will need to configure key type and key fields for such tables after import complete.') .then(() => checkOverwrite()); } @@ -1133,12 +1121,11 @@ consoleModule.controller('domainsController', [ form.$setDirty(); }, true); }) - .catch(function(errMsg) { - $common.showError(errMsg); - }) - .finally(function() { + .catch(Messages.showError) + .finally(() => { $scope.ui.ready = true; $scope.ui.inputForm.$setPristine(); + $loading.finish('loadingDomainModelsScreen'); }); @@ -1155,7 +1142,7 @@ consoleModule.controller('domainsController', [ function selectItem() { clearFormDefaults($scope.ui.inputForm); - $table.tableReset(); + LegacyTable.tableReset(); $scope.selectedItem = item; @@ -1180,25 +1167,25 @@ consoleModule.controller('domainsController', [ __original_value = $cleanup($scope.backupItem); - if ($common.isDefined($scope.backupItem) && !$common.isDefined($scope.backupItem.queryMetadata)) + if (LegacyUtils.isDefined($scope.backupItem) && !LegacyUtils.isDefined($scope.backupItem.queryMetadata)) $scope.backupItem.queryMetadata = 'Configuration'; - if ($common.isDefined($scope.selectedItem) && !$common.isDefined($scope.selectedItem.queryMetadata)) + if (LegacyUtils.isDefined($scope.selectedItem) && !LegacyUtils.isDefined($scope.selectedItem.queryMetadata)) $scope.selectedItem.queryMetadata = 'Configuration'; - if ($common.getQueryVariable('new')) + if (LegacyUtils.getQueryVariable('new')) $state.go('base.configuration.domains'); } - $common.confirmUnsavedChanges($scope.ui.inputForm.$dirty, selectItem); + LegacyUtils.confirmUnsavedChanges($scope.ui.inputForm.$dirty, selectItem); }; // Add new domain model. $scope.createItem = function(cacheId) { if ($scope.tableReset(true)) { $timeout(() => { - $common.ensureActivePanel($scope.ui, 'query'); - $common.ensureActivePanel($scope.ui, 'general', 'keyType'); + LegacyUtils.ensureActivePanel($scope.ui, 'query'); + LegacyUtils.ensureActivePanel($scope.ui, 'general', 'keyType'); }); $scope.selectItem(null, prepareNewItem(cacheId)); @@ -1206,7 +1193,7 @@ consoleModule.controller('domainsController', [ }; function checkQueryConfiguration(item) { - if (item.queryMetadata === 'Configuration' && $common.domainForQueryConfigured(item)) { + if (item.queryMetadata === 'Configuration' && LegacyUtils.domainForQueryConfigured(item)) { if (_.isEmpty(item.fields)) return showPopoverMessage($scope.ui, 'query', 'queryFields', 'Query fields should not be empty'); @@ -1225,17 +1212,17 @@ consoleModule.controller('domainsController', [ } function checkStoreConfiguration(item) { - if ($common.domainForStoreConfigured(item)) { - if ($common.isEmptyString(item.databaseSchema)) + if (LegacyUtils.domainForStoreConfigured(item)) { + if (LegacyUtils.isEmptyString(item.databaseSchema)) return showPopoverMessage($scope.ui, 'store', 'databaseSchema', 'Database schema should not be empty'); - if ($common.isEmptyString(item.databaseTable)) + if (LegacyUtils.isEmptyString(item.databaseTable)) return showPopoverMessage($scope.ui, 'store', 'databaseTable', 'Database table should not be empty'); if (_.isEmpty(item.keyFields)) return showPopoverMessage($scope.ui, 'store', 'keyFields', 'Key fields are not specified'); - if ($common.isJavaBuiltInClass(item.keyType) && item.keyFields.length !== 1) + if (LegacyUtils.isJavaBuiltInClass(item.keyType) && item.keyFields.length !== 1) return showPopoverMessage($scope.ui, 'store', 'keyFields', 'Only one field should be specified in case when key type is a Java built-in type'); if (_.isEmpty(item.valueFields)) @@ -1247,7 +1234,7 @@ consoleModule.controller('domainsController', [ // Check domain model logical consistency. function validate(item) { - if (!$common.checkFieldValidators($scope.ui)) + if (!LegacyUtils.checkFieldValidators($scope.ui)) return false; if (!checkQueryConfiguration(item)) @@ -1256,7 +1243,7 @@ consoleModule.controller('domainsController', [ if (!checkStoreConfiguration(item)) return false; - if (!$common.domainForStoreConfigured(item) && !$common.domainForQueryConfigured(item) && item.queryMetadata === 'Configuration') + if (!LegacyUtils.domainForStoreConfigured(item) && !LegacyUtils.domainForQueryConfigured(item) && item.queryMetadata === 'Configuration') return showPopoverMessage($scope.ui, 'query', 'query-title', 'SQL query domain model should be configured'); return true; @@ -1272,8 +1259,8 @@ consoleModule.controller('domainsController', [ // Save domain models into database. function save(item) { - const qry = $common.domainForQueryConfigured(item); - const str = $common.domainForStoreConfigured(item); + const qry = LegacyUtils.domainForQueryConfigured(item); + const str = LegacyUtils.domainForStoreConfigured(item); item.kind = 'query'; @@ -1306,13 +1293,11 @@ consoleModule.controller('domainsController', [ $scope.selectItem(savedMeta); - $common.showInfo('Domain model "' + item.valueType + '" saved.'); + Messages.showInfo('Domain model "' + item.valueType + '" saved.'); _checkShowValidPresentation(); }) - .error(function(errMsg) { - $common.showError(errMsg); - }); + .error(Messages.showError); } // Save domain model. @@ -1325,7 +1310,7 @@ consoleModule.controller('domainsController', [ _.forEach(item.caches, function(cacheId) { const cache = _.find($scope.caches, {value: cacheId}).cache; - const change = $common.autoCacheStoreConfiguration(cache, [item]); + const change = LegacyUtils.autoCacheStoreConfiguration(cache, [item]); if (change) item.cacheStoreChanges.push({cacheId, change}); @@ -1343,13 +1328,13 @@ consoleModule.controller('domainsController', [ } function _newNameIsValidJavaClass(newName) { - return $common.isValidJavaClass('New name for value type', newName, false, 'copy-new-name'); + return LegacyUtils.isValidJavaClass('New name for value type', newName, false, 'copy-new-name'); } // Save domain model with new name. $scope.cloneItem = function() { if ($scope.tableReset(true) && validate($scope.backupItem)) { - $clone.confirm($scope.backupItem.valueType, _domainNames(), _newNameIsValidJavaClass).then(function(newName) { + Clone.confirm($scope.backupItem.valueType, _domainNames(), _newNameIsValidJavaClass).then(function(newName) { const item = angular.copy($scope.backupItem); delete item._id; @@ -1362,17 +1347,17 @@ consoleModule.controller('domainsController', [ // Remove domain model from db. $scope.removeItem = function() { - $table.tableReset(); + LegacyTable.tableReset(); const selectedItem = $scope.selectedItem; - $confirm.confirm('Are you sure you want to remove domain model: "' + selectedItem.valueType + '"?') + Confirm.confirm('Are you sure you want to remove domain model: "' + selectedItem.valueType + '"?') .then(function() { const _id = selectedItem._id; $http.post('/api/v1/configuration/domains/remove', {_id}) .success(function() { - $common.showInfo('Domain model has been removed: ' + selectedItem.valueType); + Messages.showInfo('Domain model has been removed: ' + selectedItem.valueType); const domains = $scope.domains; @@ -1395,21 +1380,19 @@ consoleModule.controller('domainsController', [ _checkShowValidPresentation(); }) - .error(function(errMsg) { - $common.showError(errMsg); - }); + .error(Messages.showError); }); }; // Remove all domain models from db. $scope.removeAllItems = function() { - $table.tableReset(); + LegacyTable.tableReset(); - $confirm.confirm('Are you sure you want to remove all domain models?') + Confirm.confirm('Are you sure you want to remove all domain models?') .then(function() { $http.post('/api/v1/configuration/domains/remove/all') .success(function() { - $common.showInfo('All domain models have been removed'); + Messages.showInfo('All domain models have been removed'); $scope.domains = []; @@ -1419,9 +1402,7 @@ consoleModule.controller('domainsController', [ $scope.backupItem = emptyDomain; $scope.ui.showValid = true; }) - .error(function(errMsg) { - $common.showError(errMsg); - }); + .error(Messages.showError); }); }; @@ -1432,7 +1413,7 @@ consoleModule.controller('domainsController', [ let idx = -1; - if ($common.isDefined($scope.selectedItem)) { + if (LegacyUtils.isDefined($scope.selectedItem)) { idx = _.findIndex(validFilter($scope.domains, $scope.ui.showValid, true), function(domain) { return domain._id === $scope.selectedItem._id; }); @@ -1458,23 +1439,23 @@ consoleModule.controller('domainsController', [ $scope.tablePairValid = function(item, field, index) { const pairField = pairFields[field.model]; - const pairValue = $table.tablePairValue(field, index); + const pairValue = LegacyTable.tablePairValue(field, index); if (pairField) { const model = item[field.model]; - if ($common.isDefined(model)) { + if (LegacyUtils.isDefined(model)) { const idx = _.findIndex(model, function(pair) { return pair[pairField.searchCol] === pairValue[pairField.valueCol]; }); // Found duplicate by key. if (idx >= 0 && idx !== index) - return showPopoverMessage($scope.ui, 'query', $table.tableFieldId(index, pairField.idPrefix + pairField.id), 'Field with such ' + pairField.dupObjName + ' already exists!'); + return showPopoverMessage($scope.ui, 'query', LegacyTable.tableFieldId(index, pairField.idPrefix + pairField.id), 'Field with such ' + pairField.dupObjName + ' already exists!'); } - if (pairField.classValidation && !$common.isValidJavaClass(pairField.msg, pairValue.value, true, $table.tableFieldId(index, 'Value' + pairField.id), false, $scope.ui, 'query')) - return $table.tableFocusInvalidField(index, 'Value' + pairField.id); + if (pairField.classValidation && !LegacyUtils.isValidJavaClass(pairField.msg, pairValue.value, true, LegacyTable.tableFieldId(index, 'Value' + pairField.id), false, $scope.ui, 'query')) + return LegacyTable.tableFocusInvalidField(index, 'Value' + pairField.id); } return true; @@ -1497,10 +1478,10 @@ consoleModule.controller('domainsController', [ $scope.tableDbFieldSaveVisible = function(field, index) { const dbFieldValue = tableDbFieldValue(field, index); - return $common.isDefined(dbFieldValue.databaseFieldType) && - $common.isDefined(dbFieldValue.javaFieldType) && - !$common.isEmptyString(dbFieldValue.databaseFieldName) && - !$common.isEmptyString(dbFieldValue.javaFieldName); + return LegacyUtils.isDefined(dbFieldValue.databaseFieldType) && + LegacyUtils.isDefined(dbFieldValue.javaFieldType) && + !LegacyUtils.isEmptyString(dbFieldValue.databaseFieldName) && + !LegacyUtils.isEmptyString(dbFieldValue.javaFieldName); }; const dbFieldTables = { @@ -1518,17 +1499,17 @@ consoleModule.controller('domainsController', [ let model = item[field.model]; - if (!$common.isValidJavaIdentifier(dbFieldTable.msg + ' java name', dbFieldValue.javaFieldName, $table.tableFieldId(index, 'JavaFieldName' + dbFieldTable.id))) + if (!LegacyUtils.isValidJavaIdentifier(dbFieldTable.msg + ' java name', dbFieldValue.javaFieldName, LegacyTable.tableFieldId(index, 'JavaFieldName' + dbFieldTable.id))) return false; - if ($common.isDefined(model)) { + if (LegacyUtils.isDefined(model)) { let idx = _.findIndex(model, function(dbMeta) { return dbMeta.databaseFieldName === dbFieldValue.databaseFieldName; }); // Found duplicate. if (idx >= 0 && index !== idx) - return showPopoverMessage($scope.ui, 'store', $table.tableFieldId(index, 'DatabaseFieldName' + dbFieldTable.id), 'Field with such database name already exists!'); + return showPopoverMessage($scope.ui, 'store', LegacyTable.tableFieldId(index, 'DatabaseFieldName' + dbFieldTable.id), 'Field with such database name already exists!'); idx = _.findIndex(model, function(dbMeta) { return dbMeta.javaFieldName === dbFieldValue.javaFieldName; @@ -1536,7 +1517,7 @@ consoleModule.controller('domainsController', [ // Found duplicate. if (idx >= 0 && index !== idx) - return showPopoverMessage($scope.ui, 'store', $table.tableFieldId(index, 'JavaFieldName' + dbFieldTable.id), 'Field with such java name already exists!'); + return showPopoverMessage($scope.ui, 'store', LegacyTable.tableFieldId(index, 'JavaFieldName' + dbFieldTable.id), 'Field with such java name already exists!'); if (index < 0) model.push(dbFieldValue); @@ -1557,11 +1538,11 @@ consoleModule.controller('domainsController', [ if (!stopEdit) { if (index < 0) - $table.tableNewItem(field); + LegacyTable.tableNewItem(field); else if (index < model.length - 1) - $table.tableStartEdit(item, field, index + 1); + LegacyTable.tableStartEdit(item, field, index + 1); else - $table.tableNewItem(field); + LegacyTable.tableNewItem(field); } return true; @@ -1579,7 +1560,7 @@ consoleModule.controller('domainsController', [ } $scope.tableIndexSaveVisible = function(field, index) { - return !$common.isEmptyString(tableIndexName(field, index)) && $common.isDefined(tableIndexType(field, index)); + return !LegacyUtils.isEmptyString(tableIndexName(field, index)) && LegacyUtils.isDefined(tableIndexType(field, index)); }; $scope.tableIndexSave = function(field, curIdx, stopEdit) { @@ -1590,17 +1571,17 @@ consoleModule.controller('domainsController', [ const indexes = item.indexes; - if ($common.isDefined(indexes)) { + if (LegacyUtils.isDefined(indexes)) { const idx = _.findIndex(indexes, function(index) { return index.name === indexName; }); // Found duplicate. if (idx >= 0 && idx !== curIdx) - return showPopoverMessage($scope.ui, 'query', $table.tableFieldId(curIdx, 'IndexName'), 'Index with such name already exists!'); + return showPopoverMessage($scope.ui, 'query', LegacyTable.tableFieldId(curIdx, 'IndexName'), 'Index with such name already exists!'); } - $table.tableReset(); + LegacyTable.tableReset(); if (curIdx < 0) { const newIndex = {name: indexName, indexType}; @@ -1635,8 +1616,8 @@ consoleModule.controller('domainsController', [ if ($scope.tableReset(true)) { const index = $scope.backupItem.indexes[indexIdx]; - $table.tableState(field, -1, 'table-index-fields'); - $table.tableFocusInvalidField(-1, 'FieldName' + (index.indexType === 'SORTED' ? 'S' : '') + indexIdx); + LegacyTable.tableState(field, -1, 'table-index-fields'); + LegacyTable.tableFocusInvalidField(-1, 'FieldName' + (index.indexType === 'SORTED' ? 'S' : '') + indexIdx); field.newFieldName = null; field.newDirection = true; @@ -1651,7 +1632,7 @@ consoleModule.controller('domainsController', [ const index = indexes[itemIndex]; if (index) - return $table.tableNewItemActive({model: 'table-index-fields'}) && field.indexIdx === itemIndex; + return LegacyTable.tableNewItemActive({model: 'table-index-fields'}) && field.indexIdx === itemIndex; } return false; @@ -1664,7 +1645,7 @@ consoleModule.controller('domainsController', [ const index = indexes[itemIndex]; if (index) - return $table.tableEditing({model: 'table-index-fields'}, curIdx) && field.indexIdx === itemIndex; + return LegacyTable.tableEditing({model: 'table-index-fields'}, curIdx) && field.indexIdx === itemIndex; } return false; @@ -1684,7 +1665,7 @@ consoleModule.controller('domainsController', [ if ($scope.tableReset(true)) { const index = $scope.backupItem.indexes[indexIdx]; - $table.tableState(field, curIdx, 'table-index-fields'); + LegacyTable.tableState(field, curIdx, 'table-index-fields'); const indexItem = index.fields[curIdx]; @@ -1692,12 +1673,12 @@ consoleModule.controller('domainsController', [ field.curDirection = indexItem.direction; field.indexIdx = indexIdx; - $focus('curFieldName' + (index.indexType === 'SORTED' ? 'S' : '') + field.indexIdx + '-' + curIdx); + Focus.move('curFieldName' + (index.indexType === 'SORTED' ? 'S' : '') + field.indexIdx + '-' + curIdx); } }; $scope.tableIndexItemSaveVisible = function(field, index) { - return !$common.isEmptyString(tableIndexItemValue(field, index).name); + return !LegacyUtils.isEmptyString(tableIndexItemValue(field, index).name); }; $scope.tableIndexItemSave = function(field, indexIdx, curIdx, stopEdit) { @@ -1707,15 +1688,15 @@ consoleModule.controller('domainsController', [ const fields = index.fields; - if ($common.isDefined(fields)) { + if (LegacyUtils.isDefined(fields)) { const idx = _.findIndex(fields, (fld) => fld.name === indexItemValue.name); // Found duplicate. if (idx >= 0 && idx !== curIdx) - return showPopoverMessage($scope.ui, 'query', $table.tableFieldId(curIdx, 'FieldName' + (index.indexType === 'SORTED' ? 'S' : '') + indexIdx + (curIdx >= 0 ? '-' : '')), 'Field with such name already exists in index!'); + return showPopoverMessage($scope.ui, 'query', LegacyTable.tableFieldId(curIdx, 'FieldName' + (index.indexType === 'SORTED' ? 'S' : '') + indexIdx + (curIdx >= 0 ? '-' : '')), 'Field with such name already exists in index!'); } - $table.tableReset(); + LegacyTable.tableReset(); field.indexIdx = -1; @@ -1743,19 +1724,19 @@ consoleModule.controller('domainsController', [ }; $scope.tableRemoveIndexItem = function(index, curIdx) { - $table.tableReset(); + LegacyTable.tableReset(); index.fields.splice(curIdx, 1); }; $scope.resetAll = function() { - $table.tableReset(); + LegacyTable.tableReset(); - $confirm.confirm('Are you sure you want to undo all changes for current domain model?') + Confirm.confirm('Are you sure you want to undo all changes for current domain model?') .then(function() { $scope.backupItem = $scope.selectedItem ? angular.copy($scope.selectedItem) : prepareNewItem(); $scope.ui.inputForm.$setPristine(); }); }; - }] -); + } +]];
http://git-wip-us.apache.org/repos/asf/ignite/blob/00d8c0af/modules/web-console/src/main/js/controllers/igfs-controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/controllers/igfs-controller.js b/modules/web-console/src/main/js/controllers/igfs-controller.js index c37d08f..d2907a3 100644 --- a/modules/web-console/src/main/js/controllers/igfs-controller.js +++ b/modules/web-console/src/main/js/controllers/igfs-controller.js @@ -16,12 +16,10 @@ */ // Controller for IGFS screen. -import consoleModule from 'controllers/common-module'; - -consoleModule.controller('igfsController', [ - '$scope', '$http', '$state', '$filter', '$timeout', '$common', '$confirm', '$clone', '$loading', '$cleanup', '$unsavedChangesGuard', '$table', - function($scope, $http, $state, $filter, $timeout, $common, $confirm, $clone, $loading, $cleanup, $unsavedChangesGuard, $table) { - $unsavedChangesGuard.install($scope); +export default ['igfsController', [ + '$scope', '$http', '$state', '$filter', '$timeout', 'IgniteLegacyUtils', 'IgniteMessages', 'IgniteConfirm', 'IgniteClone', '$loading', '$cleanup', 'IgniteUnsavedChangesGuard', 'IgniteLegacyTable', + function($scope, $http, $state, $filter, $timeout, LegacyUtils, Messages, Confirm, Clone, $loading, $cleanup, UnsavedChangesGuard, LegacyTable) { + UnsavedChangesGuard.install($scope); const emptyIgfs = {empty: true}; @@ -35,69 +33,68 @@ consoleModule.controller('igfsController', [ // We need to initialize backupItem with empty object in order to properly used from angular directives. $scope.backupItem = emptyIgfs; - $scope.ui = $common.formUI(); + $scope.ui = LegacyUtils.formUI(); $scope.ui.activePanels = [0]; $scope.ui.topPanels = [0]; - $scope.compactJavaName = $common.compactJavaName; - $scope.widthIsSufficient = $common.widthIsSufficient; - $scope.saveBtnTipText = $common.saveBtnTipText; + $scope.compactJavaName = LegacyUtils.compactJavaName; + $scope.widthIsSufficient = LegacyUtils.widthIsSufficient; + $scope.saveBtnTipText = LegacyUtils.saveBtnTipText; - const showPopoverMessage = $common.showPopoverMessage; + const showPopoverMessage = LegacyUtils.showPopoverMessage; - // TODO LEGACY start $scope.tableSave = function(field, index, stopEdit) { - if (field.type === 'pathModes' && $table.tablePairSaveVisible(field, index)) - return $table.tablePairSave($scope.tablePairValid, $scope.backupItem, field, index, stopEdit); + if (field.type === 'pathModes' && LegacyTable.tablePairSaveVisible(field, index)) + return LegacyTable.tablePairSave($scope.tablePairValid, $scope.backupItem, field, index, stopEdit); return true; }; $scope.tableReset = (trySave) => { - const field = $table.tableField(); + const field = LegacyTable.tableField(); - if (trySave && $common.isDefined(field) && !$scope.tableSave(field, $table.tableEditedRowIndex(), true)) + if (trySave && LegacyUtils.isDefined(field) && !$scope.tableSave(field, LegacyTable.tableEditedRowIndex(), true)) return false; - $table.tableReset(); + LegacyTable.tableReset(); return true; }; $scope.tableNewItem = function(field) { if ($scope.tableReset(true)) - $table.tableNewItem(field); + LegacyTable.tableNewItem(field); }; - $scope.tableNewItemActive = $table.tableNewItemActive; + $scope.tableNewItemActive = LegacyTable.tableNewItemActive; $scope.tableStartEdit = function(item, field, index) { if ($scope.tableReset(true)) - $table.tableStartEdit(item, field, index, $scope.tableSave); + LegacyTable.tableStartEdit(item, field, index, $scope.tableSave); }; - $scope.tableEditing = $table.tableEditing; - $scope.tablePairSave = $table.tablePairSave; - $scope.tablePairSaveVisible = $table.tablePairSaveVisible; + $scope.tableEditing = LegacyTable.tableEditing; + $scope.tablePairSave = LegacyTable.tablePairSave; + $scope.tablePairSaveVisible = LegacyTable.tablePairSaveVisible; $scope.tableRemove = function(item, field, index) { if ($scope.tableReset(true)) - $table.tableRemove(item, field, index); + LegacyTable.tableRemove(item, field, index); }; $scope.tablePairValid = function(item, field, index) { - const pairValue = $table.tablePairValue(field, index); + const pairValue = LegacyTable.tablePairValue(field, index); const model = item[field.model]; - if ($common.isDefined(model)) { + if (LegacyUtils.isDefined(model)) { const idx = _.findIndex(model, function(pair) { return pair.path === pairValue.key; }); // Found duplicate. if (idx >= 0 && idx !== index) - return showPopoverMessage($scope.ui, 'misc', $table.tableFieldId(index, 'KeyPathMode'), 'Such path already exists!'); + return showPopoverMessage($scope.ui, 'misc', LegacyTable.tableFieldId(index, 'KeyPathMode'), 'Such path already exists!'); } return true; @@ -113,8 +110,7 @@ consoleModule.controller('igfsController', [ save: $scope.tableSave }; - $scope.igfsModes = $common.mkOptions(['PRIMARY', 'PROXY', 'DUAL_SYNC', 'DUAL_ASYNC']); - // TODO LEGACY start - end + $scope.igfsModes = LegacyUtils.mkOptions(['PRIMARY', 'PROXY', 'DUAL_SYNC', 'DUAL_ASYNC']); $scope.contentVisible = function() { const item = $scope.backupItem; @@ -125,7 +121,7 @@ consoleModule.controller('igfsController', [ $scope.toggleExpanded = function() { $scope.ui.expanded = !$scope.ui.expanded; - $common.hidePopover(); + LegacyUtils.hidePopover(); }; $scope.igfss = []; @@ -197,9 +193,7 @@ consoleModule.controller('igfsController', [ form.$setDirty(); }, true); }) - .catch(function(errMsg) { - $common.showError(errMsg); - }) + .catch(Messages.showError) .finally(function() { $scope.ui.ready = true; $scope.ui.inputForm.$setPristine(); @@ -208,7 +202,7 @@ consoleModule.controller('igfsController', [ $scope.selectItem = function(item, backup) { function selectItem() { - $table.tableReset(); // TODO LEGACY + LegacyTable.tableReset(); $scope.selectedItem = item; @@ -233,11 +227,11 @@ consoleModule.controller('igfsController', [ __original_value = $cleanup($scope.backupItem); - if ($common.getQueryVariable('new')) + if (LegacyUtils.getQueryVariable('new')) $state.go('base.configuration.igfs'); } - $common.confirmUnsavedChanges($scope.backupItem && $scope.ui.inputForm.$dirty, selectItem); + LegacyUtils.confirmUnsavedChanges($scope.backupItem && $scope.ui.inputForm.$dirty, selectItem); }; $scope.linkId = () => $scope.backupItem._id ? $scope.backupItem._id : 'create'; @@ -256,8 +250,8 @@ consoleModule.controller('igfsController', [ // Add new IGFS. $scope.createItem = function(linkId) { - if ($scope.tableReset(true)) { // TODO LEGACY - $timeout(() => $common.ensureActivePanel($scope.ui, 'general', 'igfsName')); + if ($scope.tableReset(true)) { + $timeout(() => LegacyUtils.ensureActivePanel($scope.ui, 'general', 'igfsName')); $scope.selectItem(null, prepareNewItem(linkId)); } @@ -265,12 +259,12 @@ consoleModule.controller('igfsController', [ // Check IGFS logical consistency. function validate(item) { - $common.hidePopover(); + LegacyUtils.hidePopover(); - if ($common.isEmptyString(item.name)) + if (LegacyUtils.isEmptyString(item.name)) return showPopoverMessage($scope.ui, 'general', 'igfsName', 'IGFS name should not be empty!'); - if (!$common.checkFieldValidators($scope.ui)) + if (!LegacyUtils.checkFieldValidators($scope.ui)) return false; if (!item.secondaryFileSystemEnabled && (item.defaultMode === 'PROXY')) @@ -305,16 +299,14 @@ consoleModule.controller('igfsController', [ $scope.selectItem(item); - $common.showInfo('IGFS "' + item.name + '" saved.'); + Messages.showInfo('IGFS "' + item.name + '" saved.'); }) - .error(function(errMsg) { - $common.showError(errMsg); - }); + .error(Messages.showError); } // Save IGFS. $scope.saveItem = function() { - if ($scope.tableReset(true)) { // TODO LEGACY + if ($scope.tableReset(true)) { const item = $scope.backupItem; if (validate(item)) @@ -330,8 +322,8 @@ consoleModule.controller('igfsController', [ // Clone IGFS with new name. $scope.cloneItem = function() { - if ($scope.tableReset(true) && validate($scope.backupItem)) { // TODO LEGACY - $clone.confirm($scope.backupItem.name, _igfsNames()).then(function(newName) { + if ($scope.tableReset(true) && validate($scope.backupItem)) { + Clone.confirm($scope.backupItem.name, _igfsNames()).then(function(newName) { const item = angular.copy($scope.backupItem); delete item._id; @@ -345,17 +337,17 @@ consoleModule.controller('igfsController', [ // Remove IGFS from db. $scope.removeItem = function() { - $table.tableReset(); // TODO LEGACY + LegacyTable.tableReset(); const selectedItem = $scope.selectedItem; - $confirm.confirm('Are you sure you want to remove IGFS: "' + selectedItem.name + '"?') + Confirm.confirm('Are you sure you want to remove IGFS: "' + selectedItem.name + '"?') .then(function() { const _id = selectedItem._id; $http.post('/api/v1/configuration/igfs/remove', {_id}) .success(function() { - $common.showInfo('IGFS has been removed: ' + selectedItem.name); + Messages.showInfo('IGFS has been removed: ' + selectedItem.name); const igfss = $scope.igfss; @@ -374,40 +366,36 @@ consoleModule.controller('igfsController', [ } } }) - .error(function(errMsg) { - $common.showError(errMsg); - }); + .error(Messages.showError); }); }; // Remove all IGFS from db. $scope.removeAllItems = function() { - $table.tableReset(); // TODO LEGACY + LegacyTable.tableReset(); - $confirm.confirm('Are you sure you want to remove all IGFS?') + Confirm.confirm('Are you sure you want to remove all IGFS?') .then(function() { $http.post('/api/v1/configuration/igfs/remove/all') .success(function() { - $common.showInfo('All IGFS have been removed'); + Messages.showInfo('All IGFS have been removed'); $scope.igfss = []; $scope.backupItem = emptyIgfs; $scope.ui.inputForm.$setPristine(); }) - .error(function(errMsg) { - $common.showError(errMsg); - }); + .error(Messages.showError); }); }; $scope.resetAll = function() { - $table.tableReset(); // TODO LEGACY + LegacyTable.tableReset(); - $confirm.confirm('Are you sure you want to undo all changes for current IGFS?') + Confirm.confirm('Are you sure you want to undo all changes for current IGFS?') .then(function() { $scope.backupItem = $scope.selectedItem ? angular.copy($scope.selectedItem) : prepareNewItem(); $scope.ui.inputForm.$setPristine(); }); }; - }] -); + } +]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/00d8c0af/modules/web-console/src/main/js/controllers/profile-controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/controllers/profile-controller.js b/modules/web-console/src/main/js/controllers/profile-controller.js index 8fe14cc..e49201a 100644 --- a/modules/web-console/src/main/js/controllers/profile-controller.js +++ b/modules/web-console/src/main/js/controllers/profile-controller.js @@ -16,18 +16,16 @@ */ // Controller for Profile screen. -import consoleModule from 'controllers/common-module'; - -consoleModule.controller('profileController', [ - '$rootScope', '$scope', '$http', '$common', '$focus', '$confirm', 'IgniteCountries', 'User', - function($root, $scope, $http, $common, $focus, $confirm, Countries, User) { +export default ['profileController', [ + '$rootScope', '$scope', '$http', 'IgniteLegacyUtils', 'IgniteMessages', 'IgniteFocus', 'IgniteConfirm', 'IgniteCountries', 'User', + function($root, $scope, $http, LegacyUtils, Messages, Focus, Confirm, Countries, User) { $scope.user = angular.copy($root.user); $scope.countries = Countries.getAll(); $scope.generateToken = () => { - $confirm.confirm('Are you sure you want to change security token?') - .then(() => $scope.user.token = $common.randomString(20)); + Confirm.confirm('Are you sure you want to change security token?') + .then(() => $scope.user.token = LegacyUtils.randomString(20)); }; const _passwordValid = () => { @@ -54,7 +52,7 @@ consoleModule.controller('profileController', [ $scope.expandedPassword = !$scope.expandedPassword; if ($scope.expandedPassword) - $focus('profile_password'); + Focus.move('profile_password'); else { delete $scope.user.password; delete $scope.user.confirm; @@ -83,11 +81,11 @@ consoleModule.controller('profileController', [ if ($scope.expandedToken) $scope.toggleToken(); - $common.showInfo('Profile saved.'); + Messages.showInfo('Profile saved.'); - $focus('profile-username'); + Focus.move('profile-username'); }) - .catch((err) => $common.showError('Failed to save profile: ' + $common.errorMessage(err))); + .catch((err) => Messages.showError(Messages.errorMessage('Failed to save profile: ', err))); }; - }] -); + } +]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/00d8c0af/modules/web-console/src/main/js/controllers/sql-controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/controllers/sql-controller.js b/modules/web-console/src/main/js/controllers/sql-controller.js index 800ea13..b2e314a 100644 --- a/modules/web-console/src/main/js/controllers/sql-controller.js +++ b/modules/web-console/src/main/js/controllers/sql-controller.js @@ -16,11 +16,9 @@ */ // Controller for SQL notebook screen. -import consoleModule from 'controllers/common-module'; - -consoleModule.controller('sqlController', [ - '$rootScope', '$scope', '$http', '$q', '$timeout', '$interval', '$animate', '$location', '$anchorScroll', '$state', '$modal', '$popover', '$loading', '$common', '$confirm', 'IgniteAgentMonitor', 'IgniteChartColors', 'QueryNotebooks', 'uiGridConstants', 'uiGridExporterConstants', - function($root, $scope, $http, $q, $timeout, $interval, $animate, $location, $anchorScroll, $state, $modal, $popover, $loading, $common, $confirm, agentMonitor, IgniteChartColors, QueryNotebooks, uiGridConstants, uiGridExporterConstants) { +export default ['sqlController', [ + '$rootScope', '$scope', '$http', '$q', '$timeout', '$interval', '$animate', '$location', '$anchorScroll', '$state', '$modal', '$popover', '$loading', 'IgniteLegacyUtils', 'IgniteMessages', 'IgniteConfirm', 'IgniteAgentMonitor', 'IgniteChartColors', 'QueryNotebooks', 'uiGridConstants', 'uiGridExporterConstants', + function($root, $scope, $http, $q, $timeout, $interval, $animate, $location, $anchorScroll, $state, $modal, $popover, $loading, LegacyUtils, Messages, Confirm, agentMonitor, IgniteChartColors, QueryNotebooks, uiGridConstants, uiGridExporterConstants) { let stopTopology = null; const _tryStopRefresh = function(paragraph) { @@ -48,7 +46,7 @@ consoleModule.controller('sqlController', [ $scope.aggregateFxs = ['FIRST', 'LAST', 'MIN', 'MAX', 'SUM', 'AVG', 'COUNT']; - $scope.modes = $common.mkOptions(['PARTITIONED', 'REPLICATED', 'LOCAL']); + $scope.modes = LegacyUtils.mkOptions(['PARTITIONED', 'REPLICATED', 'LOCAL']); $scope.loadingText = $root.IgniteDemoMode ? 'Demo grid is starting. Please wait...' : 'Loading notebook screen...'; @@ -79,10 +77,6 @@ consoleModule.controller('sqlController', [ $scope.maskCacheName = (cacheName) => _.isEmpty(cacheName) ? '<default>' : cacheName; - const _handleException = function(err) { - $common.showError(err); - }; - // Time line X axis descriptor. const TIME_LINE = {value: -1, type: 'java.sql.Date', label: 'TIME_LINE'}; @@ -856,7 +850,7 @@ consoleModule.controller('sqlController', [ .catch((err) => { $scope.notebook.name = prevName; - _handleException(err); + Messages.showError(err); }); } else @@ -864,7 +858,7 @@ consoleModule.controller('sqlController', [ }; $scope.removeNotebook = function() { - $confirm.confirm('Are you sure you want to remove: "' + $scope.notebook.name + '"?') + Confirm.confirm('Are you sure you want to remove: "' + $scope.notebook.name + '"?') .then(function() { return QueryNotebooks.remove($scope.notebook); }) @@ -874,7 +868,7 @@ consoleModule.controller('sqlController', [ else $state.go('base.configuration.clusters'); }) - .catch(_handleException); + .catch(Messages.showError); }; $scope.renameParagraph = function(paragraph, newName) { @@ -887,8 +881,8 @@ consoleModule.controller('sqlController', [ $scope.rebuildScrollParagraphs(); QueryNotebooks.save($scope.notebook) - .then(function() { paragraph.edit = false; }) - .catch(_handleException); + .then(() => paragraph.edit = false) + .catch(Messages.showError); } else paragraph.edit = false; @@ -935,7 +929,7 @@ consoleModule.controller('sqlController', [ if (!_.isEmpty(paragraph.charts)) { const chart = paragraph.charts[0].api.getScope().chart; - if (!$common.isDefined(paragraph.chartsOptions)) + if (!LegacyUtils.isDefined(paragraph.chartsOptions)) paragraph.chartsOptions = {barChart: {stacked: true}, areaChart: {style: 'stack'}}; switch (paragraph.result) { @@ -973,7 +967,7 @@ consoleModule.controller('sqlController', [ }; $scope.removeParagraph = function(paragraph) { - $confirm.confirm('Are you sure you want to remove: "' + paragraph.name + '"?') + Confirm.confirm('Are you sure you want to remove: "' + paragraph.name + '"?') .then(function() { $scope.stopRefresh(paragraph); @@ -993,7 +987,7 @@ consoleModule.controller('sqlController', [ $scope.rebuildScrollParagraphs(); QueryNotebooks.save($scope.notebook) - .catch(_handleException); + .catch(Messages.showError); }); }; @@ -1014,7 +1008,7 @@ consoleModule.controller('sqlController', [ }; const _notObjectType = function(cls) { - return $common.isJavaBuiltInClass(cls); + return LegacyUtils.isJavaBuiltInClass(cls); }; function _retainColumns(allCols, curCols, acceptableType, xAxis, unwantedCols) { @@ -1061,7 +1055,7 @@ consoleModule.controller('sqlController', [ _.forEach(colsByTypes, function(colsByType, typeName) { _.forEach(colsByType, function(col, ix) { - col.fieldName = (needType && !$common.isEmptyString(typeName) ? typeName + '.' : '') + fieldName + (ix > 0 ? ix : ''); + col.fieldName = (needType && !LegacyUtils.isEmptyString(typeName) ? typeName + '.' : '') + fieldName + (ix > 0 ? ix : ''); }); }); }); @@ -1132,10 +1126,10 @@ consoleModule.controller('sqlController', [ paragraph.chartColumns = []; - if (!$common.isDefined(paragraph.chartKeyCols)) + if (!LegacyUtils.isDefined(paragraph.chartKeyCols)) paragraph.chartKeyCols = []; - if (!$common.isDefined(paragraph.chartValCols)) + if (!LegacyUtils.isDefined(paragraph.chartValCols)) paragraph.chartValCols = []; if (res.fieldsMetadata.length <= 2) { @@ -1248,7 +1242,7 @@ consoleModule.controller('sqlController', [ $scope.execute = function(paragraph) { QueryNotebooks.save($scope.notebook) - .catch(_handleException); + .catch(Messages.showError); paragraph.prevQuery = paragraph.queryArgs ? paragraph.queryArgs.query : paragraph.query; @@ -1280,7 +1274,7 @@ consoleModule.controller('sqlController', [ }; $scope.queryExecuted = function(paragraph) { - return $common.isDefined(paragraph.queryArgs); + return LegacyUtils.isDefined(paragraph.queryArgs); }; const _cancelRefresh = function(paragraph) { @@ -1297,7 +1291,7 @@ consoleModule.controller('sqlController', [ $scope.explain = function(paragraph) { QueryNotebooks.save($scope.notebook) - .catch(_handleException); + .catch(Messages.showError); _cancelRefresh(paragraph); @@ -1324,7 +1318,7 @@ consoleModule.controller('sqlController', [ $scope.scan = function(paragraph) { QueryNotebooks.save($scope.notebook) - .catch(_handleException); + .catch(Messages.showError); _cancelRefresh(paragraph); @@ -1441,7 +1435,7 @@ consoleModule.controller('sqlController', [ csvContent += cols.join(';') + '\n'; }); - $common.download('application/octet-stream;charset=utf-8', fileName, escape(csvContent)); + LegacyUtils.download('application/octet-stream;charset=utf-8', fileName, escape(csvContent)); }; $scope.exportCsv = function(paragraph) { @@ -1459,7 +1453,7 @@ consoleModule.controller('sqlController', [ agentMonitor.queryGetAll(args.cacheName, args.query) .then((res) => _export(paragraph.name + '-all.csv', paragraph.columnFilter, res.fieldsMetadata, res.items)) - .catch((err) => $common.showError(err)) + .catch(Messages.showError) .finally(() => paragraph.ace.focus()); }; @@ -1468,9 +1462,7 @@ consoleModule.controller('sqlController', [ // .success(function(item) { // _export(paragraph.name + '-all.csv', item.meta, item.rows); // }) - // .error(function(errMsg) { - // $common.showError(errMsg); - // }); + // .error(Messages.showError); // }; $scope.rateAsString = function(paragraph) { @@ -1567,12 +1559,12 @@ consoleModule.controller('sqlController', [ return cache; }), 'name'); }) - .catch(_handleException) + .catch(Messages.showError) .finally(() => $loading.finish('loadingCacheMetadata')); }; $scope.showResultQuery = function(paragraph) { - if ($common.isDefined(paragraph)) { + if (LegacyUtils.isDefined(paragraph)) { const scope = $scope.$new(); if (_.isNil(paragraph.queryArgs.query)) { @@ -1592,5 +1584,5 @@ consoleModule.controller('sqlController', [ $modal({scope, template: '/templates/message.html', placement: 'center', show: true}); } }; - }] -); + } +]]; http://git-wip-us.apache.org/repos/asf/ignite/blob/00d8c0af/modules/web-console/src/main/js/views/configuration/domains-import.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/configuration/domains-import.jade b/modules/web-console/src/main/js/views/configuration/domains-import.jade index 23b9434..ccaeb27 100644 --- a/modules/web-console/src/main/js/views/configuration/domains-import.jade +++ b/modules/web-console/src/main/js/views/configuration/domains-import.jade @@ -83,7 +83,7 @@ mixin td-ellipses-lbl(w, lbl) .col-xs-8.col-sm-10.col-md-10 i.tipField.fa.fa-question-circle(bs-tooltip='' data-title='Password for connecting to database<br>Note, password would not be saved in preferences for security reasons') .input-tip - input.form-control(id='password' type='password' ng-model='selectedPreset.password' on-enter='importDomainNext()') + input.form-control(id='password' type='password' ng-model='selectedPreset.password' ignite-on-enter='importDomainNext()') .settings-row .checkbox label http://git-wip-us.apache.org/repos/asf/ignite/blob/00d8c0af/modules/web-console/src/main/js/views/reset.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/reset.jade b/modules/web-console/src/main/js/views/reset.jade index e5b8f12..9098105 100644 --- a/modules/web-console/src/main/js/views/reset.jade +++ b/modules/web-console/src/main/js/views/reset.jade @@ -37,11 +37,11 @@ header#header.header .settings-row label.col-sm-1.required Password: .col-sm-3 - input#user_password.form-control(enter-focus-next='user_confirm' type='password' ng-model='reset_info.password' placeholder='New password' required) + input#user_password.form-control(ignite-on-enter-focus-move='user_confirm' type='password' ng-model='reset_info.password' placeholder='New password' required) .settings-row label.col-sm-1.required Confirm: .col-sm-3 - input#user_confirm.form-control(type='password' ng-model='reset_info.confirm' match='reset_info.password' placeholder='Confirm new password' required on-enter='resetForm.$valid && resetPassword(user_info)') + input#user_confirm.form-control(type='password' ng-model='reset_info.confirm' ignite-match='reset_info.password' placeholder='Confirm new password' required ignite-on-enter='resetForm.$valid && resetPassword(user_info)') .settings-row button.btn.btn-primary(ng-disabled='resetForm.$invalid' ng-click='resetPassword(reset_info)') Reset Password http://git-wip-us.apache.org/repos/asf/ignite/blob/00d8c0af/modules/web-console/src/main/js/views/settings/profile.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/settings/profile.jade b/modules/web-console/src/main/js/views/settings/profile.jade index c16232f..bc4965a 100644 --- a/modules/web-console/src/main/js/views/settings/profile.jade +++ b/modules/web-console/src/main/js/views/settings/profile.jade @@ -28,23 +28,23 @@ mixin lbl(txt) .details-row +lbl('First name:') .col-xs-5.col-sm-4 - input#profile-firstname.form-control(enter-focus-next='profile-lastname' type='text' ng-model='user.firstName' placeholder='Input first name' required auto-focus) + input#profile-firstname.form-control(ignite-on-enter-focus-move='profile-lastname' type='text' ng-model='user.firstName' placeholder='Input first name' required ignite-auto-focus) .details-row +lbl('Last name:') .col-xs-5.col-sm-4 - input#profile-lastname.form-control(enter-focus-next='profile-email' type='text' ng-model='user.lastName' placeholder='Input last name' required) + input#profile-lastname.form-control(ignite-on-enter-focus-move='profile-email' type='text' ng-model='user.lastName' placeholder='Input last name' required) .details-row +lbl('Email:') .col-xs-5.col-sm-4 - input#profile-email.form-control(enter-focus-next='profile-company' type='email' ng-model='user.email' placeholder='Input email' required) + input#profile-email.form-control(ignite-on-enter-focus-move='profile-company' type='email' ng-model='user.email' placeholder='Input email' required) .details-row +lbl('Company:') .col-xs-5.col-sm-4 - input#profile-company.form-control(enter-focus-next='profile-country' type='text' ng-model='user.company' placeholder='Input company name' required) + input#profile-company.form-control(ignite-on-enter-focus-move='profile-country' type='text' ng-model='user.company' placeholder='Input company name' required) .details-row +lbl('Country:') .col-xs-5.col-sm-4 - button#profile-country.select-toggle.form-control(bs-select bs-options='item.name as item.name for item in countries' type='text' ng-model='user.country' placeholder='Choose your country' required) + button#profile-country.select-toggle.form-control(bs-select bs-options='item.name as item.name for item in countries' type='text' ng-model='user.country' placeholder='Choose your country' ng-required='true') .details-row .advanced-options i.fa( @@ -55,7 +55,7 @@ mixin lbl(txt) +lbl('Security token:') label {{user.token || 'No security token. Regenerate please.'}} i.tipLabel.fa.fa-refresh(ng-click='generateToken()' bs-tooltip='' data-title='Generate random security token') - i.tipLabel.fa.fa-clipboard(ng-click-copy='{{user.token}}' bs-tooltip='' data-title='Copy security token to clipboard') + i.tipLabel.fa.fa-clipboard(ignite-copy-to-clipboard='{{user.token}}' bs-tooltip='' data-title='Copy security token to clipboard') i.tipLabel.fa.fa-question-circle(ng-if=lines bs-tooltip='' data-title='The security token is used for authorization of web agent') .details-row .advanced-options @@ -67,10 +67,10 @@ mixin lbl(txt) .details-row +lbl('New password:') .col-xs-5.col-sm-4 - input#profile_password.form-control(enter-focus-next='profile_confirm' type='password' ng-model='user.password' placeholder='New password') + input#profile_password.form-control(ignite-on-enter-focus-move='profile_confirm' type='password' ng-model='user.password' placeholder='New password') .details-row +lbl('Confirm:') .col-xs-5.col-sm-4 - input#profile_confirm.form-control(type='password' ng-model='user.confirm' match='user.password' placeholder='Confirm new password') + input#profile_confirm.form-control(type='password' ng-model='user.confirm' ignite-match='user.password' placeholder='Confirm new password') .col-xs-12.col-sm-12.details-row a.btn.btn-primary(ng-disabled='!profileCouldBeSaved()' ng-click='profileCouldBeSaved() && saveUser()' bs-tooltip='' data-title='{{saveBtnTipText()}}' data-placement='bottom' data-trigger='hover') Save http://git-wip-us.apache.org/repos/asf/ignite/blob/00d8c0af/modules/web-console/src/main/js/views/signin.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/signin.jade b/modules/web-console/src/main/js/views/signin.jade index 47dadc8..a6c64a8 100644 --- a/modules/web-console/src/main/js/views/signin.jade +++ b/modules/web-console/src/main/js/views/signin.jade @@ -44,39 +44,39 @@ header#header.header .settings-row(ng-show='action == "signin"') +lblRequired('Email:') .col-xs-9.col-md-8 - input#signin_email.form-control(enter-focus-next='user_password' type='email' ng-model='ui.email' placeholder='Input email' required) + input#signin_email.form-control(ignite-on-enter-focus-move='user_password' type='email' ng-model='ui.email' placeholder='Input email' required) .settings-row(ng-show='action == "signup"') +lblRequired('Email:') .col-xs-9.col-md-8 - input#signup_email.form-control(enter-focus-next='user_password' type='email' ng-model='ui.email' placeholder='Input email' required) + input#signup_email.form-control(ignite-on-enter-focus-move='user_password' type='email' ng-model='ui.email' placeholder='Input email' required) .settings-row(ng-show='action != "password/forgot"') +lblRequired('Password:') .col-xs-9.col-md-8 - input#user_password.form-control(enter-focus-next='user_confirm' type='password' ng-model='ui.password' placeholder='Password' ng-required='action != "password/forgot"' on-enter='action == "signin" && form.$valid && auth(action, ui)') + input#user_password.form-control(ignite-on-enter-focus-move='user_confirm' type='password' ng-model='ui.password' placeholder='Password' ng-required='action != "password/forgot"' ignite-on-enter='action == "signin" && form.$valid && auth(action, ui)') .settings-row(ng-if='action == "signup"') +lblRequired('Confirm:') .col-xs-9.col-md-8 - input#user_confirm.form-control(enter-focus-next='first_name' type='password' ng-model='ui_exclude.confirm' match='ui.password' placeholder='Confirm password' ng-required='action == "signup"') + input#user_confirm.form-control(ignite-on-enter-focus-move='first_name' type='password' ng-model='ui_exclude.confirm' ignite-match='ui.password' placeholder='Confirm password' ng-required='action == "signup"') .settings-row(ng-show='action == "signup"') +lblRequired('First Name:') .col-xs-9.col-md-8 - input#first_name.form-control(enter-focus-next='last_name' type='text' ng-model='ui.firstName' placeholder='Input first name' ng-required='action=="signup"') + input#first_name.form-control(ignite-on-enter-focus-move='last_name' type='text' ng-model='ui.firstName' placeholder='Input first name' ng-required='action=="signup"') .settings-row(ng-show='action == "signup"') +lblRequired('Last Name:') .col-xs-9.col-md-8 - input#last_name.form-control(enter-focus-next='company' type='text' ng-model='ui.lastName' placeholder='Input last name' ng-required='action=="signup"') + input#last_name.form-control(ignite-on-enter-focus-move='company' type='text' ng-model='ui.lastName' placeholder='Input last name' ng-required='action=="signup"') .settings-row(ng-show='action == "password/forgot"') +lblRequired('Email:') .col-xs-9.col-md-8 - input#forgot_email.form-control(on-enter='form.$valid && forgotPassword(ui)' type='email' ng-model='ui.email' placeholder='Input email' required) + input#forgot_email.form-control(ignite-on-enter='form.$valid && forgotPassword(ui)' type='email' ng-model='ui.email' placeholder='Input email' required) .settings-row(ng-show='action == "signup"') +lblRequired('Company:') .col-xs-9.col-md-8 - input#company.form-control(enter-focus-next='country' type='text' ng-model='ui.company' placeholder='Input company name' ng-required='action=="signup"') + input#company.form-control(ignite-on-enter-focus-move='country' type='text' ng-model='ui.company' placeholder='Input company name' ng-required='action=="signup"') .settings-row(ng-show='action == "signup"') +lblRequired('Country:') .col-xs-9.col-md-8 - button#country.select-toggle.form-control(enter-focus-next='signup' bs-select bs-options='item.name as item.name for item in countries' type='text' ng-model='ui.country' placeholder='Choose your country' ng-required='action=="signup"') + button#country.select-toggle.form-control(ignite-on-enter-focus-move='signup' bs-select bs-options='item.name as item.name for item in countries' type='text' ng-model='ui.country' placeholder='Choose your country' ng-required='action=="signup"') .settings-row(ignite-terms) .col-md-offset-3(ng-if='action == "signup" && terms.termsState') label @@ -84,17 +84,17 @@ header#header.header | I agree to the #[a(ui-sref='{{::terms.termsState}}' target='_blank') terms and conditions] .col-xs-12.col-md-11 .login-footer(ng-show='action == "signup"') - a.labelField(ng-click='action = "password/forgot"' on-click-focus='signin_email') Forgot password? - a.labelLogin(ng-click='action = "signin"' on-click-focus='signin_email') Sign In + a.labelField(ng-click='action = "password/forgot"' ignite-on-click-focus='signin_email') Forgot password? + a.labelLogin(ng-click='action = "signin"' ignite-on-click-focus='signin_email') Sign In button#signup.btn.btn-primary(ng-click='auth(action, ui)' ng-disabled='form.$invalid') Sign Up .col-xs-12.col-md-11 .login-footer(ng-show='action == "password/forgot"') - a.labelField(ng-click='action = "signin"' on-click-focus='signin_email') Sign In + a.labelField(ng-click='action = "signin"' ignite-on-click-focus='signin_email') Sign In button#forgot.btn.btn-primary(ng-click='forgotPassword(ui)' ng-disabled='form.$invalid') Send it to me .col-xs-12.col-md-11 .login-footer(ng-show='action == "signin"') - a.labelField(ng-click='action = "password/forgot"' on-click-focus='signin_email') Forgot password? - a.labelLogin(ng-click='action = "signup"' on-click-focus='first_name') Sign Up + a.labelField(ng-click='action = "password/forgot"' ignite-on-click-focus='signin_email') Forgot password? + a.labelLogin(ng-click='action = "signup"' ignite-on-click-focus='first_name') Sign Up button#login.btn.btn-primary(ng-click='auth(action, ui)' ng-disabled='form.$invalid') Sign In .col-xs-12.col-md-11.home-panel http://git-wip-us.apache.org/repos/asf/ignite/blob/00d8c0af/modules/web-console/src/main/js/views/sql/notebook-new.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/sql/notebook-new.jade b/modules/web-console/src/main/js/views/sql/notebook-new.jade index 2a50137..51200e8 100644 --- a/modules/web-console/src/main/js/views/sql/notebook-new.jade +++ b/modules/web-console/src/main/js/views/sql/notebook-new.jade @@ -25,7 +25,7 @@ .col-sm-2 label.required.labelFormField Name: .col-sm-10 - input.form-control(id='create-notebook' type='text' ng-model='name' required on-enter='ui.inputForm.$valid && createNewNotebook(name)' auto-focus) + input.form-control(id='create-notebook' type='text' ng-model='name' required ignite-on-enter='ui.inputForm.$valid && createNewNotebook(name)' ignite-auto-focus) .modal-footer button.btn.btn-default(id='copy-btn-cancel' ng-click='$hide()') Cancel button.btn.btn-primary(id='copy-btn-confirm' ng-disabled='ui.inputForm.$invalid' ng-click='createNewNotebook(name)') Create http://git-wip-us.apache.org/repos/asf/ignite/blob/00d8c0af/modules/web-console/src/main/js/views/sql/paragraph-rate.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/sql/paragraph-rate.jade b/modules/web-console/src/main/js/views/sql/paragraph-rate.jade index f6f105f..03c6497 100644 --- a/modules/web-console/src/main/js/views/sql/paragraph-rate.jade +++ b/modules/web-console/src/main/js/views/sql/paragraph-rate.jade @@ -22,7 +22,7 @@ form(name='popoverForm' novalidate) .form-group(style='padding: 5px') .col-sm-4 - input.form-control(id='paragraph-rate' ng-init='value = paragraph.rate.value' ng-model='value' type='number' min='1' required auto-focus) + input.form-control(id='paragraph-rate' ng-init='value = paragraph.rate.value' ng-model='value' type='number' min='1' required ignite-auto-focus) .col-sm-8(style='padding-left: 5px') button.form-control.select-toggle(id='paragraph-unit' ng-init='unit = paragraph.rate.unit' ng-model='unit' required placeholder='Time unit' bs-select bs-options='item.value as item.label for item in timeUnit' data-container='false' tabindex='0') .form-actions(style='margin-top: 30px; padding: 5px') http://git-wip-us.apache.org/repos/asf/ignite/blob/00d8c0af/modules/web-console/src/main/js/views/sql/sql.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/sql/sql.jade b/modules/web-console/src/main/js/views/sql/sql.jade index be6d85e..a5e7fae 100644 --- a/modules/web-console/src/main/js/views/sql/sql.jade +++ b/modules/web-console/src/main/js/views/sql/sql.jade @@ -15,7 +15,7 @@ limitations under the License. mixin btn-toolbar(btn, click, tip, focusId) - i.btn.btn-default.fa(class=btn ng-click=click bs-tooltip='' data-title=tip on-click-focus=focusId data-trigger='hover' data-placement='bottom') + i.btn.btn-default.fa(class=btn ng-click=click bs-tooltip='' data-title=tip ignite-on-click-focus=focusId data-trigger='hover' data-placement='bottom') mixin btn-toolbar-data(btn, kind, tip) i.btn.btn-default.fa(class=btn ng-click='setResult(paragraph, "#{kind}")' ng-class='{active: resultEq(paragraph, "#{kind}")}' bs-tooltip='' data-title=tip data-trigger='hover' data-placement='bottom') @@ -52,7 +52,7 @@ mixin notebook-rename h1.col-sm-6(ng-show='notebook.edit') i.btn.fa.fa-floppy-o(ng-show='notebook.editName' ng-click='renameNotebook(notebook.editName)' bs-tooltip data-title='Save notebook name' data-trigger='hover') .input-tip - input.form-control(ng-model='notebook.editName' required on-enter='renameNotebook(notebook.editName)' on-escape='notebook.edit = false;') + input.form-control(ng-model='notebook.editName' required ignite-on-enter='renameNotebook(notebook.editName)' ignite-on-escape='notebook.edit = false;') h1.pull-right a.dropdown-toggle(data-toggle='dropdown' bs-dropdown='scrollParagraphs' data-placement='bottom-right') Scroll to query span.caret @@ -80,7 +80,7 @@ mixin paragraph-rename i.tipLabel.fa(style='float: left;' ng-class='paragraphExpanded(paragraph) ? "fa-chevron-circle-down" : "fa-chevron-circle-right"') i.tipLabel.fa.fa-floppy-o(style='float: right;' ng-show='paragraph.editName' ng-click='renameParagraph(paragraph, paragraph.editName); $event.stopPropagation();' bs-tooltip data-title='Save query name' data-trigger='hover') .input-tip - input.form-control(id='paragraph-name-{{paragraph.id}}' ng-model='paragraph.editName' required ng-click='$event.stopPropagation();' on-enter='renameParagraph(paragraph, paragraph.editName)' on-escape='paragraph.edit = false') + input.form-control(id='paragraph-name-{{paragraph.id}}' ng-model='paragraph.editName' required ng-click='$event.stopPropagation();' ignite-on-enter='renameParagraph(paragraph, paragraph.editName)' ignite-on-escape='paragraph.edit = false') mixin query-controls .sql-controls http://git-wip-us.apache.org/repos/asf/ignite/blob/00d8c0af/modules/web-console/src/main/js/views/templates/agent-download.jade ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/views/templates/agent-download.jade b/modules/web-console/src/main/js/views/templates/agent-download.jade index f17dac8..864694b 100644 --- a/modules/web-console/src/main/js/views/templates/agent-download.jade +++ b/modules/web-console/src/main/js/views/templates/agent-download.jade @@ -33,7 +33,7 @@ a(ng-click='agentLoad.showToken = ! agentLoad.showToken') {{agentLoad.showToken ? 'Hide security token...' : 'Show security token...'}} .details-row(ng-show='agentLoad.showToken') label.labelField Security token: {{user.token}} - i.tipLabel.fa.fa-clipboard(ng-click-copy='{{user.token}}' bs-tooltip='' data-title='Copy security token to clipboard') + i.tipLabel.fa.fa-clipboard(ignite-copy-to-clipboard='{{user.token}}' bs-tooltip='' data-title='Copy security token to clipboard') i.tipLabel.fa.fa-question-circle(ng-if=lines bs-tooltip='' data-title='The security token is used for authorization of web agent') .agent-download(ng-if='hasAgents') p Connection to Ignite Web Agent is established, but agent failed to connect to Ignite Node
