Skip to content

Commit f4070d2

Browse files
committed
Debug
1 parent 1ff93a4 commit f4070d2

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

src/components/cloud/service/StatusBadge.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import {
66
import { Status } from "./Status";
77

88
export const StatusBadge = ({ conditions, disableDropdown = false }) => {
9-
const status = !conditions.some((condition) => condition.status === "False");
9+
const status =
10+
conditions.find((condition) => condition.type === "Ready").status ===
11+
"True";
1012

1113
const renderedStatus = status ? (
1214
<CheckCircleIcon tabindex="0" role="button" class=" w-6 h-6 text-success" />

src/lib/prometheus.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use server";
22

33
import { cache } from "@solidjs/router";
4-
import { getUser } from "./server";
4+
import { getUser } from "./auth";
55
import { knative } from "~/lib/k8s";
66
import { config } from "./config";
77

@@ -51,7 +51,6 @@ export const getCompute = cache(async (app: string) => {
5151

5252
const namespace = user.name;
5353
const revision = service.raw.status.latestReadyRevisionName;
54-
5554
return await queryLastCoupleMinutes({
5655
query: `sum(rate(container_cpu_usage_seconds_total{namespace="${namespace}", pod=~"${revision}.*", container != "POD", container != ""}[1m])) by (container)`,
5756
minutes: 120,

src/routes/cloud/apps/[app].tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ import type { Service as KnativeService } from "~/lib/knative";
2222
const getService = cache(async (app: string) => {
2323
"use server";
2424
const user = await getUser();
25-
return await knative.getService(app, user.name);
25+
try {
26+
return await knative.getService(app, user.name);
27+
} catch (e) {
28+
throw redirect("/cloud/apps");
29+
}
2630
}, "service");
2731

2832
const deleteServiceFromForm = async (form: FormData) => {

src/routes/cloud/apps/[app]/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export default () => {
102102
</div>
103103
</td>
104104
<td class="hidden md:table-cell">
105-
{service()?.raw.status.traffic.find(
105+
{service()?.raw.status?.traffic?.find(
106106
(e) => e.revisionName === revision.metadata.name
107107
)?.percent ?? 0}
108108
%

src/routes/cloud/apps/[app]/logs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ export default () => {
137137
{logItem.pod}
138138
</td>
139139
</Show>
140-
<td>{logItem.log}</td>
140+
<td>
141+
<pre>{logItem.log}</pre>
142+
</td>
141143
</tr>
142144
)}
143145
</For>

0 commit comments

Comments
 (0)