YARN-7804. [UI2] Refresh action on Grid view page should not be redirected to graph view. Contributed by Gergely Novák.
This commit is contained in:
parent
7623cc5a98
commit
7c1e77dda4
@ -25,6 +25,13 @@ export default Ember.Component.extend({
|
|||||||
tableDefinition: TableDefinition.create({
|
tableDefinition: TableDefinition.create({
|
||||||
searchType: 'manual',
|
searchType: 'manual',
|
||||||
}),
|
}),
|
||||||
|
graphDrawn: false,
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
changeViewType(param) {
|
||||||
|
this.sendAction("changeViewType", param);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
canvas: {
|
canvas: {
|
||||||
svg: undefined,
|
svg: undefined,
|
||||||
@ -235,12 +242,10 @@ export default Ember.Component.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
didInsertElement: function() {
|
didInsertElement: function() {
|
||||||
// init tooltip
|
// init model
|
||||||
this.initTooltip();
|
|
||||||
this.modelArr = [];
|
this.modelArr = [];
|
||||||
this.containerIdArr = [];
|
this.containerIdArr = [];
|
||||||
|
|
||||||
// init model
|
|
||||||
if (this.get("rmModel")) {
|
if (this.get("rmModel")) {
|
||||||
this.get("rmModel").forEach(function(o) {
|
this.get("rmModel").forEach(function(o) {
|
||||||
if(!this.modelArr.contains(o)) {
|
if(!this.modelArr.contains(o)) {
|
||||||
@ -258,16 +263,30 @@ export default Ember.Component.extend({
|
|||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.modelArr.length === 0) {
|
if (this.modelArr.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.modelArr.sort(function(a, b) {
|
this.modelArr.sort(function(a, b) {
|
||||||
var tsA = a.get("startTs");
|
var tsA = a.get("startTs");
|
||||||
var tsB = b.get("startTs");
|
var tsB = b.get("startTs");
|
||||||
|
|
||||||
return tsA - tsB;
|
return tsA - tsB;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (this.get('attemptModel')) {
|
||||||
|
this.setAttemptsGridColumnsAndRows();
|
||||||
|
} else {
|
||||||
|
this.setContainersGridColumnsAndRows();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
didUpdate: function() {
|
||||||
|
if (this.get("viewType") === "grid" || this.graphDrawn) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.initTooltip();
|
||||||
|
|
||||||
var begin = 0;
|
var begin = 0;
|
||||||
if (this.modelArr.length > 0) {
|
if (this.modelArr.length > 0) {
|
||||||
begin = this.modelArr[0].get("startTs");
|
begin = this.modelArr[0].get("startTs");
|
||||||
@ -289,11 +308,7 @@ export default Ember.Component.extend({
|
|||||||
this.setSelected(this.modelArr[0]);
|
this.setSelected(this.modelArr[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.get('attemptModel')) {
|
this.graphDrawn = true;
|
||||||
this.setAttemptsGridColumnsAndRows();
|
|
||||||
} else {
|
|
||||||
this.setContainersGridColumnsAndRows();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setAttemptsGridColumnsAndRows: function() {
|
setAttemptsGridColumnsAndRows: function() {
|
||||||
|
@ -19,8 +19,15 @@
|
|||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Ember.Controller.extend({
|
||||||
queryParams: ["service"],
|
queryParams: ["service", "viewType"],
|
||||||
service: undefined,
|
service: undefined,
|
||||||
|
viewType: "graph",
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
changeViewType(param) {
|
||||||
|
this.set("viewType", param);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
breadcrumbs: Ember.computed("model.attempt.appId", "model.attempt.id", function () {
|
breadcrumbs: Ember.computed("model.attempt.appId", "model.attempt.id", function () {
|
||||||
var appId = this.get("model.attempt.appId");
|
var appId = this.get("model.attempt.appId");
|
||||||
|
@ -19,6 +19,13 @@
|
|||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Ember.Controller.extend({
|
||||||
queryParams: ["service"],
|
queryParams: ["service", "viewType"],
|
||||||
service: undefined
|
service: undefined,
|
||||||
|
viewType: "graph",
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
changeViewType(param) {
|
||||||
|
this.set("viewType", param);
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
@ -26,16 +26,16 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<ul class="nav nav-tabs" role="tablist">
|
<ul class="nav nav-tabs" role="tablist">
|
||||||
<li class="active">
|
<li class="{{if (eq viewType "graph") "active" ""}}">
|
||||||
<a href="#graphViewTab" role="tab" data-toggle="tab">Graph View</a>
|
<a href="#graphViewTab" role="tab" data-toggle="tab" {{action "changeViewType" "graph"}}>Graph View</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="">
|
<li class="{{if (eq viewType "grid") "active" ""}}">
|
||||||
<a href="#gridViewTab" role="tab" data-toggle="tab">Grid View</a>
|
<a href="#gridViewTab" role="tab" data-toggle="tab" {{action "changeViewType" "grid"}}>Grid View</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div role="tabpanel" class="tab-pane active" id="graphViewTab">
|
<div role="tabpanel" class="tab-pane {{if (eq viewType "graph") "active" ""}}" id="graphViewTab">
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<div class="col-md-7 container-fluid" id={{parent-id}}></div>
|
<div class="col-md-7 container-fluid" id={{parent-id}}></div>
|
||||||
<!-- diag info -->
|
<!-- diag info -->
|
||||||
@ -56,7 +56,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div role="tabpanel" class="tab-pane" id="gridViewTab">
|
<div role="tabpanel" class="tab-pane {{if (eq viewType "grid") "active" ""}}" id="gridViewTab">
|
||||||
{{em-table columns=gridColumns rows=gridRows definition=tableDefinition}}
|
{{em-table columns=gridColumns rows=gridRows definition=tableDefinition}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -56,6 +56,8 @@
|
|||||||
tsModel=model.tsContainers
|
tsModel=model.tsContainers
|
||||||
label="shortAppAttemptId"
|
label="shortAppAttemptId"
|
||||||
attemptModel=false
|
attemptModel=false
|
||||||
|
changeViewType="changeViewType"
|
||||||
|
viewType=viewType
|
||||||
}}
|
}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="col-md-12 container-fluid">
|
<div class="col-md-12 container-fluid">
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
label="shortAppAttemptId"
|
label="shortAppAttemptId"
|
||||||
attemptModel=true
|
attemptModel=true
|
||||||
serviceName=model.serviceName
|
serviceName=model.serviceName
|
||||||
|
changeViewType="changeViewType"
|
||||||
|
viewType=viewType
|
||||||
}}
|
}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="col-md-12 container-fluid">
|
<div class="col-md-12 container-fluid">
|
||||||
|
Loading…
Reference in New Issue
Block a user