You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2015/09/30 16:45:26 UTC
[06/50] [abbrv] ambari git commit: AMBARI-13203. Ambari Pig View -
Explain PigScript - Script Details - Shows the pig command instead of pig
script. (Nitiraj Singh Rathore via yusaku)
AMBARI-13203. Ambari Pig View - Explain PigScript - Script Details - Shows the pig command instead of pig script. (Nitiraj Singh Rathore via yusaku)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/93f86a48
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/93f86a48
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/93f86a48
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 93f86a487e133ce2a04cd3d30ac2a02a6ff63b7a
Parents: 4515215
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Thu Sep 24 15:22:17 2015 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Thu Sep 24 15:22:17 2015 -0700
----------------------------------------------------------------------
.../ui/pig-web/app/controllers/scriptJob.js | 28 +++++++++++---------
1 file changed, 16 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/93f86a48/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/scriptJob.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/scriptJob.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/scriptJob.js
index d868823..2d8226b 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/scriptJob.js
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/scriptJob.js
@@ -21,18 +21,22 @@ var App = require('app');
App.ScriptJobController = Em.ObjectController.extend(App.FileHandler,{
fullscreen:false,
scriptContents:function () {
- var promise = new Ember.RSVP.Promise(function(resolve,reject){
- return this.get('content.pigScript').then(function (pigScript) {
- return resolve(pigScript);
- },function (error) {
- var response = (error.responseJSON)?error.responseJSON:{};
- reject(response.message);
- if (error.status != 404) {
- controller.send('showAlert', {'message': Em.I18n.t('job.alert.promise_error',
- {status:response.status, message:response.message}), status:'error', trace: response.trace});
- }
- }.bind(this));
- }.bind(this));
+ var job = this.get('content'),
+ controller = this,
+ promise = new Ember.RSVP.Promise(function (resolve,reject){
+ var file = (job.get('jobType') !== 'explain') ? job.get('pigScript') : job.store.find('file',[job.get('statusDir'),'source.pig'].join('/'));
+
+ return file.then(function (data) {
+ resolve(data);
+ },function (error) {
+ var response = (error.responseJSON)?error.responseJSON:{};
+ reject(response.message);
+ if (error.status != 404) {
+ controller.send('showAlert', {'message': Em.I18n.t('job.alert.promise_error',
+ {status:response.status, message:response.message}), status:'error', trace: response.trace});
+ }
+ });
+ });
return Ember.ObjectProxy.extend(Ember.PromiseProxyMixin).create({
promise: promise
});