http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/igfs-edit-form/template.tpl.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/igfs-edit-form/template.tpl.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/igfs-edit-form/template.tpl.pug new file mode 100644 index 0000000..f14a59c --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/igfs-edit-form/template.tpl.pug @@ -0,0 +1,39 @@ +//- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +div(bs-collapse='' data-allow-multiple='true' ng-model='ui.activePanels') + form(id='igfs' name='ui.inputForm' novalidate ng-submit='$ctrl.save()') + include /app/modules/states/configuration/igfs/general + + include /app/modules/states/configuration/igfs/secondary + include /app/modules/states/configuration/igfs/ipc + include /app/modules/states/configuration/igfs/fragmentizer + + //- Removed in ignite 2.0 + include /app/modules/states/configuration/igfs/dual + include /app/modules/states/configuration/igfs/misc + +.pc-form-actions-panel + .pc-form-actions-panel__right-after + button.btn-ignite.btn-ignite--link-success( + type='button' + ng-click='$ctrl.confirmAndReset()' + ) + | Cancel + button.btn-ignite.btn-ignite--success( + form='igfs' + type='submit' + ) Save \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/component.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/component.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/component.js new file mode 100644 index 0000000..56f8677 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/component.js @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import controller from './controller'; +import templateUrl from './template.tpl.pug'; +import './style.scss'; + +export default { + controller, + templateUrl, + bindings: { + model: '<', + models: '<', + caches: '<', + onSave: '&' + } +}; http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/controller.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/controller.js new file mode 100644 index 0000000..1b16a02 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/controller.js @@ -0,0 +1,190 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import cloneDeep from 'lodash/cloneDeep'; +import _ from 'lodash'; +import get from 'lodash/get'; + +import {default as Models} from 'app/services/Models'; +import {default as ModalImportModels} from 'app/components/page-configure/components/modal-import-models/service'; +import {default as IgniteVersion} from 'app/services/Version.service'; +import {Confirm} from 'app/services/Confirm.service'; + +/** @type {ng.IComponentController} */ +export default class ModelEditFormController { + /** @type {ig.config.model.DomainModel} */ + model; + static $inject = ['ModalImportModels', 'IgniteErrorPopover', 'IgniteLegacyUtils', Confirm.name, 'ConfigChangesGuard', IgniteVersion.name, '$scope', Models.name, 'IgniteFormUtils']; + /** + * @param {ModalImportModels} ModalImportModels + * @param {Confirm} Confirm + * @param {ng.IScope} $scope + * @param {Models} Models + * @param {IgniteVersion} IgniteVersion + */ + constructor(ModalImportModels, ErrorPopover, LegacyUtils, Confirm, ConfigChangesGuard, IgniteVersion, $scope, Models, IgniteFormUtils) { + Object.assign(this, {ErrorPopover, LegacyUtils, ConfigChangesGuard, IgniteFormUtils}); + this.ModalImportModels = ModalImportModels; + this.Confirm = Confirm; + this.$scope = $scope; + this.Models = Models; + this.IgniteVersion = IgniteVersion; + this.javaBuiltInClassesBase = LegacyUtils.javaBuiltInClasses; + } + $onInit() { + this.available = this.IgniteVersion.available.bind(this.IgniteVersion); + + this.queryFieldTypes = this.LegacyUtils.javaBuiltInClasses.concat('byte[]'); + this.$scope.ui = this.IgniteFormUtils.formUI(); + this.$scope.ui.activePanels = [0, 1]; + this.$scope.ui.topPanels = [0, 1, 2]; + this.$scope.ui.expanded = true; + + this.$scope.javaBuiltInClasses = this.LegacyUtils.javaBuiltInClasses; + this.$scope.supportedJdbcTypes = this.LegacyUtils.mkOptions(this.LegacyUtils.SUPPORTED_JDBC_TYPES); + this.$scope.supportedJavaTypes = this.LegacyUtils.mkOptions(this.LegacyUtils.javaBuiltInTypes); + } + + /** + * Create list of fields to show in index fields dropdown. + * @param {string} prefix + * @param {Array<string>} cur Current queryKeyFields + */ + fields(prefix, cur) { + const fields = this.$scope.backupItem + ? _.map(this.$scope.backupItem.fields, (field) => ({value: field.name, label: field.name})) + : []; + + if (prefix === 'new') + return fields; + + _.forEach(_.isArray(cur) ? cur : [cur], (value) => { + if (!_.find(fields, {value})) + fields.push({value, label: value + ' (Unknown field)'}); + }); + + return fields; + } + + importModels() { + return this.ModalImportModels.open(); + } + + /** + * @param {ig.config.model.DomainModel} item + */ + checkQueryConfiguration(item) { + if (item.queryMetadata === 'Configuration' && this.LegacyUtils.domainForQueryConfigured(item)) { + if (_.isEmpty(item.fields)) + return this.ErrorPopover.show('queryFields', 'Query fields should not be empty', this.$scope.ui, 'query'); + + const indexes = item.indexes; + + if (indexes && indexes.length > 0) { + if (_.find(indexes, (index, idx) => { + if (_.isEmpty(index.fields)) + return !this.ErrorPopover.show('indexes' + idx, 'Index fields are not specified', this.$scope.ui, 'query'); + + if (_.find(index.fields, (field) => !_.find(item.fields, (configuredField) => configuredField.name === field.name))) + return !this.ErrorPopover.show('indexes' + idx, 'Index contains not configured fields', this.$scope.ui, 'query'); + })) + return false; + } + } + + return true; + } + + /** + * @param {ig.config.model.DomainModel} item + */ + checkStoreConfiguration(item) { + if (this.LegacyUtils.domainForStoreConfigured(item)) { + if (this.LegacyUtils.isEmptyString(item.databaseSchema)) + return this.ErrorPopover.show('databaseSchemaInput', 'Database schema should not be empty', this.$scope.ui, 'store'); + + if (this.LegacyUtils.isEmptyString(item.databaseTable)) + return this.ErrorPopover.show('databaseTableInput', 'Database table should not be empty', this.$scope.ui, 'store'); + + if (_.isEmpty(item.keyFields)) + return this.ErrorPopover.show('keyFields', 'Key fields are not specified', this.$scope.ui, 'store'); + + if (this.LegacyUtils.isJavaBuiltInClass(item.keyType) && item.keyFields.length !== 1) + return this.ErrorPopover.show('keyFields', 'Only one field should be specified in case when key type is a Java built-in type', this.$scope.ui, 'store'); + + if (_.isEmpty(item.valueFields)) + return this.ErrorPopover.show('valueFields', 'Value fields are not specified', this.$scope.ui, 'store'); + } + + return true; + } + + /** + * Check domain model logical consistency. + * @param {ig.config.model.DomainModel} item + */ + validate(item) { + if (!this.checkQueryConfiguration(item)) + return false; + + if (!this.checkStoreConfiguration(item)) + return false; + + if (!this.LegacyUtils.domainForStoreConfigured(item) && !this.LegacyUtils.domainForQueryConfigured(item) && item.queryMetadata === 'Configuration') + return this.ErrorPopover.show('query-title', 'SQL query domain model should be configured', this.$scope.ui, 'query'); + + if (!this.LegacyUtils.domainForStoreConfigured(item) && item.generatePojo) + return this.ErrorPopover.show('store-title', 'Domain model for cache store should be configured when generation of POJO classes is enabled', this.$scope.ui, 'store'); + + return true; + } + + $onChanges(changes) { + if ( + 'model' in changes && get(this.$scope.backupItem, '_id') !== get(this.model, '_id') + ) { + this.$scope.backupItem = cloneDeep(changes.model.currentValue); + if (this.$scope.ui && this.$scope.ui.inputForm) { + this.$scope.ui.inputForm.$setPristine(); + this.$scope.ui.inputForm.$setUntouched(); + } + } + if ('caches' in changes) + this.cachesMenu = (changes.caches.currentValue || []).map((c) => ({label: c.name, value: c._id})); + } + /** + * @param {ig.config.model.DomainModel} model + */ + onQueryFieldsChange(model) { + this.$scope.backupItem = this.Models.removeInvalidFields(model); + } + getValuesToCompare() { + return [this.model, this.$scope.backupItem].map(this.Models.normalize); + } + save() { + if (this.$scope.ui.inputForm.$invalid) + return this.IgniteFormUtils.triggerValidation(this.$scope.ui.inputForm, this.$scope); + if (!this.validate(this.$scope.backupItem)) return; + this.onSave({$event: cloneDeep(this.$scope.backupItem)}); + } + reset = (forReal) => forReal ? this.$scope.backupItem = cloneDeep(this.model) : void 0; + confirmAndReset() { + return this.Confirm.confirm('Are you sure you want to undo all changes for current model?').then(() => true) + .then(this.reset) + .catch(() => {}); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/index.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/index.js new file mode 100644 index 0000000..e4d2195 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/index.js @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import angular from 'angular'; +import component from './component'; +export default angular.module('configuration.model-edit-form', []) +.component('modelEditForm', component); http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/style.scss ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/style.scss b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/style.scss new file mode 100644 index 0000000..263a51a --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/style.scss @@ -0,0 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +model-edit-form { + display: block; +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/template.tpl.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/template.tpl.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/template.tpl.pug new file mode 100644 index 0000000..685213c --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/model-edit-form/template.tpl.pug @@ -0,0 +1,33 @@ +//- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +div(bs-collapse='' data-allow-multiple='true' ng-model='ui.activePanels') + form(id='model' name='ui.inputForm' novalidate ng-submit='$ctrl.save()') + include /app/modules/states/configuration/domains/general + include /app/modules/states/configuration/domains/query + include /app/modules/states/configuration/domains/store + +.pc-form-actions-panel + .pc-form-actions-panel__right-after + button.btn-ignite.btn-ignite--link-success( + type='button' + ng-click='$ctrl.confirmAndReset()' + ) + | Cancel + button.btn-ignite.btn-ignite--success( + form='model' + type='submit' + ) Save http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/component.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/component.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/component.js new file mode 100644 index 0000000..daedc4d --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/component.js @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import template from './template.pug'; +import controller from './controller'; + +export default { + name: 'pageConfigureAdvancedCaches', + template, + controller +}; http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/controller.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/controller.js new file mode 100644 index 0000000..60244e5 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/controller.js @@ -0,0 +1,174 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Subject} from 'rxjs/Subject'; +import {merge} from 'rxjs/observable/merge'; +import naturalCompare from 'natural-compare-lite'; +import {combineLatest} from 'rxjs/observable/combineLatest'; +import {removeClusterItems, advancedSaveCache} from 'app/components/page-configure/store/actionCreators'; +import ConfigureState from 'app/components/page-configure/services/ConfigureState'; +import ConfigSelectors from 'app/components/page-configure/store/selectors'; +import Caches from 'app/services/Caches'; + +// Controller for Caches screen. +export default class Controller { + static $inject = [ + ConfigSelectors.name, + 'configSelectionManager', + '$uiRouter', + '$transitions', + ConfigureState.name, + '$state', + 'IgniteFormUtils', + 'IgniteVersion', + Caches.name + ]; + /** + * @param {ConfigSelectors} ConfigSelectors + * @param {object} configSelectionManager + * @param {uirouter.UIRouter} $uiRouter + * @param {uirouter.TransitionService} $transitions + * @param {ConfigureState} ConfigureState + * @param {uirouter.StateService} $state + * @param {object} FormUtils + * @param {object} Version + * @param {Caches} Caches + */ + constructor(ConfigSelectors, configSelectionManager, $uiRouter, $transitions, ConfigureState, $state, FormUtils, Version, Caches) { + Object.assign(this, {configSelectionManager, FormUtils}); + this.$state = $state; + this.$transitions = $transitions; + this.$uiRouter = $uiRouter; + this.ConfigSelectors = ConfigSelectors; + this.ConfigureState = ConfigureState; + this.Caches = Caches; + + this.visibleRows$ = new Subject(); + this.selectedRows$ = new Subject(); + + /** @type {Array<uiGrid.IColumnDefOf<ig.config.cache.ShortCache>>} */ + this.cachesColumnDefs = [ + { + name: 'name', + displayName: 'Name', + field: 'name', + enableHiding: false, + sort: {direction: 'asc', priority: 0}, + filter: { + placeholder: 'Filter by nameâ¦' + }, + sortingAlgorithm: naturalCompare, + minWidth: 165 + }, + { + name: 'cacheMode', + displayName: 'Mode', + field: 'cacheMode', + multiselectFilterOptions: Caches.cacheModes, + width: 160 + }, + { + name: 'atomicityMode', + displayName: 'Atomicity', + field: 'atomicityMode', + multiselectFilterOptions: Caches.atomicityModes, + width: 160 + }, + { + name: 'backups', + displayName: 'Backups', + field: 'backups', + width: 130, + enableFiltering: false, + cellTemplate: ` + <div class="ui-grid-cell-contents">{{ grid.appScope.$ctrl.Caches.getCacheBackupsCount(row.entity) }}</div> + ` + } + ]; + } + + $onInit() { + const cacheID$ = this.$uiRouter.globals.params$.pluck('cacheID').publishReplay(1).refCount(); + + this.shortCaches$ = this.ConfigureState.state$.let(this.ConfigSelectors.selectCurrentShortCaches); + this.shortModels$ = this.ConfigureState.state$.let(this.ConfigSelectors.selectCurrentShortModels); + this.shortIGFSs$ = this.ConfigureState.state$.let(this.ConfigSelectors.selectCurrentShortIGFSs); + this.originalCache$ = cacheID$.distinctUntilChanged().switchMap((id) => { + return this.ConfigureState.state$.let(this.ConfigSelectors.selectCacheToEdit(id)); + }); + + this.isNew$ = cacheID$.map((id) => id === 'new'); + this.itemEditTitle$ = combineLatest(this.isNew$, this.originalCache$, (isNew, cache) => { + return `${isNew ? 'Create' : 'Edit'} cache ${!isNew && cache.name ? `â${cache.name}â` : ''}`; + }); + this.selectionManager = this.configSelectionManager({ + itemID$: cacheID$, + selectedItemRows$: this.selectedRows$, + visibleRows$: this.visibleRows$, + loadedItems$: this.shortCaches$ + }); + + this.subscription = merge( + this.originalCache$, + this.selectionManager.editGoes$.do((id) => this.edit(id)), + this.selectionManager.editLeaves$.do((options) => this.$state.go('base.configuration.edit.advanced.caches', null, options)) + ).subscribe(); + + this.isBlocked$ = cacheID$; + + this.tableActions$ = this.selectionManager.selectedItemIDs$.map((selectedItems) => [ + { + action: 'Clone', + click: () => this.clone(selectedItems), + available: false + }, + { + action: 'Delete', + click: () => { + this.remove(selectedItems); + }, + available: true + } + ]); + } + + /** + * @param {Array<string>} itemIDs + */ + remove(itemIDs) { + this.ConfigureState.dispatchAction( + removeClusterItems(this.$uiRouter.globals.params.clusterID, 'caches', itemIDs, true, true) + ); + } + + $onDestroy() { + this.subscription.unsubscribe(); + this.visibleRows$.complete(); + this.selectedRows$.complete(); + } + + /** + * @param {string} cacheID + */ + edit(cacheID) { + this.$state.go('base.configuration.edit.advanced.caches.cache', {cacheID}); + } + + save(cache) { + this.ConfigureState.dispatchAction(advancedSaveCache(cache)); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/index.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/index.js new file mode 100644 index 0000000..818c263 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/index.js @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import angular from 'angular'; +import component from './component'; + +export default angular + .module('ignite-console.page-configure-advanced.caches', []) + .component(component.name, component); http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/template.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/template.pug new file mode 100644 index 0000000..ac50b16 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/template.pug @@ -0,0 +1,57 @@ +//- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +pc-items-table( + table-title='::"My caches"' + column-defs='$ctrl.cachesColumnDefs' + items='$ctrl.shortCaches$|async:this' + actions-menu='$ctrl.tableActions$|async:this' + selected-row-id='$ctrl.selectionManager.selectedItemIDs$|async:this' + one-way-selection='::true' + on-selection-change='$ctrl.selectedRows$.next($event)' + on-filter-changed='$ctrl.filterChanges$.next($event)' + on-visible-rows-change='$ctrl.visibleRows$.next($event)' +) + footer-slot + div(style='font-style: italic' ng-hide='($ctrl.shortCaches$|async:this).length') + | You have no caches. + a.link-success( + ui-sref='base.configuration.edit.advanced.caches.cache({cacheID: "new"})' + ui-sref-opts='{location: "replace"}' + ) Create one? + a.link-success( + ui-sref='base.configuration.edit.advanced.caches.cache({cacheID: "new"})' + ui-sref-opts='{location: "replace"}' + ng-show='($ctrl.shortCaches$|async:this).length' + ) + Add new cache + +h2.pc-page-header.ng-animate-disabled(ng-if='!($ctrl.isBlocked$|async:this)') + | {{ ($ctrl.selectionManager.selectedItemIDs$|async:this).length ? 'Multiple' : 'No' }} caches selected + span.pc-page-header-sub Select only one cache to see settings and edit it + +h2.pc-page-header.ng-animate-disabled(ng-if='$ctrl.isBlocked$|async:this') + | {{ $ctrl.itemEditTitle$|async:this }} + +cache-edit-form( + cache='$ctrl.originalCache$|async:this' + caches='$ctrl.shortCaches$|async:this' + igfss='$ctrl.shortIGFSs$|async:this' + models='$ctrl.shortModels$|async:this' + on-save='$ctrl.save($event)' + ng-class='{"pca-form-blocked": !($ctrl.isBlocked$|async:this)}' + fake-ui-can-exit='base.configuration.edit.advanced.caches.cache' + form-ui-can-exit-guard +) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/component.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/component.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/component.js new file mode 100644 index 0000000..a520146 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/component.js @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import template from './template.pug'; +import controller from './controller'; + +export default { + name: 'pageConfigureAdvancedCluster', + template, + controller +}; http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/controller.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/controller.js new file mode 100644 index 0000000..ad2eed4 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/controller.js @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {default as ConfigSelectors} from 'app/components/page-configure/store/selectors'; +import {default as ConfigureState} from 'app/components/page-configure/services/ConfigureState'; +import {advancedSaveCluster} from 'app/components/page-configure/store/actionCreators'; +import 'rxjs/add/operator/publishReplay'; + +// Controller for Clusters screen. +export default class PageConfigureAdvancedCluster { + static $inject = ['$uiRouter', ConfigSelectors.name, ConfigureState.name]; + + /** + * @param {uirouter.UIRouter} $uiRouter + * @param {ConfigSelectors} ConfigSelectors + * @param {ConfigureState} ConfigureState + */ + constructor($uiRouter, ConfigSelectors, ConfigureState) { + this.$uiRouter = $uiRouter; + this.ConfigSelectors = ConfigSelectors; + this.ConfigureState = ConfigureState; + } + + $onInit() { + const clusterID$ = this.$uiRouter.globals.params$.take(1).pluck('clusterID').filter((v) => v).take(1); + this.shortCaches$ = this.ConfigureState.state$.let(this.ConfigSelectors.selectCurrentShortCaches); + this.originalCluster$ = clusterID$.distinctUntilChanged().switchMap((id) => { + return this.ConfigureState.state$.let(this.ConfigSelectors.selectClusterToEdit(id)); + }).distinctUntilChanged().publishReplay(1).refCount(); + this.isNew$ = this.$uiRouter.globals.params$.pluck('clusterID').map((id) => id === 'new'); + this.isBlocked$ = clusterID$; + } + + save(cluster) { + this.ConfigureState.dispatchAction(advancedSaveCluster(cluster)); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/index.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/index.js new file mode 100644 index 0000000..c647937 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/index.js @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import angular from 'angular'; +import component from './component'; + +export default angular + .module('ignite-console.page-configure-advanced.clusters', []) + .component(component.name, component); http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/template.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/template.pug new file mode 100644 index 0000000..51ba005 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/template.pug @@ -0,0 +1,25 @@ +//- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +cluster-edit-form( + is-new='$ctrl.isNew$|async:this' + cluster='$ctrl.originalCluster$|async:this' + caches='$ctrl.shortCaches$|async:this' + on-save='$ctrl.save($event)' + ng-class='{"pca-form-blocked": !($ctrl.isBlocked$|async:this)}' + fake-ui-can-exit='base.configuration.edit.advanced.cluster' + form-ui-can-exit-guard +) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/component.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/component.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/component.js new file mode 100644 index 0000000..868e3d0 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/component.js @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import controller from './controller'; +import template from './template.pug'; + +export default { + name: 'pageConfigureAdvancedIgfs', + template, + controller +}; http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/controller.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/controller.js new file mode 100644 index 0000000..09d139d --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/controller.js @@ -0,0 +1,139 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Observable} from 'rxjs/Observable'; +import {Subject} from 'rxjs/Subject'; +import {combineLatest} from 'rxjs/observable/combineLatest'; +import naturalCompare from 'natural-compare-lite'; +import {merge} from 'rxjs/observable/merge'; +import get from 'lodash/get'; +import {removeClusterItems, advancedSaveIGFS} from 'app/components/page-configure/store/actionCreators'; +import ConfigureState from 'app/components/page-configure/services/ConfigureState'; +import ConfigSelectors from 'app/components/page-configure/store/selectors'; +import IGFSs from 'app/services/IGFSs'; + +export default class PageConfigureAdvancedIGFS { + static $inject = [ConfigSelectors.name, ConfigureState.name, '$uiRouter', IGFSs.name, '$state', 'configSelectionManager']; + /** + * @param {ConfigSelectors} ConfigSelectors + * @param {ConfigureState} ConfigureState + * @param {uirouter.UIRouter} $uiRouter + * @param {IGFSs} IGFSs + * @param {uirouter.StateService} $state + */ + constructor(ConfigSelectors, ConfigureState, $uiRouter, IGFSs, $state, configSelectionManager) { + this.ConfigSelectors = ConfigSelectors; + this.ConfigureState = ConfigureState; + this.$uiRouter = $uiRouter; + this.IGFSs = IGFSs; + this.$state = $state; + this.configSelectionManager = configSelectionManager; + } + $onDestroy() { + this.subscription.unsubscribe(); + this.visibleRows$.complete(); + this.selectedRows$.complete(); + } + $onInit() { + this.visibleRows$ = new Subject(); + this.selectedRows$ = new Subject(); + + /** @type {Array<uiGrid.IColumnDefOf<ig.config.igfs.ShortIGFS>>} */ + this.columnDefs = [ + { + name: 'name', + displayName: 'Name', + field: 'name', + enableHiding: false, + filter: { + placeholder: 'Filter by nameâ¦' + }, + sort: {direction: 'asc', priority: 0}, + sortingAlgorithm: naturalCompare, + minWidth: 165 + }, + { + name: 'defaultMode', + displayName: 'Mode', + field: 'defaultMode', + multiselectFilterOptions: this.IGFSs.defaultMode.values, + width: 160 + }, + { + name: 'affinnityGroupSize', + displayName: 'Group size', + field: 'affinnityGroupSize', + enableFiltering: false, + width: 130 + } + ]; + this.itemID$ = this.$uiRouter.globals.params$.pluck('igfsID'); + + /** @type {Observable<ig.config.igfs.ShortIGFS>} */ + this.shortItems$ = this.ConfigureState.state$ + .let(this.ConfigSelectors.selectCurrentShortIGFSs) + .map((items = []) => items.map((i) => ({ + _id: i._id, + name: i.name, + affinnityGroupSize: i.affinnityGroupSize || this.IGFSs.affinnityGroupSize.default, + defaultMode: i.defaultMode || this.IGFSs.defaultMode.default + }))); + this.originalItem$ = this.itemID$.distinctUntilChanged().switchMap((id) => { + return this.ConfigureState.state$.let(this.ConfigSelectors.selectIGFSToEdit(id)); + }).distinctUntilChanged().publishReplay(1).refCount(); + this.isNew$ = this.itemID$.map((id) => id === 'new'); + this.itemEditTitle$ = combineLatest(this.isNew$, this.originalItem$, (isNew, item) => { + return `${isNew ? 'Create' : 'Edit'} IGFS ${!isNew && get(item, 'name') ? `â${get(item, 'name')}â` : ''}`; + }); + this.selectionManager = this.configSelectionManager({ + itemID$: this.itemID$, + selectedItemRows$: this.selectedRows$, + visibleRows$: this.visibleRows$, + loadedItems$: this.shortItems$ + }); + this.tableActions$ = this.selectionManager.selectedItemIDs$.map((selectedItems) => [ + { + action: 'Clone', + click: () => this.clone(selectedItems), + available: false + }, + { + action: 'Delete', + click: () => { + this.remove(selectedItems); + }, + available: true + } + ]); + this.subscription = merge( + this.originalItem$, + this.selectionManager.editGoes$.do((id) => this.edit(id)), + this.selectionManager.editLeaves$.do((options) => this.$state.go('base.configuration.edit.advanced.igfs', null, options)) + ).subscribe(); + } + edit(igfsID) { + this.$state.go('base.configuration.edit.advanced.igfs.igfs', {igfsID}); + } + save(igfs) { + this.ConfigureState.dispatchAction(advancedSaveIGFS(igfs)); + } + remove(itemIDs) { + this.ConfigureState.dispatchAction( + removeClusterItems(this.$uiRouter.globals.params.clusterID, 'igfss', itemIDs, true, true) + ); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/index.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/index.js new file mode 100644 index 0000000..44b50b0 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/index.js @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import angular from 'angular'; +import component from './component'; + +export default angular + .module('ignite-console.page-configure-advanced.igfs', []) + .component(component.name, component); http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/template.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/template.pug new file mode 100644 index 0000000..e11b9df --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/template.pug @@ -0,0 +1,51 @@ +//- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +pc-items-table( + table-title='::"My IGFS"' + column-defs='$ctrl.columnDefs' + items='$ctrl.shortItems$|async:this' + actions-menu='$ctrl.tableActions$|async:this' + selected-row-id='$ctrl.selectionManager.selectedItemIDs$|async:this' + one-way-selection='::true' + on-selection-change='$ctrl.selectedRows$.next($event)' + on-filter-changed='$ctrl.filterChanges$.next($event)' + on-visible-rows-change='$ctrl.visibleRows$.next($event)' +) + footer-slot + div(style='font-style: italic' ng-hide='($ctrl.shortItems$|async:this).length') + | You have no IGFS. #[a.link-success(ui-sref='base.configuration.edit.advanced.igfs.igfs({igfsID: "new"})') Create one?] + a.link-success( + ui-sref='base.configuration.edit.advanced.igfs.igfs({igfsID: "new"})' + ng-show='($ctrl.shortItems$|async:this).length' + ) + Add new IGFS + +h2.pc-page-header.ng-animate-disabled(ng-if='!($ctrl.itemID$|async:this)') + | {{ ($ctrl.selectionManager.selectedItemIDs$|async:this).length ? 'Multiple' : 'No' }} IGFSs selected + span.pc-page-header-sub Select only one IGFS to see settings and edit it + +h2.pc-page-header.ng-animate-disabled(ng-if='$ctrl.itemID$|async:this') + | {{ $ctrl.itemEditTitle$|async:this }} + +igfs-edit-form( + igfs='$ctrl.originalItem$|async:this' + igfss='$ctrl.shortItems$|async:this' + m_odels='$ctrl.shortModels$|async:this' + on-save='$ctrl.save($event)' + ng-class='{"pca-form-blocked": !($ctrl.itemID$|async:this)}' + fake-ui-can-exit='base.configuration.edit.advanced.igfs.igfs' + form-ui-can-exit-guard +) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/component.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/component.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/component.js new file mode 100644 index 0000000..f29a940 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/component.js @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import controller from './controller'; +import template from './template.pug'; +import './style.scss'; + +export default { + name: 'pageConfigureAdvancedModels', + template, + controller +}; http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/controller.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/controller.js new file mode 100644 index 0000000..7771735 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/controller.js @@ -0,0 +1,171 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Subject} from 'rxjs/Subject'; +import {Observable} from 'rxjs/Observable'; +import {combineLatest} from 'rxjs/observable/combineLatest'; +import {merge} from 'rxjs/observable/merge'; +import get from 'lodash/get'; + +import hasIndexTemplate from './hasIndex.template.pug'; +import keyCellTemplate from './keyCell.template.pug'; +import valueCellTemplate from './valueCell.template.pug'; + +import {removeClusterItems, advancedSaveModel} from 'app/components/page-configure/store/actionCreators'; + +import {default as ConfigSelectors} from 'app/components/page-configure/store/selectors'; +import {default as ConfigureState} from 'app/components/page-configure/services/ConfigureState'; +import {default as Models} from 'app/services/Models'; + +export default class PageConfigureAdvancedModels { + static $inject = [ConfigSelectors.name, ConfigureState.name, '$uiRouter', Models.name, '$state', 'configSelectionManager']; + /** + * @param {ConfigSelectors} ConfigSelectors + * @param {ConfigureState} ConfigureState + * @param {Models} Models + * @param {uirouter.UIRouter} $uiRouter + * @param {uirouter.StateService} $state + */ + constructor(ConfigSelectors, ConfigureState, $uiRouter, Models, $state, configSelectionManager) { + this.$state = $state; + this.$uiRouter = $uiRouter; + this.configSelectionManager = configSelectionManager; + this.ConfigSelectors = ConfigSelectors; + this.ConfigureState = ConfigureState; + this.Models = Models; + } + $onDestroy() { + this.subscription.unsubscribe(); + this.visibleRows$.complete(); + this.selectedRows$.complete(); + } + $onInit() { + /** @type {Subject<Array<ig.config.model.ShortDomainModel>>} */ + this.visibleRows$ = new Subject(); + + /** @type {Subject<Array<ig.config.model.ShortDomainModel>>} */ + this.selectedRows$ = new Subject(); + + /** @type {Array<uiGrid.IColumnDefOf<ig.config.model.ShortDomainModel>>} */ + this.columnDefs = [ + { + name: 'hasIndex', + displayName: 'Indexed', + field: 'hasIndex', + type: 'boolean', + enableFiltering: true, + visible: true, + multiselectFilterOptions: [{value: true, label: 'Yes'}, {value: false, label: 'No'}], + width: 100, + cellTemplate: hasIndexTemplate + }, + { + name: 'keyType', + displayName: 'Key type', + field: 'keyType', + enableHiding: false, + filter: { + placeholder: 'Filter by key typeâ¦' + }, + cellTemplate: keyCellTemplate, + minWidth: 165 + }, + { + name: 'valueType', + displayName: 'Value type', + field: 'valueType', + enableHiding: false, + filter: { + placeholder: 'Filter by value typeâ¦' + }, + sort: {direction: 'asc', priority: 0}, + cellTemplate: valueCellTemplate, + minWidth: 165 + } + ]; + + /** @type {Observable<string>} */ + this.itemID$ = this.$uiRouter.globals.params$.pluck('modelID'); + + /** @type {Observable<Array<ig.config.model.ShortDomainModel>>} */ + this.shortItems$ = this.ConfigureState.state$.let(this.ConfigSelectors.selectCurrentShortModels) + .do((shortModels = []) => { + const value = shortModels.every((m) => m.hasIndex); + this.columnDefs[0].visible = !value; + }) + .publishReplay(1) + .refCount(); + + this.shortCaches$ = this.ConfigureState.state$.let(this.ConfigSelectors.selectCurrentShortCaches); + + /** @type {Observable<ig.config.model.DomainModel>} */ + this.originalItem$ = this.itemID$.distinctUntilChanged().switchMap((id) => { + return this.ConfigureState.state$.let(this.ConfigSelectors.selectModelToEdit(id)); + }).distinctUntilChanged().publishReplay(1).refCount(); + + this.isNew$ = this.itemID$.map((id) => id === 'new'); + + this.itemEditTitle$ = combineLatest(this.isNew$, this.originalItem$, (isNew, item) => { + return `${isNew ? 'Create' : 'Edit'} model ${!isNew && get(item, 'valueType') ? `â${get(item, 'valueType')}â` : ''}`; + }); + + this.selectionManager = this.configSelectionManager({ + itemID$: this.itemID$, + selectedItemRows$: this.selectedRows$, + visibleRows$: this.visibleRows$, + loadedItems$: this.shortItems$ + }); + + this.tableActions$ = this.selectionManager.selectedItemIDs$.map((selectedItems) => [ + { + action: 'Clone', + click: () => this.clone(selectedItems), + available: false + }, + { + action: 'Delete', + click: () => { + this.remove(selectedItems); + }, + available: true + } + ]); + + this.subscription = merge( + this.originalItem$, + this.selectionManager.editGoes$.do((id) => this.edit(id)), + this.selectionManager.editLeaves$.do((options) => this.$state.go('base.configuration.edit.advanced.models', null, options)) + ).subscribe(); + } + + edit(modelID) { + this.$state.go('base.configuration.edit.advanced.models.model', {modelID}); + } + + save(model) { + this.ConfigureState.dispatchAction(advancedSaveModel(model)); + } + + /** + * @param {Array<string>} itemIDs + */ + remove(itemIDs) { + this.ConfigureState.dispatchAction( + removeClusterItems(this.$uiRouter.globals.params.clusterID, 'models', itemIDs, true, true) + ); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/hasIndex.template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/hasIndex.template.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/hasIndex.template.pug new file mode 100644 index 0000000..68330a0 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/hasIndex.template.pug @@ -0,0 +1,23 @@ +//- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +.ui-grid-cell-contents(ng-class=`{ + 'page-configure-advanced__invalid-model-cell': !row.entity[col.field], + 'page-configure-advanced__valid-model-cell': row.entity[col.field], +}`) + svg(ignite-icon='attention' ng-if='!row.entity[col.field]') + svg(ignite-icon='checkmark' ng-if='row.entity[col.field]') + span {{ row.entity[col.field] ? 'Yes' : 'No'}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/index.js b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/index.js new file mode 100644 index 0000000..e1a800a --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/index.js @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import angular from 'angular'; +import component from './component'; + +export default angular + .module('ignite-console.page-configure-advanced.models', []) + .component(component.name, component); http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/keyCell.template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/keyCell.template.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/keyCell.template.pug new file mode 100644 index 0000000..5608448 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/keyCell.template.pug @@ -0,0 +1,21 @@ +//- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +.ui-grid-cell-contents(ng-class=`{'page-configure-advanced__invalid-model-cell': !row.entity.keyType}`) + span(ng-if='row.entity[col.field]') + | {{ row.entity[col.field] }} + i(ng-if-start='!row.entity[col.field]') No keyType defined + svg(ignite-icon='attention' ng-if-end) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/style.scss ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/style.scss b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/style.scss new file mode 100644 index 0000000..8dc6e23 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/style.scss @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +page-configure-advanced-models { + @import 'public/stylesheets/variables.scss'; + .page-configure-advanced__valid-model-cell, + .page-configure-advanced__invalid-model-cell { + i { + font-style: italic; + } + [ignite-icon] { + vertical-align: -3px; + margin-right: 10px; + } + } + .page-configure-advanced__valid-model-cell { + color: green; + } + .page-configure-advanced__invalid-model-cell { + color: $ignite-brand-primary; + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/template.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/template.pug new file mode 100644 index 0000000..0586ae1 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/template.pug @@ -0,0 +1,51 @@ +//- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +pc-items-table( + table-title='::"My domain models"' + column-defs='$ctrl.columnDefs' + items='$ctrl.shortItems$|async:this' + actions-menu='$ctrl.tableActions$|async:this' + selected-row-id='$ctrl.selectionManager.selectedItemIDs$|async:this' + one-way-selection='::true' + on-selection-change='$ctrl.selectedRows$.next($event)' + on-filter-changed='$ctrl.filterChanges$.next($event)' + on-visible-rows-change='$ctrl.visibleRows$.next($event)' +) + footer-slot + div(style='font-style: italic' ng-hide='($ctrl.shortItems$|async:this).length') + | You have no models. #[a.link-success(ui-sref='base.configuration.edit.advanced.models.model({modelID: "new"})') Create one?] + a.link-success( + ui-sref='base.configuration.edit.advanced.models.model({modelID: "new"})' + ng-show='($ctrl.shortItems$|async:this).length' + ) + Add new model + +h2.pc-page-header.ng-animate-disabled(ng-if='!($ctrl.itemID$|async:this)') + | {{ ($ctrl.selectionManager.selectedItemIDs$|async:this).length ? 'Multiple' : 'No' }} models selected + span.pc-page-header-sub Select only one model to see settings and edit it + +h2.pc-page-header.ng-animate-disabled(ng-if='$ctrl.itemID$|async:this') + | {{ $ctrl.itemEditTitle$|async:this }} + +model-edit-form( + model='$ctrl.originalItem$|async:this' + models='$ctrl.shortItems$|async:this' + caches='$ctrl.shortCaches$|async:this' + on-save='$ctrl.save($event)' + ng-class='{"pca-form-blocked": !($ctrl.itemID$|async:this)}' + fake-ui-can-exit='base.configuration.edit.advanced.models.model' + form-ui-can-exit-guard +) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/valueCell.template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/valueCell.template.pug b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/valueCell.template.pug new file mode 100644 index 0000000..6bbe294 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/valueCell.template.pug @@ -0,0 +1,18 @@ +//- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +.ui-grid-cell-contents(ng-class=`{'page-configure-advanced__invalid-model-cell': !row.entity.keyType}`) + | {{ row.entity[col.field]}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/controller.js b/modules/web-console/frontend/app/components/page-configure-advanced/controller.js index da20527..ebd7f99 100644 --- a/modules/web-console/frontend/app/components/page-configure-advanced/controller.js +++ b/modules/web-console/frontend/app/components/page-configure-advanced/controller.js @@ -16,20 +16,13 @@ */ export default class PageConfigureAdvancedController { - static $inject = ['$scope']; - static menuItems = [ - { text: 'Clusters', sref: 'base.configuration.tabs.advanced.clusters' }, - { text: 'Model', sref: 'base.configuration.tabs.advanced.domains' }, - { text: 'Caches', sref: 'base.configuration.tabs.advanced.caches' }, - { text: 'IGFS', sref: 'base.configuration.tabs.advanced.igfs' }, - { text: 'Summary', sref: 'base.configuration.tabs.advanced.summary' } + { text: 'Cluster', sref: 'base.configuration.edit.advanced.cluster' }, + { text: 'SQL Scheme', sref: 'base.configuration.edit.advanced.models' }, + { text: 'Caches', sref: 'base.configuration.edit.advanced.caches' }, + { text: 'IGFS', sref: 'base.configuration.edit.advanced.igfs' } ]; - constructor($scope) { - Object.assign(this, {$scope}); - } - $onInit() { this.menuItems = this.constructor.menuItems; } http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/index.js b/modules/web-console/frontend/app/components/page-configure-advanced/index.js index 65734cd..9eab482 100644 --- a/modules/web-console/frontend/app/components/page-configure-advanced/index.js +++ b/modules/web-console/frontend/app/components/page-configure-advanced/index.js @@ -17,9 +17,24 @@ import angular from 'angular'; import component from './component'; -import service from './service'; +import cluster from './components/page-configure-advanced-cluster'; +import models from './components/page-configure-advanced-models'; +import caches from './components/page-configure-advanced-caches'; +import igfs from './components/page-configure-advanced-igfs'; +import cacheEditForm from './components/cache-edit-form'; +import clusterEditForm from './components/cluster-edit-form'; +import igfsEditForm from './components/igfs-edit-form'; +import modelEditForm from './components/model-edit-form'; export default angular - .module('ignite-console.page-configure-advanced', []) - .component('pageConfigureAdvanced', component) - .service('PageConfigureAdvanced', service); + .module('ignite-console.page-configure-advanced', [ + cluster.name, + models.name, + caches.name, + igfs.name, + igfsEditForm.name, + modelEditForm.name, + cacheEditForm.name, + clusterEditForm.name + ]) + .component('pageConfigureAdvanced', component); http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/service.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/service.js b/modules/web-console/frontend/app/components/page-configure-advanced/service.js deleted file mode 100644 index 679837f..0000000 --- a/modules/web-console/frontend/app/components/page-configure-advanced/service.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default class PageConfigureAdvanced { - static $inject = ['$state', '$q']; - - constructor($state, $q) { - Object.assign(this, {$state, $q}); - } - - onStateEnterRedirect(toState) { - if (toState.name === 'base.configuration.tabs.advanced') - return this.$state.go('.clusters', null, {location: 'replace'}); - - return this.$q.resolve(); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/style.scss ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/style.scss b/modules/web-console/frontend/app/components/page-configure-advanced/style.scss index 0415a79..7af830c 100644 --- a/modules/web-console/frontend/app/components/page-configure-advanced/style.scss +++ b/modules/web-console/frontend/app/components/page-configure-advanced/style.scss @@ -18,65 +18,124 @@ page-configure-advanced { @import '../../../public/stylesheets/variables.scss'; + $nav-height: 46px; + display: flex; - flex-direction: row; - padding: 30px; + flex-direction: column; - .pca-sidebar { - flex: 0 0 180px; - display: flex; - flex-direction: column; - border-right: 1px solid $gray-lighter; - padding-right: 20px; + .pca-form-blocked { + opacity: 0.5; + pointer-events: none; + transition: opacity 0.2s; } .pca-menu { + height: $nav-height; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2); + } + + .pca-menu > ul { + margin: 0; padding: 0; + display: flex; + flex-direction: row; + height: $nav-height; + background-color: #f9f9f9; list-style: none; + border-bottom: 1px solid #dddddd !important; + position: sticky; - li { - line-height: $input-height; - - a { - font-size: 18px !important; - color: $ignite-header-color; - position: relative; - white-space: nowrap; - overflow: hidden; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; - - span.fa-stack { - margin-right: 5px; - font-size: 12px; - height: 26px; - } - } + .pca-menu-link { + border-radius: 0; + color: #393939; + font-weight: normal; + font-size: 12px; + padding: 15px 20px 14px; + line-height: 16px; + border-right: 1px solid #dddddd; + text-decoration: none !important; + transition-duration: 0.2s; + transition-property: border-bottom, background-color, color, padding-bottom; + border-bottom: $ignite-brand-primary 0px solid; - a:hover { color: $link-hover-color; } + &.active, &:hover { + background-color: white; + color: $ignite-brand-primary; + border-bottom: $ignite-brand-primary 3px solid; + padding-bottom: 12px; + } - a.active { - color: $link-color; + &:hover:not(.active) { + border-bottom-color: lighten($ignite-brand-primary, 25%) } } + } + + .pca-content { + border-left: 1px solid $gray-lighter; + padding: 30px; + flex: 1; + } + + + .pca-panel { + margin-bottom: 20px; + } - li.active > a { - color: $link-color; + .pca-form-row { + display: flex; + flex-direction: row; + + .pca-form-column-6 { + flex: 6; + } + } + + // Aligns config section form and preview top + .pca-form-column-6.pc-form-grid-row { + margin-top: -10px; + } +} + +.pca-panel { + font-family: Roboto; + border-radius: 0 0 4px 4px; + background-color: #ffffff; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2); + + &#{&}__disabled { + opacity: 0.5; + } + + .pca-panel-heading { + padding: 30px 20px 30px; + color: #393939; + display: flex; + flex-direction: row; + align-items: baseline; + user-select: none; + cursor: pointer; + + ignite-form-panel-chevron { + margin-right: 10px; + position: relative; + top: -3px; } - li a:hover { - text-decoration: none; + .pca-panel-heading-title { + font-size: 16px; + margin-right: 8px; + white-space: nowrap; } - li.active > a:not(.dropdown-toggle) { - cursor: default; - pointer-events: none; + .pca-panel-heading-description { + font-size: 12px; + color: #757575; } } - .pca-content { - border-left: 1px solid $gray-lighter; - padding: 30px; - flex: 1; + .pca-panel-body { + border-top: 1px solid #dddddd; + padding: 15px 20px; } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/7ee1683e/modules/web-console/frontend/app/components/page-configure-advanced/template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure-advanced/template.pug b/modules/web-console/frontend/app/components/page-configure-advanced/template.pug index d930fbc..ba594f3 100644 --- a/modules/web-console/frontend/app/components/page-configure-advanced/template.pug +++ b/modules/web-console/frontend/app/components/page-configure-advanced/template.pug @@ -14,13 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. -.pca-sidebar - nav.pca-menu(bs-affix) +nav.pca-menu + ul li(ng-repeat='item in $ctrl.menuItems') - a(ui-sref-active='active' ui-sref='{{::item.sref}}') - span.fa-stack - i.fa.fa-circle-thin.fa-stack-2x - i.fa.fa-stack-1x {{::$index + 1}} - | {{::item.text}} + a.pca-menu-link.btn-ignite(ui-sref-active='active' ui-sref='{{::item.sref}}') + svg(ng-if='::item.icon' ignite-icon='{{::item.icon}}').icon-left + |{{::item.text}} -.pca-content.docs-content(ui-view='') \ No newline at end of file +ui-view \ No newline at end of file
