Skip to content

Commit

Permalink
Merge pull request #261 from us3r-network/scan-dev
Browse files Browse the repository at this point in the history
Scan dev
  • Loading branch information
sin-bufan authored Oct 9, 2023
2 parents 7bfd7e1 + 2a103b7 commit 3ddbdeb
Show file tree
Hide file tree
Showing 30 changed files with 3,491 additions and 133 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/dashboard-firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ jobs:
env:
CI: false
GENERATE_SOURCEMAP: false
REACT_APP_NAME: "US3R CONSOLE"
REACT_APP_API_BASE_URL: "${{ vars.REACT_APP_API_BASE_URL }}"
REACT_APP_UPLOAD_API_URL: "${{ vars.REACT_APP_UPLOAD_API_URL }}"
REACT_APP_CERAMIC_MAINNET_HOST: "${{ vars.REACT_APP_CERAMIC_MAINNET_HOST }}"
REACT_APP_CERAMIC_TESTNET_HOST: "${{ vars.REACT_APP_CERAMIC_TESTNET_HOST }}"
REACT_APP_S3_SCAN_URL: "${{ vars.REACT_APP_S3_SCAN_URL }}"
REACT_APP_DOCS_URL: "${{ vars.REACT_APP_DOCS_URL }}"
REACT_APP_NAME: 'US3R DASHBOARD'
REACT_APP_API_BASE_URL: '${{ vars.REACT_APP_API_BASE_URL }}'
REACT_APP_UPLOAD_API_URL: '${{ vars.REACT_APP_UPLOAD_API_URL }}'
REACT_APP_CERAMIC_MAINNET_HOST: '${{ vars.REACT_APP_CERAMIC_MAINNET_HOST }}'
REACT_APP_CERAMIC_TESTNET_HOST: '${{ vars.REACT_APP_CERAMIC_TESTNET_HOST }}'
REACT_APP_S3_SCAN_URL: '${{ vars.REACT_APP_S3_SCAN_URL }}'
REACT_APP_DOCS_URL: '${{ vars.REACT_APP_DOCS_URL }}'
REACT_APP_ADMIN_ADDRESS: '${{ vars.REACT_APP_ADMIN_ADDRESS }}'
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
Expand All @@ -58,14 +59,15 @@ jobs:
yarn build
env:
CI: false
NODE_OPTIONS: "--max-old-space-size=8192"
REACT_APP_NAME: "US3R CONSOLE DEV"
REACT_APP_API_BASE_URL: "${{ vars.REACT_APP_API_BASE_URL }}"
REACT_APP_UPLOAD_API_URL: "${{ vars.REACT_APP_UPLOAD_API_URL }}"
REACT_APP_CERAMIC_MAINNET_HOST: "${{ vars.REACT_APP_CERAMIC_MAINNET_HOST }}"
REACT_APP_CERAMIC_TESTNET_HOST: "${{ vars.REACT_APP_CERAMIC_TESTNET_HOST }}"
REACT_APP_S3_SCAN_URL: "${{ vars.REACT_APP_S3_SCAN_URL }}"
REACT_APP_DOCS_URL: "${{ vars.REACT_APP_DOCS_URL }}"
NODE_OPTIONS: '--max-old-space-size=8192'
REACT_APP_NAME: 'US3R DASHBOARD DEV'
REACT_APP_API_BASE_URL: '${{ vars.REACT_APP_API_BASE_URL }}'
REACT_APP_UPLOAD_API_URL: '${{ vars.REACT_APP_UPLOAD_API_URL }}'
REACT_APP_CERAMIC_MAINNET_HOST: '${{ vars.REACT_APP_CERAMIC_MAINNET_HOST }}'
REACT_APP_CERAMIC_TESTNET_HOST: '${{ vars.REACT_APP_CERAMIC_TESTNET_HOST }}'
REACT_APP_S3_SCAN_URL: '${{ vars.REACT_APP_S3_SCAN_URL }}'
REACT_APP_DOCS_URL: '${{ vars.REACT_APP_DOCS_URL }}'
REACT_APP_ADMIN_ADDRESS: '${{ vars.REACT_APP_ADMIN_ADDRESS }}'
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
32 changes: 17 additions & 15 deletions .github/workflows/dashboard-firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ jobs:
env:
CI: false
GENERATE_SOURCEMAP: false
REACT_APP_NAME: "US3R CONSOLE"
REACT_APP_API_BASE_URL: "${{ vars.REACT_APP_API_BASE_URL }}"
REACT_APP_UPLOAD_API_URL: "${{ vars.REACT_APP_UPLOAD_API_URL }}"
REACT_APP_CERAMIC_MAINNET_HOST: "${{ vars.REACT_APP_CERAMIC_MAINNET_HOST }}"
REACT_APP_CERAMIC_TESTNET_HOST: "${{ vars.REACT_APP_CERAMIC_TESTNET_HOST }}"
REACT_APP_S3_SCAN_URL: "${{ vars.REACT_APP_S3_SCAN_URL }}"
REACT_APP_DOCS_URL: "${{ vars.REACT_APP_DOCS_URL }}"
REACT_APP_NAME: 'US3R DASHBOARD'
REACT_APP_API_BASE_URL: '${{ vars.REACT_APP_API_BASE_URL }}'
REACT_APP_UPLOAD_API_URL: '${{ vars.REACT_APP_UPLOAD_API_URL }}'
REACT_APP_CERAMIC_MAINNET_HOST: '${{ vars.REACT_APP_CERAMIC_MAINNET_HOST }}'
REACT_APP_CERAMIC_TESTNET_HOST: '${{ vars.REACT_APP_CERAMIC_TESTNET_HOST }}'
REACT_APP_S3_SCAN_URL: '${{ vars.REACT_APP_S3_SCAN_URL }}'
REACT_APP_DOCS_URL: '${{ vars.REACT_APP_DOCS_URL }}'
REACT_APP_ADMIN_ADDRESS: '${{ vars.REACT_APP_ADMIN_ADDRESS }}'
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
Expand All @@ -57,14 +58,15 @@ jobs:
yarn build
env:
CI: false
NODE_OPTIONS: "--max-old-space-size=8192"
REACT_APP_NAME: "US3R CONSOLE DEV"
REACT_APP_API_BASE_URL: "${{ vars.REACT_APP_API_BASE_URL }}"
REACT_APP_UPLOAD_API_URL: "${{ vars.REACT_APP_UPLOAD_API_URL }}"
REACT_APP_CERAMIC_MAINNET_HOST: "${{ vars.REACT_APP_CERAMIC_MAINNET_HOST }}"
REACT_APP_CERAMIC_TESTNET_HOST: "${{ vars.REACT_APP_CERAMIC_TESTNET_HOST }}"
REACT_APP_S3_SCAN_URL: "${{ vars.REACT_APP_S3_SCAN_URL }}"
REACT_APP_DOCS_URL: "${{ vars.REACT_APP_DOCS_URL }}"
NODE_OPTIONS: '--max-old-space-size=8192'
REACT_APP_NAME: 'US3R DASHBOARD DEV'
REACT_APP_API_BASE_URL: '${{ vars.REACT_APP_API_BASE_URL }}'
REACT_APP_UPLOAD_API_URL: '${{ vars.REACT_APP_UPLOAD_API_URL }}'
REACT_APP_CERAMIC_MAINNET_HOST: '${{ vars.REACT_APP_CERAMIC_MAINNET_HOST }}'
REACT_APP_CERAMIC_TESTNET_HOST: '${{ vars.REACT_APP_CERAMIC_TESTNET_HOST }}'
REACT_APP_S3_SCAN_URL: '${{ vars.REACT_APP_S3_SCAN_URL }}'
REACT_APP_DOCS_URL: '${{ vars.REACT_APP_DOCS_URL }}'
REACT_APP_ADMIN_ADDRESS: '${{ vars.REACT_APP_ADMIN_ADDRESS }}'
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scan-firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
REACT_APP_UPLOAD_API_URL: '${{ vars.REACT_APP_UPLOAD_API_URL }}'
REACT_APP_CERAMIC_MAINNET_HOST: '${{ vars.REACT_APP_CERAMIC_MAINNET_HOST }}'
REACT_APP_CERAMIC_TESTNET_HOST: '${{ vars.REACT_APP_CERAMIC_TESTNET_HOST }}'
REACT_APP_ADMIN_ADDRESS: '${{ vars.REACT_APP_ADMIN_ADDRESS }}'
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
Expand Down Expand Up @@ -60,6 +61,7 @@ jobs:
REACT_APP_UPLOAD_API_URL: '${{ vars.REACT_APP_UPLOAD_API_URL }}'
REACT_APP_CERAMIC_MAINNET_HOST: '${{ vars.REACT_APP_CERAMIC_MAINNET_HOST }}'
REACT_APP_CERAMIC_TESTNET_HOST: '${{ vars.REACT_APP_CERAMIC_TESTNET_HOST }}'
REACT_APP_ADMIN_ADDRESS: '${{ vars.REACT_APP_ADMIN_ADDRESS }}'
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scan-firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
REACT_APP_UPLOAD_API_URL: '${{ vars.REACT_APP_UPLOAD_API_URL }}'
REACT_APP_CERAMIC_MAINNET_HOST: '${{ vars.REACT_APP_CERAMIC_MAINNET_HOST }}'
REACT_APP_CERAMIC_TESTNET_HOST: '${{ vars.REACT_APP_CERAMIC_TESTNET_HOST }}'
REACT_APP_ADMIN_ADDRESS: '${{ vars.REACT_APP_ADMIN_ADDRESS }}'
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
Expand Down Expand Up @@ -59,6 +60,7 @@ jobs:
REACT_APP_UPLOAD_API_URL: '${{ vars.REACT_APP_UPLOAD_API_URL }}'
REACT_APP_CERAMIC_MAINNET_HOST: '${{ vars.REACT_APP_CERAMIC_MAINNET_HOST }}'
REACT_APP_CERAMIC_TESTNET_HOST: '${{ vars.REACT_APP_CERAMIC_TESTNET_HOST }}'
REACT_APP_ADMIN_ADDRESS: '${{ vars.REACT_APP_ADMIN_ADDRESS }}'
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
Expand Down
2 changes: 1 addition & 1 deletion packages/client/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@ceramicnetwork/common": "^2.26.0",
"@ceramicnetwork/http-client": "^2.22.0",
"@composedb/devtools": "0.4",
"@composedb/devtools": "0.5.0",
"@graphiql/plugin-explorer": "^0.1.20",
"@monaco-editor/react": "^4.5.1",
"@rjsf/core": "^5.8.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,12 @@ directive @createModel(
) on OBJECT
directive @loadModel(id: StreamID!) on OBJECT
input IndexField {
path: [String!]!
}
directive @createIndex(
fields: [IndexField!]!
) repeatable on OBJECT
`
4 changes: 3 additions & 1 deletion packages/client/scan/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ REACT_APP_UPLOAD_API_URL=https://api-dev.u3.xyz
REACT_APP_CERAMIC_MAINNET_HOST=https://gcp-ceramic-mainnet-dev.s3.xyz
REACT_APP_CERAMIC_TESTNET_HOST=https://gcp-ceramic-testnet-dev.s3.xyz

REACT_APP_WALLET_CONNECT_PROJECT_ID = c652d0148879353d7e965d7f6f361e59
REACT_APP_WALLET_CONNECT_PROJECT_ID = c652d0148879353d7e965d7f6f361e59

REACT_APP_ADMIN_ADDRESS = 0x0000000
4 changes: 2 additions & 2 deletions packages/client/scan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"web-vitals": "^2.1.0"
},
"devDependencies": {
"@composedb/devtools": "^0.4.3",
"@composedb/types": "^0.4.3",
"@composedb/devtools": "^0.5.0",
"@composedb/types": "^0.5.0",
"@craco/craco": "^7.0.0",
"@types/file-saver": "^2.0.5",
"assert": "^2.0.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/client/scan/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ import DappCreate from './container/DappCreate'
import DappInfo from './container/DappInfo'
import DappEdit from './container/DappEdit'
import { useEffect, useState } from 'react'
import DappsLayout from './container/DappsLayout'
import DappsList from './container/DappsList'
import DappsInfo from './container/DappsInfo'

dayjs.extend(relativeTime)

Expand Down Expand Up @@ -63,6 +66,11 @@ function Routers() {
<Route path=":appId/edit" element={<DappEdit />} />
<Route path=":appId" element={<DappInfo />} />
</Route>

<Route path="dapps" element={<DappsLayout />}>
<Route index element={<DappsList />} />
<Route path=":dappId" element={<DappsInfo />} />
</Route>
</Route>
<Route path="*" element={<NoMatch />} />
</Routes>
Expand Down
57 changes: 56 additions & 1 deletion packages/client/scan/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Network,
Stats,
Stream,
Dapp,
} from '../types'

enum ApiRespCode {
Expand Down Expand Up @@ -142,7 +143,7 @@ export function getHomeStats({
export function getModelMid({
network,
modelId,
pageSize = 50,
pageSize = PageSize,
pageNumber = 1,
}: {
network: Network
Expand Down Expand Up @@ -229,3 +230,57 @@ export function startIndexModel({
},
})
}

export function getModelStreams({
network,
ids,
}: {
network: Network
ids: string[]
}): AxiosPromise<ApiResp<Array<ModelStream>>> {
return axios.post(`${API_BASE_URL}/models/ids`, {
network: network.toUpperCase(),
ids,
})
}

export function getDapps({
pageNumber,
network,
name,
}: {
pageNumber?: number
network: Network
name?: string
}): AxiosPromise<ApiResp<Dapp[]>> {
const net = network.toLowerCase()
const n = net.charAt(0).toUpperCase() + net.slice(1)
return axios({
url: `${API_BASE_URL}/dapps`,
method: 'get',
params: {
network: n,
pageSize: PageSize,
pageNumber: pageNumber || 1,
name,
},
})
}

export function getDappInfo({
network,
appId,
}: {
network: Network
appId: string
}): AxiosPromise<ApiResp<Dapp>> {
const net = network.toLowerCase()
const n = net.charAt(0).toUpperCase() + net.slice(1)
return axios({
url: `${API_BASE_URL}/dapps/${appId}`,
method: 'get',
params: {
network: n,
},
})
}
2 changes: 1 addition & 1 deletion packages/client/scan/src/components/CodeDownload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function CodeDownload({
downloadContent: string
downloadFileName: string
}) {
const [show, setShow] = useState(false)
const [show, setShow] = useState(true)
const download = (text: string, filename: string) => {
const blob = new Blob([text], {
type: 'text/plain;charset=utf-8',
Expand Down
Loading

0 comments on commit 3ddbdeb

Please sign in to comment.