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