-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from abjrcode/sinks
aws credentials file sink can now be configured
- Loading branch information
Showing
36 changed files
with
832 additions
and
128 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
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
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
6 changes: 3 additions & 3 deletions
6
...d/src/routes/aws-idc/aws-idc-card-data.ts → ...src/routes/providers/aws-idc/card-data.ts
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
8 changes: 4 additions & 4 deletions
8
frontend/src/routes/aws-idc/aws-idc-card.tsx → ...end/src/routes/providers/aws-idc/card.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
4 changes: 2 additions & 2 deletions
4
...outes/aws-idc/aws-idc-device-auth-data.ts → ...tes/providers/aws-idc/device-auth-data.ts
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
6 changes: 3 additions & 3 deletions
6
...rc/routes/aws-idc/aws-idc-device-auth.tsx → .../routes/providers/aws-idc/device-auth.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
2 changes: 1 addition & 1 deletion
2
.../routes/aws-idc/aws-idc-instances-data.ts → ...outes/providers/aws-idc/instances-data.ts
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
2 changes: 1 addition & 1 deletion
2
.../src/routes/aws-idc/aws-idc-instances.tsx → ...rc/routes/providers/aws-idc/instances.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
6 changes: 3 additions & 3 deletions
6
.../src/routes/aws-idc/aws-idc-setup-data.ts → ...rc/routes/providers/aws-idc/setup-data.ts
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
6 changes: 3 additions & 3 deletions
6
...tend/src/routes/aws-idc/aws-idc-setup.tsx → ...nd/src/routes/providers/aws-idc/setup.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
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,5 +1,5 @@ | ||
import { ListProviders } from "../../../wailsjs/go/main/DashboardController" | ||
import { Dashboard_ListProviders } from "../../utils/ipc-adapter"; | ||
|
||
export async function providersLoader() { | ||
return ListProviders() | ||
return Dashboard_ListProviders() | ||
} |
26 changes: 26 additions & 0 deletions
26
frontend/src/routes/sinks/aws-credentials-file/card-data.ts
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,26 @@ | ||
import { awscredentialsfile } from '../../../../wailsjs/go/models' | ||
import { ActionDataResult } from '../../../utils/action-data-result' | ||
import { AwsCredentialsFile_GetInstanceData } from '../../../utils/ipc-adapter' | ||
|
||
export enum AwsCredentialsFileCardDataError { } | ||
|
||
export type AwsCredentialsFileCardDataResult = ActionDataResult<awscredentialsfile.AwsCredentialsFileInstance, AwsCredentialsFileCardDataError> | ||
|
||
export async function awsCredentialsFileCardLoader({ request }: { request: Request }): Promise<AwsCredentialsFileCardDataResult> { | ||
const instanceId = new URL(request.url).searchParams.get('instanceId') | ||
|
||
if (!instanceId) { | ||
throw new Response('instanceId is required', { status: 400 }) | ||
} | ||
|
||
try { | ||
return { success: true, result: await AwsCredentialsFile_GetInstanceData(instanceId) } | ||
} | ||
catch (error) { | ||
switch (error) { | ||
|
||
default: | ||
throw error | ||
} | ||
} | ||
} |
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,42 @@ | ||
import React from "react" | ||
import { useFetcher } from "react-router-dom" | ||
|
||
import { AwsCredentialsFileCardDataResult } from "./card-data" | ||
|
||
export function AwsCredentialsFileCard({ instanceId }: { instanceId: string }) { | ||
const fetcher = useFetcher() | ||
|
||
React.useEffect(() => { | ||
if (fetcher.state === "idle" && !fetcher.data) { | ||
const urlSearchParams = new URLSearchParams() | ||
urlSearchParams.append("instanceId", instanceId) | ||
fetcher.load( | ||
`/internal/api/aws-credentials-file-card?${urlSearchParams.toString()}`, | ||
) | ||
} | ||
}, [instanceId, fetcher]) | ||
|
||
const cardDataResult = fetcher.data as AwsCredentialsFileCardDataResult | undefined | ||
|
||
if (cardDataResult === undefined) { | ||
return <div className="skeleton items-center w-48"></div> | ||
} | ||
|
||
if (cardDataResult.success) { | ||
const cardData = cardDataResult.result | ||
|
||
return ( | ||
<div className="card gap-6 px-6 py-4 max-w-lg card-bordered border-secondary bg-base-200 drop-shadow-lg"> | ||
<div | ||
role="heading" | ||
className="card-title justify-between"> | ||
<div className="inline-flex items-center justify-center gap-2"> | ||
<h1 className="text-2xl font-semibold">{cardData.label}</h1> | ||
</div> | ||
</div> | ||
<div className="card-body">{cardData.filePath}</div> | ||
<div className="card-actions items-center justify-between"></div> | ||
</div> | ||
) | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
frontend/src/routes/sinks/aws-credentials-file/instances-data.ts
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,5 @@ | ||
import { AwsCredentialsFile_ListInstances } from "../../../utils/ipc-adapter"; | ||
|
||
export function awsCredentialsFileInstancesData() { | ||
return AwsCredentialsFile_ListInstances(); | ||
} |
Oops, something went wrong.