logster 2.11.4 → 2.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +63 -12
  3. data/.gitignore +2 -0
  4. data/CHANGELOG.md +10 -5
  5. data/README.md +8 -0
  6. data/assets/javascript/.gitkeep +0 -0
  7. data/assets/javascript/chunk.143.2faa04830259ce9aa59a.js +22 -0
  8. data/assets/javascript/chunk.178.ca5ade1d8cbdbfbe6d72.js +22 -0
  9. data/assets/javascript/chunk.468.95dd450003497c781cb3.js +1213 -0
  10. data/assets/javascript/chunk.916.85a3fc9d873df80f5ea5.js +579 -0
  11. data/assets/javascript/client-app.js +1257 -280
  12. data/assets/javascript/vendor.js +4068 -3375
  13. data/assets/stylesheets/.gitkeep +0 -0
  14. data/assets/stylesheets/client-app.css +1 -1
  15. data/assets/stylesheets/vendor.css +1 -1
  16. data/build_client_app.sh +6 -8
  17. data/client-app/.editorconfig +0 -1
  18. data/client-app/.eslintignore +2 -0
  19. data/client-app/.eslintrc +10 -0
  20. data/client-app/.gitignore +1 -1
  21. data/client-app/.prettierignore +21 -0
  22. data/client-app/.prettierrc +1 -0
  23. data/client-app/.template-lintrc.js +10 -0
  24. data/client-app/README.md +4 -5
  25. data/client-app/app/app.js +2 -2
  26. data/client-app/app/components/actions-menu.js +21 -21
  27. data/client-app/app/components/back-trace.js +89 -90
  28. data/client-app/app/components/env-tab.js +41 -29
  29. data/client-app/app/components/message-info.js +78 -75
  30. data/client-app/app/components/message-row.js +20 -17
  31. data/client-app/app/components/page-nav.js +33 -24
  32. data/client-app/app/components/panel-resizer.js +53 -37
  33. data/client-app/app/components/patterns-list.js +101 -84
  34. data/client-app/app/components/tab-contents.js +15 -19
  35. data/client-app/app/components/tabbed-section.js +30 -18
  36. data/client-app/app/components/time-formatter.js +29 -18
  37. data/client-app/app/controllers/index.js +143 -119
  38. data/client-app/app/controllers/show.js +17 -13
  39. data/client-app/app/helpers/or.js +1 -1
  40. data/client-app/app/initializers/app-init.js +23 -34
  41. data/client-app/app/lib/decorators.js +4 -2
  42. data/client-app/app/lib/preload.js +7 -4
  43. data/client-app/app/lib/utilities.js +55 -54
  44. data/client-app/app/models/group.js +20 -15
  45. data/client-app/app/models/message-collection.js +153 -149
  46. data/client-app/app/models/message.js +60 -58
  47. data/client-app/app/models/pattern-item.js +24 -22
  48. data/client-app/app/router.js +2 -2
  49. data/client-app/app/routes/index.js +19 -12
  50. data/client-app/app/routes/settings.js +12 -10
  51. data/client-app/app/routes/show.js +6 -4
  52. data/client-app/app/services/events.js +4 -0
  53. data/client-app/app/styles/app.css +2 -0
  54. data/client-app/app/templates/application.hbs +1 -2
  55. data/client-app/app/templates/components/actions-menu.hbs +23 -8
  56. data/client-app/app/templates/components/back-trace.hbs +10 -3
  57. data/client-app/app/templates/components/env-tab.hbs +9 -7
  58. data/client-app/app/templates/components/message-info.hbs +65 -34
  59. data/client-app/app/templates/components/message-row.hbs +25 -8
  60. data/client-app/app/templates/components/page-nav.hbs +34 -10
  61. data/client-app/app/templates/components/panel-resizer.hbs +3 -3
  62. data/client-app/app/templates/components/patterns-list.hbs +54 -20
  63. data/client-app/app/templates/components/tabbed-section.hbs +12 -4
  64. data/client-app/app/templates/components/time-formatter.hbs +1 -1
  65. data/client-app/app/templates/index.hbs +100 -78
  66. data/client-app/app/templates/settings.hbs +30 -19
  67. data/client-app/app/templates/show.hbs +9 -8
  68. data/client-app/config/ember-cli-update.json +18 -0
  69. data/client-app/config/environment.js +13 -13
  70. data/client-app/config/icons.js +3 -3
  71. data/client-app/config/targets.js +16 -8
  72. data/client-app/ember-cli-build.js +4 -4
  73. data/client-app/package.json +41 -31
  74. data/client-app/testem.js +16 -17
  75. data/client-app/tests/index.html +8 -1
  76. data/client-app/tests/integration/components/back-trace-test.js +32 -26
  77. data/client-app/tests/integration/components/env-tab-test.js +79 -53
  78. data/client-app/tests/integration/components/message-info-test.js +25 -23
  79. data/client-app/tests/integration/components/patterns-list-test.js +14 -11
  80. data/client-app/tests/test-helper.js +8 -4
  81. data/client-app/tests/unit/controllers/index-test.js +32 -16
  82. data/client-app/tests/unit/controllers/show-test.js +5 -5
  83. data/client-app/tests/unit/routes/index-test.js +5 -5
  84. data/client-app/tests/unit/routes/show-test.js +5 -5
  85. data/client-app/yarn.lock +9673 -0
  86. data/lib/logster/version.rb +1 -1
  87. data/logster.gemspec +6 -3
  88. metadata +15 -6
  89. data/client-app/.eslintrc.js +0 -60
  90. data/client-app/.travis.yml +0 -28
  91. data/client-app/app/components/update-time.js +0 -21
  92. data/client-app/package-lock.json +0 -16639
@@ -1,125 +1,142 @@
1
+ import classic from "ember-classic-decorator";
2
+ import { equal, not } from "@ember/object/computed";
1
3
  import Component from "@ember/component";
2
- import { not, equal } from "@ember/object/computed";
3
- import { computed } from "@ember/object";
4
+ import { action, computed } from "@ember/object";
4
5
  import Pattern from "client-app/models/pattern-item";
5
6
  import { ajax } from "client-app/lib/utilities";
6
7
 
7
- export default Component.extend({
8
- immutable: not("mutable"),
9
- showCounter: equal("key", "suppression"),
8
+ @classic
9
+ export default class PatternsList extends Component {
10
+ @not("mutable") immutable;
11
+ @equal("key", "suppression") showCounter;
10
12
 
11
13
  init() {
12
- this._super(...arguments);
13
- if (this.get("patterns.length") < 1 && this.get("mutable")) {
14
- this.send("create");
14
+ super.init(...arguments);
15
+
16
+ if (this.patterns.length < 1 && this.mutable) {
17
+ this.create();
15
18
  }
16
- },
19
+ }
17
20
 
18
- allPatterns: computed("patterns.[]", "newPatterns.[]", function() {
19
- const patterns = this.get("patterns");
20
- const newPatterns = this.get("newPatterns") || [];
21
+ @computed("patterns.[]", "newPatterns.[]")
22
+ get allPatterns() {
23
+ const patterns = this.patterns;
24
+ const newPatterns = this.newPatterns || [];
21
25
  return [...newPatterns.reverse(), ...patterns.reverse()];
22
- }),
26
+ }
23
27
 
24
28
  makeAPICall(data = {}) {
25
29
  const { method } = data;
26
30
  delete data.method;
27
31
 
28
- return ajax(`/patterns/${this.get("key")}.json`, { method, data });
29
- },
32
+ return ajax(`/patterns/${this.key}.json`, { method, data });
33
+ }
30
34
 
31
35
  finallyBlock(pattern) {
32
36
  pattern.set("saving", false);
33
- },
37
+ }
34
38
 
35
39
  catchBlock(pattern, response) {
36
40
  if (response.responseText) {
37
41
  pattern.set("error", response.responseText);
38
42
  } else {
39
- pattern.set("error", "Unkown error occured. Please see dev console.");
43
+ pattern.set("error", "Unknown error occurred. Please see dev console.");
40
44
  }
41
- },
45
+ }
42
46
 
43
47
  requestInit(pattern) {
44
48
  pattern.setProperties({
45
49
  saving: true,
46
- error: null
50
+ error: null,
47
51
  });
48
- },
52
+ }
49
53
 
50
- actions: {
51
- create() {
52
- if (!this.get("newPatterns")) {
53
- this.set("newPatterns", []);
54
- }
55
- this.get("newPatterns").pushObject(Pattern.create({ isNew: true }));
56
- },
54
+ @action
55
+ create() {
56
+ if (!this.newPatterns) {
57
+ this.set("newPatterns", []);
58
+ }
59
+ this.newPatterns.pushObject(Pattern.create({ isNew: true }));
60
+ }
57
61
 
58
- trash(pattern) {
59
- if (pattern.get("isNew")) {
60
- this.get("newPatterns").removeObject(pattern);
61
- pattern.destroy();
62
- } else {
63
- this.requestInit(pattern);
64
- this.makeAPICall({
65
- method: "DELETE",
66
- pattern: pattern.get("value")
67
- })
68
- .then(() => {
69
- this.get("patterns").removeObject(pattern);
70
- pattern.destroy();
71
- })
72
- .catch(response => this.catchBlock(pattern, response))
73
- .finally(() => this.finallyBlock(pattern));
74
- }
75
- },
62
+ @action
63
+ async trash(pattern) {
64
+ if (pattern.isNew) {
65
+ this.newPatterns.removeObject(pattern);
66
+ pattern.destroy();
67
+ return;
68
+ }
69
+
70
+ this.requestInit(pattern);
76
71
 
77
- save(pattern) {
78
- this.requestInit(pattern);
79
- let promise;
80
- if (pattern.get("isNew")) {
81
- promise = this.makeAPICall({
72
+ try {
73
+ await this.makeAPICall({
74
+ method: "DELETE",
75
+ pattern: pattern.value,
76
+ });
77
+
78
+ this.patterns.removeObject(pattern);
79
+ pattern.destroy();
80
+ } catch (response) {
81
+ this.catchBlock(pattern, response);
82
+ } finally {
83
+ this.finallyBlock(pattern);
84
+ }
85
+ }
86
+
87
+ @action
88
+ async save(pattern) {
89
+ this.requestInit(pattern);
90
+
91
+ try {
92
+ if (pattern.isNew) {
93
+ const response = await this.makeAPICall({
82
94
  method: "POST",
83
95
  pattern: pattern.valueBuffer,
84
- retroactive: !!pattern.retroactive
85
- }).then(response => {
86
- pattern.updateValue(response.pattern);
87
- pattern.set("isNew", false);
88
- this.get("patterns").pushObject(pattern);
89
- this.get("newPatterns").removeObject(pattern);
96
+ retroactive: !!pattern.retroactive,
90
97
  });
98
+
99
+ pattern.updateValue(response.pattern);
100
+ pattern.set("isNew", false);
101
+ this.patterns.pushObject(pattern);
102
+ this.newPatterns.removeObject(pattern);
91
103
  } else {
92
- promise = this.makeAPICall({
104
+ const response = await this.makeAPICall({
93
105
  method: "PUT",
94
- pattern: pattern.get("value"),
95
- new_pattern: pattern.get("valueBuffer")
96
- }).then(response => {
97
- pattern.updateValue(response.pattern);
98
- pattern.set("count", 0);
106
+ pattern: pattern.value,
107
+ new_pattern: pattern.valueBuffer,
99
108
  });
109
+
110
+ pattern.updateValue(response.pattern);
111
+ pattern.set("count", 0);
100
112
  }
101
- promise
102
- .catch(response => {
103
- this.catchBlock(pattern, response);
104
- })
105
- .finally(() => this.finallyBlock(pattern));
106
- },
107
-
108
- resetCount(pattern) {
109
- pattern.set("saving", true);
110
- ajax("/reset-count.json", {
113
+ } catch (response) {
114
+ this.catchBlock(pattern, response);
115
+ } finally {
116
+ this.finallyBlock(pattern);
117
+ }
118
+ }
119
+
120
+ @action
121
+ async resetCount(pattern) {
122
+ pattern.set("saving", true);
123
+
124
+ try {
125
+ await ajax("/reset-count.json", {
111
126
  method: "PUT",
112
- data: { pattern: pattern.get("value"), hard: !!pattern.get("hard") }
113
- })
114
- .then(() => {
115
- pattern.set("count", 0);
116
- })
117
- .catch(response => this.catchBlock(pattern, response))
118
- .finally(() => this.finallyBlock(pattern));
119
- },
120
-
121
- checkboxChanged(pattern) {
122
- pattern.toggleProperty("retroactive");
127
+ data: { pattern: pattern.value, hard: !!pattern.hard },
128
+ });
129
+
130
+ pattern.set("count", 0);
131
+ } catch (response) {
132
+ this.catchBlock(pattern, response);
133
+ } finally {
134
+ this.finallyBlock(pattern);
123
135
  }
124
136
  }
125
- });
137
+
138
+ @action
139
+ checkboxChanged(pattern) {
140
+ pattern.toggleProperty("retroactive");
141
+ }
142
+ }
@@ -1,27 +1,23 @@
1
+ import classic from "ember-classic-decorator";
2
+ import { classNameBindings } from "@ember-decorators/component";
1
3
  import Component from "@ember/component";
2
4
 
3
- export default Component.extend({
4
- classNameBindings: ["active", ":content", "name"],
5
- isLink: false,
6
-
7
- invokeParent(name) {
8
- let current = this.get("parentView");
9
- while (current && !current[name]) {
10
- current = current.get("parentView");
11
- }
12
- if (current) {
13
- current[name](this);
14
- }
15
- },
5
+ @classic
6
+ @classNameBindings("active", ":content", "name")
7
+ export default class TabContents extends Component {
8
+ isLink = false;
16
9
 
17
10
  didInsertElement() {
18
- this.invokeParent("addTab");
19
- if (this.get("defaultTab")) {
20
- this.invokeParent("selectTab");
11
+ super.didInsertElement(...arguments);
12
+ this.tabActions.addTab(this);
13
+
14
+ if (this.defaultTab) {
15
+ this.tabActions.selectTab(this);
21
16
  }
22
- },
17
+ }
23
18
 
24
19
  willDestroyElement() {
25
- this.invokeParent("removeTab");
20
+ super.willDestroyElement(...arguments);
21
+ this.tabActions.removeTab(this);
26
22
  }
27
- });
23
+ }
@@ -1,33 +1,45 @@
1
+ import classic from "ember-classic-decorator";
1
2
  import Component from "@ember/component";
3
+ import { A } from "@ember/array";
4
+ import { action } from "@ember/object";
2
5
 
3
- export default Component.extend({
4
- tabs: Em.A(),
5
- selectTab(view) {
6
- if (view.get("isLink")) {
7
- this.triggerAction(view.get("action"));
6
+ @classic
7
+ export default class TabbedSection extends Component {
8
+ tabs = A();
9
+ selected = null;
10
+
11
+ @action
12
+ selectTab(tab) {
13
+ if (tab.isLink) {
14
+ this.triggerAction(tab.action);
8
15
  return;
9
16
  }
10
17
 
11
- const selected = this.get("selected");
12
- if (selected) {
13
- selected.set("active", false);
18
+ if (this.selected) {
19
+ this.selected.set("active", false);
14
20
  }
15
- this.set("selected", view);
16
- view.set("active", true);
17
- this.onTabChange(view.name);
18
- },
19
21
 
22
+ this.set("selected", tab);
23
+ tab.set("active", true);
24
+
25
+ this.onTabChange(tab.name);
26
+ }
27
+
28
+ @action
20
29
  addTab(tab) {
21
- this.get("tabs").addObject(tab);
22
- if (!this.get("selected") && !tab.get("isLink")) {
30
+ this.tabs.addObject(tab);
31
+
32
+ if (!this.selected && !tab.isLink) {
23
33
  this.selectTab(tab);
24
34
  }
25
- },
35
+ }
26
36
 
37
+ @action
27
38
  removeTab(tab) {
28
- if (this.get("selected") === tab) {
39
+ if (this.selected === tab) {
29
40
  this.set("selected", null);
30
41
  }
31
- this.get("tabs").removeObject(tab);
42
+
43
+ this.tabs.removeObject(tab);
32
44
  }
33
- });
45
+ }
@@ -1,25 +1,36 @@
1
+ import classic from "ember-classic-decorator";
2
+ import { tagName } from "@ember-decorators/component";
3
+ import { computed } from "@ember/object";
1
4
  import Component from "@ember/component";
2
5
  import { formatTime } from "client-app/lib/utilities";
3
- import { computed } from "@ember/object";
6
+ import { later } from "@ember/runloop";
7
+
8
+ const UPDATE_INTERVAL = 60_000;
4
9
 
5
- export default Component.extend({
6
- tagName: "span",
7
- classNames: "auto-update-time",
8
- attributeBindings: ["dataTimestamp:data-timestamp", "title"],
10
+ @classic
11
+ @tagName("")
12
+ export default class TimeFormatter extends Component {
13
+ didInsertElement() {
14
+ super.didInsertElement(...arguments);
15
+ later(this, this.updateTime, UPDATE_INTERVAL);
16
+ }
9
17
 
10
- title: computed(function() {
11
- return this.get("moment").format();
12
- }),
18
+ @computed("timestamp")
19
+ get title() {
20
+ return moment(this.timestamp).format();
21
+ }
13
22
 
14
- dataTimestamp: computed(function() {
15
- return this.get("timestamp");
16
- }),
23
+ @computed("timestamp")
24
+ get time() {
25
+ return formatTime(this.timestamp);
26
+ }
17
27
 
18
- moment: computed(function() {
19
- return moment(this.get("timestamp"));
20
- }),
28
+ updateTime() {
29
+ if (this.isDestroying || this.isDestroyed) {
30
+ return;
31
+ }
21
32
 
22
- time: computed("timestamp", function() {
23
- return formatTime(this.get("timestamp"));
24
- })
25
- });
33
+ this.notifyPropertyChange("timestamp");
34
+ later(this, this.updateTime, UPDATE_INTERVAL);
35
+ }
36
+ }
@@ -1,141 +1,165 @@
1
+ import classic from "ember-classic-decorator";
1
2
  import { debounce } from "@ember/runloop";
2
- import { computed } from "@ember/object";
3
+ import { action, computed } from "@ember/object";
3
4
  import Controller from "@ember/controller";
4
- import { ajax, getLocalStorage, setLocalStorage } from "client-app/lib/utilities";
5
+ import {
6
+ ajax,
7
+ getLocalStorage,
8
+ setLocalStorage,
9
+ } from "client-app/lib/utilities";
5
10
  import Preload from "client-app/lib/preload";
6
11
 
7
- export default Controller.extend({
8
- showDebug: getLocalStorage("showDebug", false),
9
- showInfo: getLocalStorage("showInfo", false),
10
- showWarn: getLocalStorage("showWarn", true),
11
- showErr: getLocalStorage("showErr", true),
12
- showFatal: getLocalStorage("showFatal", true),
13
- search: null,
14
- queryParams: ["search"],
15
-
16
- showSettings: computed(function() {
12
+ @classic
13
+ export default class IndexController extends Controller {
14
+ showDebug = getLocalStorage("showDebug", false);
15
+ showInfo = getLocalStorage("showInfo", false);
16
+ showWarn = getLocalStorage("showWarn", true);
17
+ showErr = getLocalStorage("showErr", true);
18
+ showFatal = getLocalStorage("showFatal", true);
19
+ search = null;
20
+ queryParams = ["search"];
21
+
22
+ @computed
23
+ get showSettings() {
17
24
  return Preload.get("patterns_enabled");
18
- }),
25
+ }
26
+
27
+ get actionsInMenu() {
28
+ return (
29
+ /mobile/i.test(navigator.userAgent) && !/iPad/.test(navigator.userAgent)
30
+ );
31
+ }
32
+
33
+ @computed("search")
34
+ get searchTerm() {
35
+ if (this.search) {
36
+ this.doSearch(this.search);
37
+ return this.search;
38
+ }
39
+ return null;
40
+ }
41
+
42
+ async doSearch(term) {
43
+ this.model.set("search", term);
44
+ await this.model.reload();
45
+ this.model.updateSelectedRow();
46
+ }
19
47
 
20
48
  resizePanels(amount) {
21
49
  const bottomPanel = document.getElementById("bottom-panel");
22
50
  const topPanel = document.getElementById("top-panel");
23
51
  bottomPanel.style.height = `${amount - 13}px`;
24
52
  topPanel.style.bottom = `${amount + 12}px`;
25
- },
26
-
27
- actionsInMenu: computed(function() {
28
- return this.site.isMobile;
29
- }),
30
-
31
- actions: {
32
- expandMessage(message) {
33
- message.expand();
34
- },
35
-
36
- selectRowAction(row, opts = {}) {
37
- this.model.selectRow(row, opts);
38
- },
39
-
40
- tabChangedAction(newTab) {
41
- this.model.tabChanged(newTab);
42
- },
43
-
44
- showMoreBefore() {
45
- this.model.showMoreBefore();
46
- },
47
-
48
- loadMore() {
49
- return this.model.loadMore();
50
- },
51
-
52
- clear() {
53
- if (confirm("Clear the logs?\n\nCancel = No, OK = Clear")) {
54
- ajax("/clear", { type: "POST" }).then(() => {
55
- this.model.reload();
56
- });
57
- }
58
- },
59
-
60
- removeMessage(msg) {
61
- const group = this.model.currentRow.group ? this.model.currentRow : null;
62
- const rows = this.model.rows;
63
- const idx = group ? rows.indexOf(group) : rows.indexOf(msg);
64
-
65
- msg.destroy();
66
- msg.set("selected", false);
67
- this.model.set("total", this.model.total - 1);
68
- let removedRow = false;
69
- let messageIndex = 0;
70
-
71
- if (group) {
72
- messageIndex = group.messages.indexOf(msg);
73
- group.messages.removeObject(msg);
74
- messageIndex = Math.min(messageIndex, group.messages.length - 1);
75
- if (group.messages.length === 0) {
76
- rows.removeObject(group);
77
- removedRow = true;
78
- }
79
- } else {
80
- rows.removeObject(msg);
53
+ }
54
+
55
+ @action
56
+ expandMessage(message) {
57
+ message.expand();
58
+ }
59
+
60
+ @action
61
+ selectRowAction(row, opts = {}) {
62
+ this.model.selectRow(row, opts);
63
+ }
64
+
65
+ @action
66
+ tabChangedAction(newTab) {
67
+ this.model.tabChanged(newTab);
68
+ }
69
+
70
+ @action
71
+ showMoreBefore() {
72
+ this.model.showMoreBefore();
73
+ }
74
+
75
+ @action
76
+ loadMore() {
77
+ return this.model.loadMore();
78
+ }
79
+
80
+ @action
81
+ async clear() {
82
+ // eslint-disable-next-line no-alert
83
+ if (confirm("Clear the logs?\n\nCancel = No, OK = Clear")) {
84
+ await ajax("/clear", { type: "POST" });
85
+ this.model.reload();
86
+ }
87
+ }
88
+
89
+ @action
90
+ removeMessage(msg) {
91
+ const group = this.model.currentRow.group ? this.model.currentRow : null;
92
+ const rows = this.model.rows;
93
+ const idx = group ? rows.indexOf(group) : rows.indexOf(msg);
94
+
95
+ msg.destroy();
96
+ msg.set("selected", false);
97
+ this.model.set("total", this.model.total - 1);
98
+ let removedRow = false;
99
+ let messageIndex = 0;
100
+
101
+ if (group) {
102
+ messageIndex = group.messages.indexOf(msg);
103
+ group.messages.removeObject(msg);
104
+ messageIndex = Math.min(messageIndex, group.messages.length - 1);
105
+ if (group.messages.length === 0) {
106
+ rows.removeObject(group);
81
107
  removedRow = true;
82
108
  }
109
+ } else {
110
+ rows.removeObject(msg);
111
+ removedRow = true;
112
+ }
83
113
 
84
- if (removedRow) {
85
- if (idx > 0) {
86
- this.model.selectRow(rows[idx - 1]);
87
- } else if (this.model.total > 0) {
88
- this.model.selectRow(rows[0]);
89
- } else {
90
- this.model.reload();
91
- }
92
- } else if (group) {
93
- this.model.selectRow(rows[idx], { messageIndex });
94
- }
95
- },
96
-
97
- solveMessage(msg) {
98
- this.model.solve(msg);
99
- },
100
-
101
- groupedMessageChangedAction(newPosition) {
102
- this.model.groupedMessageChanged(newPosition);
103
- },
104
-
105
- envChangedAction(newPosition) {
106
- this.model.envChanged(newPosition);
107
- },
108
-
109
- updateFilter(name) {
110
- this.toggleProperty(name);
111
- this.model.set(name, this[name]);
112
- setLocalStorage(name, this[name]);
113
- this.model.reload().then(() => this.model.updateSelectedRow());
114
- },
115
-
116
- updateSearch(term) {
117
- if (term === this.search) {
118
- return;
114
+ if (removedRow) {
115
+ if (idx > 0) {
116
+ this.model.selectRow(rows[idx - 1]);
117
+ } else if (this.model.total > 0) {
118
+ this.model.selectRow(rows[0]);
119
+ } else {
120
+ this.model.reload();
119
121
  }
122
+ } else if (group) {
123
+ this.model.selectRow(rows[idx], { messageIndex });
124
+ }
125
+ }
120
126
 
121
- if (term && term.length === 1) {
122
- return;
123
- }
127
+ @action
128
+ solveMessage(msg) {
129
+ this.model.solve(msg);
130
+ }
131
+
132
+ @action
133
+ groupedMessageChangedAction(newPosition) {
134
+ this.model.groupedMessageChanged(newPosition);
135
+ }
136
+
137
+ @action
138
+ envChangedAction(newPosition) {
139
+ this.model.envChanged(newPosition);
140
+ }
141
+
142
+ @action
143
+ async updateFilter(name) {
144
+ this.toggleProperty(name);
145
+ this.model.set(name, this[name]);
146
+ setLocalStorage(name, this[name]);
147
+ await this.model.reload();
148
+ this.model.updateSelectedRow();
149
+ }
150
+
151
+ @action
152
+ updateSearch(event) {
153
+ const term = event.target.value;
124
154
 
125
- debounce(this, this.doSearch, term, 250);
155
+ if (term === this.search) {
156
+ return;
126
157
  }
127
- },
128
158
 
129
- searchTerm: computed("search", function () {
130
- if (this.search) {
131
- this.doSearch(this.search)
132
- return this.search;
159
+ if (term && term.length === 1) {
160
+ return;
133
161
  }
134
- return null;
135
- }),
136
162
 
137
- doSearch(term) {
138
- this.model.set("search", term);
139
- this.model.reload().then(() => this.model.updateSelectedRow());
163
+ debounce(this, this.doSearch, term, 250);
140
164
  }
141
- });
165
+ }