-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(provider): provider attributes and actions (#451)
* added server-access and server-form files * added wallet import page - wip, fixed issue with file upload in server access forms * added become-provider steps ui * server access step added with state support * added provider config and provider attribute screen * added provider process with hoc to prevent access to pages * added progress for becoming prvider for final stage * Code clean up and added navigation logic to homecontainer * package lock updated * more cleanup and remove general warnings * removed unused npm package * fix minor error on api * Added dashboard and actions page * change status api endpoint * added stat line and pie charts * Added console apis to get dashboard data and show appropriate details * fixed actions and changed home component * token varification and refresh token fix * changed wallet connect from wallet status to wallet provider * fixed issue in loading provider status * fixed home loading issue * fixed refresh token, added disabled menu items * fixed build process * feat(provider): added sentry and docker * fix(provider): fixed wallet switching and getting status * feat(provider): reduced number of events in dashboard * feat(provider): added docker compose changes for provider-console * feat(provider): added deployments and deployment detail page * fix(provider): change hours to seconds for calculation purpose) * feat(provider): added auth for deployments and deployment details page * feat(provider): added env and removed settingsprovider * fix(provider): fix lint errors and removed console.logs * fix(provider): become-provider looped, fixed it * fix(provider): router and reset process fixed * fix(provider): removed Get Started button for now * fix(provider): removed unused import in nav * fix(provider): change functions to react fc component * fix(provider): fix lint issues * fix(provider): change functions to react fc component * fix(provider): added docker build and fix build related issues * feat(provider): control machine edit, add from sidebar * feat(provider): added attributes screen * fix(provider): control machine auto connect on page load * fix(provider): fix loading not showing while connecting provider control machine * fix(provider): close drawer on successfull connection * feat(provider): change favicon to akash favicon * feat(provider): provider add, edit and remove and show acitons list page * fix(provider): fix url when provider process finish * fix(provider): merge issues with main * fix(provider): changed to useQuery and fix lint * chore(provider): removed comment
- Loading branch information
1 parent
c676fd2
commit 6dfaf3b
Showing
11 changed files
with
169 additions
and
39 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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"use client"; | ||
|
||
import { Layout } from "@src/components/layout/Layout"; | ||
import { ProviderActionList } from "@src/components/shared/ProviderActionList"; | ||
import { Title } from "@src/components/shared/Title"; | ||
import { useProviderActions } from "@src/queries/useProviderQuery"; | ||
|
||
const ActionsList: React.FC = () => { | ||
const { data: actions } = useProviderActions(); | ||
return ( | ||
<Layout> | ||
<div className="flex items-center"> | ||
<div className="w-10 flex-1"> | ||
<Title>User Actions</Title> | ||
</div> | ||
</div> | ||
<div className="mt-10"> | ||
<div className="text-sm font-semibold"> | ||
<div className="items-center space-x-2"> | ||
<ProviderActionList actions={actions} /> | ||
</div> | ||
</div> | ||
</div> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default ActionsList; |
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,33 @@ | ||
import React from "react"; | ||
import { useQuery } from "react-query"; | ||
|
||
import { ProviderAttributes } from "@src/components/become-provider/ProviderAttributes"; | ||
import { Layout } from "@src/components/layout/Layout"; | ||
import { useSelectedChain } from "@src/context/CustomChainProvider"; | ||
import consoleClient from "@src/utils/consoleClient"; | ||
|
||
const Attributes: React.FunctionComponent = () => { | ||
const { address } = useSelectedChain(); | ||
const { data: providerDetails, isLoading: isLoadingProviderDetails }: { data: any; isLoading: boolean } = useQuery( | ||
"providerDetails", | ||
() => consoleClient.get(`/v1/providers/${address}`), | ||
{ | ||
refetchOnWindowFocus: false, | ||
retry: 3 | ||
} | ||
); | ||
|
||
return ( | ||
<Layout> | ||
{isLoadingProviderDetails ? ( | ||
<div>Loading...</div> | ||
) : ( | ||
<div> | ||
<ProviderAttributes existingAttributes={providerDetails.attributes} editMode={true} /> | ||
</div> | ||
)} | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default Attributes; |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ControlMachineWithAddress } from "@src/types/controlMachine"; | ||
|
||
export function sanitizeMachineAccess(machine: ControlMachineWithAddress | null) { | ||
if (!machine) { | ||
return undefined; | ||
} | ||
return { | ||
hostname: machine.access.hostname, | ||
port: machine.access.port, | ||
username: machine.access.username, | ||
keyfile: machine.access.file || null, | ||
password: machine.access.password || null, | ||
passphrase: machine.access.passphrase || null | ||
}; | ||
} |
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