Skip to content

Commit

Permalink
feat: link & name
Browse files Browse the repository at this point in the history
  • Loading branch information
HuberTRoy committed Nov 7, 2024
1 parent 581cd0d commit 2ae4785
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 37 deletions.
2 changes: 1 addition & 1 deletion apps/indexer-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@mui/material": "^5.5.1",
"@patternfly/react-log-viewer": "^4.43.19",
"@rainbow-me/rainbowkit": "^1.2.0",
"@subql/components": "2.0.1-1",
"@subql/components": "3.0.1-3",
"@subql/contract-sdk": "1.3.0",
"@subql/network-clients": "1.1.0",
"@subql/network-config": "1.1.1",
Expand Down
14 changes: 8 additions & 6 deletions apps/indexer-admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from 'react-router-dom';
import { ApolloProvider } from '@apollo/client';
import { loadDevMessages, loadErrorMessages } from '@apollo/client/dev';
import { Footer } from '@subql/components';
import { Footer, SubqlProvider } from '@subql/components';
import { useMount } from 'ahooks';
import { RainbowProvider, tipsChainIds } from 'conf/rainbowConf';
import { isUndefined } from 'lodash';
Expand Down Expand Up @@ -152,11 +152,13 @@ const App: FC = () => (
<LoadingProvider>
<ModalProvider>
<NotificationProvider>
<div className="App">
<Router>
<AppContents />
</Router>
</div>
<SubqlProvider version="v2">
<div className="App">
<Router>
<AppContents />
</Router>
</div>
</SubqlProvider>
</NotificationProvider>
</ModalProvider>
</LoadingProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { GET_RPC_ENDPOINT_KEYS } from 'utils/queries';

import { CardContainer } from '../styles';
import { ProjectDetails, ProjectStatus, TQueryMetadata } from '../types';
import RpcSetting from './rpcSetting';
import RpcSetting, { getKeyName } from './rpcSetting';

type Props = {
project: ProjectDetails;
Expand All @@ -19,21 +19,6 @@ type Props = {
refresh: () => void;
};

const getKeyName = (keyName: string) => {
if (keyName.includes('Metrics')) {
return 'Metrics' as const;
}

if (keyName.includes('Ws')) {
return 'WebSocket' as const;
}

if (keyName.includes('Http')) {
return 'HTTP' as const;
}
return keyName;
};

const getEndpointStatus = (endpoint?: { valid: boolean }) => {
if (!endpoint) {
return {
Expand Down Expand Up @@ -150,7 +135,14 @@ const ProjectRpcServiceCard: FC<Props> = ({ project, metadata, projectStatus, re
description={
<Typography>
You have not entered a valid metrics endpoint. You may receive fewer RPC requests
without this set and active
without this set and active.{' '}
<Typography.Link
href="https://academy.subquery.network/subquery_network/node_operators/rpc_providers/connect-node.html#prerequisites"
type="info"
target="_blank"
>
Learn more.
</Typography.Link>
</Typography>
}
/>
Expand All @@ -169,7 +161,14 @@ const ProjectRpcServiceCard: FC<Props> = ({ project, metadata, projectStatus, re
<Typography>
Your metrics endpoint cannot be reached. You may receive fewer RPC requests without a
healthy metrics endpoint. <br />
Please check: {metricStatus.reason}
Please check: {metricStatus.reason}{' '}
<Typography.Link
href="https://academy.subquery.network/subquery_network/node_operators/rpc_providers/connect-node.html#prerequisites"
type="info"
target="_blank"
>
Learn more.
</Typography.Link>
</Typography>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ interface IProps {
id?: string;
}

export const getKeyName = (keyName: string) => {
if (keyName.includes('Metrics')) {
return 'Metrics' as const;
}

if (keyName.includes('Ws')) {
return 'WebSocket' as const;
}

if (keyName.includes('Http')) {
return 'HTTP' as const;
}
return keyName;
};

const getRuleField = (key: string) => {
const lowerCaseKey = key.toLowerCase();

Expand Down Expand Up @@ -353,7 +368,7 @@ const RpcSetting: FC<IProps> = (props) => {
<WithWarning key={key}>
<Form.Item
key={key}
label={`${key} Endpoint`}
label={`${getKeyName(key)} Endpoint`}
name={`${key}`}
hasFeedback
className={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import { useEffect, useMemo, useState } from 'react';
import { BsInfoCircle } from 'react-icons/bs';
import { Modal, Spinner, Tooltip, Typography } from '@subql/components';
import { Modal, Spinner, Typography } from '@subql/components';
import { TOKEN_SYMBOLS } from '@subql/network-config';
import { Input, Select } from 'antd';
import { Input, Select, Tooltip } from 'antd';
import { SubqlInput } from 'styles/input';

import { useContractSDK } from 'containers/contractSdk';
Expand Down
44 changes: 35 additions & 9 deletions apps/indexer-admin/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2502,10 +2502,10 @@
"@stablelib/random" "^1.0.2"
"@stablelib/wipe" "^1.0.1"

"@subql/components@2.0.1-1":
version "2.0.1-1"
resolved "https://registry.yarnpkg.com/@subql/components/-/components-2.0.1-1.tgz#9fac7f6d7f1d6c29428dce0161279efa174aaf5c"
integrity sha512-Y1VyI4BS6+Zx40JPUUmpyPtkzJxzDKBihNTeg82g3v2cNMJHJYzOfQDgVlDknNR65ds9x4jXntecXCjDPAKLUg==
"@subql/components@3.0.1-3":
version "3.0.1-3"
resolved "https://registry.yarnpkg.com/@subql/components/-/components-3.0.1-3.tgz#121ef9147a797f4c456c904eeae42a0b130762b5"
integrity sha512-WFHXqA6ESP6ZdhDfqzIbWXvrpFER+PFsStZUIRlk6dBxdFF0ieAsuBC6eBe3b7sn5U5usaREEYtZbl6uKbHeyQ==
dependencies:
"@graphiql/plugin-explorer" "^0.3.4"
"@graphiql/toolkit" "^0.9.1"
Expand All @@ -2514,14 +2514,16 @@
graphql "^16.7.0"
graphql-ws "^5.13.1"
jdenticon "^3.2.0"
localforage "^1.10.0"
lodash-es "^4.17.21"
ra-data-graphql "^4.11.3"
react-icons "^4.8.0"
react-icons "^5.2.1"
react-jazzicon "^0.1.3"
react-markdown "^9.0.0"
react-router-dom "^6.4.2"
string-width "4.2.3"
use-screen "^1.1.3"
uuid "^10.0.0"

"@subql/[email protected]":
version "1.3.0"
Expand Down Expand Up @@ -6350,6 +6352,11 @@ ignore@^5.2.0:
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324"
integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==

immediate@~3.0.5:
version "3.0.6"
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==

import-fresh@^3.0.0, import-fresh@^3.2.1:
version "3.3.0"
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b"
Expand Down Expand Up @@ -7153,6 +7160,13 @@ libphonenumber-js@^1.10.14:
resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.10.43.tgz#ef8b697c70a160142a653fc92931852c403a656f"
integrity sha512-M/iPACJGsTvEy8QmUY4K0SoIFB71X2j7y2JvUMYzUXUxCNmiU+NTfHdz7gt+dC48BVfBzZi2oO6s9TDGllCfxA==

[email protected]:
version "3.1.1"
resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e"
integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==
dependencies:
immediate "~3.0.5"

lilconfig@^2.0.5, lilconfig@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52"
Expand Down Expand Up @@ -7252,6 +7266,13 @@ [email protected]:
lit-element "^3.3.0"
lit-html "^2.8.0"

localforage@^1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4"
integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==
dependencies:
lie "3.1.1"

locate-path@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0"
Expand Down Expand Up @@ -9141,10 +9162,10 @@ react-icons@^4.11.0:
resolved "https://registry.npmjs.org/react-icons/-/react-icons-4.11.0.tgz#4b0e31c9bfc919608095cc429c4f1846f4d66c65"
integrity sha512-V+4khzYcE5EBk/BvcuYRq6V/osf11ODUM2J8hg2FDSswRrGvqiYUYPRy4OdrWaQOBj4NcpJfmHZLNaD+VH0TyA==

react-icons@^4.8.0:
version "4.10.1"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.10.1.tgz#3f3b5eec1f63c1796f6a26174a1091ca6437a500"
integrity sha512-/ngzDP/77tlCfqthiiGNZeYFACw85fUjZtLbedmJ5DTlNDIwETxhwBzdOJ21zj4iJdvc0J3y7yOsX3PpxAJzrw==
react-icons@^5.2.1:
version "5.3.0"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-5.3.0.tgz#ccad07a30aebd40a89f8cfa7d82e466019203f1c"
integrity sha512-DnUk8aFbTyQPSkCfF8dbX6kQjXA9DktMeJqfjrg6cK9vwQVMxmcA3BfP4QoiztVmEHtwlTgLFsPuH2NskKT6eg==

react-is@^16.12.0, react-is@^16.13.1, react-is@^16.3.2, react-is@^16.6.0, react-is@^16.7.0:
version "16.13.1"
Expand Down Expand Up @@ -10641,6 +10662,11 @@ util@^0.12.4, util@^0.12.5:
is-typed-array "^1.1.3"
which-typed-array "^1.1.2"

uuid@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-10.0.0.tgz#5a95aa454e6e002725c79055fd42aaba30ca6294"
integrity sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==

uuid@^8.3.2:
version "8.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
Expand Down

0 comments on commit 2ae4785

Please sign in to comment.