You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2014/05/21 18:32:03 UTC
git commit: AMBARI-5843. Clicking on app in Slider Apps table should
show the details page (alexantonenko)
Repository: ambari
Updated Branches:
refs/heads/trunk 7dc9d8c53 -> d4f502272
AMBARI-5843. Clicking on app in Slider Apps table should show the details page (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d4f50227
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d4f50227
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d4f50227
Branch: refs/heads/trunk
Commit: d4f502272e4f249509c96bfdb76d4b831187a5f7
Parents: 7dc9d8c
Author: Alex Antonenko <hi...@gmail.com>
Authored: Wed May 21 19:28:58 2014 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Wed May 21 19:28:58 2014 +0300
----------------------------------------------------------------------
.../src/main/resources/ui/app/config/router.js | 3 +-
.../app/controllers/slider_apps_controller.js | 20 +++
.../src/main/resources/ui/app/initialize.js | 4 +
.../main/resources/ui/app/models/slider_app.js | 10 +-
.../ui/app/models/slider_app_component.js | 2 +-
.../resources/ui/app/models/slider_app_type.js | 12 +-
.../src/main/resources/ui/app/routes/main.js | 23 ++-
.../resources/ui/app/styles/application.less | 4 +
.../resources/ui/app/templates/application.hbs | 3 +
.../ui/app/templates/createAppWizard.hbs | 8 +-
.../resources/ui/app/templates/slider_app.hbs | 24 +++
.../resources/ui/app/templates/slider_apps.hbs | 11 +-
.../resources/ui/app/views/common/sort_view.js | 2 +-
.../src/main/resources/ui/app/views/slider.js | 150 -------------------
.../resources/ui/app/views/slider_app_view.js | 21 +++
.../resources/ui/app/views/slider_apps_view.js | 150 +++++++++++++++++++
16 files changed, 272 insertions(+), 175 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/config/router.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/config/router.js b/contrib/views/slider/src/main/resources/ui/app/config/router.js
index 5a6eaa6..41d1b37 100755
--- a/contrib/views/slider/src/main/resources/ui/app/config/router.js
+++ b/contrib/views/slider/src/main/resources/ui/app/config/router.js
@@ -19,7 +19,7 @@
'use strict';
module.exports = App.Router.map(function () {
- this.resource("slider_apps", { path: "/slider" }, function () {
+ this.resource("slider_apps", { path: "/" }, function () {
this.resource('createAppWizard', function(){
this.route('step1');
this.route('step2');
@@ -27,5 +27,6 @@ module.exports = App.Router.map(function () {
this.route('step4');
});
});
+ this.resource('slider_app', { path: 'apps/:slider_app_id' });
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js
new file mode 100644
index 0000000..b9f3698
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js
@@ -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.
+ */
+
+App.SliderAppsController = Ember.ArrayController.extend({
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/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 4df4dfc..f0a25de 100755
--- a/contrib/views/slider/src/main/resources/ui/app/initialize.js
+++ b/contrib/views/slider/src/main/resources/ui/app/initialize.js
@@ -19,6 +19,10 @@
'use strict';
window.App = require('config/app');
+
+App.ApplicationAdapter = DS.FixtureAdapter.extend({
+ namespace: 'slider-emberjs'
+});
require('config/router');
require('config/store');
require('translations');
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js b/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js
index 18679df..022b35f 100644
--- a/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js
+++ b/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js
@@ -56,7 +56,7 @@ App.SliderApp = DS.Model.extend({
/**
* @type {App.SliderAppType}
*/
- appType: DS.belongsTo('App.SliderAppType'),
+ appType: DS.belongsTo('SliderAppType'),
/**
* @type {string}
@@ -66,17 +66,17 @@ App.SliderApp = DS.Model.extend({
/**
* @type {App.SliderAppComponent[]}
*/
- components: DS.hasMany('App.SliderAppComponent'),
+ components: DS.hasMany('SliderAppComponent'),
/**
* @type {App.QuickLink[]}
*/
- quickLinks: DS.hasMany('App.QuickLink'),
+ quickLinks: DS.hasMany('QuickLink'),
/**
* @type {App.TypedProperty[]}
*/
- runtimeProperties: DS.hasMany('App.TypedProperty')
+ runtimeProperties: DS.hasMany('TypedProperty')
});
App.SliderApp.FIXTURES = [
@@ -85,7 +85,7 @@ App.SliderApp.FIXTURES = [
index: 'indx1',
yarnId: 'y1',
name: 'name1',
- status: 'Running',
+ status: 'FROZEN',
user: 'u1',
started: 1400132912,
ended: 1400152912,
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/models/slider_app_component.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/models/slider_app_component.js b/contrib/views/slider/src/main/resources/ui/app/models/slider_app_component.js
index de115c4..e6602a6 100644
--- a/contrib/views/slider/src/main/resources/ui/app/models/slider_app_component.js
+++ b/contrib/views/slider/src/main/resources/ui/app/models/slider_app_component.js
@@ -31,7 +31,7 @@ App.SliderAppComponent = DS.Model.extend({
/**
* @type {App.Host}
*/
- host: DS.belongsTo('App.Host')
+ host: DS.belongsTo('Host')
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/models/slider_app_type.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/models/slider_app_type.js b/contrib/views/slider/src/main/resources/ui/app/models/slider_app_type.js
index 0c1e81d..9b7f991 100644
--- a/contrib/views/slider/src/main/resources/ui/app/models/slider_app_type.js
+++ b/contrib/views/slider/src/main/resources/ui/app/models/slider_app_type.js
@@ -31,7 +31,7 @@ App.SliderAppType = DS.Model.extend({
/**
* @type {App.SliderAppTypeComponent[]}
*/
- components: DS.hasMany('App.SliderAppTypeComponent'),
+ components: DS.hasMany('SliderAppTypeComponent'),
/**
* @type {object}
@@ -44,7 +44,7 @@ App.SliderAppType.FIXTURES = [
{
id: 1,
index: 'indx1',
- disaplyName: 'Index 1',
+ displayName: 'Index 1',
components: [1, 2],
configs: {
c1: 'v1',
@@ -54,7 +54,7 @@ App.SliderAppType.FIXTURES = [
{
id: 2,
index: 'indx2',
- disaplyName: 'Index 2',
+ displayName: 'Index 2',
components: [2, 4, 5],
configs: {
c1: 'v2',
@@ -64,7 +64,7 @@ App.SliderAppType.FIXTURES = [
{
id: 3,
index: 'indx3',
- disaplyName: 'Index 3',
+ displayName: 'Index 3',
components: [1, 2, 4],
configs: {
c1: 'v3',
@@ -74,7 +74,7 @@ App.SliderAppType.FIXTURES = [
{
id: 4,
index: 'indx4',
- disaplyName: 'Index 4',
+ displayName: 'Index 4',
components: [5],
configs: {
c1: 'v4',
@@ -84,7 +84,7 @@ App.SliderAppType.FIXTURES = [
{
id: 5,
index: 'indx5',
- disaplyName: 'Index 5',
+ displayName: 'Index 5',
components: [1, 2, 3, 4, 5],
configs: {
c1: 'v5',
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/routes/main.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/routes/main.js b/contrib/views/slider/src/main/resources/ui/app/routes/main.js
index 04831b9..c79f9ca 100644
--- a/contrib/views/slider/src/main/resources/ui/app/routes/main.js
+++ b/contrib/views/slider/src/main/resources/ui/app/routes/main.js
@@ -17,14 +17,17 @@
*/
App.IndexRoute = Ember.Route.extend({
+
redirect: function () {
this.transitionTo('slider_apps');
}
+
});
App.SliderAppsRoute = Ember.Route.extend({
- setupController: function (controller) {
- controller.set('model', App.SliderApp.FIXTURES);
+
+ model: function () {
+ return this.store.find('sliderApp');
},
actions: {
@@ -33,3 +36,19 @@ App.SliderAppsRoute = Ember.Route.extend({
}
}
});
+
+App.SliderAppsIndexRoute = Ember.Route.extend({
+
+ model: function () {
+ return this.modelFor('sliderApps');
+ }
+
+});
+
+App.SliderAppRoute = Ember.Route.extend({
+
+ model: function(params) {
+ return this.store.find('sliderApp', params.slider_app_id);
+ }
+
+});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/styles/application.less
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/styles/application.less b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
index 1edc9e9..09a3a91 100644
--- a/contrib/views/slider/src/main/resources/ui/app/styles/application.less
+++ b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
@@ -16,6 +16,10 @@
* limitations under the License.
*/
+a {
+ cursor: pointer;
+}
+
#slider-apps-table {
.create-app {
margin-top:27px;
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs
index 8285573..f4f66d1 100755
--- a/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs
@@ -16,6 +16,9 @@
* limitations under the License.
}}
+<div>
+ <h1>{{t slider.apps.title}}</h1>
+</div>
{{#if App.viewEnabled}}
{{outlet}}
{{else}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard.hbs
index 20efa2b..8714a5f 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard.hbs
@@ -28,10 +28,10 @@
<div class="span3">
<div class="well">
<ul class="nav nav-pills nav-stacked">
- <li {{bindAttr class="view.isStep1:active view.isStep1Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep 1 target="controller"}}>{{t wizard.step1.name}}</a></li>
- <li {{bindAttr class="view.isStep2:active view.isStep2Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep 2 target="controller"}}>{{t wizard.step2.name}}</a></li>
- <li {{bindAttr class="view.isStep3:active view.isStep3Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep 3 target="controller"}}>{{t wizard.step3.name}}</a></li>
- <li {{bindAttr class="view.isStep4:active view.isStep4Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep 4 target="controller"}}>{{t wizard.step4.name}}</a></li>
+ <li {{bind-attr class="view.isStep1:active view.isStep1Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep 1 target="controller"}}>{{t wizard.step1.name}}</a></li>
+ <li {{bind-attr class="view.isStep2:active view.isStep2Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep 2 target="controller"}}>{{t wizard.step2.name}}</a></li>
+ <li {{bind-attr class="view.isStep3:active view.isStep3Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep 3 target="controller"}}>{{t wizard.step3.name}}</a></li>
+ <li {{bind-attr class="view.isStep4:active view.isStep4Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep 4 target="controller"}}>{{t wizard.step4.name}}</a></li>
</ul>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs
new file mode 100644
index 0000000..7a9c2df
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs
@@ -0,0 +1,24 @@
+{{!
+* 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.
+}}
+
+{{#link-to 'slider_apps'}}
+ {{t slider.apps.title}}
+{{/link-to}}
+ →
+{{model.name}}
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/templates/slider_apps.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_apps.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_apps.hbs
index 3844857..385a790 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/slider_apps.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_apps.hbs
@@ -18,9 +18,6 @@
<div id="slider-apps-table">
<div class="box-header row">
- <div class="pull-left">
- <h1>{{t slider.apps.title}}</h1>
- </div>
<div class="pull-right create-app">
<a href="#" class="btn btn-inverse" {{action createApp}}>
<i class="icon-plus"></i><span> {{t slider.apps.create}}</span>
@@ -51,11 +48,15 @@
{{#each slider in view.pageContent}}
{{#view view.SliderView contentBinding="slider"}}
- <td><a href="#">{{slider.name}}</a></td>
+ <td>
+ {{#link-to 'slider_app' slider}}
+ {{slider.name}}
+ {{/link-to}}
+ </td>
<td>{{slider.status}}</td>
- <td>{{slider.appType}}</td>
+ <td>{{slider.appType.displayName}}</td>
<td>{{slider.user}}</td>
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/views/common/sort_view.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/views/common/sort_view.js b/contrib/views/slider/src/main/resources/ui/app/views/common/sort_view.js
index 436ed69..acce22a 100644
--- a/contrib/views/slider/src/main/resources/ui/app/views/common/sort_view.js
+++ b/contrib/views/slider/src/main/resources/ui/app/views/common/sort_view.js
@@ -168,7 +168,7 @@ var wrapperView = Em.View.extend({
* @type {*}
*/
var fieldView = Em.View.extend({
- template:Em.Handlebars.compile('<span {{bindAttr class="view.status :column-name"}}>{{view.displayName}}</span>'),
+ template:Em.Handlebars.compile('<span {{bind-attr class="view.status :column-name"}}>{{view.displayName}}</span>'),
classNameBindings: ['viewNameClass'],
tagName: 'th',
name: null,
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/views/slider.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/views/slider.js b/contrib/views/slider/src/main/resources/ui/app/views/slider.js
deleted file mode 100644
index caf9692..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/views/slider.js
+++ /dev/null
@@ -1,150 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var filters = require('views/common/filter_view');
-var sort = require('views/common/sort_view');
-
-App.SliderAppsView = App.TableView.extend({
-
- statusList: [
- "",
- App.SliderApp.Status.running,
- App.SliderApp.Status.frozen,
- App.SliderApp.Status.destroyed,
- ],
-
- content: function () {
- return this.get('controller.model');
- }.property('controller.model.length'),
-
- didInsertElement: function () {
- this.set('filteredContent',this.get('content'));
- },
-
- filteredContentInfo: function () {
- return Em.I18n.t('sliderApps.filters.info').format(this.get('filteredContent.length'), this.get('content.length'));
- }.property('content.length', 'filteredContent.length'),
-
- sortView: sort.wrapperView,
- nameSort: sort.fieldView.extend({
- column: 0,
- name:'name',
- displayName: "Name"
- }),
-
- statusSort: sort.fieldView.extend({
- column: 1,
- name:'status',
- displayName: "Status"
- }),
-
- typeSort: sort.fieldView.extend({
- column: 2,
- name:'appType',
- displayName: "Type"
- }),
-
- userSort: sort.fieldView.extend({
- column: 3,
- name:'user',
- displayName: "User"
- }),
-
- startSort: sort.fieldView.extend({
- column: 4,
- name:'started',
- displayName: "Start Time",
- type: "number"
- }),
-
- endSort: sort.fieldView.extend({
- column: 5,
- name:'ended',
- displayName: "End Time",
- type: "number"
- }),
-
- SliderView: Em.View.extend({
- content:null,
- tagName: 'tr'
- }),
-
- /**
- * Filter view for name column
- * Based on <code>filters</code> library
- */
- nameFilterView: filters.createTextView({
- column: 0,
- fieldType: 'filter-input-width',
- onChangeValue: function(){
- this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string');
- }
- }),
-
- statusFilterView: filters.createSelectView({
- column: 1,
- fieldType: 'filter-input-width',
- content: function() {
- return this.get('parentView.statusList');
- }.property('parentView.statusList'),
- onChangeValue: function(){
- this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string');
- }
- }),
-
- typeFilterView: filters.createTextView({
- column: 2,
- fieldType: 'filter-input-width',
- onChangeValue: function(){
- this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string');
- }
- }),
-
- userFilterView: filters.createTextView({
- column: 3,
- fieldType: 'filter-input-width',
- onChangeValue: function(){
- this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string');
- }
- }),
-
- startFilterView: filters.createSelectView({
- column: 4,
- fieldType: 'filter-input-width',
- content: ['', 'Past 1 hour', 'Past 1 Day', 'Past 2 Days', 'Past 7 Days', 'Past 14 Days', 'Past 30 Days', 'Custom'],
- onChangeValue: function(){
- this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'date');
- },
- type: 'number'
- }),
-
- /**
- * associations between host property and column index
- * @type {Array}
- */
- colPropAssoc: function(){
- var associations = [];
- associations[0] = 'name';
- associations[1] = 'status';
- associations[2] = 'appType';
- associations[3] = 'user';
- associations[4] = 'started';
- associations[5] = 'ended';
- return associations;
- }.property()
-
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/views/slider_app_view.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/views/slider_app_view.js b/contrib/views/slider/src/main/resources/ui/app/views/slider_app_view.js
new file mode 100644
index 0000000..2da3f5b
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/app/views/slider_app_view.js
@@ -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.
+ */
+
+App.SliderAppView = Ember.View.extend({
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/d4f50227/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js b/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js
new file mode 100644
index 0000000..caf9692
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js
@@ -0,0 +1,150 @@
+/**
+ * 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 filters = require('views/common/filter_view');
+var sort = require('views/common/sort_view');
+
+App.SliderAppsView = App.TableView.extend({
+
+ statusList: [
+ "",
+ App.SliderApp.Status.running,
+ App.SliderApp.Status.frozen,
+ App.SliderApp.Status.destroyed,
+ ],
+
+ content: function () {
+ return this.get('controller.model');
+ }.property('controller.model.length'),
+
+ didInsertElement: function () {
+ this.set('filteredContent',this.get('content'));
+ },
+
+ filteredContentInfo: function () {
+ return Em.I18n.t('sliderApps.filters.info').format(this.get('filteredContent.length'), this.get('content.length'));
+ }.property('content.length', 'filteredContent.length'),
+
+ sortView: sort.wrapperView,
+ nameSort: sort.fieldView.extend({
+ column: 0,
+ name:'name',
+ displayName: "Name"
+ }),
+
+ statusSort: sort.fieldView.extend({
+ column: 1,
+ name:'status',
+ displayName: "Status"
+ }),
+
+ typeSort: sort.fieldView.extend({
+ column: 2,
+ name:'appType',
+ displayName: "Type"
+ }),
+
+ userSort: sort.fieldView.extend({
+ column: 3,
+ name:'user',
+ displayName: "User"
+ }),
+
+ startSort: sort.fieldView.extend({
+ column: 4,
+ name:'started',
+ displayName: "Start Time",
+ type: "number"
+ }),
+
+ endSort: sort.fieldView.extend({
+ column: 5,
+ name:'ended',
+ displayName: "End Time",
+ type: "number"
+ }),
+
+ SliderView: Em.View.extend({
+ content:null,
+ tagName: 'tr'
+ }),
+
+ /**
+ * Filter view for name column
+ * Based on <code>filters</code> library
+ */
+ nameFilterView: filters.createTextView({
+ column: 0,
+ fieldType: 'filter-input-width',
+ onChangeValue: function(){
+ this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string');
+ }
+ }),
+
+ statusFilterView: filters.createSelectView({
+ column: 1,
+ fieldType: 'filter-input-width',
+ content: function() {
+ return this.get('parentView.statusList');
+ }.property('parentView.statusList'),
+ onChangeValue: function(){
+ this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string');
+ }
+ }),
+
+ typeFilterView: filters.createTextView({
+ column: 2,
+ fieldType: 'filter-input-width',
+ onChangeValue: function(){
+ this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string');
+ }
+ }),
+
+ userFilterView: filters.createTextView({
+ column: 3,
+ fieldType: 'filter-input-width',
+ onChangeValue: function(){
+ this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'string');
+ }
+ }),
+
+ startFilterView: filters.createSelectView({
+ column: 4,
+ fieldType: 'filter-input-width',
+ content: ['', 'Past 1 hour', 'Past 1 Day', 'Past 2 Days', 'Past 7 Days', 'Past 14 Days', 'Past 30 Days', 'Custom'],
+ onChangeValue: function(){
+ this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'date');
+ },
+ type: 'number'
+ }),
+
+ /**
+ * associations between host property and column index
+ * @type {Array}
+ */
+ colPropAssoc: function(){
+ var associations = [];
+ associations[0] = 'name';
+ associations[1] = 'status';
+ associations[2] = 'appType';
+ associations[3] = 'user';
+ associations[4] = 'started';
+ associations[5] = 'ended';
+ return associations;
+ }.property()
+
+});