logster 2.11.3 → 2.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +72 -11
- data/.gitignore +2 -0
- data/CHANGELOG.md +13 -3
- data/README.md +8 -0
- data/assets/javascript/.gitkeep +0 -0
- data/assets/javascript/chunk.143.2faa04830259ce9aa59a.js +22 -0
- data/assets/javascript/chunk.178.ca5ade1d8cbdbfbe6d72.js +22 -0
- data/assets/javascript/chunk.468.95dd450003497c781cb3.js +1213 -0
- data/assets/javascript/chunk.916.85a3fc9d873df80f5ea5.js +579 -0
- data/assets/javascript/client-app.js +1261 -276
- data/assets/javascript/vendor.js +4199 -3514
- data/assets/stylesheets/.gitkeep +0 -0
- data/assets/stylesheets/client-app.css +1 -1
- data/assets/stylesheets/vendor.css +1 -1
- data/build_client_app.sh +6 -8
- data/client-app/.editorconfig +0 -1
- data/client-app/.eslintignore +2 -0
- data/client-app/.eslintrc +10 -0
- data/client-app/.gitignore +1 -1
- data/client-app/.prettierignore +21 -0
- data/client-app/.prettierrc +1 -0
- data/client-app/.template-lintrc.js +10 -0
- data/client-app/README.md +4 -5
- data/client-app/app/app.js +2 -2
- data/client-app/app/components/actions-menu.js +21 -21
- data/client-app/app/components/back-trace.js +89 -90
- data/client-app/app/components/env-tab.js +41 -29
- data/client-app/app/components/message-info.js +78 -75
- data/client-app/app/components/message-row.js +20 -17
- data/client-app/app/components/page-nav.js +33 -24
- data/client-app/app/components/panel-resizer.js +53 -37
- data/client-app/app/components/patterns-list.js +101 -84
- data/client-app/app/components/tab-contents.js +15 -19
- data/client-app/app/components/tabbed-section.js +30 -18
- data/client-app/app/components/time-formatter.js +29 -18
- data/client-app/app/controllers/index.js +143 -119
- data/client-app/app/controllers/show.js +17 -13
- data/client-app/app/helpers/or.js +1 -1
- data/client-app/app/initializers/app-init.js +23 -34
- data/client-app/app/lib/decorators.js +4 -2
- data/client-app/app/lib/preload.js +7 -4
- data/client-app/app/lib/utilities.js +55 -54
- data/client-app/app/models/group.js +20 -15
- data/client-app/app/models/message-collection.js +153 -148
- data/client-app/app/models/message.js +60 -58
- data/client-app/app/models/pattern-item.js +24 -22
- data/client-app/app/router.js +2 -2
- data/client-app/app/routes/index.js +19 -12
- data/client-app/app/routes/settings.js +12 -10
- data/client-app/app/routes/show.js +6 -4
- data/client-app/app/services/events.js +4 -0
- data/client-app/app/styles/app.css +2 -0
- data/client-app/app/templates/application.hbs +1 -2
- data/client-app/app/templates/components/actions-menu.hbs +23 -8
- data/client-app/app/templates/components/back-trace.hbs +10 -3
- data/client-app/app/templates/components/env-tab.hbs +9 -7
- data/client-app/app/templates/components/message-info.hbs +65 -34
- data/client-app/app/templates/components/message-row.hbs +25 -8
- data/client-app/app/templates/components/page-nav.hbs +34 -10
- data/client-app/app/templates/components/panel-resizer.hbs +3 -3
- data/client-app/app/templates/components/patterns-list.hbs +54 -20
- data/client-app/app/templates/components/tabbed-section.hbs +12 -4
- data/client-app/app/templates/components/time-formatter.hbs +1 -1
- data/client-app/app/templates/index.hbs +100 -78
- data/client-app/app/templates/settings.hbs +30 -19
- data/client-app/app/templates/show.hbs +9 -8
- data/client-app/config/ember-cli-update.json +18 -0
- data/client-app/config/environment.js +13 -13
- data/client-app/config/icons.js +3 -3
- data/client-app/config/targets.js +16 -8
- data/client-app/ember-cli-build.js +4 -4
- data/client-app/package.json +43 -30
- data/client-app/testem.js +16 -17
- data/client-app/tests/index.html +8 -1
- data/client-app/tests/integration/components/back-trace-test.js +32 -26
- data/client-app/tests/integration/components/env-tab-test.js +79 -53
- data/client-app/tests/integration/components/message-info-test.js +25 -23
- data/client-app/tests/integration/components/patterns-list-test.js +14 -11
- data/client-app/tests/test-helper.js +8 -4
- data/client-app/tests/unit/controllers/index-test.js +32 -16
- data/client-app/tests/unit/controllers/show-test.js +5 -5
- data/client-app/tests/unit/routes/index-test.js +5 -5
- data/client-app/tests/unit/routes/show-test.js +5 -5
- data/client-app/yarn.lock +9673 -0
- data/lib/logster/middleware/viewer.rb +12 -12
- data/lib/logster/version.rb +1 -1
- data/logster.gemspec +6 -3
- data/test/logster/middleware/test_viewer.rb +14 -8
- metadata +15 -6
- data/client-app/.eslintrc.js +0 -60
- data/client-app/.travis.yml +0 -28
- data/client-app/app/components/update-time.js +0 -21
- data/client-app/package-lock.json +0 -39196
@@ -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 {
|
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
|
-
|
8
|
-
|
9
|
-
|
8
|
+
@classic
|
9
|
+
export default class PatternsList extends Component {
|
10
|
+
@not("mutable") immutable;
|
11
|
+
@equal("key", "suppression") showCounter;
|
10
12
|
|
11
13
|
init() {
|
12
|
-
|
13
|
-
|
14
|
-
|
14
|
+
super.init(...arguments);
|
15
|
+
|
16
|
+
if (this.patterns.length < 1 && this.mutable) {
|
17
|
+
this.create();
|
15
18
|
}
|
16
|
-
}
|
19
|
+
}
|
17
20
|
|
18
|
-
|
19
|
-
|
20
|
-
const
|
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.
|
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", "
|
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
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
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
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
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
|
-
|
78
|
-
this.
|
79
|
-
|
80
|
-
|
81
|
-
|
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
|
-
|
104
|
+
const response = await this.makeAPICall({
|
93
105
|
method: "PUT",
|
94
|
-
pattern: pattern.
|
95
|
-
new_pattern: pattern.
|
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
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
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.
|
113
|
-
})
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
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
|
-
|
4
|
-
|
5
|
-
|
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
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
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
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
-
|
12
|
-
|
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.
|
22
|
-
|
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.
|
39
|
+
if (this.selected === tab) {
|
29
40
|
this.set("selected", null);
|
30
41
|
}
|
31
|
-
|
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 {
|
6
|
+
import { later } from "@ember/runloop";
|
7
|
+
|
8
|
+
const UPDATE_INTERVAL = 60_000;
|
4
9
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
-
|
11
|
-
|
12
|
-
|
18
|
+
@computed("timestamp")
|
19
|
+
get title() {
|
20
|
+
return moment(this.timestamp).format();
|
21
|
+
}
|
13
22
|
|
14
|
-
|
15
|
-
|
16
|
-
|
23
|
+
@computed("timestamp")
|
24
|
+
get time() {
|
25
|
+
return formatTime(this.timestamp);
|
26
|
+
}
|
17
27
|
|
18
|
-
|
19
|
-
|
20
|
-
|
28
|
+
updateTime() {
|
29
|
+
if (this.isDestroying || this.isDestroyed) {
|
30
|
+
return;
|
31
|
+
}
|
21
32
|
|
22
|
-
|
23
|
-
|
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 {
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
showMoreBefore()
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
}
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
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
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
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
|
-
|
122
|
-
|
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
|
-
|
155
|
+
if (term === this.search) {
|
156
|
+
return;
|
126
157
|
}
|
127
|
-
},
|
128
158
|
|
129
|
-
|
130
|
-
|
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
|
-
|
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
|
+
}
|