|
@@ -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() {
|