You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by tb...@apache.org on 2014/05/02 18:24:50 UTC
[3/7] AMBARI-5616 - Ambari Views: Pig view (Roman Rader via
tbeerbower)
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/util/pigUtilAlert.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/util/pigUtilAlert.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/util/pigUtilAlert.js
new file mode 100644
index 0000000..9a15d3e
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/util/pigUtilAlert.js
@@ -0,0 +1,28 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+App.PigUtilAlertController = Ember.ArrayController.extend({
+ content:Ember.A(),
+ actions:{
+ removeAlertObject:function (alert) {
+ this.content.removeObject(alert)
+ }
+ },
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/initialize.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/initialize.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/initialize.js
new file mode 100644
index 0000000..0f2424b
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/initialize.js
@@ -0,0 +1,157 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+App.ApplicationAdapter = DS.RESTAdapter.extend({
+ namespace:'api/v1/views/PIG/instances/PIG_1',
+ headers: {
+ 'X-Requested-By': 'ambari'
+ }
+});
+
+App.FileAdapter = App.ApplicationAdapter.extend({
+ pathForType: function() {
+ return 'resources/file';
+ }
+});
+
+App.FileSerializer = DS.RESTSerializer.extend({
+ primaryKey:'filePath',
+});
+
+App.IsodateTransform = DS.Transform.extend({
+ deserialize: function (serialized) {
+ if (serialized) {
+ return moment.unix(serialized).toDate();
+ }
+ return serialized;
+ },
+ serialize: function (deserialized) {
+ if (deserialized) {
+ return moment(deserialized).format('X');
+ }
+ return deserialized;
+ }
+});
+
+Ember.Handlebars.registerBoundHelper('showDate', function(date,format) {
+ return moment(date).format(format)
+});
+
+Em.TextField.reopen(Em.I18n.TranslateableAttributes)
+
+//////////////////////////////////
+// Templates
+//////////////////////////////////
+
+require('translations');
+
+require('templates/application');
+require('templates/index');
+require('templates/pig/loading');
+
+require('templates/pig');
+require('templates/pig/index');
+require('templates/pig/scriptList');
+require('templates/pig/scriptEdit');
+require('templates/pig/scriptEditIndex');
+require('templates/pig/scriptResults');
+require('templates/pig/scriptResultsNav');
+require('templates/pig/job');
+require('templates/pig/jobEdit');
+require('templates/pig/jobStatus');
+require('templates/pig/jobResults');
+require('templates/pig/jobResultsOutput');
+require('templates/pig/history');
+require('templates/pig/udfs');
+
+require('templates/pig/util/script-nav');
+require('templates/pig/util/alert');
+require('templates/pig/util/alert-content');
+require('templates/pig/util/pigHelper');
+require('templates/pig/modal/confirmdelete');
+require('templates/pig/modal/createUdf');
+require('templates/pig/modal/modalLayout');
+require('templates/pig/modal/createScript');
+
+//////////////////////////////////
+// Models
+//////////////////////////////////
+
+require('models/pig_script');
+require('models/pig_job');
+require('models/file');
+require('models/udf');
+
+/////////////////////////////////
+// Controllers
+/////////////////////////////////
+
+require('controllers/pig');
+require('controllers/poll');
+require('controllers/edit');
+require('controllers/pigScriptEdit');
+require('controllers/pigScriptList');
+require('controllers/pigScriptEditResults');
+require('controllers/pigUdfs');
+require('controllers/pigHistory');
+require('controllers/pigJob');
+require('controllers/jobResults');
+require('controllers/util/pigUtilAlert');
+require('controllers/modal/pigModal');
+
+/////////////////////////////////
+// Views
+/////////////////////////////////
+
+require('views/pig');
+require('views/pig/scriptList');
+require('views/pig/scriptEdit');
+require('views/pig/scriptResults');
+require('views/pig/scriptResultsNav');
+require('views/pig/pigHistory');
+require('views/pig/pigUdfs');
+require('views/pig/pigJob');
+require('views/pig/jobResults');
+require('views/pig/modal/pigModal');
+require('views/pig/modal/confirmDelete');
+require('views/pig/modal/createUdf');
+require('views/pig/modal/createScript');
+require('views/pig/util/pigUtilAlert');
+
+/////////////////////////////////
+// Routes
+/////////////////////////////////
+
+require('routes/pig');
+require('routes/pigHistory');
+require('routes/pigIndex');
+require('routes/pigScriptEdit');
+require('routes/pigScriptEditIndex');
+require('routes/pigScriptEditResults');
+require('routes/pigScriptList');
+require('routes/pigUdfs');
+require('routes/pigJob');
+require('routes/jobResults');
+
+/////////////////////////////////
+// Router
+/////////////////////////////////
+
+require('router');
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/models/file.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/models/file.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/models/file.js
new file mode 100644
index 0000000..1c7fa11
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/models/file.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.
+ */
+
+var App = require('app');
+
+App.File = DS.Model.extend({
+ fileContent: DS.attr('string'),
+ hasNext:DS.attr('boolean'),
+ page:DS.attr('number'),
+ pageCount:DS.attr('number')
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_job.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_job.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_job.js
new file mode 100644
index 0000000..e4217ae
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_job.js
@@ -0,0 +1,90 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+App.Job = DS.Model.extend({
+ pigScript:DS.belongsTo('file', { async: true }),
+ //pythonScript:DS.belongsTo('script'),
+ scriptId: DS.attr('number'),
+ title: DS.attr('string'),
+ templetonArguments:DS.attr('string'),
+ owner: DS.attr('string'),
+ forcedContent:DS.attr('string'),
+
+ sourceFile:DS.attr('string'),
+ sourceFileContent:DS.attr('string'),
+
+ statusDir: DS.attr('string'),
+ status: DS.attr('string'),
+ dateStarted:DS.attr('isodate'),
+ jobId: DS.attr('string'),
+ jobType: DS.attr('string'),
+ percentComplete: DS.attr('number'),
+ percentStatus:function () {
+ if (this.get('isTerminated')) {
+ return 100;
+ };
+ return (this.get('status')==='COMPLETED')?100:(this.get('percentComplete')||0);
+ }.property('status','percentComplete'),
+
+ isTerminated:function(){
+ return (this.get('status')=='KILLED'||this.get('status')=='FAILED');
+ }.property('status'),
+ isKilling:false,
+ kill:function(success,error){
+ var self = this;
+ var host = self.store.adapterFor('application').get('host');
+ var namespace = self.store.adapterFor('application').get('namespace');
+ var url = [host, namespace,'jobs',self.get('id')].join('/');
+
+ self.set('isKilling',true)
+ return Em.$.ajax(url, {
+ type:'DELETE',
+ contentType:'application/json',
+ beforeSend:function(xhr){
+ xhr.setRequestHeader('X-Requested-By','ambari');
+ }
+ }).always(function() {
+ self.set('isKilling',false);
+ }).then(success,error);
+ },
+
+ isExplainJob: function(){
+ return this.jobType == "explain";
+ },
+ isSyntaxCheckJob: function(){
+ return this.jobType == "syntax_check";
+ },
+ isUtilityJob: function(){
+ return this.isExplainJob() || this.isSyntaxCheckJob();
+ },
+
+ pingStatusMap:{
+ 'SUBMITTING':true,
+ 'SUBMITTED':true,
+ 'RUNNING':true,
+ 'COMPLETED':false,
+ 'SUBMIT_FAILED':false,
+ 'KILLED':false,
+ 'FAILED':false
+ },
+ needsPing:function () {
+ return this.pingStatusMap[this.get('status')];
+ }.property('status')
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_script.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_script.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_script.js
new file mode 100644
index 0000000..37b6164
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_script.js
@@ -0,0 +1,43 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+App.OpenedScript = Ember.Mixin.create({
+ opened:DS.attr('boolean'),
+ open:function (argument) {
+ return this.set('opened',true);
+ },
+ close:function (argument) {
+ return this.set('opened',false);
+ }
+});
+
+App.Script = DS.Model.extend(App.OpenedScript,{
+ title:DS.attr('string', { defaultValue: 'New script'}),
+ pigScript:DS.belongsTo('file', { async: true }),
+ dateCreated:DS.attr('isodate', { defaultValue: moment()}),
+ templetonArguments:DS.attr('string', { defaultValue: '-useHCatalog'}),
+ // nav item identifier
+ name:function (q){
+ return this.get('title')+this.get('id');
+ }.property('title'),
+ label:function (){
+ return this.get('title');
+ }.property('title')
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/models/udf.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/models/udf.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/models/udf.js
new file mode 100644
index 0000000..6854e2c
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/models/udf.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.
+ */
+
+var App = require('app');
+
+App.Udf = DS.Model.extend({
+ path: DS.attr('string'),
+ name: DS.attr('string'),
+ owner: DS.attr('string')
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/router.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/router.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/router.js
new file mode 100644
index 0000000..92b3a3a
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/router.js
@@ -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.
+ */
+
+var App = require('app');
+
+App.Router.map(function () {
+ this.resource('pig', { path: "/" }, function() {
+ this.route('scriptList',{ path: "/list" });
+ this.route('scriptEdit',{ path: "/edit/:script_id" });
+ this.resource('job', { path: "/job/:job_id" },function (argument) {
+ this.route('results');
+ });
+ this.route('udfs');
+ this.route('history');
+ });
+});
+
+App.LoadingRoute = Ember.Route.extend({});
+
+App.LoadingView = Em.View.extend({
+ templateName: 'pig/loading'
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/jobResults.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/jobResults.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/jobResults.js
new file mode 100644
index 0000000..d01c69a
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/jobResults.js
@@ -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.
+ */
+
+var App = require('app');
+
+App.JobResultsRoute = Em.Route.extend({
+ enter: function() {
+ this.controllerFor('pig').set('category',"");
+ this.controllerFor('job').set('category',"results");
+ },
+ model: function (controller) {
+ return this.modelFor('job');
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pig.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pig.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pig.js
new file mode 100644
index 0000000..71e1d0d
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pig.js
@@ -0,0 +1,69 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+App.PigRoute = Em.Route.extend({
+ actions: {
+ gotoSection: function(nav) {
+ var location = (nav.hasOwnProperty('url'))?[nav.url]:['pig.scriptEdit',nav.get('id')];
+ this.transitionTo.apply(this,location);
+ },
+ close:function (script) {
+ var self = this;
+ script.close().save().then(function() {
+ if (self.get('controller.category') == script.get('name')) {
+ opened = self.get('controller.openScripts');
+ if (opened.length > 0 && opened.filterBy('id',script.get('id')).length == 0){
+ self.transitionTo('pig.scriptEdit',opened.get(0));
+ } else {
+ self.transitionTo('pig.scriptList');
+ }
+ }
+ self.send('showAlert', {'message':Em.I18n.t('scripts.alert.script_saved',{title: script.get('title')}), status:'success'});
+ },function (error) {
+ //script.open();
+ self.send('showAlert', {'message': Em.I18n.t('scripts.alert.save_error_reason',{message:error.statusText}) , status:'error'});
+ });
+ },
+ showAlert:function (alert) {
+ var pigUtilAlert = this.controllerFor('pigUtilAlert');
+ return pigUtilAlert.content.pushObject(Em.Object.create(alert));
+ },
+ openModal: function(modalName,controller) {
+ return this.render(modalName, {
+ into: 'pig',
+ outlet: 'modal',
+ controller:'pigModal'
+ });
+ },
+ closeModal: function() {
+ return this.disconnectOutlet({
+ outlet: 'modal',
+ parentView: 'pig'
+ });
+ }
+ },
+ model: function() {
+ return this.store.find('script');
+ },
+ renderTemplate: function() {
+ this.render('pig');
+ this.render('pig/util/alert', {into:'pig',outlet:'alert',controller: 'pigUtilAlert' });
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigHistory.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigHistory.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigHistory.js
new file mode 100644
index 0000000..cf9e3d5
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigHistory.js
@@ -0,0 +1,28 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+App.PigHistoryRoute = Em.Route.extend({
+ enter: function() {
+ this.controllerFor('pig').set('category',"history");
+ },
+ model: function() {
+ return this.store.find('job');
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigIndex.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigIndex.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigIndex.js
new file mode 100644
index 0000000..04e04dd
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigIndex.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.
+ */
+
+var App = require('app');
+
+App.PigIndexRoute = Em.Route.extend({
+ beforeModel: function() {
+ this.transitionTo('pig.scriptList');
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigJob.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigJob.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigJob.js
new file mode 100644
index 0000000..5f8a0ba
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigJob.js
@@ -0,0 +1,54 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+App.JobRoute = Em.Route.extend({
+ actions: {
+ error: function(error, transition) {
+ Em.warn(error.stack);
+ transition.send('showAlert', {'message':Em.I18n.t('job.alert.load_error',{message:error.message}), status:'error'});
+ this.transitionTo('pig.scriptList');
+ },
+ navigate:function (argument) {
+ return this.transitionTo(argument.route)
+ }
+ },
+ setupController: function(controller, model) {
+ controller.set('model', model);
+ this.controllerFor('poll').set('model', model);
+ },
+ afterModel:function (job,arg) {
+ this.controllerFor('poll').get('pollster').start(job);
+ },
+ deactivate: function() {
+ this.controllerFor('poll').get('pollster').stop();
+ },
+ renderTemplate: function() {
+ this.render('pig/scriptEdit', {controller: 'job' });
+ this.render('pig/job', {into:'pig/scriptEdit',outlet: 'main', controller: 'poll' });
+ this.render('pig/scriptResultsNav',{into:'pig/scriptEdit',outlet: 'nav'});
+ }
+});
+
+App.JobIndexRoute = Em.Route.extend({
+ enter: function() {
+ this.controllerFor('pig').set('category',"");
+ this.controllerFor('job').set('category',"edit");
+ },
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptEdit.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptEdit.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptEdit.js
new file mode 100644
index 0000000..a31864f
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptEdit.js
@@ -0,0 +1,71 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+App.PigScriptEditRoute = Em.Route.extend({
+ actions:{
+ willTransition: function(transition){
+ var model = this.controller.get('model');
+ if (model.get('isDirty') || model.get('pigScript.isDirty')) {
+ return this.send('saveScript',model);
+ };
+ },
+ toresults:function (argument) {
+ // DUMMY TRANSITION
+ this.transitionTo('pigScriptEdit.results',argument);
+ },
+ saveScript: function (script) {
+ var router = this,
+ onSuccess = function(model){
+ router.send('showAlert', {'message':Em.I18n.t('scripts.alert.script_saved',{title: script.get('title')}),status:'success'});
+ },
+ onFail = function(error){
+ router.send('showAlert', {'message':Em.I18n.t('scripts.alert.save_error'),status:'error'});
+ };
+
+ return script.get('pigScript').then(function(file){
+ return Ember.RSVP.all([file.save(),script.save()]).then(onSuccess,onFail);
+ },onFail);
+ },
+ },
+ isExec:false,
+ model: function(params) {
+ var record;
+ var isExist = this.store.all('script').some(function(script) {
+ return script.get('id') === params.script_id;
+ });
+ if (isExist) {
+ record = this.store.find('script',params.script_id);
+ } else {
+ record = this.store.createRecord('script');
+ }
+ return record;
+ },
+ afterModel:function (model) {
+ if (model.get('length') == 0) {
+ this.transitionTo('pig');
+ }
+ this.controllerFor('pig').set('category', model.get('name'));
+ model.open();
+ },
+ renderTemplate: function() {
+ this.render('pig/scriptEdit');
+ }
+});
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptEditIndex.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptEditIndex.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptEditIndex.js
new file mode 100644
index 0000000..638ebe8
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptEditIndex.js
@@ -0,0 +1,27 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+App.PigScriptEditIndexRoute = Em.Route.extend({
+ renderTemplate: function() {
+ this.render('pig/scriptEditIndex',{
+ outlet: 'main',
+ });
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptEditResults.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptEditResults.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptEditResults.js
new file mode 100644
index 0000000..1a77e71
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptEditResults.js
@@ -0,0 +1,36 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+App.PigScriptEditResultsRoute = Em.Route.extend({
+ model: function(params) {
+ return this.store.find('job',params.job_id);
+ },
+ afterModel:function (model) {
+ //this.controllerFor('pigScriptEdit').set('activeJob',model);
+ },
+ renderTemplate: function() {
+ this.render('pig/scriptResultsNav',{
+ outlet: 'nav',
+ });
+ this.render('pig/scriptResults',{
+ outlet: 'main',
+ });
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptList.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptList.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptList.js
new file mode 100644
index 0000000..20c0fe9
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigScriptList.js
@@ -0,0 +1,88 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+App.PigScriptListRoute = Em.Route.extend({
+ actions:{
+ createScript:function () {
+ var newScript = this.store.createRecord('script');
+ this.controllerFor('pigModal').set('content', newScript);
+ return this.send('openModal','createScript');
+
+ },
+ deletescript:function (script) {
+ this.controllerFor('pigModal').set('content', script);
+ return this.send('openModal','confirmDelete');
+ },
+ confirmcreate:function (script,filePath) {
+ // /tmp/.pigscripts/admin/39.pig
+ var route = this;
+ var sendAlert = function (status) {
+ var alerts = {
+ success:Em.I18n.t('scripts.alert.script_created',{title:'New script'}),
+ error: Em.I18n.t('scripts.alert.create_failed')
+ };
+ return function () {
+ if (status=='error'){
+ script.deleteRecord();
+ }
+ route.send('showAlert', {message:alerts[status],status:status});
+ };
+ };
+ if (filePath) {
+ var file = this.store.createRecord('file',{
+ id:filePath,
+ fileContent:''
+ });
+ return file.save().then(function(file){
+ script.set('pigScript',file);
+ script.save().then(sendAlert('success'),sendAlert('error'));
+ },function () {
+ file.deleteRecord();
+ route.store.find('file', filePath).then(function(file) {
+ route.send('showAlert', {message:Em.I18n.t('scripts.alert.file_exist_error'),status:'success'});
+ script.set('pigScript',file);
+ script.save().then(sendAlert('success'),sendAlert('error'));
+ }, sendAlert('error'));
+ });
+ } else {
+ script.save().then(sendAlert('success'),sendAlert('error'));
+ }
+
+
+ },
+ confirmdelete:function (script) {
+ var router = this;
+ var onSuccess = function(model){
+ router.send('showAlert', {'message':Em.I18n.t('scripts.alert.script_deleted',{title : model.get('title')}),status:'success'});
+ };
+ var onFail = function(error){
+ router.send('showAlert', {'message':Em.I18n.t('scripts.alert.delete_failed'),status:'error'});
+ };
+ script.deleteRecord();
+ return script.save().then(onSuccess,onFail);
+ }
+ },
+ enter: function() {
+ this.controllerFor('pig').set('category',"scripts");
+ },
+ model: function(object,transition) {
+ return this.modelFor('pig');
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigUdfs.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigUdfs.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigUdfs.js
new file mode 100644
index 0000000..42e4223
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/pigUdfs.js
@@ -0,0 +1,55 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+App.PigUdfsRoute = Em.Route.extend({
+ actions:{
+ createUdfModal:function () {
+ this.controllerFor('pigModal').set('content', this.store.createRecord('udf'));
+ return this.send('openModal','createUdf');
+ },
+ createUdf:function (udf) {
+ var router = this;
+ var onSuccess = function(model){
+ router.send('showAlert', {'message': Em.I18n.t('udfs.alert.udf_created',{name : model.get('name')}), status:'success'});
+ };
+ var onFail = function(error){
+ router.send('showAlert', {'message':Em.I18n.t('udfs.alert.create_failed'),status:'error'});
+ };
+ return udf.save().then(onSuccess,onFail);
+ },
+ deleteUdf:function(udf){
+ var router = this;
+ var onSuccess = function(model){
+ router.send('showAlert', {'message': Em.I18n.t('udfs.alert.udf_deleted',{name : model.get('name')}),status:'success'});
+ };
+ var onFail = function(error){
+ router.send('showAlert', {'message': Em.I18n.t('udfs.alert.delete_failed'),status:'error'});
+ };
+ udf.deleteRecord();
+ return udf.save().then(onSuccess,onFail);
+ }
+ },
+ enter: function() {
+ this.controllerFor('pig').set('category',"udfs");
+ },
+ model: function() {
+ return this.store.find('udf');
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/styles/style.less
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/styles/style.less b/contrib/views/pig/src/main/resources/ui/pig-web/app/styles/style.less
new file mode 100644
index 0000000..9871a9a
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/styles/style.less
@@ -0,0 +1,295 @@
+/**
+ * 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.
+ */
+
+.wrap {
+ padding: 15px;
+}
+.moz-padding (@selector, @pre: ~'', @padding) {
+ @-moz-document url-prefix() {
+ @{pre}@{selector} {
+ padding: @padding !important;
+ }
+ }
+}
+
+.base-shadow (@shadow) {
+ -webkit-box-shadow: @shadow;
+ -moz-box-shadow: @shadow;
+ box-shadow: @shadow;
+}
+
+.base-transition (@transition) {
+ -webkit-transition: @transition;
+ -moz-transition: @transition;
+ -o-transition: @transition;
+ -ms-transition: @transition;
+ transition: @transition;
+}
+
+.common-shadow {
+ .base-shadow(0 5px 10px rgba(0, 0, 0, 0.2));
+}
+
+.common-shadow-inset {
+ .base-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.05));
+}
+
+// navigation
+.navigation {
+ //position: fixed;
+ a {
+ cursor: pointer;
+ }
+ .pig-nav-item {
+ word-break: break-word;
+ .rm {
+ top:2px;
+ position: absolute;
+ right: 5px;
+ top: 5px;
+ }
+ }
+}
+
+//script list
+.panel-scriptlist {
+ .new-script {
+ position: relative;
+ top:-5px;
+ }
+}
+
+//udfs
+.panel-udfs {
+ .upload-udf {
+ position: relative;
+ top:-5px;
+ }
+}
+
+//edit script
+.edit-script {
+ .panel-editscript {
+ textarea {
+ width: 100%;
+ max-width: 100%;
+ height: 300px;
+ }
+ div > textarea{
+ padding-right: 10px;
+ }
+ .inactive {
+ opacity: 0.2;
+ }
+ .CodeMirror {
+ .common-shadow-inset;
+
+ }
+ .panel-heading{
+ #title {
+ display: inline-block;
+ width: auto;
+ }
+ .nav-results > li > a {
+ padding: 7px 15px;
+ }
+ }
+ .panel-body {
+ padding: 5px;
+ background-color: #f5f5f5;
+ border-bottom: 1px solid #dddddd;
+ .argadd {
+ font-size: 13px;
+ width:10%;
+ display: inline-block;
+ height:22px;
+ padding: 0 5px;
+ }
+ .editable{
+ background-color: #428bca !important;
+ }
+ .argument {
+ vertical-align: middle;
+ background-color: #999999;
+ display: inline-block;
+ font-size: 75%;
+ font-weight: bold;
+ line-height: 1;
+ color: #ffffff;
+ text-align: center;
+ white-space: nowrap;
+ border-radius: .3em;
+ height: 22px;
+ .title {
+ float: left;
+ padding: 7px;
+ }
+ .moz-padding(rm-arg, ~'.',0 5px 0 0);
+ .rm-arg {
+ position: relative;
+ padding: 2px 5px 0 0;
+ }
+ }
+ }
+ }
+ .pigParams {
+ padding-bottom: 10px;
+ }
+}
+
+.job-status-view {
+ .progress {
+ margin-bottom: 0;
+ }
+ .kill-button {
+ float: left;
+ margin-right: 10px;
+ }
+}
+
+//utils
+#alert-wrap {
+ position: fixed;
+ bottom: 0;
+ width: 16.666666666666664%;
+ padding-right: 30px;
+ font-size: 0.9em;
+
+ .alert {
+ .common-shadow;
+ }
+}
+
+.spinner (@border, @size) {
+ //display: inline-block;
+ border: @border;
+ font-size: @size;
+ width: 1em;
+ height: 1em;
+ border-radius: .5em;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ -webkit-animation: spin 1s linear infinite;
+ -moz-animation: spin 1s linear infinite;
+ animation: spin 1s linear infinite;
+ border-top-color: black;
+}
+
+.spinner-sm {
+ .spinner(2px solid #eeeeee, 20px);
+}
+
+.spinner-bg {
+ .spinner(6px solid #eeeeee, 60px);
+}
+
+.editor-container {
+ position: relative;
+}
+
+.edit-confirm-container {
+ display: inline-block;
+ margin-top: 20px;
+}
+
+.edit-confirm {
+ height: 100%;
+ width: 100%;
+ position: absolute;
+ z-index: 1000;
+ text-align: center;
+}
+
+
+@-webkit-keyframes spin {
+ to {
+ -moz-transform: rotate(360deg);
+ -ms-transform: rotate(360deg);
+ -webkit-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
+@-moz-keyframes spin {
+ to {
+ -moz-transform: rotate(360deg);
+ -ms-transform: rotate(360deg);
+ -webkit-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
+@keyframes spin {
+ to {
+ -moz-transform: rotate(360deg);
+ -ms-transform: rotate(360deg);
+ -webkit-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
+
+.dropdown-submenu {
+ position:relative;
+}
+.dropdown-submenu > .dropdown-menu {
+ top:0;
+ left:100%;
+ margin-top:-6px;
+ margin-left:-1px;
+ -webkit-border-radius:0 6px 6px 6px;
+ -moz-border-radius:0 6px 6px 6px;
+ border-radius:0 6px 6px 6px;
+}
+.dropdown-submenu:hover > .dropdown-menu {
+ display:block;
+}
+.dropdown-submenu > a:after {
+ display:block;
+ content:" ";
+ float:right;
+ width:0;
+ height:0;
+ border-color:transparent;
+ border-style:solid;
+ border-width:5px 0 5px 5px;
+ border-left-color:#cccccc;
+ margin-top:5px;
+ margin-right:-10px;
+}
+.dropdown-submenu:hover > a:after {
+ border-left-color:#ffffff;
+}
+.dropdown-submenu.pull-left {
+ float:none;
+}
+.dropdown-submenu.pull-left > .dropdown-menu {
+ left:-100%;
+ margin-left:10px;
+ -webkit-border-radius:6px 0 6px 6px;
+ -moz-border-radius:6px 0 6px 6px;
+ border-radius:6px 0 6px 6px;
+}
+
+
+a.list-group-item.active{
+ z-index: 2;
+ color: #ffffff;
+ background-color: #428bca;
+ border-color: #428bca;
+ .base-transition(border-color 200ms linear, background-color 200ms linear;);
+}
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/application.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/application.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/application.hbs
new file mode 100644
index 0000000..a87c2a7
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/application.hbs
@@ -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.
+}}
+
+<div class="wrap">
+ {{outlet}}
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/index.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/index.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/index.hbs
new file mode 100644
index 0000000..0efb5b2
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/index.hbs
@@ -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.
+}}
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/loading.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/loading.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/loading.hbs
new file mode 100644
index 0000000..8017bcf
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/loading.hbs
@@ -0,0 +1,19 @@
+{{!
+ 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 class="spinner spinner-bg"></div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig.hbs
new file mode 100644
index 0000000..70e87ae
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig.hbs
@@ -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.
+}}
+
+<div class="container-fluid">
+ <div class="row">
+ <div class="col-md-2 navigation">
+ {{view view.navItemsView}}
+ {{outlet alert}}
+ </div>
+ <div class="col-md-10">
+ {{outlet}}
+ </div>
+ </div>
+</div>
+
+{{outlet modal}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/history.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/history.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/history.hbs
new file mode 100644
index 0000000..a1d5aae
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/history.hbs
@@ -0,0 +1,46 @@
+{{!
+ 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 class="panel panel-default panel-history">
+ <div class="panel-heading">
+ {{t 'common.history'}}
+ </div>
+
+ <table class="table table-bordered table-striped ">
+ <thead>
+ <tr class="label-row">
+ <th class="first">{{t 'job.title'}}</th>
+ <th>{{t 'job.started'}}</th>
+ <th>{{t 'job.status'}}</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ {{#each jobs}}
+ {{#view view.historyTableRow}}
+ <tr>
+ <td class="first">{{#link-to 'job' this.id }} {{this.title}}{{/link-to}}</td>
+ <td><span class="date">{{showDate this.dateStarted 'YYYY-MM-DD HH:mm'}}</span></td>
+ <td><span {{bind-attr class=":label view.labelClass"}}>{{this.status}}</span></td>
+ <td>{{#link-to 'job.results' this.id }} {{t 'job.results'}} {{/link-to}}</td>
+ </tr>
+ {{/view}}
+ {{/each}}
+ </tbody>
+ </table>
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/index.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/index.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/index.hbs
new file mode 100644
index 0000000..e3cbb1e
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/index.hbs
@@ -0,0 +1,19 @@
+{{!
+ 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.
+}}
+
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/job.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/job.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/job.hbs
new file mode 100644
index 0000000..ed81a68
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/job.hbs
@@ -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 class="well well-sm">
+ <div class="jobStatus" style="margin-bottom: 5px;">
+ <small>
+ {{t 'job.job_status'}} <strong>{{content.status}}</strong>
+ </small>
+ </div>
+
+ {{#if content.needsPing}}
+ {{#unless content.isKilling}}
+ <button {{action "killjob" content}} type="button" class="btn btn-danger btn-xs kill-button">Kill</button>
+ {{/unless}}
+ {{#if content.isKilling}}
+ <div class="spinner-sm pull-left kill-button"></div>
+ {{/if}}
+ {{/if}}
+
+ {{view view.progressBar contentBinding="content"}}
+</div>
+
+
+{{outlet}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobEdit.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobEdit.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobEdit.hbs
new file mode 100644
index 0000000..0efb5b2
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobEdit.hbs
@@ -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.
+}}
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobResults.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobResults.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobResults.hbs
new file mode 100644
index 0000000..67c49bd
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobResults.hbs
@@ -0,0 +1,19 @@
+{{!
+ 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.
+}}
+
+{{view view.outputView}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobResultsOutput.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobResultsOutput.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobResultsOutput.hbs
new file mode 100644
index 0000000..947b973
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobResultsOutput.hbs
@@ -0,0 +1,40 @@
+{{!
+ 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 class="panel-heading">
+ <div class="btn-group" data-toggle="buttons" >
+ <label id='btn-stdout' {{action 'getOutput' 'stdout' target="view"}} {{bind-attr class=":btn :btn-success view.isLoadingOutput:disabled:" }} >
+ <input type="radio" name="options"> {{t 'job.job_results.stdout'}}
+ </label>
+ <label id='btn-stderr' {{action 'getOutput' 'stderr' target="view"}} {{bind-attr class=":btn :btn-danger view.isLoadingOutput:disabled:" }}>
+ <input type="radio" name="options"> {{t 'job.job_results.stderr'}}
+ </label>
+ <label id='btn-exitcode' {{action 'getOutput' 'exitcode' target="view"}} {{bind-attr class=":btn :btn-default view.isLoadingOutput:disabled:" }}>
+ <input type="radio" name="options"> {{t 'job.job_results.exitcode'}}
+ </label>
+ </div>
+</div>
+<div class="panel-body">
+
+ {{#unless view.isLoadingOutput}}
+ <pre>{{view.activeOutput}}</pre>
+ {{/unless}}
+ {{#if view.isLoadingOutput}}
+ <div class="spinner-sm"></div>
+ {{/if}}
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobStatus.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobStatus.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobStatus.hbs
new file mode 100644
index 0000000..0efb5b2
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/jobStatus.hbs
@@ -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.
+}}
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/loading.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/loading.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/loading.hbs
new file mode 100644
index 0000000..d677772
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/loading.hbs
@@ -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.
+}}
+
+
+<div class="spinner-bg center-block"></div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/confirmdelete.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/confirmdelete.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/confirmdelete.hbs
new file mode 100644
index 0000000..39e3a1c
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/confirmdelete.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.
+}}
+
+<div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+ <h4 class="modal-title">{{t 'scripts.modal.confirm_delete'}}</h4>
+</div>
+<div class="modal-body">
+{{t 'scripts.modal.confirm_delete_massage' titleBinding="content.title" tagName="p"}}
+</div>
+<div class="modal-footer">
+ <button type="button" {{action "close" target="view"}} class="btn btn-default" data-dismiss="modal">{{t 'common.cancel'}}</button>
+ <button type="button" {{action "confirm" content target="view"}} class="btn btn-danger">{{t 'common.delete'}}</button>
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/createScript.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/createScript.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/createScript.hbs
new file mode 100644
index 0000000..6e536e9
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/createScript.hbs
@@ -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.
+}}
+
+<div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+ <h4 class="modal-title">{{t 'scripts.modal.create_script'}}</h4>
+</div>
+<div class="modal-body">
+<div class="form-group">
+ <label for="exampleInputEmail1">{{t 'scripts.title'}}</label>
+ {{input class="form-control" placeholderTranslation="udfs.modal.udf_name" valueBinding="content.title"}}
+ </div>
+ <div class="form-group">
+ <label for="exampleInputPassword1">{{t 'common.path'}}</label>
+ {{input class="form-control" placeholderTranslation="scripts.modal.file_path_placeholder" valueBinding="filePath"}}
+ <small class="pull-right help-block">{{t 'scripts.modal.file_path_hint'}}</small>
+ </div>
+</div>
+<div class="modal-footer">
+ <button type="button" {{action "close" content target="view"}} class="btn btn-default" >{{t 'common.cancel'}}</button>
+ <button type="button" {{action "create" content target="view"}} {{bind-attr disabled="view.udfInvalid"}} class="btn btn-success">{{t 'common.create'}}</button>
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/createUdf.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/createUdf.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/createUdf.hbs
new file mode 100644
index 0000000..a47ad1e
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/createUdf.hbs
@@ -0,0 +1,36 @@
+{{!
+ 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 class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+ <h4 class="modal-title">{{t 'udfs.modal.create_udf'}}</h4>
+</div>
+<div class="modal-body">
+<div class="form-group">
+ <label for="exampleInputEmail1">{{t 'common.name'}}</label>
+ {{input class="form-control" placeholderTranslation="udfs.modal.udf_name" valueBinding="content.name"}}
+ </div>
+ <div class="form-group">
+ <label for="exampleInputPassword1">{{t 'common.path'}}</label>
+ {{input class="form-control" placeholderTranslation="udfs.modal.hdfs_path" valueBinding="content.path"}}
+ </div>
+</div>
+<div class="modal-footer">
+ <button type="button" {{action "close" content target="view"}} class="btn btn-default" >{{t 'common.cancel'}}</button>
+ <button type="button" {{action "createUdf" content target="view"}} {{bind-attr disabled="view.udfInvalid"}} class="btn btn-success">{{t 'common.create'}}</button>
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/modalLayout.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/modalLayout.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/modalLayout.hbs
new file mode 100644
index 0000000..79bebd9
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/modal/modalLayout.hbs
@@ -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.
+}}
+
+<div class="modal fade in" data-backdrop="static">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ {{yield}}
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+</div><!-- /.modal -->
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptEdit.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptEdit.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptEdit.hbs
new file mode 100644
index 0000000..45d391a
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptEdit.hbs
@@ -0,0 +1,120 @@
+{{!
+ 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 class="edit-script">
+ <div {{bind-attr class=":panel :panel-editscript scriptError:panel-danger:panel-default"}} >
+ <div class="panel-heading">
+ <div class="head control-group">
+ {{outlet nav}}
+ <div class="btn-group">
+ {{input id="title" placeholderTranslation="scripts.title" class="form-control" disabled=controller.isJob valueBinding="content.title"}}
+ </div>
+ <div class="btn-group">
+ <input type="button" {{action "saveScript" content}} {{bind-attr class=":btn :btn-primary scriptDirty::disabled"}} {{translateAttr value="editor.save"}}
+ >
+ </div>
+ {{#if view.isEditConfirmed}}
+ {{view view.pigHelperView class="btn-group" }}
+ <div class="btn-group">
+ <button type="button" data-toggle="dropdown" {{bind-attr class=":btn :btn-default :dropdown-toggle ufdsList.length::disabled"}} >
+ {{t 'editor.udfhelper'}}
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu">
+ {{#each ufdsList}}
+ <li><a href="#" {{action 'insertUdf' this target="view" }}>{{this.name}}</a></li>
+ {{/each}}
+ </ul>
+ </div>
+ {{/if}}
+ </div>
+ </div>
+ <div class="panel-body" >
+ <span>
+ {{#with controller }}
+ {{#each controller.pigArgumentsPull}}
+ <span {{bind-attr class=":argument controller.isScript:editable:"}} >
+ <span class="title"> {{this}} </span>
+ {{#if controller.isScript}}
+ <button {{action "removeArgument" this}} class="close rm-arg">
+ ×
+ </button>
+ {{/if}}
+ </span>
+ {{/each}}
+ {{/with}}
+ {{#if controller.isScript}}
+ {{view view.argumentInput}}
+ <button {{action "sendArgument" target="view.argumentInput" }} type="button" class="btn btn-default btn-xs" >
+ <span class="glyphicon glyphicon-plus"></span> {{t 'common.add'}}
+ </button>
+ {{/if}}
+ </span>
+ <kbd class="file-path pull-right" data-toggle="tooltip" data-placement="bottom"{{translateAttr title="udfs.tooltips.path"}} >
+ {{#unless content.pigScript.isLoaded}}
+ <div class="spinner-sm"></div>
+ {{/unless}}
+ {{#if content.pigScript.isLoaded}}
+ {{content.pigScript.id}}
+ {{/if}}
+ </kbd>
+ </div>
+ <div class="editor-container">
+ {{#if controller.isJob}}
+ {{#unless view.isEditConfirmed}}
+ <div class="edit-confirm">
+ <div class="well edit-confirm-container">
+ When you executed job, script was copied to another place in filesystem. <br />
+ You're going to edit the <u>copy of original script</u> from history<br />
+ <button {{action "confirmEdit" target="view"}} class="btn btn-large" type="button">Edit script from history</button>
+ {{#if content.scriptId}}
+ <button {{action "returnToOriginal" content}} class="btn btn-large btn-primary" type="button">Return to original file</button>
+ {{/if}}
+ </div>
+ </div>
+ {{/unless}}
+ {{/if}}
+ {{view view.codeMirrorView id="pig_script" contentBinding="content.pigScript"}}
+ </div>
+ </div>
+
+ {{outlet main}}
+
+ <div class="form-inline pigParams">
+ {{#each pigParams}}
+ <div class="form-group">
+ <label class="control-label">{{this.title}}</label>
+ <div class="">
+ {{view view.pigParamView class='form-control input-sm' valueBinding='value'}}
+ </div>
+ </div>
+ {{/each}}
+ </div>
+
+ <div class="controls">
+ {{#unless isExec}}
+ <button {{action "execute" content 'execute' }} type="button" class="btn btn-default">{{t 'editor.execute'}}</button>
+ <button {{action "execute" content 'explain' }} type="button" class="btn btn-default">{{t 'editor.explain'}}</button>
+ <button {{action "execute" content 'syntax_check' }} type="button" class="btn btn-default">{{t 'editor.syntax_check'}}</button>
+ {{/unless}}
+
+ {{#if isExec}}
+ <div class="spinner-sm"></div>
+ {{/if}}
+ </div>
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptEditIndex.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptEditIndex.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptEditIndex.hbs
new file mode 100644
index 0000000..0efb5b2
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptEditIndex.hbs
@@ -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.
+}}
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptList.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptList.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptList.hbs
new file mode 100644
index 0000000..fdba0a6
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptList.hbs
@@ -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.
+}}
+
+<div class="panel panel-default panel-scriptlist">
+ <div class="panel-heading">
+ {{t 'scripts.scripts'}}
+ <a {{action "createScript"}} class="btn btn-default btn-sm pull-right new-script"><span class="glyphicon glyphicon-plus"></span> {{t 'scripts.newscript'}}</a>
+ </div>
+
+ <table class="table table-bordered table-striped ">
+ <thead>
+ <tr class="label-row">
+ <th class="first">{{t 'common.name'}}</th>
+ <th>{{t 'common.created'}}</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ {{#each content}}
+ <tr>
+
+ <td class="first">{{#link-to 'pig.scriptEdit' this.id}}
+ {{#if this.isNew}}
+ <div class="spinner-sm"></div>
+ {{/if}}
+ {{#unless this.isNew}}
+ {{this.title}}
+ {{/unless}}
+ {{/link-to}}</td>
+ <td><span class="date">{{showDate this.dateCreated 'YYYY-MM-DD HH:mm'}}</span></td>
+ <td>
+ {{#unless this.isNew}}
+ <a>{{t 'common.history'}}</a> - <a>{{t 'common.clone'}}</a> - <a href="#" {{action "deletescript" this}}>{{t 'common.delete'}}</a>
+ {{/unless}}
+ </td>
+ </tr>
+ {{/each}}
+ </tbody>
+ </table>
+</div>
+
+{{outlet modal}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptResults.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptResults.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptResults.hbs
new file mode 100644
index 0000000..0efb5b2
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptResults.hbs
@@ -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.
+}}
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptResultsNav.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptResultsNav.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptResultsNav.hbs
new file mode 100644
index 0000000..a94716f
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/scriptResultsNav.hbs
@@ -0,0 +1,19 @@
+{{!
+ 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.
+}}
+
+{{view view.navResultsView }}
http://git-wip-us.apache.org/repos/asf/ambari/blob/5eb22214/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/udfs.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/udfs.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/udfs.hbs
new file mode 100644
index 0000000..1ecd6be
--- /dev/null
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/pig/udfs.hbs
@@ -0,0 +1,45 @@
+{{!
+ 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 class="panel panel-default panel-udfs">
+ <div class="panel-heading">
+ UDFs
+ <a {{action "createUdfModal"}} class="btn btn-default btn-sm pull-right upload-udf"><span class="glyphicon glyphicon-plus"></span>{{t 'common.create'}}</a>
+ </div>
+
+ <table class="table table-bordered table-striped">
+ <thead>
+ <tr class="label-row">
+ <th class="first">{{t 'common.name'}}</th>
+ <th>{{t 'common.path'}}</th>
+ <th>{{t 'common.owner'}}</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ {{#each content}}
+ <tr>
+ <td> {{this.name}}</td>
+ <td> {{this.path}}</td>
+ <td> {{this.owner}}</td>
+ <td><a href="#" {{action "deleteUdf" this}} >{{t 'common.delete'}}</a></td>
+ </tr>
+ {{/each}}
+ </tbody>
+ </table>
+</div>