ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject git commit: AMBARI-5819. Slider UI should initialize the view name, instance, version from URL. (onechiporenko)
Date Tue, 20 May 2014 11:14:50 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b6c56e807 -> 07193440d


AMBARI-5819. Slider UI should initialize the view name, instance, version from URL. (onechiporenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/07193440
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/07193440
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/07193440

Branch: refs/heads/trunk
Commit: 07193440d619c359bb5a21ec0644f015a6cd19fd
Parents: b6c56e8
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Tue May 20 14:12:24 2014 +0300
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Tue May 20 14:12:24 2014 +0300

----------------------------------------------------------------------
 .../src/main/resources/ui/app/config/app.js     |  6 ++---
 .../src/main/resources/ui/app/initialize.js     | 27 ++++++++++++++++++++
 2 files changed, 30 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/07193440/contrib/views/slider/src/main/resources/ui/app/config/app.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/config/app.js b/contrib/views/slider/src/main/resources/ui/app/config/app.js
index 74d6d33..9e19d56 100755
--- a/contrib/views/slider/src/main/resources/ui/app/config/app.js
+++ b/contrib/views/slider/src/main/resources/ui/app/config/app.js
@@ -19,8 +19,8 @@
 'use strict';
 
 var config = {
-    LOG_TRANSITIONS: true,
-    LOG_TRANSITIONS_INTERNAL: false
-  };
+  LOG_TRANSITIONS: true,
+  LOG_TRANSITIONS_INTERNAL: false
+};
 
 module.exports = Ember.Application.create(config);

http://git-wip-us.apache.org/repos/asf/ambari/blob/07193440/contrib/views/slider/src/main/resources/ui/app/initialize.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/initialize.js b/contrib/views/slider/src/main/resources/ui/app/initialize.js
index 63edecf..0e9541a 100755
--- a/contrib/views/slider/src/main/resources/ui/app/initialize.js
+++ b/contrib/views/slider/src/main/resources/ui/app/initialize.js
@@ -23,6 +23,33 @@ require('config/router');
 require('config/store');
 require('translations');
 
+App.reopen({
+  /**
+   * @type {string}
+   */
+  name: 'SLIDER',
+
+  /**
+   * @type {string}
+   */
+  version: '1.0.0',
+
+  /**
+   * @type {string}
+   */
+  instance: 'SLIDER_1',
+
+  /**
+   * API url for Slider
+   * Format:
+   *  <code>/api/v1/views/[VIEW_NAME]/versions/[VERSION]/instances/[INSTANCE_NAME]/</code>
+   * @type {string}
+   */
+  urlPrefix: function() {
+    return '/api/v1/views/%@1/versions/%@2/instances/%@3/'.fmt(this.get('name'), this.get('version'),
this.get('instance'));
+  }.property('name', 'version', 'instance')
+});
+
 // Load all modules in order automagically. Ember likes things to work this
 // way so everything is in the App.* namespace.
 var folderOrder = [


Mime
View raw message