http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/components/query-editor.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/query-editor.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/query-editor.js index 01ba37e..f119fc8 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/query-editor.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/query-editor.js @@ -87,14 +87,14 @@ export default Ember.Component.extend({ editor = this.get('editor'); - editor.on('cursorActivity', function() { + editor.on('cursorActivity', function () { self.set('highlightedText', editor.getSelections()); }); editor.setValue(this.get('query') || ''); editor.on('change', function (instance) { - Ember.run(function() { + Ember.run(function () { self.set('query', instance.getValue()); }); }); @@ -110,7 +110,7 @@ export default Ember.Component.extend({ this.tablesChanged(); }.on('didInsertElement'), - updateValue: function() { + updateValue: function () { var query = this.get('query'); var editor = this.get('editor');
http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/components/query-tabs.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/query-tabs.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/query-tabs.js deleted file mode 100644 index 0ef6768..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/query-tabs.js +++ /dev/null @@ -1,121 +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. - */ -import Ember from 'ember'; - -export default Ember.Component.extend({ - tabClassNames : "fa queries-icon query-context-tab", - openOverlayAction : 'openOverlay', - closeOverlayAction : 'closeOverlay', - - tabs: [ - Ember.Object.create({ - iconClass: 'fa-code', - action: 'setDefaultActive' - }), - Ember.Object.create({ - iconClass: 'fa-gear', - action: 'toggleOverlay', - template: 'settings', - outlet: 'overlay', - into: 'open-queries' - }), - Ember.Object.create({ - iconClass: 'fa-bar-chart', - action: 'toggleOverlay', - template: 'visual-explain', - outlet: 'overlay', - into: 'index' - }), - Ember.Object.create({ - iconClass: 'text-icon', - text: 'TEZ', - action: 'toggleOverlay', - template: 'tez-ui', - outlet: 'overlay', - into: 'index' - }), - Ember.Object.create({ - iconClass: 'fa-envelope', - action: 'toggleOverlay', - template: 'messages', - outlet: 'overlay', - into: 'open-queries', - badgeProperty: 'count' - }) - ], - - setDefaultTab: function() { - var defaultTab = this.get('tabs.firstObject'); - - defaultTab.set('active', true); - this.set('default', defaultTab); - this.set('active', defaultTab); - }.on('init'), - - setupTabsBadges: function() { - var tabs = this.get('tabs'); - var self = this; - - tabs.map(function(tab) { - if (tab.get('badgeProperty')) { - var controller = self.container.lookup('controller:' + tab.get('template')); - tab.set('controller', controller); - - Ember.oneWay(tab, 'badge', 'controller.count'); - } - }); - }.on('init'), - - closeActiveOverlay: function() { - this.sendAction('closeOverlayAction', this.get('active')); - }, - - openOverlay: function(tab) { - this.closeActiveOverlay(); - this.set('active.active', false); - tab.set('active', true); - this.set('active', tab); - this.sendAction('openOverlayAction', tab); - }, - - setDefaultActive: function() { - var active = this.get('active'); - var defaultTab = this.get('default'); - - if (active !== defaultTab) { - this.closeActiveOverlay(); - defaultTab.set('active', true); - active.set('active', false); - this.set('active', defaultTab); - } - }, - - actions: { - toggleOverlay: function(tab) { - if (tab !== this.get('default') && tab.get('active')) { - this.setDefaultActive(); - } else { - this.openOverlay(tab); - } - }, - - setDefaultActive: function() { - this.setDefaultActive(); - } - } -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/components/typeahead-widget.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/typeahead-widget.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/typeahead-widget.js index 51f09be..b38c891 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/typeahead-widget.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/typeahead-widget.js @@ -20,7 +20,7 @@ import Typeahead from 'ember-cli-selectize/components/ember-selectize'; import Ember from 'ember'; export default Typeahead.extend(Ember.I18n.TranslateableProperties, { - didInsertElement: function() { + didInsertElement: function () { this._super(); if (!this.get('selection') && this.get('content.firstObject')) { @@ -30,8 +30,7 @@ export default Typeahead.extend(Ember.I18n.TranslateableProperties, { this.selectize.on('dropdown_close', Ember.$.proxy(this.onClose, this)); }, - removeExcludedObserver: function() { - var self = this; + removeExcludedObserver: function () { var options = this.get('content'); if (!options) { @@ -42,8 +41,7 @@ export default Typeahead.extend(Ember.I18n.TranslateableProperties, { } }.observes('[email protected]').on('init'), - removeExcluded: function(shouldReturn) { - var self = this; + removeExcluded: function (shouldReturn) { var excluded = this.get('excluded') || []; var options = this.get('options'); var selection = this.get('selection'); @@ -59,9 +57,12 @@ export default Typeahead.extend(Ember.I18n.TranslateableProperties, { objectToModify = Ember.copy(options); } + var valuePath = this.get('optionValuePath'); + var selectionName = selection ? selection[valuePath] : selection; + if (options) { - options.forEach(function(option, index) { - if (excluded.contains(option) && option !== selection) { + options.forEach(function (option) { + if (excluded.contains(option) && option.name !== selectionName) { objectsToRemove.push(option); } else if (!objectToModify.contains(option)) { objectsToAdd.push(option); @@ -75,13 +76,13 @@ export default Typeahead.extend(Ember.I18n.TranslateableProperties, { return objectToModify; }, - onClose: function() { + onClose: function () { if (!this.get('selection') && this.get('prevSelection')) { this.set('selection', this.get('prevSelection')); } }, - _onItemAdd: function(value) { + _onItemAdd: function (value) { this._super(value); this.set('prevSelection', this.get('selection')); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/databases.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/databases.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/databases.js index 0b103cd..77b5fe5 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/databases.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/databases.js @@ -209,24 +209,24 @@ export default Ember.ArrayController.extend({ }.property(), actions: { - refreshDatabaseExplorer: function() { + refreshDatabaseExplorer: function () { var self = this; var selectedDatabase = this.get('selectedDatabase'); this.store.unloadAll('database'); - this.store.fetchAll('database').then(function() { + this.store.fetchAll('database').then(function () { var database = self.get('model').findBy('id', selectedDatabase.get('id')); self.set('selectedDatabase', database); - }).catch(function(response) { + }).catch(function (response) { self.notify.error(response.responseJSON.message, response.responseJSON.trace); }); }, - loadSampleData: function(tableName, database) { + loadSampleData: function (tableName, database) { var self = this; this.send('addQuery', Ember.I18n.t('titles.tableSample', { tableName: tableName })); - Ember.run.later(function() { + Ember.run.later(function () { var query = constants.sampleDataQuery.fmt(tableName); self.set('selectedDatabase', database); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/history.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/history.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/history.js index a5de342..30e9b9b 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/history.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/history.js @@ -142,6 +142,31 @@ export default Ember.ArrayController.extend(FilterableMixin, { job.destroyRecord().then(function () { self.store.find(constants.namingConventions.job, id); }); + }, + + clearFilters: function () { + var columns = this.get('columns'); + + if (columns) { + columns.forEach(function (column) { + var filterValue = column.get('filterValue'); + var rangeFilter; + + if (filterValue) { + if (typeof filterValue === 'string') { + column.set('filterValue'); + } else { + rangeFilter = column.get('numberRange') || column.get('dateRange'); + + rangeFilter.set('from', rangeFilter.get('min')); + rangeFilter.set('to', rangeFilter.get('max')); + } + } + }); + } + + //call clear filters from Filterable mixin + this.clearFilters(); } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js index df2d088..fa79048 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js @@ -29,7 +29,8 @@ export default Ember.Controller.extend({ constants.namingConventions.jobExplain, constants.namingConventions.settings, constants.namingConventions.visualExplain, - constants.namingConventions.tezUI + constants.namingConventions.tezUI, + constants.namingConventions.jobProgress, ], openQueries: Ember.computed.alias('controllers.' + constants.namingConventions.openQueries), @@ -41,19 +42,7 @@ export default Ember.Controller.extend({ settings: Ember.computed.alias('controllers.' + constants.namingConventions.settings), visualExplain: Ember.computed.alias('controllers.' + constants.namingConventions.visualExplain), tezUI: Ember.computed.alias('controllers.' + constants.namingConventions.tezUI), - - isQueryTabActive: function() { - return !this.get('tezUI.showOverlay') && !this.get('visualExplain.showOverlay') && !this.get('settings.showOverlay'); - }.property('tezUI.showOverlay', 'visualExplain.showOverlay', 'settings.showOverlay'), - - shouldShowTez: function() { - return this.get('model.dagId') && this.get('tezUI.isTezViewAvailable'); - }.property('model.dagId', 'tezUI.isTezViewAvailable'), - - shouldShowVisualExplain: function () { - return this.get('openQueries.currentQuery.fileContent'); - }.property('openQueries.currentQuery.fileContent'), - + jobProgress: Ember.computed.alias('controllers.' + constants.namingConventions.jobProgress), canExecute: function () { var isModelRunning = this.get('model.isRunning'); @@ -199,10 +188,26 @@ export default Ember.Controller.extend({ }, prependQuerySettings: function (query) { - var settings = this.get('settings').getSettingsString(); + var validSettings = this.get('settings').getCurrentValidSettings(); + var regex = new RegExp(utils.regexes.setSetting); + var existingSettings = query.match(regex); + + //clear previously added settings + if (existingSettings) { + existingSettings.forEach(function (setting) { + query = query.replace(setting, ''); + }); + } + + query = query.trim(); - if (settings.length) { - return settings + "\n\n" + query; + //update with the current settings + if (validSettings) { + query = '\n' + query; + + validSettings.forEach(function (setting) { + query = setting + '\n' + query; + }); } return query; @@ -221,16 +226,16 @@ export default Ember.Controller.extend({ } queries = queryComponents.queryString.split(';'); - queries = queries.map(function(s) { + queries = queries.map(function (s) { return s.trim(); }); queries = queries.filter(Boolean); // return false if multiple queries are selected // @FIXME: Remove this to support multiple queries - if (queries.length > 1) { - return false; - } + // if (queries.length > 1) { + // return false; + // } queries = queries.map(function (query) { if (shouldExplain) { @@ -335,7 +340,7 @@ export default Ember.Controller.extend({ }); }.observes('content'), - selectedDatabaseChanged: function() { + selectedDatabaseChanged: function () { this.set('content.dataBase', this.get('databases.selectedDatabase.name')); }.observes('databases.selectedDatabase'), @@ -447,7 +452,7 @@ export default Ember.Controller.extend({ this.saveToHDFS(); }, - downloadAsCSV: function() { + downloadAsCSV: function () { var self = this, defer = Ember.RSVP.defer(); @@ -467,7 +472,7 @@ export default Ember.Controller.extend({ }, insertUdf: function (item) { - var query = this.get('openQueries').getQueryForModel(this.get('model')); + var query = this.get('openQueries.currentQuery'); var queryString = query.get('fileContent'); @@ -523,7 +528,8 @@ export default Ember.Controller.extend({ //case 4. Update an existing query tab. -> route doesn't change var self = this, - defer = Ember.RSVP.defer(); + defer = Ember.RSVP.defer(), + currentQuery = this.get('openQueries.currentQuery'); this.set('model.dataBase', this.get('databases.selectedDatabase.name')); @@ -536,6 +542,8 @@ export default Ember.Controller.extend({ }); defer.promise.then(function (result) { + currentQuery.set('fileContent', self.prependQuerySettings(currentQuery.get('fileContent'))); + if (result.get('overwrite')) { self.get('openQueries').save(self.get('content'), null, true, result.get('text')); } else { @@ -578,41 +586,6 @@ export default Ember.Controller.extend({ }, function (err) { this.notify.error(err.responseJSON.message, err.responseJSON.trace); }); - }, - - toggleOverlay: function (targetController) { - var self = this; - - if (this.get('visualExplain.showOverlay') && targetController !== 'visualExplain') { - this.set('visualExplain.showOverlay', false); - } else if (this.get('tezUI.showOverlay') && targetController !== 'tezUI') { - this.set('tezUI.showOverlay', false); - } else if (this.get('settings.showOverlay') && targetController !== 'settings') { - this.set('settings.showOverlay', false); - } - - if (!targetController) { - return; - } - - if (targetController !== 'settings') { - //set content for visual explain and tez ui. - this.set(targetController + '.content', this.get('content')); - } - - if (targetController === 'visualExplain' && !this.get(targetController + '.showOverlay')) { - this._executeQuery(true, true).then(function (json) { - //this condition should be changed once we change the way of retrieving this json - if (json['STAGE PLANS']['Stage-1']) { - self.set(targetController + '.json', json); - self.toggleProperty(targetController + '.showOverlay'); - } - }, function (err) { - self.notify.error(err.responseJSON.message, err.responseJSON.trace); - }); - } else { - this.toggleProperty(targetController + '.showOverlay'); - } } } -}); +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/explain.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/explain.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/explain.js index e61df51..2f3e78d 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/explain.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/explain.js @@ -80,7 +80,6 @@ export default Ember.ObjectController.extend({ currentNode, currentNodeWhitespace, previousNode, - formattedExplain = [], getLeadingWhitespacesCount = function (str) { return str.replace(utils.regexes.whitespaces, '$1').length; }; @@ -96,7 +95,7 @@ export default Ember.ObjectController.extend({ text: str, parentNode: null, contents: [] - } + }; }); for (var i = 0; i < explainSet.length; i++) { @@ -130,4 +129,4 @@ export default Ember.ObjectController.extend({ this.set('formattedExplain', formatted); } -}); +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/logs.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/logs.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/logs.js index 59c0892..c75fffe 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/logs.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/logs.js @@ -21,8 +21,10 @@ import constants from 'hive/utils/constants'; import utils from 'hive/utils/functions'; export default Ember.ObjectController.extend({ - needs: [ constants.namingConventions.loadedFiles ], + needs: [ constants.namingConventions.queryTabs, + constants.namingConventions.loadedFiles ], + queryTabs: Ember.computed.alias('controllers.' + constants.namingConventions.queryTabs), files: Ember.computed.alias('controllers.' + constants.namingConventions.loadedFiles), reloadJobLogs: function (job) { @@ -68,19 +70,22 @@ export default Ember.ObjectController.extend({ this.reloadJobLogs(job).then(function () { var stillRunning = self.isJobRunning(job); + var currentContentId = self.get('content.id'); + var currentActiveTab = self.get('queryTabs.activeTab.name'); //if the current model is the same with the one displayed, continue reloading job - if (stillRunning && job.get('id') === self.get('content.id')) { + if (stillRunning && job.get('id') === currentContentId) { self.listenForUpdates(job); } else if (!stillRunning) { job.set('isRunning', undefined); - if (job.get('id') === self.get('content.id')) { + if (job.get('id') === currentContentId && + currentActiveTab === constants.namingConventions.index) { self.transitionToRoute(constants.namingConventions.subroutes.jobResults); } } }); - }, 2000); + }, 10000); }, isJobRunning: function (job) { http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/results.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/results.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/results.js index 9a50f27..dc7c199 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/results.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index/history-query/results.js @@ -24,19 +24,19 @@ export default Ember.ObjectController.extend({ cachedResults: [], formattedResults: [], - processResults: function() { + processResults: function () { var results = this.get('results'); if (!results || !results.schema || !results.rows) { return; } - var schema = results.schema.map(function(column) { + var schema = results.schema.map(function (column) { return { name: column[0], type: column[1], index: column[2] - } + }; }); this.set('formattedResults', { schema: schema, rows: results.rows }); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/job-progress.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/job-progress.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/job-progress.js new file mode 100644 index 0000000..737506e --- /dev/null +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/job-progress.js @@ -0,0 +1,92 @@ +/** + * 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 Ember from 'ember'; +import constants from 'hive/utils/constants'; + +export default Ember.Controller.extend({ + needs: [ constants.namingConventions.index ], + + index: Ember.computed.alias('controllers.' + constants.namingConventions.index), + + listenForProgress: function () { + var self = this; + var url = this.container.lookup('adapter:application').buildURL(); + var stages = []; + var job = this.get('index.model'); + + var reloadProgress = function () { + Ember.run.later(function () { + Ember.$.getJSON(url).then(function (data) { + var total = 0; + var length = Object.keys(data.vertexProgresses).length; + + if (!self.get('stages.length')) { + data.vertexProgresses.forEach(function (vertexProgress) { + var progress = vertexProgress.progress * 100; + + stages.pushObject(Ember.Object.create({ + name: vertexProgress.name, + value: progress + })); + + total += progress; + }); + + self.set('stages', stages); + } else { + data.vertexProgresses.forEach(function (vertexProgress) { + var progress = vertexProgress.progress * 100; + + self.get('stages').findBy('name', vertexProgress.name).set('value', progress); + + total += progress; + }); + } + + total /= length; + + self.set('totalProgress', total); + + if (job.get('isRunning')) { + reloadProgress(); + } + + }, function (err) { + reloadProgress(); + }); + }, 1000); + }; + + //reset stages + this.set('stages', []); + this.set('totalProgress', 0); + + if (!job.get('applicationId')) { + return; + } + + url += '/' + constants.namingConventions.jobs + '/' + job.get('id') + '/progress'; + + reloadProgress(); + }.observes('index.model', 'index.model.applicationId'), + + displayProgress: function () { + return this.get('index.model.constructor.typeKey') === constants.namingConventions.job; + }.property('index.model') +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/job.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/job.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/job.js index 7e62c20..2d53524 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/job.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/job.js @@ -26,7 +26,7 @@ export default Ember.ObjectController.extend({ files: Ember.computed.alias('controllers.' + constants.namingConventions.loadedFiles), canStop: function () { - return utils.insensitiveCompare(this.get('status'), constants.statuses.running, constants.statuses.initialized, constants.statuses.pending) + return utils.insensitiveCompare(this.get('status'), constants.statuses.running, constants.statuses.initialized, constants.statuses.pending); }.property('status'), actions: { http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/messages.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/messages.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/messages.js index 6de1c64..db8e0b5 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/messages.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/messages.js @@ -19,15 +19,19 @@ import Ember from 'ember'; export default Ember.Controller.extend({ messages: Ember.computed.alias('notify.messages'), - count: Ember.computed.alias('messages.length'), + count: Ember.computed.alias('notify.unseenMessages.length'), actions: { - removeMessage: function(message) { + removeMessage: function (message) { this.notify.removeMessage(message); }, - removeAllMessages: function() { + removeAllMessages: function () { this.notify.removeAllMessages(); + }, + + markMessagesAsSeen: function () { + this.notify.markMessagesAsSeen(); } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/open-queries.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/open-queries.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/open-queries.js index a0c033e..8add9a1 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/open-queries.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/open-queries.js @@ -200,7 +200,7 @@ export default Ember.ArrayController.extend({ tab.set('isDirty', false); - var content = self.get('index').prependQuerySettings(query.get('fileContent')); + var content = query.get('fileContent'); //update query tab path with saved model id if its a new record if (wasNew) { self.get('settings').updateSettingsId(originalId, updatedModel.get('id')); @@ -274,7 +274,7 @@ export default Ember.ArrayController.extend({ hasSettings; }, - isDirty: function(model) { + isDirty: function (model) { var query = this.getQueryForModel(model); if (model.get('isNew') && !query.get('fileContent')) { @@ -286,8 +286,6 @@ export default Ember.ArrayController.extend({ } return !!(!model.get('queryId') && model.get('isDirty')); - - }, updatedDeletedQueryTab: function (model) { http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/queries.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/queries.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/queries.js index aec2273..cbf6b42 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/queries.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/queries.js @@ -31,9 +31,6 @@ export default Ember.ArrayController.extend(FilterableMixin, { sortProperties: [], init: function () { - var oneYearAgo = new Date(); - oneYearAgo.setFullYear(oneYearAgo.getFullYear() - 1); - this._super(); this.set('columns', Ember.ArrayProxy.create({ content: Ember.A([ @@ -106,6 +103,23 @@ export default Ember.ArrayController.extend(FilterableMixin, { this.set('sortAscending', true); this.set('sortProperties', [ property ]); } + }, + + clearFilters: function () { + var columns = this.get('columns'); + + if (columns) { + columns.forEach(function (column) { + var filterValue = column.get('filterValue'); + + if (filterValue && typeof filterValue === 'string') { + column.set('filterValue'); + } + }); + } + + //call clear filters from Filterable mixin + this.clearFilters(); } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js new file mode 100644 index 0000000..4c50c2e --- /dev/null +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/query-tabs.js @@ -0,0 +1,164 @@ +/** + * 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 Ember from 'ember'; +import constants from 'hive/utils/constants'; + +export default Ember.Controller.extend({ + needs: [ constants.namingConventions.index], + + index: Ember.computed.alias('controllers' + constants.namingConventions.index), + + tabClassNames : "fa queries-icon query-context-tab", + + tabs: [ + Ember.Object.create({ + iconClass: 'fa-code', + id: 'query-icon', + action: 'setDefaultActive', + name: constants.namingConventions.index, + tooltip: Ember.I18n.t('tooltips.query') + }), + Ember.Object.create({ + iconClass: 'fa-gear', + id: 'settings-icon', + action: 'toggleOverlay', + template: 'settings', + outlet: 'overlay', + into: 'open-queries', + tooltip: Ember.I18n.t('tooltips.settings') + }), + Ember.Object.create({ + iconClass: 'fa-link', + id: 'visual-explain-icon', + action: 'toggleOverlay', + template: 'visual-explain', + outlet: 'overlay', + into: 'index', + onTabOpen: 'onTabOpen', + tooltip: Ember.I18n.t('tooltips.visualExplain') + }), + Ember.Object.create({ + iconClass: 'text-icon', + id: 'tez-icon', + text: 'TEZ', + action: 'toggleOverlay', + template: 'tez-ui', + outlet: 'overlay', + into: 'index', + tooltip: Ember.I18n.t('tooltips.tez') + }), + Ember.Object.create({ + iconClass: 'fa-envelope', + id: 'notifications-icon', + action: 'toggleOverlay', + template: 'messages', + outlet: 'overlay', + into: 'index', + badgeProperty: 'count', + onTabOpen: 'markMessagesAsSeen', + tooltip: Ember.I18n.t('tooltips.notifications') + }) + ], + + init: function() { + this.setupControllers(); + this.setDefaultTab(); + this.setupTabsBadges(); + }, + + setupControllers: function() { + var tabs = this.get('tabs'); + var self = this; + + tabs.map(function (tab) { + var controller; + + if (tab.get('template')) { + controller = self.container.lookup('controller:' + tab.get('template')); + tab.set('controller', controller); + } + }); + }, + + setDefaultTab: function () { + var defaultTab = this.get('tabs.firstObject'); + + defaultTab.set('active', true); + + this.set('default', defaultTab); + this.set('activeTab', defaultTab); + }, + + setupTabsBadges: function () { + var tabs = this.get('tabs').filterProperty('badgeProperty'); + + tabs.map(function (tab) { + Ember.oneWay(tab, 'badge', 'controller.' + tab.badgeProperty); + }); + }, + + closeActiveOverlay: function () { + this.send('closeOverlay', this.get('activeTab')); + }, + + onTabOpen: function (tab) { + if (!tab.onTabOpen) { + return; + } + + var controller = this.container.lookup('controller:' + tab.template); + controller.send(tab.onTabOpen, controller); + }, + + openOverlay: function (tab) { + this.closeActiveOverlay(); + this.set('activeTab.active', false); + tab.set('active', true); + this.set('activeTab', tab); + + this.onTabOpen(tab); + this.send('openOverlay', tab); + }, + + setDefaultActive: function () { + var activeTab = this.get('activeTab'); + var defaultTab = this.get('default'); + + if (activeTab !== defaultTab) { + this.closeActiveOverlay(); + defaultTab.set('active', true); + activeTab.set('active', false); + this.set('activeTab', defaultTab); + } + }, + + actions: { + toggleOverlay: function (tab) { + if (tab !== this.get('default') && tab.get('active')) { + this.setDefaultActive(); + } else { + this.openOverlay(tab); + } + }, + + setDefaultActive: function () { + this.setDefaultActive(); + } + } +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/settings.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/settings.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/settings.js index ddc5b1e..0bb540f 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/settings.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/settings.js @@ -18,6 +18,7 @@ import Ember from 'ember'; import constants from 'hive/utils/constants'; +import utils from 'hive/utils/functions'; export default Ember.ArrayController.extend({ needs: [ @@ -34,11 +35,11 @@ export default Ember.ArrayController.extend({ predefinedSettings: constants.hiveParameters, - selectedSettings: function() { + selectedSettings: function () { var predefined = this.get('predefinedSettings'); var current = this.get('currentSettings.settings'); - return predefined.filter(function(setting) { + return predefined.filter(function (setting) { return current.findBy('key.name', setting.name); }); }.property('[email protected]'), @@ -47,7 +48,7 @@ export default Ember.ArrayController.extend({ var currentId = this.get('index.model.id'); var targetSettings = this.findBy('id', currentId); - if (!targetSettings) { + if (!targetSettings && currentId) { targetSettings = this.pushObject(Ember.Object.create({ id: currentId, settings: [] @@ -55,64 +56,54 @@ export default Ember.ArrayController.extend({ } return targetSettings; - }.property('index.model.id'), + }.property('openQueries.currentQuery'), updateSettingsId: function (oldId, newId) { this.filterBy('id', oldId).setEach('id', newId); }, - getSettingsString: function () { - var currentId = this.get('index.model.id'); - - var querySettings = this.findBy('id', currentId); + getCurrentValidSettings: function () { + var currentSettings = this.get('currentSettings'); + var validSettings = []; - if (!querySettings) { - return ""; + if (!currentSettings) { + return ''; } - var settings = querySettings.get('settings').map(function (setting) { - return 'set %@ = %@;'.fmt(setting.get('key.name'), setting.get('value')); + currentSettings.get('settings').map(function (setting) { + if (setting.get('valid')) { + validSettings.pushObject('set %@ = %@;'.fmt(setting.get('key.name'), setting.get('value'))); + } }); - return settings.join("\n"); + return validSettings; }, hasSettings: function (id) { - id = id ? id : this.get('index.model.id'); - var settings = this.findBy('id', id); + var settings; + var settingId = id ? id : this.get('index.model.id'); + + settings = this.findBy('id', settingId); return settings && settings.get('settings.length'); }, parseQuerySettings: function () { - var id = this.get('index.model.id'); var query = this.get('openQueries.currentQuery'); var content = query.get('fileContent'); var self = this; + var regex = new RegExp(utils.regexes.setSetting); + var settings = content.match(regex) || []; + var targetSettings = this.findBy('id', this.get('index.model.id')); - var regex = new RegExp(/^set\s+[\w-.]+(\s+|\s?)=(\s+|\s?)[\w-.]+(\s+|\s?);/gim); - var settings = content.match(regex); - - if (!settings) { + if (!query || !targetSettings) { return; } - var Setting = Ember.Object.extend({ - key: Ember.Object.create(), - valid: true, - selection: Ember.Object.create(), - value: Ember.computed.alias('selection.value') - }); - - query.set('fileContent', content.replace(regex, '').trim()); settings = settings.map(function (setting) { - var KV = setting.split('='); - var name = KV[0].replace('set', '').trim(); - var value = KV[1].replace(';', '').trim(); - - var newSetting = Setting.create({}); - newSetting.set('key.name', name); - newSetting.set('selection.value', value); + var KeyValue = setting.split('='); + var name = KeyValue[0].replace('set', '').trim(); + var value = KeyValue[1].replace(';', '').trim(); if (!self.get('predefinedSettings').findBy('name', name)) { self.get('predefinedSettings').pushObject({ @@ -120,37 +111,32 @@ export default Ember.ArrayController.extend({ }); } - return newSetting; - }); + var settingObj = Ember.Object.createWithMixins({ + key: Ember.Object.create({ name: 'nam' }), + selection : Ember.Object.create({ value: 'val'}), - this.setSettingForQuery(id, settings); - }.observes('openQueries.currentQuery', 'openQueries.tabUpdated'), + value: Ember.computed.alias('selection.value'), + valid: true + }); - setSettingForQuery: function (id, settings) { - var querySettings = this.findBy('id', id); + settingObj.set('key.name', name); + settingObj.set('selection.value', value); - if (!querySettings) { - this.pushObject(Ember.Object.create({ - id: id, - settings: settings - })); - } else { - querySettings.setProperties({ - 'settings': settings - }); - } - }, + return settingObj; + }); + + targetSettings.set('settings', settings); + }.observes('openQueries.currentQuery', 'openQueries.currentQuery.fileContent', 'openQueries.tabUpdated'), - validate: function() { + validate: function () { var settings = this.get('currentSettings.settings') || []; var predefinedSettings = this.get('predefinedSettings'); - settings.forEach(function(setting) { - var predefined = predefinedSettings.filterProperty('name', setting.get('key.name')); - if (!predefined.length) { + settings.forEach(function (setting) { + var predefined = predefinedSettings.findBy('name', setting.get('key.name')); + + if (!predefined) { return; - } else { - predefined = predefined[0]; } if (predefined.values && predefined.values.contains(setting.get('value'))) { @@ -172,14 +158,14 @@ export default Ember.ArrayController.extend({ }); }.observes('currentSettings.[]', 'currentSettings.settings.[]', '[email protected]', '[email protected]'), - currentSettingsAreValid: function() { + currentSettingsAreValid: function () { var currentSettings = this.get('currentSettings.settings'); var invalid = currentSettings.filterProperty('valid', false); return invalid.length ? false : true; }.property('[email protected]', '[email protected]'), - loadSessionStatus: function() { + loadSessionStatus: function () { var model = this.get('index.model'); var sessionActive = this.get('sessionActive'); var sessionTag = this.get('sessionTag'); @@ -188,10 +174,10 @@ export default Ember.ArrayController.extend({ if (sessionTag && sessionActive === undefined) { adapter.ajax(url, 'GET') - .then(function(response) { + .then(function (response) { model.set('sessionActive', response.session.actual); }) - .catch(function() { + .catch(function () { model.set('sessionActive', false); }); } @@ -199,20 +185,25 @@ export default Ember.ArrayController.extend({ actions: { add: function () { - var currentId = this.get('index.model.id'), - querySettings = this.findBy('id', currentId); - - var Setting = Ember.Object.extend({ + var setting = Ember.Object.createWithMixins({ valid: true, selection: Ember.Object.create(), value: Ember.computed.alias('selection.value') }); - querySettings.get('settings').pushObject(Setting.create({})); + this.get('currentSettings.settings').pushObject(setting); }, remove: function (setting) { - this.findBy('id', this.get('index.model.id')).settings.removeObject(setting); + var currentQuery = this.get('openQueries.currentQuery'); + var currentQueryContent = currentQuery.get('fileContent'); + var keyValue = 'set %@ = %@;\n'.fmt(setting.get('key.name'), setting.get('value')); + + this.get('currentSettings.settings').removeObject(setting); + + if (currentQueryContent.indexOf(keyValue) > -1) { + currentQuery.set('fileContent', currentQueryContent.replace(keyValue, '')); + } }, addKey: function (param) { @@ -223,14 +214,17 @@ export default Ember.ArrayController.extend({ this.get('currentSettings.settings').findBy('key', null).set('key', newKey); }, - removeAll: function() { - var currentId = this.get('index.model.id'), - querySettings = this.findBy('id', currentId); + removeAll: function () { + var currentQuery = this.get('openQueries.currentQuery'), + currentQueryContent = currentQuery.get('fileContent'), + regex = new RegExp(utils.regexes.setSetting), + settings = currentQueryContent.match(regex); - querySettings.set('settings', []); + currentQuery.set('fileContent', currentQueryContent.replace(settings, '')); + this.get('currentSettings').set('settings', []); }, - invalidateSession: function() { + invalidateSession: function () { var self = this; var sessionTag = this.get('sessionTag'); var adapter = this.container.lookup('adapter:application'); @@ -238,7 +232,7 @@ export default Ember.ArrayController.extend({ var model = this.get('index.model'); // @TODO: Split this into then/catch once the BE is fixed - adapter.ajax(url, 'DELETE').catch(function(response) { + adapter.ajax(url, 'DELETE').catch(function (response) { if ([200, 404].contains(response.status)) { model.set('sessionActive', false); self.notify.success('alerts.success.sessions.deleted'); @@ -248,4 +242,4 @@ export default Ember.ArrayController.extend({ }); } } -}); +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/tez-ui.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/tez-ui.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/tez-ui.js index c511e0b..bdb66a1 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/tez-ui.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/tez-ui.js @@ -31,7 +31,7 @@ export default Ember.Controller.extend({ isTezViewAvailable: Ember.computed.bool('tezViewURL'), - dagId: function() { + dagId: function () { if (this.get('isTezViewAvailable')) { return this.get('index.model.dagId'); } @@ -39,7 +39,7 @@ export default Ember.Controller.extend({ return false; }.property('index.model.dagId', 'isTezViewAvailable'), - dagURL: function() { + dagURL: function () { if (this.get('dagId')) { return "%@%@%@".fmt(this.get('tezViewURL'), this.get('tezDagPath'), this.get('dagId')); } @@ -47,27 +47,27 @@ export default Ember.Controller.extend({ return false; }.property('dagId'), - getTezView: function() { + getTezView: function () { if (this.get('isTezViewAvailable')) { return; } var self = this; Ember.$.getJSON(this.get('tezApiURL')) - .then(function(response) { + .then(function (response) { self.getTezViewInstance(response); }) - .fail(function(response) { + .fail(function (response) { self.setTezViewError(response); }); }.on('init'), - getTezViewInstance: function(data) { + getTezViewInstance: function (data) { var self = this; var url = data.versions[0].href; Ember.$.getJSON(url) - .then(function(response) { + .then(function (response) { if (!response.instances.length) { self.setTezViewError(response); return; @@ -80,7 +80,7 @@ export default Ember.Controller.extend({ }); }, - setTezViewURL: function(instance) { + setTezViewURL: function (instance) { var url = "%@/%@/%@".fmt( this.get('tezURLPrefix'), instance.version, @@ -90,7 +90,7 @@ export default Ember.Controller.extend({ this.set('tezViewURL', url); }, - setTezViewError: function(data) { + setTezViewError: function (data) { // status: 404 => Tev View isn't deployed if (data.status && data.status === 404) { this.set('error', 'tez.errors.not.deployed'); @@ -100,7 +100,6 @@ export default Ember.Controller.extend({ // no instance created if (data.instances && !data.instances.length) { this.set('error', 'tez.errors.no.instance'); - return; } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/udfs.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/udfs.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/udfs.js index 52faba1..d9a7d6b 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/udfs.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/udfs.js @@ -64,6 +64,23 @@ export default Ember.ArrayController.extend(FilterableMixin, { add: function () { this.store.createRecord(constants.namingConventions.udf); + }, + + clearFilters: function () { + var columns = this.get('columns'); + + if (columns) { + columns.forEach(function (column) { + var filterValue = column.get('filterValue'); + + if (filterValue && typeof filterValue === 'string') { + column.set('filterValue'); + } + }); + } + + //call clear filters from Filterable mixin + this.clearFilters(); } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visual-explain.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visual-explain.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visual-explain.js index 5275a9b..dfd9889 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visual-explain.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/visual-explain.js @@ -17,6 +17,31 @@ */ import Ember from 'ember'; +import constants from 'hive/utils/constants'; -export default Ember.ObjectController.extend({ +export default Ember.Controller.extend({ + needs: [ constants.namingConventions.index, + constants.namingConventions.jobProgress ], + + index: Ember.computed.alias('controllers.' + constants.namingConventions.index), + jobProgress: Ember.computed.alias('controllers.' + constants.namingConventions.jobProgress), + + updateProgress: function () { + this.set('verticesProgress', this.get('jobProgress.stages')); + }.observes('jobProgress.stages', '[email protected]'), + + actions: { + onTabOpen: function () { + var self = this; + + this.get('index')._executeQuery(true, true).then(function (json) { + //this condition should be changed once we change the way of retrieving this json + if (json['STAGE PLANS']['Stage-1']) { + self.set('json', json); + } + }, function (err) { + self.notify.error(err.responseJSON.message, err.responseJSON.trace); + }); + } + } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/all-uppercase.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/all-uppercase.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/all-uppercase.js index f068ed0..92930a9 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/all-uppercase.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/all-uppercase.js @@ -18,8 +18,8 @@ import Ember from 'ember'; -export function allUppercase(input) { +export function allUppercase (input) { return input ? input.toUpperCase() : input; -}; +} export default Ember.Handlebars.makeBoundHelper(allUppercase); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/code-helper.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/code-helper.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/code-helper.js index 327636f..8bbd19e 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/code-helper.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/code-helper.js @@ -18,7 +18,7 @@ import Ember from 'ember'; -export function code(text) { +export function code (text) { text = Ember.Handlebars.Utils.escapeExpression(text); text = text.replace(/(\r\n|\n|\r)/gm, '<br>'); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/date-binding.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/date-binding.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/date-binding.js index 4baeca8..61251f8 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/date-binding.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/date-binding.js @@ -20,7 +20,7 @@ import Ember from 'ember'; -export function pathBinding(data, key) { +export function pathBinding (data, key) { return moment(data.get(key)).fromNow(); } http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/log-helper.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/log-helper.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/log-helper.js index c603c60..c29d129 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/log-helper.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/log-helper.js @@ -18,7 +18,7 @@ import Ember from 'ember'; -export function log(text) { +export function log (text) { text = Ember.Handlebars.Utils.escapeExpression(text); text = text.replace(/(\r\n|\n|\r)/gm, '<br>'); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/path-binding.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/path-binding.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/path-binding.js index e53772e..926aaaa 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/path-binding.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/path-binding.js @@ -18,7 +18,7 @@ import Ember from 'ember'; -export function pathBinding(data, key) { +export function pathBinding (data, key) { if (!data || !key) { return; } http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/preformatted-string.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/preformatted-string.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/preformatted-string.js index bb3d006..4ab6a2e 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/preformatted-string.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/preformatted-string.js @@ -17,7 +17,7 @@ */ import Ember from 'ember'; -export function preformattedString(string) { +export function preformattedString (string) { string = string.replace(/\\n/g, ' '); // newline string = string.replace(/\\t/g, '	'); // tabs string = string.replace(/^\s+|\s+$/g, ''); // trim http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/tb-helper.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/tb-helper.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/tb-helper.js index fcce185..81af5ff 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/tb-helper.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/helpers/tb-helper.js @@ -18,7 +18,7 @@ import Ember from 'ember'; -export function tb(key, data) { +export function tb (key, data) { var path = data.get ? data.get(key) : data[key]; if (!path && key) { http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js index b637c5e..e5bb82b 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/i18n.js @@ -22,7 +22,7 @@ var TRANSLATIONS; export default { name: 'i18n', - initialize: function() { + initialize: function () { Ember.ENV.I18N_COMPILE_WITHOUT_HANDLEBARS = true; Ember.FEATURES.I18N_TRANSLATE_HELPER_SPAN = false; Ember.I18n.translations = TRANSLATIONS; @@ -33,8 +33,14 @@ export default { TRANSLATIONS = { tooltips: { refresh: 'Refresh database', - loadSample: 'Load sample data' + loadSample: 'Load sample data', + query: 'Query', + settings: 'Settings', + visualExplain: 'Visual Explain', + tez: 'Tez', + notifications: 'Notifications' }, + alerts: { errors: { save: { @@ -58,6 +64,7 @@ TRANSLATIONS = { } } }, + modals: { delete: { heading: 'Confirm deletion', @@ -76,6 +83,7 @@ TRANSLATIONS = { csv: 'Download results as CSV' } }, + titles: { database: 'Database Explorer', explorer: 'Databases', @@ -87,11 +95,13 @@ TRANSLATIONS = { process: 'Query Process Results', parameters: 'Parameters', visualExplain: 'Visual Explain', - tez: 'TEZ' + tez: 'TEZ', + messages: 'Messages' }, download: 'Save results...', tableSample: '{{tableName}} sample' }, + placeholders: { search: { tables: 'Search tables...', @@ -119,6 +129,7 @@ TRANSLATIONS = { value: '1' } }, + menus: { query: 'Query', savedQueries: 'Saved Queries', @@ -128,6 +139,7 @@ TRANSLATIONS = { results: 'Results', explain: 'Explain' }, + columns: { id: 'id', shortQuery: 'preview', @@ -142,6 +154,7 @@ TRANSLATIONS = { expand: '', actions: '' }, + buttons: { addItem: 'Add new item...', insert: 'Insert', @@ -168,10 +181,12 @@ TRANSLATIONS = { saveCsv: 'Download as CSV', runOnTez: 'Run on Tez' }, + labels: { noTablesMatch: 'No tables match', table: 'Table ' }, + popover: { visualExplain: { statistics: "Statistics" @@ -186,6 +201,7 @@ TRANSLATIONS = { }, add: 'Add' }, + tez: { errors: { 'not.deployed': "Tez View isn't deployed.", http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/notify.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/notify.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/notify.js index be9c359..cf9d64a 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/notify.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/initializers/notify.js @@ -17,7 +17,7 @@ */ export default { name: 'notify', - initialize: function(container, app) { + initialize: function (container, app) { app.inject('route', 'notify', 'service:notify'); app.inject('controller', 'notify', 'service:notify'); app.inject('component', 'notify', 'service:notify'); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/filterable.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/filterable.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/filterable.js index 55d4593..5758bf9 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/filterable.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/mixins/filterable.js @@ -87,7 +87,9 @@ export default Ember.Mixin.create({ }, clearFilters: function () { - if (!this.get('filters') || this.get('filters.length')) { + var filters = this.get('filters'); + + if (!filters || filters.get('length')) { this.set('filters', Ember.A()); } }, @@ -95,10 +97,6 @@ export default Ember.Mixin.create({ actions: { filter: function (property, filterValue) { this.updateFilters(property, filterValue); - }, - - clearFilters: function () { - this.clearFilters(); } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/router.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/router.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/router.js index 244bc58..5a51b11 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/router.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/router.js @@ -24,7 +24,7 @@ var Router = Ember.Router.extend({ location: config.locationType }); -Router.map(function() { +Router.map(function () { var savedQueryPath = constants.namingConventions.routes.queries + '/:' + constants.namingConventions.savedQuery + '_id'; var historyQueryPath = constants.namingConventions.routes.history + '/:' + constants.namingConventions.job + '_id'; http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/application.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/application.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/application.js index bf413a3..90b8055 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/application.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/application.js @@ -53,17 +53,28 @@ export default Ember.Route.extend({ }); }, - openOverlay: function(overlay) { + openOverlay: function (overlay) { return this.render(overlay.template, { outlet: overlay.outlet, into: overlay.into }); }, - closeOverlay: function(overlay) { + closeOverlay: function (overlay) { return this.disconnectOutlet({ outlet: overlay.outlet, parentView: overlay.into }); + }, + + removeNotification: function (notification) { + this.notify.removeNotification(notification); + }, + + willTransition: function(transition) { + // close active overlay if we transition + this.controllerFor('queryTabs').setDefaultActive(); + + return transition; } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/index/saved-query.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/index/saved-query.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/index/saved-query.js index e64c522..0366b0d 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/index/saved-query.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/index/saved-query.js @@ -21,11 +21,21 @@ import constants from 'hive/utils/constants'; export default Ember.Route.extend({ setupController: function (controller, model) { + // settings modify fileContent to extract the settings + // when you load a saved query use the original fileContent + // this.store.find('file', model.get('queryFile')) + // .then(function(queryFile) { + // var changes = queryFile.changedAttributes(); + // if (changes.fileContent && changes.fileContent[0]) { + // queryFile.set('fileContent', changes.fileContent[0]); + // } + // }); + this.controllerFor(constants.namingConventions.routes.index).set('model', model); }, actions: { - error: function() { + error: function () { this.store.unloadAll(constants.namingConventions.savedQuery); this.transitionTo(constants.namingConventions.routes.index); } http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/serializers/database.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/serializers/database.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/serializers/database.js index fed6d14..f598b20 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/serializers/database.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/serializers/database.js @@ -31,8 +31,8 @@ export default DS.JSONSerializer.extend({ return this._super(store, primaryType, payload); }, - normalizePayload: function(payload) { - var normalized = payload.databases.map(function(database) { + normalizePayload: function (payload) { + var normalized = payload.databases.map(function (database) { return database; }); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/services/notify.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/services/notify.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/services/notify.js index fbd50cd..38e88c3 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/services/notify.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/services/notify.js @@ -21,10 +21,11 @@ import constants from 'hive/utils/constants'; export default Ember.Service.extend({ types: constants.notify, - messages : Ember.ArrayProxy.create({ content : [] }), - notifications : Ember.ArrayProxy.create({ content : [] }), + messages : Ember.ArrayProxy.create({ content : [] }), + notifications : Ember.ArrayProxy.create({ content : [] }), + unseenMessages : Ember.ArrayProxy.create({ content : [] }), - add: function(type, message, body) { + add: function (type, message, body) { var formattedBody = this.formatMessageBody(body); var notification = Ember.Object.create({ @@ -35,25 +36,26 @@ export default Ember.Service.extend({ this.messages.pushObject(notification); this.notifications.pushObject(notification); + this.unseenMessages.pushObject(notification); }, - info: function(message, body) { + info: function (message, body) { this.add(this.types.INFO, message, body); }, - warn: function(message, body) { + warn: function (message, body) { this.add(this.types.WARN, message, body); }, - error: function(message, body) { + error: function (message, body) { this.add(this.types.ERROR, message, body); }, - success: function(message, body) { + success: function (message, body) { this.add(this.types.SUCCESS, message, body); }, - formatMessageBody: function(body) { + formatMessageBody: function (body) { if (!body) { return; } @@ -72,17 +74,22 @@ export default Ember.Service.extend({ } }, - removeMessage: function(message) { + removeMessage: function (message) { this.messages.removeObject(message); this.notifications.removeObject(message); }, - removeNotification: function(notification) { + removeNotification: function (notification) { this.notifications.removeObject(notification); }, - removeAllMessages: function() { + removeAllMessages: function () { this.messages.removeAt(0, this.messages.get('length')); - } + }, + markMessagesAsSeen: function () { + if (this.unseenMessages.get('length')) { + this.unseenMessages.removeAt(0, this.unseenMessages.get('length')); + } + } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss index 7fdf096..488fe04 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss @@ -66,9 +66,13 @@ a { #visual-explain { white-space: nowrap; + + .panel-body { + overflow: hidden; + } } -#visual-explain, #tez-ui { +.index-overlay { position: absolute; left: 0; width: 0; @@ -152,6 +156,30 @@ aside hr { background-color: white; } +.gray { + background-color: gray; +} + +.green { + background-color: #99CC00; +} + +.red { + background-color: #ff3300; +} + +.orange { + background-color: #FF9933; +} + +.yellow { + background-color: #CCCC00; +} + +.blue { + background-color: blue; +} + .UNKNOWN { color: gray; } @@ -372,6 +400,7 @@ tree-view ul li { font-weight: 800; .edge-path { + margin-top: -55px; height: 2px; background-color: #dedede; position: absolute; @@ -436,6 +465,19 @@ tree-view ul li { color: green; } } + + .progress { + border-radius: 0; + margin: 0 10px 10px 10px; + } + + .progress-bar { + min-width: 2em; + } } } } + +.messages-controls { + margin: 0 0 10px; +} http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/dropdown-submenu.scss ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/dropdown-submenu.scss b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/dropdown-submenu.scss index 8b43bce..bab2216 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/dropdown-submenu.scss +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/dropdown-submenu.scss @@ -16,7 +16,6 @@ * limitations under the License. */ - .dropdown-submenu { position:relative; } http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/mixins.scss ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/mixins.scss b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/mixins.scss index 95e4ae8..3e85727 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/mixins.scss +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/mixins.scss @@ -1,20 +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. - */ +* 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. +*/ @mixin box-shadow($horizontal, $vertical, $blur, $color) { -webkit-box-shadow: $horizontal $vertical $blur $color; http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/notifications.scss ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/notifications.scss b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/notifications.scss index c676e4e..166056b 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/notifications.scss +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/notifications.scss @@ -15,6 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + .notifications-container { position: absolute; top: 4px; http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/query-tabs.scss ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/query-tabs.scss b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/query-tabs.scss index d23a751..3bc3095 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/query-tabs.scss +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/query-tabs.scss @@ -15,6 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + .query-menu { margin-top: 57px; @@ -59,7 +60,7 @@ .query-menu-tab .badge { position: absolute; top: -4px; - left: -4px; + right: 0; background-color: red; color: #fff; padding: 2px 4px; http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/vars.scss ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/vars.scss b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/vars.scss index eec2277..184ac9d 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/vars.scss +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/vars.scss @@ -15,6 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + $panel-background: #f5f5f5; $placeholder-color: #aaa; $border-color: #ddd; http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/application.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/application.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/application.hbs index 99662dd..2242a4f 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/application.hbs +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/application.hbs @@ -16,7 +16,7 @@ * limitations under the License. }} -{{notify-widget}} +{{notify-widget notifications=notify.notifications}} {{render 'navbar'}} <div id="content"> http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/progress-widget.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/progress-widget.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/progress-widget.hbs index c89a9dd..2ea7b94 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/progress-widget.hbs +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/progress-widget.hbs @@ -17,9 +17,7 @@ }} <div class="progress"> - {{#each stage in formattedStages}} - <div {{bind-attr class="stage.className :progress-bar"}} {{bind-attr style=stage.progress}}> - <span class="sr-only">35% Complete (success)</span> - </div> - {{/each}} -</div> + <div {{bind-attr class=":progress-bar :progress-bar-success" style=style}}> + {{percentage}} + </div> +</div> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/query-tabs.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/query-tabs.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/query-tabs.hbs deleted file mode 100644 index f131367..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/components/query-tabs.hbs +++ /dev/null @@ -1,29 +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. -}} - -{{#each tab in tabs}} - <span {{action tab.action tab}} {{bind-attr class=":query-menu-tab tabClassNames tab.iconClass tab.active:active"}}> - {{#if tab.badge}} - <span class="badge">{{tab.badge}}</span> - {{/if}} - - {{#if tab.text}} - {{tab.text}} - {{/if}} - </span> -{{/each}} http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/index.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/index.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/index.hbs index 1551072..47becfd 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/index.hbs +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/index.hbs @@ -23,7 +23,6 @@ </aside> <div class="col-md-9 col-xs-12 query-container"> - {{#panel-widget headingTranslation="titles.query.editor" classNames="query-editor-panel"}} {{render 'open-queries'}} @@ -47,6 +46,11 @@ </div> {{/panel-widget}} + {{#if jobProgress.stages}} + {{#progress-widget value=jobProgress.totalProgress}} + {{/progress-widget}} + {{/if}} + {{#if queryParams}} {{#panel-widget headingTranslation="titles.query.parameters"}} <div class="form-horizontal"> @@ -87,6 +91,6 @@ </ul> {{/popover-widget}} - {{query-tabs}} + {{render 'query-tabs'}} </div> </div> http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/messages.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/messages.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/messages.hbs index 7c494b6..3dfc7d0 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/messages.hbs +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/messages.hbs @@ -16,15 +16,17 @@ * limitations under the License. }} -<div class="editor-overlay messages-container"> - <h3>Messages - {{#if messages.length}} - <button class="btn btn-danger btn-xs" {{action 'removeAllMessages'}}><i class="fa fa-minus"></i> Clear All</button> - {{/if}} - </h3> +<div id="messages" class="index-overlay"> + {{#panel-widget headingTranslation="titles.query.messages"}} + <div class="messages-controls"> + {{#if messages.length}} + <button class="btn btn-danger btn-xs" {{action 'removeAllMessages'}}><i class="fa fa-minus"></i> Clear All</button> + {{/if}} + </div> - {{#each message in messages}} - {{view 'message' notification=message}} - {{/each}} + {{#each message in messages}} + {{view 'message' notification=message}} + {{/each}} + {{/panel-widget}} </div> http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/query-tabs.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/query-tabs.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/query-tabs.hbs new file mode 100644 index 0000000..c170e02 --- /dev/null +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/query-tabs.hbs @@ -0,0 +1,29 @@ +{{! +* 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. +}} + +{{#each tab in tabs}} + <span {{action tab.action tab}} {{bind-attr class=":query-menu-tab tabClassNames tab.iconClass tab.active:active" title="tab.tooltip" id="tab.id"}}> + {{#if tab.badge}} + <span class="badge">{{tab.badge}}</span> + {{/if}} + + {{#if tab.text}} + {{tab.text}} + {{/if}} + </span> +{{/each}} http://git-wip-us.apache.org/repos/asf/ambari/blob/642fd46c/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/tez-ui.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/tez-ui.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/tez-ui.hbs index 4bc0c0e..6f6df4c 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/tez-ui.hbs +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/tez-ui.hbs @@ -16,7 +16,7 @@ * limitations under the License. }} -<div id="tez-ui"> +<div id="tez-ui" class="index-overlay"> {{#panel-widget headingTranslation="titles.query.tez"}} {{#if dagURL}} <iframe {{bind-attr src=dagURL}}></iframe>
