Skip to content

Commit b885a48

Browse files
committed
Fix api metrics widget sizing and upgraded core dependencies
1 parent 9162337 commit b885a48

6 files changed

Lines changed: 21 additions & 27 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>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"dependencies": {
4444
"@babel/core": "^7.23.2",
4545
"@fleetbase/ember-core": "^0.3.8",
46-
"@fleetbase/ember-ui": "^0.3.13",
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",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)