Skip to content

Commit

Permalink
Invocation details sidebar (#123)
Browse files Browse the repository at this point in the history
Signed-off-by: Nik Nasr <[email protected]>
  • Loading branch information
nikrooz authored Dec 12, 2024
1 parent 53a0b67 commit 683d958
Show file tree
Hide file tree
Showing 48 changed files with 2,399 additions and 386 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
with:
fetch-depth: 0
- run: pnpm install --frozen-lockfile
- run: pnpm audit --prod
- run: pnpm nx affected --targets=lint --base=origin/main --head=HEAD
- run: NX_BASE=origin/main NX_HEAD=HEAD ./scripts/typecheck.js
- run: NX_BASE=origin/main NX_HEAD=HEAD pnpm nx format:check
- run: pnpm audit --prod
e2e:
runs-on: ubuntu-latest
permissions:
Expand Down
6 changes: 5 additions & 1 deletion apps/web-ui/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ import {
ServiceDetails,
} from '@restate/features/overview-route';
import { Spinner } from '@restate/ui/loading';
import { InvocationPanel } from '@restate/features/invocation-route';
import {
DeleteInvocation,
InvocationPanel,
} from '@restate/features/invocation-route';

export const links: LinksFunction = () => [
{
Expand Down Expand Up @@ -153,6 +156,7 @@ export default function App() {
<DeleteDeployment />
<ServicePlayground />
<InvocationPanel />
<DeleteInvocation />
</RestateContextProvider>
</QueryProvider>
);
Expand Down
4 changes: 2 additions & 2 deletions apps/web-ui/public/site.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"src": "/ui/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"src": "/ui/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
Expand Down
68 changes: 68 additions & 0 deletions libs/data-access/admin-api/src/lib/api/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,71 @@ export function useListInvocations(
queryKey: queryOptions.queryKey,
};
}

export function useGetInvocation(
invocationId: string,
options?: HookQueryOptions<'/query/invocations/{invocationId}', 'get'>
) {
const baseUrl = useAdminBaseUrl();
const queryOptions = adminApi(
'query',
'/query/invocations/{invocationId}',
'get',
{
baseUrl,
parameters: { path: { invocationId } },
}
);

const results = useQuery({
...queryOptions,
...options,
});

return {
...results,
queryKey: queryOptions.queryKey,
};
}

export function useGetVirtualObjectInbox(
key: string,
invocationId: string,
options?: HookQueryOptions<'/query/virtualObjects/{key}/inbox', 'get'>
) {
const baseUrl = useAdminBaseUrl();
const queryOptions = adminApi(
'query',
'/query/virtualObjects/{key}/inbox',
'get',
{
baseUrl,
parameters: { path: { key }, query: { invocationId } },
}
);

const results = useQuery({
...queryOptions,
...options,
});

return {
...results,
queryKey: queryOptions.queryKey,
};
}

export function useDeleteInvocation(
invocation_id: string,
options?: HookMutationOptions<'/invocations/{invocation_id}', 'delete'>
) {
const baseUrl = useAdminBaseUrl();

return useMutation({
...adminApi('mutate', '/invocations/{invocation_id}', 'delete', {
baseUrl,
resolvedPath: `/invocations/${invocation_id}`,
}),
...options,
});
}
189 changes: 189 additions & 0 deletions libs/data-access/admin-api/src/lib/api/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,46 @@ export interface paths {
patch?: never;
trace?: never;
};
'/query/invocations/{invocationId}': {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get invocation
* @description Get invocation
*/
get: operations['get_invocation'];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
'/query/virtualObjects/{key}/inbox': {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get Virtual Object inbox inbox for a key
* @description Get Virtual Object inbox inbox for a key
*/
get: operations['get_inbox'];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
}
export type webhooks = Record<string, never>;
export interface components {
Expand Down Expand Up @@ -730,6 +770,12 @@ export interface components {
*/
services: components['schemas']['ServiceMetadata'][];
};
InboxResponse: {
size?: number;
head: string;
} & {
[key: string]: number;
};
Invocation: {
/** Format: date-time */
created_at: string;
Expand Down Expand Up @@ -2102,4 +2148,147 @@ export interface operations {
};
};
};
get_invocation: {
parameters: {
query?: never;
header?: never;
path: {
/** @description Invocation id */
invocationId: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
200: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['Invocation'];
};
};
400: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['ErrorDescriptionResponse'];
};
};
403: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['ErrorDescriptionResponse'];
};
};
404: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['ErrorDescriptionResponse'];
};
};
409: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['ErrorDescriptionResponse'];
};
};
500: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['ErrorDescriptionResponse'];
};
};
503: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['ErrorDescriptionResponse'];
};
};
};
};
get_inbox: {
parameters: {
query?: {
/** @description Invocation id */
invocationId?: string;
};
header?: never;
path: {
/** @description key */
key: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
200: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['InboxResponse'];
};
};
400: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['ErrorDescriptionResponse'];
};
};
403: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['ErrorDescriptionResponse'];
};
};
404: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['ErrorDescriptionResponse'];
};
};
409: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['ErrorDescriptionResponse'];
};
};
500: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['ErrorDescriptionResponse'];
};
};
503: {
headers: {
[name: string]: unknown;
};
content: {
'application/json': components['schemas']['ErrorDescriptionResponse'];
};
};
};
};
}
Loading

0 comments on commit 683d958

Please sign in to comment.