-
Notifications
You must be signed in to change notification settings - Fork 308
[xc-admin] permission accounts #494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
14f1772
Rework pyth hooks
guibescos 1ae79d5
xc admin/add min pub page (#492)
cctdaniel 6251084
add update permissions tab
cctdaniel 4ada09e
fix default tab
cctdaniel 828914e
show default value when permission account does not exists
cctdaniel 8d29b1a
use table and add copy text function
cctdaniel 79f3a69
update package-lock.json
cctdaniel 5847ce9
update package-lock.json
cctdaniel 5f0b65c
trigger deployment
cctdaniel 700fbaf
remove unused icon
cctdaniel 7b4bf7a
capitalize tabInfo
cctdaniel dea779a
remove -1 index check
cctdaniel 011c622
refactor
cctdaniel 2970d5a
refactor TabInfo to TAB_INFO
cctdaniel 8c7d5c7
trigger deployment
cctdaniel a5c23f0
remove unused icon
cctdaniel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
16 changes: 8 additions & 8 deletions
16
...min-frontend/components/MinPublishers.tsx → ...rontend/components/tabs/MinPublishers.tsx
This file contains hidden or 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
96 changes: 96 additions & 0 deletions
96
governance/xc-admin/packages/xc-admin-frontend/components/tabs/UpdatePermissions.tsx
This file contains hidden or 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,96 @@ | ||
| import { PublicKey } from '@solana/web3.js' | ||
| import copy from 'copy-to-clipboard' | ||
| import React from 'react' | ||
| import { usePythContext } from '../../contexts/PythContext' | ||
| import CopyIcon from '../../images/icons/copy.inline.svg' | ||
| import ClusterSwitch from '../ClusterSwitch' | ||
| import Loadbar from '../loaders/Loadbar' | ||
|
|
||
| interface UpdatePermissionsProps { | ||
| account: string | ||
| pubkey?: PublicKey | ||
| } | ||
|
|
||
| const UpdatePermissionsRow: React.FunctionComponent<UpdatePermissionsProps> = ({ | ||
| account, | ||
| pubkey = new PublicKey(0), | ||
| }) => { | ||
| return ( | ||
| <tr key={account} className="border-t border-beige-300"> | ||
| <td className="py-3 pl-4 pr-2 lg:pl-14">{account}</td> | ||
| <td className="py-3 pl-1 lg:pl-14"> | ||
| <div | ||
| className="-ml-1 inline-flex cursor-pointer items-center px-1 hover:bg-dark hover:text-white active:bg-darkGray3" | ||
| onClick={() => { | ||
| copy(pubkey.toBase58()) | ||
| }} | ||
| > | ||
| <span className="mr-2 hidden lg:block">{pubkey.toBase58()}</span> | ||
| <span className="mr-2 lg:hidden"> | ||
| {pubkey.toBase58().slice(0, 6) + | ||
| '...' + | ||
| pubkey.toBase58().slice(-6)} | ||
| </span>{' '} | ||
| <CopyIcon className="shrink-0" /> | ||
| </div> | ||
| </td> | ||
| </tr> | ||
| ) | ||
| } | ||
|
|
||
| const UpdatePermissions = () => { | ||
| const { rawConfig, dataIsLoading } = usePythContext() | ||
|
|
||
| return ( | ||
| <div className="relative"> | ||
| <div className="container flex flex-col items-center justify-between lg:flex-row"> | ||
| <div className="mb-4 w-full text-left lg:mb-0"> | ||
| <h1 className="h1 mb-4">Update Permissions</h1> | ||
| </div> | ||
| </div> | ||
| <div className="container"> | ||
| <div className="mb-4 md:mb-0"> | ||
| <ClusterSwitch /> | ||
| </div> | ||
| <div className="table-responsive relative mt-6"> | ||
| {dataIsLoading ? ( | ||
| <div className="mt-3"> | ||
| <Loadbar theme="light" /> | ||
| </div> | ||
| ) : ( | ||
| <div className="table-responsive mb-10"> | ||
| <table className="w-full bg-darkGray text-left"> | ||
| <thead> | ||
| <tr> | ||
| <th className="base16 pt-8 pb-6 pl-4 pr-2 font-semibold opacity-60 lg:pl-14"> | ||
| Account | ||
| </th> | ||
| <th className="base16 pt-8 pb-6 pl-1 pr-2 font-semibold opacity-60 lg:pl-14"> | ||
| Public Key | ||
| </th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <UpdatePermissionsRow | ||
| account="Master Authority" | ||
| pubkey={rawConfig.permissionAccount?.masterAuthority} | ||
| /> | ||
| <UpdatePermissionsRow | ||
| account="Data Curation Authority" | ||
| pubkey={rawConfig.permissionAccount?.dataCurationAuthority} | ||
| /> | ||
| <UpdatePermissionsRow | ||
| account="Security Authority" | ||
| pubkey={rawConfig.permissionAccount?.securityAuthority} | ||
| /> | ||
| </tbody> | ||
| </table> | ||
| </div> | ||
| )} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| export default UpdatePermissions |
This file contains hidden or 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 hidden or 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
88 changes: 86 additions & 2 deletions
88
governance/xc-admin/packages/xc-admin-frontend/pages/index.tsx
This file contains hidden or 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
Binary file added
BIN
+3.34 KB
governance/xc-admin/packages/xc-admin-frontend/public/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.27 KB
governance/xc-admin/packages/xc-admin-frontend/public/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.22 KB
governance/xc-admin/packages/xc-admin-frontend/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions
9
governance/xc-admin/packages/xc-admin-frontend/public/browserconfig.xml
This file contains hidden or 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,9 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <browserconfig> | ||
| <msapplication> | ||
| <tile> | ||
| <square150x150logo src="/mstile-150x150.png"/> | ||
| <TileColor>#242235</TileColor> | ||
| </tile> | ||
| </msapplication> | ||
| </browserconfig> |
Binary file added
BIN
+965 Bytes
governance/xc-admin/packages/xc-admin-frontend/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.42 KB
governance/xc-admin/packages/xc-admin-frontend/public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.7 KB
governance/xc-admin/packages/xc-admin-frontend/public/favicon-light.ico
Binary file not shown.
Binary file modified
BIN
-10.6 KB
(58%)
governance/xc-admin/packages/xc-admin-frontend/public/favicon.ico
Binary file not shown.
Binary file added
BIN
+3.59 KB
governance/xc-admin/packages/xc-admin-frontend/public/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
governance/xc-admin/packages/xc-admin-frontend/public/safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions
19
governance/xc-admin/packages/xc-admin-frontend/public/site.webmanifest
This file contains hidden or 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,19 @@ | ||
| { | ||
| "name": "", | ||
| "short_name": "", | ||
| "icons": [ | ||
| { | ||
| "src": "/android-chrome-192x192.png", | ||
| "sizes": "192x192", | ||
| "type": "image/png" | ||
| }, | ||
| { | ||
| "src": "/android-chrome-512x512.png", | ||
| "sizes": "512x512", | ||
| "type": "image/png" | ||
| } | ||
| ], | ||
| "theme_color": "#242235", | ||
| "background_color": "#242235", | ||
| "display": "standalone" | ||
| } |
1 change: 0 additions & 1 deletion
1
governance/xc-admin/packages/xc-admin-frontend/public/thirteen.svg
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
governance/xc-admin/packages/xc-admin-frontend/utils/classNames.ts
This file contains hidden or 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,3 @@ | ||
| export const classNames = (...classes: any) => { | ||
| return classes.filter(Boolean).join(' ') | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.