ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject 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)
Date Thu, 24 Sep 2015 22:22:41 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 4515215a2 -> 93f86a487


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/trunk
Commit: 93f86a487e133ce2a04cd3d30ac2a02a6ff63b7a
Parents: 4515215
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Thu Sep 24 15:22:17 2015 -0700
Committer: Yusaku Sako <yusaku@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
     });


Mime
View raw message