-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix and adapt new dashboard endpoint (#1594)
Because - fix and adapt new dashboard endpoint This commit - fix and adapt new dashboard endpoint --------- Co-authored-by: Wojciech Bandzerewicz <57405495+thewbuk@users.noreply.github.com>
- Loading branch information
Showing
63 changed files
with
2,941 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Metadata } from "next"; | ||
|
||
import { generateNextMetaBase } from "@instill-ai/toolkit/server"; | ||
|
||
import ActivityRender from "./render"; | ||
|
||
export async function generateMetadata(): Promise<Metadata> { | ||
return { | ||
title: "Instill Core | Activity Dashboard", | ||
metadataBase: generateNextMetaBase({ | ||
defaultBase: "http://localhost:3000", | ||
}), | ||
openGraph: { | ||
images: ["/instill-open-graph.png"], | ||
}, | ||
}; | ||
} | ||
|
||
export default function ActivityPage() { | ||
return <ActivityRender />; | ||
} |
29 changes: 29 additions & 0 deletions
29
apps/console/src/app/[entity]/dashboard/activity/render.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"use client"; | ||
|
||
import * as React from "react"; | ||
|
||
import { | ||
AppTopbar, | ||
DashboardActivityPageMainView, | ||
NamespaceSwitch, | ||
PageBase, | ||
} from "@instill-ai/toolkit"; | ||
|
||
import { useAppAccessToken } from "~/lib/use-app-access-token"; | ||
import { useAppTrackToken } from "~/lib/useAppTrackToken"; | ||
|
||
export default function ActivityRender() { | ||
useAppAccessToken(); | ||
useAppTrackToken({ enabled: true }); | ||
|
||
return ( | ||
<PageBase> | ||
<AppTopbar namespaceSwitch={<NamespaceSwitch />} /> | ||
<PageBase.Container> | ||
<PageBase.Content contentPadding="p-8"> | ||
<DashboardActivityPageMainView /> | ||
</PageBase.Content> | ||
</PageBase.Container> | ||
</PageBase> | ||
); | ||
} |
21 changes: 21 additions & 0 deletions
21
apps/console/src/app/[entity]/dashboard/cost/model/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Metadata } from "next"; | ||
|
||
import { generateNextMetaBase } from "@instill-ai/toolkit/server"; | ||
|
||
import CostPipelineRender from "./render"; | ||
|
||
export async function generateMetadata(): Promise<Metadata> { | ||
return { | ||
title: "Instill Core | Pipeline Cost Dashboard", | ||
metadataBase: generateNextMetaBase({ | ||
defaultBase: "http://localhost:3000", | ||
}), | ||
openGraph: { | ||
images: ["/instill-open-graph.png"], | ||
}, | ||
}; | ||
} | ||
|
||
export default function CostPipelinePage() { | ||
return <CostPipelineRender />; | ||
} |
29 changes: 29 additions & 0 deletions
29
apps/console/src/app/[entity]/dashboard/cost/model/render.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"use client"; | ||
|
||
import * as React from "react"; | ||
|
||
import { | ||
AppTopbar, | ||
DashboardCostModelPageMainView, | ||
NamespaceSwitch, | ||
PageBase, | ||
} from "@instill-ai/toolkit"; | ||
|
||
import { useAppAccessToken } from "~/lib/use-app-access-token"; | ||
import { useAppTrackToken } from "~/lib/useAppTrackToken"; | ||
|
||
export default function CostModelRender() { | ||
useAppAccessToken(); | ||
useAppTrackToken({ enabled: true }); | ||
|
||
return ( | ||
<PageBase> | ||
<AppTopbar namespaceSwitch={<NamespaceSwitch />} /> | ||
<PageBase.Container> | ||
<PageBase.Content contentPadding="p-8"> | ||
<DashboardCostModelPageMainView /> | ||
</PageBase.Content> | ||
</PageBase.Container> | ||
</PageBase> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { redirect } from "next/navigation"; | ||
|
||
type RedirectionDashboardCostPageProps = { | ||
params: { id: string; entity: string }; | ||
}; | ||
|
||
const RedirectionDashboardCostPage = ({ | ||
params, | ||
}: RedirectionDashboardCostPageProps) => { | ||
const { entity } = params; | ||
|
||
return redirect(`/${entity}/dashboard/cost/pipeline`); | ||
}; | ||
|
||
export default RedirectionDashboardCostPage; |
21 changes: 21 additions & 0 deletions
21
apps/console/src/app/[entity]/dashboard/cost/pipeline/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Metadata } from "next"; | ||
|
||
import { generateNextMetaBase } from "@instill-ai/toolkit/server"; | ||
|
||
import CostModelRender from "./render"; | ||
|
||
export async function generateMetadata(): Promise<Metadata> { | ||
return { | ||
title: "Instill Core | Model Cost Dashboard", | ||
metadataBase: generateNextMetaBase({ | ||
defaultBase: "http://localhost:3000", | ||
}), | ||
openGraph: { | ||
images: ["/instill-open-graph.png"], | ||
}, | ||
}; | ||
} | ||
|
||
export default function CostModelPage() { | ||
return <CostModelRender />; | ||
} |
29 changes: 29 additions & 0 deletions
29
apps/console/src/app/[entity]/dashboard/cost/pipeline/render.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"use client"; | ||
|
||
import * as React from "react"; | ||
|
||
import { | ||
AppTopbar, | ||
DashboardCostPipelinePageMainView, | ||
NamespaceSwitch, | ||
PageBase, | ||
} from "@instill-ai/toolkit"; | ||
|
||
import { useAppAccessToken } from "~/lib/use-app-access-token"; | ||
import { useAppTrackToken } from "~/lib/useAppTrackToken"; | ||
|
||
export default function CostPipelineRender() { | ||
useAppAccessToken(); | ||
useAppTrackToken({ enabled: true }); | ||
|
||
return ( | ||
<PageBase> | ||
<AppTopbar namespaceSwitch={<NamespaceSwitch />} /> | ||
<PageBase.Container> | ||
<PageBase.Content contentPadding="p-8"> | ||
<DashboardCostPipelinePageMainView /> | ||
</PageBase.Content> | ||
</PageBase.Container> | ||
</PageBase> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import { redirect } from "next/navigation"; | ||
|
||
type Props = { | ||
params: { entity: string }; | ||
type RedirectionDashboardPageProps = { | ||
params: { id: string; entity: string }; | ||
}; | ||
|
||
export default async function Page({ params }: Props) { | ||
redirect(`/${params.entity}/dashboard/pipeline`); | ||
} | ||
const RedirectionDashboardPage = ({ | ||
params, | ||
}: RedirectionDashboardPageProps) => { | ||
const { entity } = params; | ||
|
||
return redirect(`/${entity}/dashboard/activity`); | ||
}; | ||
|
||
export default RedirectionDashboardPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.