Skip to content

Commit

Permalink
Merge branch 'main' into mvp1
Browse files Browse the repository at this point in the history
  • Loading branch information
CoNETProject authored Dec 17, 2023
2 parents f29005b + 1a9946c commit f88be0a
Show file tree
Hide file tree
Showing 19 changed files with 575 additions and 11 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@tippyjs/react": "^4.2.6",
"dayjs": "^1.11.10",
"framer-motion": "^10.16.16",

"get-port": "^7.0.0",
"react-draggable": "^4.4.6",
"react-hot-toast": "^2.4.1",
Expand Down Expand Up @@ -91,6 +92,7 @@
"react-dom": "^18.2.0",
"react-icons": "^4.12.0",
"react-intl": "^6.5.5",

"react-redux": "^9.0.4",
"react-scripts": "^5.0.1",
"styled-components": "^6.1.1",
Expand Down
11 changes: 10 additions & 1 deletion src/API/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import {v4} from 'uuid'
import {logger} from '../components/App/logger'
import useAppState from "../store/appState/useAppState"

import store from '../store/store'

type WorkerCommandErrorType = 'NOT_READY'|'INVALID_DATA'|
Expand Down Expand Up @@ -184,6 +185,7 @@ export const testLocalServer = async () => {
return null
}


const postMessage = (cmd: WorkerCommand, close: boolean, resolve: any, Callback?:(err: string, data: string[]) => void) => {

const channel = new BroadcastChannel(channelWrokerListenName)
Expand All @@ -202,6 +204,7 @@ const postMessage = (cmd: WorkerCommand, close: boolean, resolve: any, Callback
// 'searchPage.tsx', 'checkLinkedUrl ifram is NULL'
return logger ('class CONET_Platfrom_API', `listeningChannel JSON.parse(data) Error`)
}

if (close) {
listenChannel.close()
}
Expand All @@ -223,7 +226,6 @@ const postMessage = (cmd: WorkerCommand, close: boolean, resolve: any, Callback
return Callback('', cmd.data)
}
return console.log (`postMessage Callback && resolve all null`, cmd.data)

}

listenChannel.addEventListener('message', kk)
Expand All @@ -249,6 +251,7 @@ export const getCONETBalance: () => Promise < StartWorkerResolveForAPI > = () =>
uuid: v4()
}
return postMessage (cmd, true, resolve)

})
}

Expand All @@ -260,6 +263,7 @@ export const setRegion: (region: regionType) => Promise < StartWorkerResolveForA
data: [region]
}
return postMessage (cmd, true, resolve)

})
}

Expand All @@ -281,6 +285,7 @@ export const getRegiestNodes : () => Promise < StartWorkerResolveForAPI > = () =
uuid: v4(),
data: []
}

return postMessage (cmd, true, resolve)
})
}
Expand All @@ -293,7 +298,9 @@ export const createPasscode : (passcord: string, local: string) => Promise < Sta
uuid: v4(),
data: [passcord, local]
}

return postMessage (cmd, true, resolve)

})
}

Expand All @@ -304,7 +311,9 @@ export const getIPaddress: () => Promise < StartWorkerResolveForAPI > = () => {
uuid: v4(),
data: []
}

return postMessage (cmd, true, resolve)

})
}

Expand Down
8 changes: 7 additions & 1 deletion src/components/App/Apps/CONET-Proxy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const regions: regionType = {
fr: false
}


const ChromeImg = styled.img`
width: 50%;
`
Expand All @@ -43,7 +44,6 @@ const IOSImg = styled.img`
width: 100%;
`


const OneLineText = styled.span`
`
interface TabPanelProps {
Expand Down Expand Up @@ -584,13 +584,16 @@ const LaunchPage = () => {

const {
locale,


setlocalDaemon
} = useAppState()

const intl = useIntl()

useEffect(() => {


const fetchData = async() => {

const test = await testLocalServer ()
Expand All @@ -605,6 +608,7 @@ const LaunchPage = () => {
fetchData()
return () => { active = false }


}, [])
//
// const conetToken = currentProfile().tokens.conet
Expand Down Expand Up @@ -632,7 +636,9 @@ const LaunchPage = () => {
{ intl.formatMessage({id:'platform.proxy.FeatureArea5.moreDetail'})}
</Typography>
</Link>

<Link target="_blank" href={'https://github.com/CoNET-project/seguro-platform/issues'}>

<Typography variant="subtitle1" sx={{ color: '#2e7d32'}}>
{ intl.formatMessage({id:'platform.proxy.issueReport'})}
</Typography>
Expand Down
3 changes: 3 additions & 0 deletions src/components/App/Apps/dashboard/UnLockWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,17 @@ const UnLockWallet = () => {
}

return (

<Stack alignItems="center" justifyContent='center' sx={{width: '100%', height: '100%', marginTop:'-10rem'}}>

<Stack direction="column" alignItems="center" justifyContent='center'>
<Slide direction="right" in={true} mountOnEnter >
<Typography variant="h5" sx={{paddingBottom: '2rem'}}>
{ intl.formatMessage({id:'platform.overlay.unlocking'})}
</Typography>
</Slide>
<Slide direction="left" in={true} mountOnEnter >

<Paper sx={{ p: '2px 4px', display: 'flex', alignItems: 'center', width: '80%', marginBottom: '2rem' , borderRadius: '2rem'}} elevation={1}>
<InputBase
sx={{width: '100%', ml: 1, flex: 1, fontSize: '1rem' , padding:'0.7rem 0.5rem 0.5rem 1rem'}}
Expand Down
5 changes: 5 additions & 0 deletions src/components/App/Apps/dashboard/index-next.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import NoDaemon from '../../NoDaemon/index'
import Proxy from '../CONET-Proxy/index'
import Miner from '../miner/index'
import ManageProfiles from '../../PlatformModal/ManageProfiles/ManageProfiles' //"..//ManageProfiles/ManageProfiles"

import ProfileDropdown from '../../../UI/Dropdowns/ProfileDropdown/ProfileDropdown'
import Container from '@mui/material/Container'
interface StyledTabsProps {
Expand Down Expand Up @@ -91,7 +92,9 @@ type action = {
const actions: action[] = [
{ icon: <SvgIcon component={JP} inheritViewBox/>, name: 'ja-JP' },
{ icon: <SvgIcon component={CN} inheritViewBox/>, name: 'zh-CN' },

// { icon: <SvgIcon component={TW} inheritViewBox/>, name: 'zh-TW' },

{ icon: <SvgIcon component={US} inheritViewBox/>, name: 'en-US' }
]

Expand Down Expand Up @@ -132,6 +135,7 @@ const DashBoard = () => {
isInitializing,
setShowAppStore,
locale,

isModalOpen,
setLocale,

Expand Down Expand Up @@ -180,6 +184,7 @@ const DashBoard = () => {
}

const MenuSideBar = () => {


const animeCONET = () => {
return (
Expand Down
30 changes: 29 additions & 1 deletion src/components/App/Apps/miner/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@

import { styled } from '@mui/material/styles'
import { useIntl } from "react-intl"

import {Grid, CircularProgress, styled as materialStyled, TableContainer, Table, TableHead, TableRow, TableCell, TableBody} from '@mui/material'


import styledCom from "styled-components"
import Paper from '@mui/material/Paper'
import Box from '@mui/material/Box'

import CloudQueueIcon from '@mui/icons-material/CloudQueue'
import Slide from '@mui/material/Slide'
import Typography from '@mui/material/Typography'
import useAppState from "../../../../store/appState/useAppState"
import miner2 from '../../../../assets/miner/FancyNyan.webp'
import minerPause from '../../../../assets/miner/FancyNyanPause.png'
import {Stack, Link, IconButton, SvgIcon} from '@mui/material'

import Fab from '@mui/material/Fab'
import CallMissedOutgoingIcon from '@mui/icons-material/CallMissedOutgoing'
import DriveFolderUploadIcon from '@mui/icons-material/DriveFolderUpload'
import DnsIcon from '@mui/icons-material/Dns'

import React, {useState, useEffect} from "react"
import {getCONETBalance, startLiveness, stopLiveness} from '../../../../API/index'
import {logger} from '../../logger'
Expand All @@ -33,13 +38,15 @@ const StyleDiv = styledCom.div`
`

const cntp_address = '0x0f43685B2cB08b9FB8Ca1D981fF078C22Fec84c5'

const BoostImg = styledCom.img`
width: 7rem;
`

const ItemStyle = styled(Paper)(() => ({
textAlign: 'center',
borderRadius: '1rem',

padding: '0.5rem',
height: '4rem'
}))
Expand All @@ -52,14 +59,14 @@ const ItemStyle3 = styled(Paper)(() => ({
}))



const ItemStyle2 = styled(Paper)(() => ({
textAlign: 'center',
borderRadius: '1rem',
padding: '1rem',
color: grey[500]
}))


const CloudNode = ( check: boolean, setcheck: React.Dispatch<React.SetStateAction<boolean>>) => {
const intl = useIntl()

Expand Down Expand Up @@ -171,6 +178,7 @@ const CloudNode = ( check: boolean, setcheck: React.Dispatch<React.SetStateActio
}

const Bandwidth = ( check: boolean, setcheck: React.Dispatch<React.SetStateAction<boolean>>) => {

const intl = useIntl()

return (
Expand Down Expand Up @@ -199,6 +207,7 @@ const Bandwidth = ( check: boolean, setcheck: React.Dispatch<React.SetStateActio
variant="outlined" size="large"
disabled
sx={{fontFamily:'inherit'}}>

{ intl.formatMessage({id: 'platform.joinUS.forDeveloper.button'})}
</Button>
</ItemStyle2>
Expand All @@ -207,7 +216,9 @@ const Bandwidth = ( check: boolean, setcheck: React.Dispatch<React.SetStateActio
)
}


const SaaS = (check: boolean,setcheck: React.Dispatch<React.SetStateAction<boolean>>) => {

const intl = useIntl()
return (
<Grid item>
Expand All @@ -232,9 +243,11 @@ const SaaS = (check: boolean,setcheck: React.Dispatch<React.SetStateAction<boole

</Typography>
<Button

variant="outlined" size="large"
disabled
sx={{fontFamily:'inherit' }}>

{ intl.formatMessage({id: 'platform.joinUS.forDeveloper.button'})}
</Button>
</ItemStyle2>
Expand All @@ -243,7 +256,9 @@ const SaaS = (check: boolean,setcheck: React.Dispatch<React.SetStateAction<boole
)
}


const Storage = (check: boolean,setcheck: React.Dispatch<React.SetStateAction<boolean>>) => {

const intl = useIntl()

return (
Expand All @@ -265,13 +280,15 @@ const Storage = (check: boolean,setcheck: React.Dispatch<React.SetStateAction<bo
<Typography variant="h5" sx={{ fontWeight: '900', textAlign:'center', color: grey[500] }}>
{intl.formatMessage({id:'platform.joinUS.miner.storage'})}
</Typography>

<Typography variant="body1" sx={{ textAlign:'center', color: grey[500]}}>
{intl.formatMessage({id:'platform.joinUS.miner.storageDetail'})}
</Typography>
<Button
variant="outlined"
disabled
sx={{ fontFamily:'inherit' }}>

{ intl.formatMessage({id: 'platform.joinUS.forDeveloper.button'})}
</Button>
</ItemStyle2>
Expand All @@ -283,8 +300,10 @@ const Storage = (check: boolean,setcheck: React.Dispatch<React.SetStateAction<bo
const Boost = (CONET_balance: number, setBoost: React.Dispatch<React.SetStateAction<boolean>>) => {
const intl = useIntl()
return (

<Grid item >
<Box sx={{paddingTop: '4rem'}}>


<Paper sx={{ borderRadius: '1rem'}}>

Expand All @@ -300,6 +319,7 @@ const Boost = (CONET_balance: number, setBoost: React.Dispatch<React.SetStateAct
{intl.formatMessage({id: 'platform.miner.register.boost.detail'})}
</Typography>
<Button

variant="outlined"
disabled
sx={{fontFamily:'inherit', margin: '2rem' }}>
Expand Down Expand Up @@ -346,6 +366,7 @@ const CustomTabPanel = (props: TabPanelProps) => {
)
}


const currentProfile = () => {
const workerService = getWorkerService()
if (workerService.data.passcode.status === 'LOCKED') {
Expand Down Expand Up @@ -535,6 +556,7 @@ const Community = (CNTP: string, setCNTP:(v: string) => void, setTodayCNTP:(v: s
const NodeProvider = () => {
const [value, setValue] = React.useState(0)


const [check1, setcheck1] = useState(false)
const [check2, setcheck2] = useState(false)
const [check3, setcheck3] = useState(false)
Expand Down Expand Up @@ -570,6 +592,7 @@ const NodeProvider = () => {
variant="scrollable"
scrollButtons
allowScrollButtonsMobile>

<Tab label={intl.formatMessage({id: 'platform.joinUS.miner.cloudTitle'})} {...a11yProps(0)} />
<Tab label={intl.formatMessage({id: 'platform.joinUS.miner.Bandwidth'})} {...a11yProps(1)} />
<Tab label={intl.formatMessage({id: 'platform.joinUS.miner.SaaS'})} {...a11yProps(2)} />
Expand All @@ -585,12 +608,15 @@ const NodeProvider = () => {
<CustomTabPanel value={value} index={1}>
<Slide direction={animei} in={value===1} mountOnEnter unmountOnExit>
{Bandwidth(check1,setcheck1)}

</Slide>

</CustomTabPanel>
<CustomTabPanel value={value} index={2}>
<Slide direction={animei} in={value===2} mountOnEnter unmountOnExit>

{SaaS(check2, setcheck2)}

</Slide>

</CustomTabPanel>
Expand All @@ -601,6 +627,7 @@ const NodeProvider = () => {

</CustomTabPanel>


</Grid>
</Grid>
)
Expand Down Expand Up @@ -768,6 +795,7 @@ const DashBoardpanel = (cntp: string, todayCNTP: string) => {
const Miner = () => {
const {
locale,

} = useAppState()

const [minerReward, setMinerReward] = useState(0)
Expand Down
Loading

0 comments on commit f88be0a

Please sign in to comment.