Skip to content

Commit f11d032

Browse files
authored
Merge pull request #37 from fleetbase/dev-v0.2.12
Updated core dependencies, and removed redundant ember-ui styles filt…
2 parents b68cc9a + b885a48 commit f11d032

7 files changed

Lines changed: 1863 additions & 3535 deletions

File tree

addon/components/widget/api-metrics.hbs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
<ContentPanel @title={{t "developers.component.widget.api-metrics.title"}} @open={{or @open true}} @wrapperClass="bordered-classic" @panelBodyClass="p-0i">
22
<div class="grid grid-cols-1 md:grid-cols-2 gap-px bg-gray-200 dark:bg-gray-800">
3-
<div class="bg-white dark:bg-gray-900 p-5">
3+
<div class="bg-white dark:bg-gray-900 p-2">
44
<h4 class="mb-4 text-sm font-semibold text-gray-700 dark:text-gray-200">
55
{{t "developers.component.widget.api-metrics.api-requests"}}
66
</h4>
7-
<div class="h-96">
7+
<div class="relative" style={{html-safe "position: relative; height: 18rem; width: 100%;"}}>
88
<Chart @type="line" @datasets={{this.apiRequestData}} @options={{this.chartOptions}} />
99
</div>
1010
</div>
1111

12-
<div class="bg-white dark:bg-gray-900 p-5">
12+
<div class="bg-white dark:bg-gray-900 p-2">
1313
<h4 class="mb-4 text-sm font-semibold text-gray-700 dark:text-gray-200">
1414
{{t "developers.component.widget.api-metrics.api-error"}}
1515
</h4>
16-
<div class="h-96">
16+
<div class="relative" style={{html-safe "position: relative; height: 18rem; width: 100%;"}}>
1717
<Chart @type="line" @datasets={{this.apiErrorDistributionData}} @options={{this.chartOptions}} />
1818
</div>
1919
</div>
2020

21-
<div class="bg-white dark:bg-gray-900 p-5">
21+
<div class="bg-white dark:bg-gray-900 p-2">
2222
<h4 class="mb-4 text-sm font-semibold text-gray-700 dark:text-gray-200">
2323
{{t "developers.component.widget.api-metrics.webhooks"}}
2424
</h4>
25-
<div class="h-96">
25+
<div class="relative" style={{html-safe "position: relative; height: 18rem; width: 100%;"}}>
2626
<Chart @type="line" @datasets={{this.webhookRequestData}} @options={{this.chartOptions}} />
2727
</div>
2828
</div>
2929

30-
<div class="bg-white dark:bg-gray-900 p-5">
30+
<div class="bg-white dark:bg-gray-900 p-2">
3131
<h4 class="mb-4 text-sm font-semibold text-gray-700 dark:text-gray-200">
3232
{{t "developers.component.widget.api-metrics.webhooks-response"}}
3333
</h4>
34-
<div class="h-96">
34+
<div class="relative" style={{html-safe "position: relative; height: 18rem; width: 100%;"}}>
3535
<Chart @type="line" @datasets={{this.webhookRequestTimingData}} @options={{this.chartOptions}} />
3636
</div>
3737
</div>

addon/components/widget/api-metrics.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,16 +252,6 @@ export default class WidgetApiMetricsComponent extends Component {
252252
.then((webhookRequestLogs) => {
253253
const records = webhookRequestLogs.toArray();
254254

255-
// Debug: Check first record
256-
if (records.length > 0) {
257-
console.log('[webhook-timing] First record:', {
258-
duration: records[0].duration,
259-
type: typeof records[0].duration,
260-
parsed: parseFloat(records[0].duration || 0),
261-
ms: parseFloat(records[0].duration || 0) * 1000,
262-
});
263-
}
264-
265255
const data = records.map((req) => {
266256
// Duration might be a string, ensure it's parsed as float
267257
const duration = req.duration;
@@ -274,8 +264,6 @@ export default class WidgetApiMetricsComponent extends Component {
274264
};
275265
});
276266

277-
console.log('[webhook-timing] Data points:', data.length, 'Sample:', data[0]);
278-
279267
// Show points if we have sparse data
280268
const showPoints = records.length < 50;
281269

addon/styles/dev-engine.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@
4444
body[data-theme='dark'] .webhook-attempts-date-filter-container > .date-filter-label {
4545
color: #9ca3af;
4646
}
47+
48+
.ui-chart {
49+
position: relative;
50+
height: 100%;
51+
width: 100%;
52+
}

addon/templates/home/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<Layout::Section::Body class="mx-auto max-w-6xl p-8">
1+
<Layout::Section::Body class="mx-auto max-w-6xl p-8 h-full overflow-y-scroll">
22
<Widget::ApiMetrics />
33
</Layout::Section::Body>

index.js

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,10 @@
11
'use strict';
22
const { buildEngine } = require('ember-engines/lib/engine-addon');
33
const { name } = require('./package');
4-
const Funnel = require('broccoli-funnel');
5-
6-
function isDevServe() {
7-
// env checks
8-
const env = process.env.EMBER_ENV || process.env.NODE_ENV || 'development';
9-
const isProd = env === 'production' || process.env.CI === 'true';
10-
11-
// command-line checks (serve/watch only)
12-
const argv = process.argv.join(' ');
13-
const isServeCmd = /\b(ember|node).* (serve|server)\b/.test(argv) || process.argv.includes('serve') || process.argv.includes('server');
14-
const isWatch = process.argv.includes('--watch') || process.env.BROCCOLI_WATCHER;
15-
16-
return !isProd && (isServeCmd || isWatch);
17-
}
184

195
module.exports = buildEngine({
206
name,
217

22-
init() {
23-
if (this._super.init) this._super.init.apply(this, arguments);
24-
25-
if (isDevServe()) {
26-
for (let addon of this.addons || []) {
27-
if (['@fleetbase/ember-core', '@fleetbase/ember-ui'].includes(addon.name)) {
28-
let origTreeFor = addon.treeFor?.bind(addon);
29-
addon.treeFor = function (type) {
30-
if (type === 'styles') {
31-
return undefined;
32-
}
33-
return origTreeFor ? origTreeFor(type) : undefined;
34-
};
35-
}
36-
}
37-
38-
const origNonDup = this.nonDuplicatedAddonInvoke?.bind(this);
39-
this.nonDuplicatedAddonInvoke = (hook, args = []) => {
40-
if (hook === 'treeFor' && args[0] === 'styles') {
41-
return []; // prevents dependency style relocation funnel (dev-only)
42-
}
43-
return origNonDup ? origNonDup(hook, args) : [];
44-
};
45-
}
46-
},
47-
48-
postprocessTree(type, tree) {
49-
if (type === 'css') {
50-
tree = new Funnel(tree, {
51-
exclude: ['**/@fleetbase/ember-ui/**/*.css'],
52-
});
53-
}
54-
55-
return tree;
56-
},
57-
588
lazyLoading: {
599
enabled: true,
6010
},

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fleetbase/dev-engine",
3-
"version": "0.2.11",
3+
"version": "0.2.12",
44
"description": "Fleetbase Developers extension provides a module for managing developer resources such as API keys, webhooks, sockets, events and logs.",
55
"fleetbase": {
66
"route": "developers"
@@ -42,8 +42,8 @@
4242
},
4343
"dependencies": {
4444
"@babel/core": "^7.23.2",
45-
"@fleetbase/ember-core": "^0.3.7",
46-
"@fleetbase/ember-ui": "^0.3.12",
45+
"@fleetbase/ember-core": "^0.3.8",
46+
"@fleetbase/ember-ui": "^0.3.14",
4747
"@fortawesome/ember-fontawesome": "^2.0.0",
4848
"@fortawesome/fontawesome-svg-core": "6.4.0",
4949
"@fortawesome/free-brands-svg-icons": "6.4.0",

0 commit comments

Comments
 (0)