mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
format fix
This commit is contained in:
parent
77ea9d0432
commit
6cac77607b
@ -1,6 +1,5 @@
|
||||
.customOverlay {
|
||||
|
||||
}
|
||||
.customModal {
|
||||
border-radius: 15px;
|
||||
}
|
||||
}
|
||||
.customModal {
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
35
src/components/atoms/BaseDialog.tsx
Normal file
35
src/components/atoms/BaseDialog.tsx
Normal file
@ -0,0 +1,35 @@
|
||||
import React from 'react'
|
||||
import styles from './BaseDialog.module.css'
|
||||
import { Modal } from 'react-responsive-modal'
|
||||
|
||||
export default function BaseDialog({
|
||||
open,
|
||||
title,
|
||||
onClose,
|
||||
children,
|
||||
disableClose,
|
||||
actions,
|
||||
...other
|
||||
}: {
|
||||
open: boolean
|
||||
title: string
|
||||
onClose: () => void
|
||||
children: React.ReactNode
|
||||
disableClose?: boolean
|
||||
actions?: any
|
||||
}) {
|
||||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
classNames={{
|
||||
overlay: 'customOverlay',
|
||||
modal: 'customModal'
|
||||
}}
|
||||
{...other}
|
||||
>
|
||||
<h2>{title}</h2>
|
||||
<p>{children}</p>
|
||||
</Modal>
|
||||
)
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
import React from 'react'
|
||||
import styles from './BaseDialog.module.css'
|
||||
import { Modal } from "react-responsive-modal";
|
||||
|
||||
|
||||
export default function BaseDialog({
|
||||
open,
|
||||
title,
|
||||
onClose,
|
||||
children,
|
||||
disableClose,
|
||||
actions,
|
||||
...other }: {
|
||||
open: boolean
|
||||
title: string
|
||||
onClose: () => void
|
||||
children: React.ReactNode
|
||||
disableClose?: boolean
|
||||
actions?: any
|
||||
}) {
|
||||
|
||||
return (
|
||||
<Modal open={open} onClose={onClose} classNames={{
|
||||
overlay: 'customOverlay',
|
||||
modal: 'customModal',
|
||||
}} {...other}>
|
||||
<h2>{title}</h2>
|
||||
<p>
|
||||
{children}
|
||||
</p>
|
||||
</Modal>
|
||||
)
|
||||
}
|
@ -16,7 +16,10 @@ import {
|
||||
import styles from './Compute.module.css'
|
||||
import Button from '../atoms/Button'
|
||||
import Input from '../atoms/Input/Input'
|
||||
import { LoggerInstance, LogLevel } from '@oceanprotocol/squid/dist/node/utils/Logger'
|
||||
import {
|
||||
LoggerInstance,
|
||||
LogLevel
|
||||
} from '@oceanprotocol/squid/dist/node/utils/Logger'
|
||||
|
||||
export default function Compute({
|
||||
ddo,
|
||||
@ -29,7 +32,6 @@ export default function Compute({
|
||||
}) {
|
||||
if (!ddo) return null
|
||||
|
||||
|
||||
const { compute, isLoading, computeStepText, computeError } = useCompute()
|
||||
const [isJobStarting, setIsJobStarting] = useState(false)
|
||||
const [, setError] = useState('')
|
||||
@ -60,7 +62,6 @@ export default function Compute({
|
||||
!isTermsAgreed
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
setIsBalanceSufficient(
|
||||
isFree ||
|
||||
(balance !== null &&
|
||||
@ -91,7 +92,7 @@ export default function Compute({
|
||||
setError('')
|
||||
|
||||
await compute(ddo.id, algorithmRawCode, computeContainer)
|
||||
|
||||
|
||||
setIsPublished(true)
|
||||
setFile(null)
|
||||
} catch (error) {
|
||||
|
@ -54,7 +54,7 @@ export default function ConsumedList() {
|
||||
setIsLoading(true)
|
||||
|
||||
const consumedItems = await getConsumedList()
|
||||
|
||||
|
||||
if (!consumedItems) return
|
||||
|
||||
const data = consumedItems.map(ddo => {
|
||||
@ -66,7 +66,7 @@ export default function ConsumedList() {
|
||||
price: price
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
setConsumedList(data)
|
||||
setIsLoading(false)
|
||||
}
|
||||
|
@ -71,51 +71,52 @@ export default function JobsList() {
|
||||
const { getComputeItems } = useSearch()
|
||||
|
||||
const getJobs = async () => {
|
||||
if (!accountId || !ocean || status !== OceanConnectionStatus.CONNECTED) return
|
||||
if (!accountId || !ocean || status !== OceanConnectionStatus.CONNECTED)
|
||||
return
|
||||
setIsLoading(true)
|
||||
setUserAgreed(true)
|
||||
try {
|
||||
|
||||
|
||||
const jobList = await ocean.compute.status(account)
|
||||
console.log(jobList)
|
||||
const computeItemss = await Promise.all(
|
||||
jobList.map(async (job) => {
|
||||
jobList.map(async job => {
|
||||
if (!job) return
|
||||
try {
|
||||
|
||||
const { did } = await ocean.keeper.agreementStoreManager.getAgreement(
|
||||
const {
|
||||
did
|
||||
} = await ocean.keeper.agreementStoreManager.getAgreement(
|
||||
job.agreementId
|
||||
)
|
||||
console.log(did)
|
||||
if(did==='0x0000000000000000000000000000000000000000000000000000000000000000') return
|
||||
if (
|
||||
did ===
|
||||
'0x0000000000000000000000000000000000000000000000000000000000000000'
|
||||
)
|
||||
return
|
||||
const ddo = await ocean.assets.resolve(did)
|
||||
if (ddo) {
|
||||
|
||||
// Since we are getting assets from chain there might be
|
||||
// assets from other marketplaces. So return only those assets
|
||||
// whose serviceEndpoint contains the configured Aquarius URI.
|
||||
const metadata = findServiceByType(ddo,'metadata')
|
||||
console.log(did,metadata)
|
||||
if(!metadata) return
|
||||
const metadata = findServiceByType(ddo, 'metadata')
|
||||
console.log(did, metadata)
|
||||
if (!metadata) return
|
||||
const { serviceEndpoint } = metadata
|
||||
if (serviceEndpoint?.includes(config.aquariusUri)) {
|
||||
return { job, ddo }
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
|
||||
})
|
||||
)
|
||||
|
||||
const computeItems = computeItemss.filter(
|
||||
(value) => value !== undefined
|
||||
value => value !== undefined
|
||||
) as ComputeItem[] | undefined
|
||||
|
||||
// const computeItems = await getComputeItems()
|
||||
// const computeItems = await getComputeItems()
|
||||
console.log('compute items', computeItems)
|
||||
if (!computeItems) return
|
||||
const data = computeItems.map(item => {
|
||||
@ -148,15 +149,15 @@ export default function JobsList() {
|
||||
userAgreed ? (
|
||||
<Table data={jobList} columns={columns} />
|
||||
) : (
|
||||
<>
|
||||
<div>
|
||||
<Button primary onClick={getJobs}>
|
||||
Sign to retrieve jobs
|
||||
<>
|
||||
<div>
|
||||
<Button primary onClick={getJobs}>
|
||||
Sign to retrieve jobs
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
) : (
|
||||
<div>Connect your wallet to see your compute jobs.</div>
|
||||
)
|
||||
<div>Connect your wallet to see your compute jobs.</div>
|
||||
)
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ const AssetDetailsPageMeta = ({
|
||||
}) => {
|
||||
if (!attributes) return null
|
||||
|
||||
|
||||
const { ocean, balanceInOcean } = useOcean()
|
||||
const { datePublished } = attributes.main
|
||||
const {
|
||||
|
@ -36,8 +36,7 @@ export interface OceanConfig extends Config {
|
||||
// why is this partial?
|
||||
export const config: OceanConfig = {
|
||||
nodeUri: 'https://pacific.oceanprotocol.com',
|
||||
aquariusUri:
|
||||
'https://aquarius.marketplace.oceanprotocol.com',
|
||||
aquariusUri: 'https://aquarius.marketplace.oceanprotocol.com',
|
||||
brizoUri: 'https://brizo.marketplace.oceanprotocol.com',
|
||||
brizoAddress: '0x00c6A0BC5cD0078d6Cd0b659E8061B404cfa5704',
|
||||
secretStoreUri: 'https://secret-store.oceanprotocol.com',
|
||||
|
Loading…
Reference in New Issue
Block a user