logster 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +19 -19
- data/.rubocop.yml +1 -1
- data/.travis.yml +16 -16
- data/CHANGELOG.md +169 -166
- data/Gemfile +4 -4
- data/Guardfile +8 -8
- data/LICENSE.txt +22 -22
- data/README.md +99 -99
- data/Rakefile +21 -21
- data/assets/fonts/FontAwesome.otf +0 -0
- data/assets/fonts/fontawesome-webfont.eot +0 -0
- data/assets/fonts/fontawesome-webfont.svg +639 -639
- data/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/assets/fonts/fontawesome-webfont.woff +0 -0
- data/assets/fonts/fontawesome-webfont.woff2 +0 -0
- data/assets/images/Icon-144_rounded.png +0 -0
- data/assets/images/Icon-144_square.png +0 -0
- data/assets/images/icon_144x144.png +0 -0
- data/assets/images/icon_64x64.png +0 -0
- data/assets/javascript/client-app.js +100 -100
- data/assets/stylesheets/client-app.css +0 -0
- data/build_client_app.sh +0 -0
- data/client-app/.editorconfig +20 -20
- data/client-app/.ember-cli +9 -9
- data/client-app/.eslintignore +19 -19
- data/client-app/.eslintrc.js +46 -46
- data/client-app/.gitignore +23 -23
- data/client-app/.travis.yml +27 -27
- data/client-app/.watchmanconfig +3 -3
- data/client-app/README.md +57 -57
- data/client-app/app/app.js +14 -14
- data/client-app/app/components/actions-menu.js +37 -37
- data/client-app/app/components/env-tab.js +44 -44
- data/client-app/app/components/message-info.js +65 -65
- data/client-app/app/components/message-row.js +45 -45
- data/client-app/app/components/panel-resizer.js +74 -74
- data/client-app/app/components/tab-contents.js +27 -27
- data/client-app/app/components/tab-link.js +5 -5
- data/client-app/app/components/tabbed-section.js +32 -32
- data/client-app/app/components/time-formatter.js +25 -25
- data/client-app/app/components/update-time.js +21 -21
- data/client-app/app/controllers/index.js +105 -105
- data/client-app/app/controllers/show.js +13 -13
- data/client-app/app/index.html +29 -29
- data/client-app/app/initializers/app-init.js +72 -72
- data/client-app/app/lib/preload.js +14 -14
- data/client-app/app/lib/utilities.js +140 -140
- data/client-app/app/models/message-collection.js +178 -178
- data/client-app/app/models/message.js +100 -100
- data/client-app/app/resolver.js +3 -3
- data/client-app/app/router.js +14 -14
- data/client-app/app/routes/index.js +57 -57
- data/client-app/app/routes/show.js +14 -14
- data/client-app/app/styles/app.css +521 -521
- data/client-app/app/templates/application.hbs +2 -2
- data/client-app/app/templates/components/actions-menu.hbs +12 -12
- data/client-app/app/templates/components/env-tab.hbs +10 -10
- data/client-app/app/templates/components/message-info.hbs +41 -41
- data/client-app/app/templates/components/message-row.hbs +15 -15
- data/client-app/app/templates/components/panel-resizer.hbs +3 -3
- data/client-app/app/templates/components/tabbed-section.hbs +10 -10
- data/client-app/app/templates/components/time-formatter.hbs +1 -1
- data/client-app/app/templates/index.hbs +58 -58
- data/client-app/app/templates/show.hbs +7 -7
- data/client-app/config/environment.js +51 -51
- data/client-app/config/optional-features.json +3 -3
- data/client-app/config/targets.js +18 -18
- data/client-app/ember-cli-build.js +29 -29
- data/client-app/package-lock.json +11365 -11365
- data/client-app/package.json +56 -56
- data/client-app/testem.js +25 -25
- data/client-app/tests/index.html +34 -34
- data/client-app/tests/integration/components/actions-menu-test.js +26 -26
- data/client-app/tests/integration/components/env-tab-test.js +73 -73
- data/client-app/tests/integration/components/message-info-test.js +26 -26
- data/client-app/tests/integration/components/message-row-test.js +26 -26
- data/client-app/tests/integration/components/panel-resizer-test.js +26 -26
- data/client-app/tests/integration/components/tab-contents-test.js +26 -26
- data/client-app/tests/integration/components/tab-link-test.js +26 -26
- data/client-app/tests/integration/components/tabbed-section-test.js +26 -26
- data/client-app/tests/integration/components/time-formatter-test.js +26 -26
- data/client-app/tests/integration/components/update-time-test.js +26 -26
- data/client-app/tests/test-helper.js +8 -8
- data/client-app/tests/unit/controllers/index-test.js +12 -12
- data/client-app/tests/unit/controllers/show-test.js +12 -12
- data/client-app/tests/unit/initializers/app-init-test.js +31 -31
- data/client-app/tests/unit/routes/index-test.js +11 -11
- data/client-app/tests/unit/routes/show-test.js +11 -11
- data/lib/examples/sidekiq_logster_reporter.rb +21 -21
- data/lib/logster.rb +54 -54
- data/lib/logster/base_store.rb +141 -141
- data/lib/logster/configuration.rb +25 -25
- data/lib/logster/defer_logger.rb +14 -14
- data/lib/logster/ignore_pattern.rb +65 -65
- data/lib/logster/logger.rb +113 -113
- data/lib/logster/message.rb +212 -212
- data/lib/logster/middleware/debug_exceptions.rb +26 -26
- data/lib/logster/middleware/reporter.rb +55 -55
- data/lib/logster/middleware/viewer.rb +221 -221
- data/lib/logster/rails/railtie.rb +63 -63
- data/lib/logster/redis_store.rb +566 -566
- data/lib/logster/scheduler.rb +54 -40
- data/lib/logster/version.rb +3 -3
- data/lib/logster/web.rb +14 -14
- data/logster.gemspec +35 -35
- data/test/examples/test_sidekiq_reporter_example.rb +46 -46
- data/test/fake_data/Gemfile +4 -4
- data/test/fake_data/generate.rb +10 -10
- data/test/logster/middleware/test_reporter.rb +19 -19
- data/test/logster/middleware/test_viewer.rb +96 -96
- data/test/logster/test_base_store.rb +147 -147
- data/test/logster/test_defer_logger.rb +34 -34
- data/test/logster/test_ignore_pattern.rb +41 -41
- data/test/logster/test_logger.rb +86 -86
- data/test/logster/test_message.rb +119 -119
- data/test/logster/test_redis_rate_limiter.rb +230 -230
- data/test/logster/test_redis_store.rb +720 -720
- data/test/test_helper.rb +38 -38
- data/vendor/assets/javascripts/logster.js.erb +39 -39
- metadata +2 -2
@@ -1,105 +1,105 @@
|
|
1
|
-
import Controller from "@ember/controller";
|
2
|
-
import { ajax } from "client-app/lib/utilities";
|
3
|
-
import { observer, computed } from "@ember/object";
|
4
|
-
|
5
|
-
export default Controller.extend({
|
6
|
-
currentMessage: Em.computed.alias("model.currentMessage"),
|
7
|
-
|
8
|
-
resizePanels(amount) {
|
9
|
-
Em.$("#bottom-panel").css("height", amount - 13);
|
10
|
-
Em.$("#top-panel").css("bottom", amount + 12);
|
11
|
-
},
|
12
|
-
|
13
|
-
actionsInMenu: computed(function() {
|
14
|
-
return this.site.isMobile;
|
15
|
-
}),
|
16
|
-
|
17
|
-
actions: {
|
18
|
-
expandMessage(message) {
|
19
|
-
message.expand();
|
20
|
-
},
|
21
|
-
|
22
|
-
selectMessage(message) {
|
23
|
-
const old = this.get("currentMessage");
|
24
|
-
if (old) {
|
25
|
-
old.set("selected", false);
|
26
|
-
}
|
27
|
-
|
28
|
-
message.set("selected", true);
|
29
|
-
this.set("currentMessage", message);
|
30
|
-
},
|
31
|
-
|
32
|
-
showMoreBefore() {
|
33
|
-
this.get("model").showMoreBefore();
|
34
|
-
},
|
35
|
-
|
36
|
-
loadMore() {
|
37
|
-
return this.get("model").loadMore();
|
38
|
-
},
|
39
|
-
|
40
|
-
clear() {
|
41
|
-
if (confirm("Clear the logs?\n\nCancel = No, OK = Clear")) {
|
42
|
-
ajax("/clear", { type: "POST" }).then(() => {
|
43
|
-
this.get("model").reload();
|
44
|
-
});
|
45
|
-
}
|
46
|
-
},
|
47
|
-
|
48
|
-
removeMessage(msg) {
|
49
|
-
const messages = this.get("model");
|
50
|
-
messages.destroy(msg);
|
51
|
-
},
|
52
|
-
|
53
|
-
solveMessage(msg) {
|
54
|
-
const messages = this.get("model");
|
55
|
-
messages.solve(msg);
|
56
|
-
}
|
57
|
-
},
|
58
|
-
|
59
|
-
updateSelectedMessage() {
|
60
|
-
const currentKey = this.get("currentMessage.key");
|
61
|
-
const messages = this.get("model.messages");
|
62
|
-
if (currentKey && messages) {
|
63
|
-
const match = messages.find(m => m.key === currentKey);
|
64
|
-
if (match) {
|
65
|
-
match.set("selected", true);
|
66
|
-
} else {
|
67
|
-
this.set("currentMessage", null);
|
68
|
-
}
|
69
|
-
}
|
70
|
-
},
|
71
|
-
|
72
|
-
filterChanged: observer(
|
73
|
-
"showDebug",
|
74
|
-
"showInfo",
|
75
|
-
"showWarn",
|
76
|
-
"showErr",
|
77
|
-
"showFatal",
|
78
|
-
function() {
|
79
|
-
const filter = [];
|
80
|
-
["Debug", "Info", "Warn", "Err", "Fatal"].forEach((severity, index) => {
|
81
|
-
if (this.get(`show${severity}`)) {
|
82
|
-
filter.push(index);
|
83
|
-
}
|
84
|
-
});
|
85
|
-
|
86
|
-
// always show unknown, rare
|
87
|
-
filter.push(5);
|
88
|
-
const model = this.get("model");
|
89
|
-
model.set("filter", filter);
|
90
|
-
if (this.get("initialized")) {
|
91
|
-
model.reload().then(() => this.updateSelectedMessage());
|
92
|
-
}
|
93
|
-
}
|
94
|
-
),
|
95
|
-
|
96
|
-
searchChanged: observer("search", function() {
|
97
|
-
const search = this.get("search");
|
98
|
-
const model = this.get("model");
|
99
|
-
model.set("search", search);
|
100
|
-
|
101
|
-
if (this.get("initialized")) {
|
102
|
-
model.reload().then(() => this.updateSelectedMessage());
|
103
|
-
}
|
104
|
-
})
|
105
|
-
});
|
1
|
+
import Controller from "@ember/controller";
|
2
|
+
import { ajax } from "client-app/lib/utilities";
|
3
|
+
import { observer, computed } from "@ember/object";
|
4
|
+
|
5
|
+
export default Controller.extend({
|
6
|
+
currentMessage: Em.computed.alias("model.currentMessage"),
|
7
|
+
|
8
|
+
resizePanels(amount) {
|
9
|
+
Em.$("#bottom-panel").css("height", amount - 13);
|
10
|
+
Em.$("#top-panel").css("bottom", amount + 12);
|
11
|
+
},
|
12
|
+
|
13
|
+
actionsInMenu: computed(function() {
|
14
|
+
return this.site.isMobile;
|
15
|
+
}),
|
16
|
+
|
17
|
+
actions: {
|
18
|
+
expandMessage(message) {
|
19
|
+
message.expand();
|
20
|
+
},
|
21
|
+
|
22
|
+
selectMessage(message) {
|
23
|
+
const old = this.get("currentMessage");
|
24
|
+
if (old) {
|
25
|
+
old.set("selected", false);
|
26
|
+
}
|
27
|
+
|
28
|
+
message.set("selected", true);
|
29
|
+
this.set("currentMessage", message);
|
30
|
+
},
|
31
|
+
|
32
|
+
showMoreBefore() {
|
33
|
+
this.get("model").showMoreBefore();
|
34
|
+
},
|
35
|
+
|
36
|
+
loadMore() {
|
37
|
+
return this.get("model").loadMore();
|
38
|
+
},
|
39
|
+
|
40
|
+
clear() {
|
41
|
+
if (confirm("Clear the logs?\n\nCancel = No, OK = Clear")) {
|
42
|
+
ajax("/clear", { type: "POST" }).then(() => {
|
43
|
+
this.get("model").reload();
|
44
|
+
});
|
45
|
+
}
|
46
|
+
},
|
47
|
+
|
48
|
+
removeMessage(msg) {
|
49
|
+
const messages = this.get("model");
|
50
|
+
messages.destroy(msg);
|
51
|
+
},
|
52
|
+
|
53
|
+
solveMessage(msg) {
|
54
|
+
const messages = this.get("model");
|
55
|
+
messages.solve(msg);
|
56
|
+
}
|
57
|
+
},
|
58
|
+
|
59
|
+
updateSelectedMessage() {
|
60
|
+
const currentKey = this.get("currentMessage.key");
|
61
|
+
const messages = this.get("model.messages");
|
62
|
+
if (currentKey && messages) {
|
63
|
+
const match = messages.find(m => m.key === currentKey);
|
64
|
+
if (match) {
|
65
|
+
match.set("selected", true);
|
66
|
+
} else {
|
67
|
+
this.set("currentMessage", null);
|
68
|
+
}
|
69
|
+
}
|
70
|
+
},
|
71
|
+
|
72
|
+
filterChanged: observer(
|
73
|
+
"showDebug",
|
74
|
+
"showInfo",
|
75
|
+
"showWarn",
|
76
|
+
"showErr",
|
77
|
+
"showFatal",
|
78
|
+
function() {
|
79
|
+
const filter = [];
|
80
|
+
["Debug", "Info", "Warn", "Err", "Fatal"].forEach((severity, index) => {
|
81
|
+
if (this.get(`show${severity}`)) {
|
82
|
+
filter.push(index);
|
83
|
+
}
|
84
|
+
});
|
85
|
+
|
86
|
+
// always show unknown, rare
|
87
|
+
filter.push(5);
|
88
|
+
const model = this.get("model");
|
89
|
+
model.set("filter", filter);
|
90
|
+
if (this.get("initialized")) {
|
91
|
+
model.reload().then(() => this.updateSelectedMessage());
|
92
|
+
}
|
93
|
+
}
|
94
|
+
),
|
95
|
+
|
96
|
+
searchChanged: observer("search", function() {
|
97
|
+
const search = this.get("search");
|
98
|
+
const model = this.get("model");
|
99
|
+
model.set("search", search);
|
100
|
+
|
101
|
+
if (this.get("initialized")) {
|
102
|
+
model.reload().then(() => this.updateSelectedMessage());
|
103
|
+
}
|
104
|
+
})
|
105
|
+
});
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import Controller from "@ember/controller";
|
2
|
-
|
3
|
-
export default Controller.extend({
|
4
|
-
actions: {
|
5
|
-
protect() {
|
6
|
-
this.get("model").protect();
|
7
|
-
},
|
8
|
-
|
9
|
-
unprotect() {
|
10
|
-
this.get("model").unprotect();
|
11
|
-
}
|
12
|
-
}
|
13
|
-
});
|
1
|
+
import Controller from "@ember/controller";
|
2
|
+
|
3
|
+
export default Controller.extend({
|
4
|
+
actions: {
|
5
|
+
protect() {
|
6
|
+
this.get("model").protect();
|
7
|
+
},
|
8
|
+
|
9
|
+
unprotect() {
|
10
|
+
this.get("model").unprotect();
|
11
|
+
}
|
12
|
+
}
|
13
|
+
});
|
data/client-app/app/index.html
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
|
-
<title>ClientApp</title>
|
7
|
-
<meta name="description" content="">
|
8
|
-
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes">
|
9
|
-
<meta id="preloaded-data" data-root-path="/logs" data-preloaded="{}">
|
10
|
-
|
11
|
-
{{content-for "head"}}
|
12
|
-
|
13
|
-
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
|
14
|
-
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/client-app.css">
|
15
|
-
|
16
|
-
<link href='//fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
|
17
|
-
<link href='//fonts.googleapis.com/css?family=Roboto+Mono' rel='stylesheet' type='text/css'>
|
18
|
-
|
19
|
-
{{content-for "head-footer"}}
|
20
|
-
</head>
|
21
|
-
<body>
|
22
|
-
{{content-for "body"}}
|
23
|
-
|
24
|
-
<script src="{{rootURL}}assets/vendor.js"></script>
|
25
|
-
<script src="{{rootURL}}assets/client-app.js"></script>
|
26
|
-
|
27
|
-
{{content-for "body-footer"}}
|
28
|
-
</body>
|
29
|
-
</html>
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
|
+
<title>ClientApp</title>
|
7
|
+
<meta name="description" content="">
|
8
|
+
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes">
|
9
|
+
<meta id="preloaded-data" data-root-path="/logs" data-preloaded="{}">
|
10
|
+
|
11
|
+
{{content-for "head"}}
|
12
|
+
|
13
|
+
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
|
14
|
+
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/client-app.css">
|
15
|
+
|
16
|
+
<link href='//fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
|
17
|
+
<link href='//fonts.googleapis.com/css?family=Roboto+Mono' rel='stylesheet' type='text/css'>
|
18
|
+
|
19
|
+
{{content-for "head-footer"}}
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
{{content-for "body"}}
|
23
|
+
|
24
|
+
<script src="{{rootURL}}assets/vendor.js"></script>
|
25
|
+
<script src="{{rootURL}}assets/client-app.js"></script>
|
26
|
+
|
27
|
+
{{content-for "body-footer"}}
|
28
|
+
</body>
|
29
|
+
</html>
|
@@ -1,72 +1,72 @@
|
|
1
|
-
import {
|
2
|
-
updateHiddenProperty,
|
3
|
-
resetTitleCount
|
4
|
-
} from "client-app/lib/utilities";
|
5
|
-
import { init } from "client-app/lib/preload";
|
6
|
-
import Evented from "@ember/object/evented";
|
7
|
-
import EmberObject from "@ember/object";
|
8
|
-
|
9
|
-
const TARGETS = ["component", "route"];
|
10
|
-
|
11
|
-
export function initialize(app) {
|
12
|
-
// config for moment.js
|
13
|
-
moment.updateLocale("en", {
|
14
|
-
relativeTime: {
|
15
|
-
future: "in %s",
|
16
|
-
past: "%s ago",
|
17
|
-
s: "secs",
|
18
|
-
m: "a min",
|
19
|
-
mm: "%d mins",
|
20
|
-
h: "an hr",
|
21
|
-
hh: "%d hrs",
|
22
|
-
d: "a day",
|
23
|
-
dd: "%d days",
|
24
|
-
M: "a mth",
|
25
|
-
MM: "%d mths",
|
26
|
-
y: "a yr",
|
27
|
-
yy: "%d yrs"
|
28
|
-
}
|
29
|
-
});
|
30
|
-
|
31
|
-
// parse preloaded json
|
32
|
-
const dataset = document.getElementById("preloaded-data").dataset;
|
33
|
-
init(dataset);
|
34
|
-
|
35
|
-
// setup event for updating document title and title count
|
36
|
-
let hiddenProperty;
|
37
|
-
let visibilitychange;
|
38
|
-
|
39
|
-
["", "webkit", "ms", "moz", "ms"].forEach(prefix => {
|
40
|
-
const check = prefix + (prefix === "" ? "hidden" : "Hidden");
|
41
|
-
if (document[check] !== undefined && !hiddenProperty) {
|
42
|
-
hiddenProperty = check;
|
43
|
-
visibilitychange = prefix + "visibilitychange";
|
44
|
-
}
|
45
|
-
});
|
46
|
-
|
47
|
-
updateHiddenProperty(hiddenProperty);
|
48
|
-
document.addEventListener(
|
49
|
-
visibilitychange,
|
50
|
-
() => {
|
51
|
-
resetTitleCount();
|
52
|
-
},
|
53
|
-
false
|
54
|
-
);
|
55
|
-
|
56
|
-
app.register("events:main", EmberObject.extend(Evented).create(), {
|
57
|
-
instantiate: false
|
58
|
-
});
|
59
|
-
TARGETS.forEach(t => app.inject(t, "events", "events:main"));
|
60
|
-
|
61
|
-
const isMobile =
|
62
|
-
/mobile/i.test(navigator.userAgent) && !/iPad/.test(navigator.userAgent);
|
63
|
-
if (isMobile) {
|
64
|
-
Em.$("body").addClass("mobile");
|
65
|
-
}
|
66
|
-
app.register("site:main", { isMobile }, { instantiate: false });
|
67
|
-
app.inject("controller", "site", "site:main");
|
68
|
-
}
|
69
|
-
|
70
|
-
export default {
|
71
|
-
initialize
|
72
|
-
};
|
1
|
+
import {
|
2
|
+
updateHiddenProperty,
|
3
|
+
resetTitleCount
|
4
|
+
} from "client-app/lib/utilities";
|
5
|
+
import { init } from "client-app/lib/preload";
|
6
|
+
import Evented from "@ember/object/evented";
|
7
|
+
import EmberObject from "@ember/object";
|
8
|
+
|
9
|
+
const TARGETS = ["component", "route"];
|
10
|
+
|
11
|
+
export function initialize(app) {
|
12
|
+
// config for moment.js
|
13
|
+
moment.updateLocale("en", {
|
14
|
+
relativeTime: {
|
15
|
+
future: "in %s",
|
16
|
+
past: "%s ago",
|
17
|
+
s: "secs",
|
18
|
+
m: "a min",
|
19
|
+
mm: "%d mins",
|
20
|
+
h: "an hr",
|
21
|
+
hh: "%d hrs",
|
22
|
+
d: "a day",
|
23
|
+
dd: "%d days",
|
24
|
+
M: "a mth",
|
25
|
+
MM: "%d mths",
|
26
|
+
y: "a yr",
|
27
|
+
yy: "%d yrs"
|
28
|
+
}
|
29
|
+
});
|
30
|
+
|
31
|
+
// parse preloaded json
|
32
|
+
const dataset = document.getElementById("preloaded-data").dataset;
|
33
|
+
init(dataset);
|
34
|
+
|
35
|
+
// setup event for updating document title and title count
|
36
|
+
let hiddenProperty;
|
37
|
+
let visibilitychange;
|
38
|
+
|
39
|
+
["", "webkit", "ms", "moz", "ms"].forEach(prefix => {
|
40
|
+
const check = prefix + (prefix === "" ? "hidden" : "Hidden");
|
41
|
+
if (document[check] !== undefined && !hiddenProperty) {
|
42
|
+
hiddenProperty = check;
|
43
|
+
visibilitychange = prefix + "visibilitychange";
|
44
|
+
}
|
45
|
+
});
|
46
|
+
|
47
|
+
updateHiddenProperty(hiddenProperty);
|
48
|
+
document.addEventListener(
|
49
|
+
visibilitychange,
|
50
|
+
() => {
|
51
|
+
resetTitleCount();
|
52
|
+
},
|
53
|
+
false
|
54
|
+
);
|
55
|
+
|
56
|
+
app.register("events:main", EmberObject.extend(Evented).create(), {
|
57
|
+
instantiate: false
|
58
|
+
});
|
59
|
+
TARGETS.forEach(t => app.inject(t, "events", "events:main"));
|
60
|
+
|
61
|
+
const isMobile =
|
62
|
+
/mobile/i.test(navigator.userAgent) && !/iPad/.test(navigator.userAgent);
|
63
|
+
if (isMobile) {
|
64
|
+
Em.$("body").addClass("mobile");
|
65
|
+
}
|
66
|
+
app.register("site:main", { isMobile }, { instantiate: false });
|
67
|
+
app.inject("controller", "site", "site:main");
|
68
|
+
}
|
69
|
+
|
70
|
+
export default {
|
71
|
+
initialize
|
72
|
+
};
|
@@ -1,14 +1,14 @@
|
|
1
|
-
let CONTAINER;
|
2
|
-
|
3
|
-
export function init(dataset) {
|
4
|
-
CONTAINER = {
|
5
|
-
rootPath: dataset.rootPath,
|
6
|
-
preload: JSON.parse(dataset.preloaded)
|
7
|
-
};
|
8
|
-
}
|
9
|
-
|
10
|
-
export default {
|
11
|
-
get(key) {
|
12
|
-
return Em.get(CONTAINER, key);
|
13
|
-
}
|
14
|
-
};
|
1
|
+
let CONTAINER;
|
2
|
+
|
3
|
+
export function init(dataset) {
|
4
|
+
CONTAINER = {
|
5
|
+
rootPath: dataset.rootPath,
|
6
|
+
preload: JSON.parse(dataset.preloaded)
|
7
|
+
};
|
8
|
+
}
|
9
|
+
|
10
|
+
export default {
|
11
|
+
get(key) {
|
12
|
+
return Em.get(CONTAINER, key);
|
13
|
+
}
|
14
|
+
};
|