Skip to content

Commit

Permalink
v1.2.1-rc2 (#189)
Browse files Browse the repository at this point in the history
* feat: add vscode config

* update ui

* update font

* update ui

* fix docker build

* fix build error

* fix build error

* fix build error

* fix build error

* fix build error

* add template for uploading wasm

* update the api for uploading wasm

* fix the api for uploading wasm

* update modal desc (#181)

* update modal desc

* hide widget label

* update operator address

* update ui

---------

Co-authored-by: uu-z <ncysatnaf@gmail.com>

* fix build error

* update modal input size

* perf(lab): lazy import lab

* disable editor minimap (#184)

* v1.2.1-rc1 (#182)

* feat: add vscode config

* update ui

* update font

* update ui

* fix docker build

* fix build error

* fix build error

* fix build error

* fix build error

* fix build error

* add template for uploading wasm

* update the api for uploading wasm

* fix the api for uploading wasm

* update modal desc (#181)

* update modal desc

* hide widget label

* update operator address

* update ui

---------

Co-authored-by: uu-z <ncysatnaf@gmail.com>

* fix build error

* update modal input size

---------

Co-authored-by: DLHTX <949729789@qq.com>
Co-authored-by: DLHTX <35157091+DLHTX@users.noreply.github.com>
Co-authored-by: osdodo <osdodo@qq.com>
Co-authored-by: MORTAL <mortaldodo@proton.me>

* disable editor minimap

---------

Co-authored-by: uuz <ncysatnaf@gmail.com>
Co-authored-by: DLHTX <949729789@qq.com>
Co-authored-by: DLHTX <35157091+DLHTX@users.noreply.github.com>
Co-authored-by: MORTAL <mortaldodo@proton.me>

* set default sql (#185)

* v1.2.1-rc1 (#182)

* feat: add vscode config

* update ui

* update font

* update ui

* fix docker build

* fix build error

* fix build error

* fix build error

* fix build error

* fix build error

* add template for uploading wasm

* update the api for uploading wasm

* fix the api for uploading wasm

* update modal desc (#181)

* update modal desc

* hide widget label

* update operator address

* update ui

---------

Co-authored-by: uu-z <ncysatnaf@gmail.com>

* fix build error

* update modal input size

---------

Co-authored-by: DLHTX <949729789@qq.com>
Co-authored-by: DLHTX <35157091+DLHTX@users.noreply.github.com>
Co-authored-by: osdodo <osdodo@qq.com>
Co-authored-by: MORTAL <mortaldodo@proton.me>

* set default sql

---------

Co-authored-by: uuz <ncysatnaf@gmail.com>
Co-authored-by: DLHTX <949729789@qq.com>
Co-authored-by: DLHTX <35157091+DLHTX@users.noreply.github.com>
Co-authored-by: MORTAL <mortaldodo@proton.me>

* call polling immediately after sending an event message (#186)

* v1.2.1-rc1 (#182)

* feat: add vscode config

* update ui

* update font

* update ui

* fix docker build

* fix build error

* fix build error

* fix build error

* fix build error

* fix build error

* add template for uploading wasm

* update the api for uploading wasm

* fix the api for uploading wasm

* update modal desc (#181)

* update modal desc

* hide widget label

* update operator address

* update ui

---------

Co-authored-by: uu-z <ncysatnaf@gmail.com>

* fix build error

* update modal input size

---------

Co-authored-by: DLHTX <949729789@qq.com>
Co-authored-by: DLHTX <35157091+DLHTX@users.noreply.github.com>
Co-authored-by: osdodo <osdodo@qq.com>
Co-authored-by: MORTAL <mortaldodo@proton.me>

* call polling immediately after sending an event message

---------

Co-authored-by: uuz <ncysatnaf@gmail.com>
Co-authored-by: DLHTX <949729789@qq.com>
Co-authored-by: DLHTX <35157091+DLHTX@users.noreply.github.com>
Co-authored-by: MORTAL <mortaldodo@proton.me>

* fix metrics

* update metries

* Lang en (#187)

* update error msg

* update error msg

* update toast

* update metrics

* update metrics

* fix build error

* update ui

* display content based on zoom level (#188)

* update editor widget

* update project card

* update ui

* fix LiveIcon

* improve flow node data editing

* fix indentation of t_iot.json

* update the language selector of the editor widget

* update paging status after writing table data

* update ui

* fix the information in the wallet button

* update ui

* update ui

* update ui

* update ui

* update ui

* Squashed commit of the following:

commit 406e410
Author: uuz <ncysatnaf@gmail.com>
Date:   Wed May 24 15:51:45 2023 +0800

    v1.2.1-rc1 (#182)

    * feat: add vscode config

    * update ui

    * update font

    * update ui

    * fix docker build

    * fix build error

    * fix build error

    * fix build error

    * fix build error

    * fix build error

    * add template for uploading wasm

    * update the api for uploading wasm

    * fix the api for uploading wasm

    * update modal desc (#181)

    * update modal desc

    * hide widget label

    * update operator address

    * update ui

    ---------

    Co-authored-by: uu-z <ncysatnaf@gmail.com>

    * fix build error

    * update modal input size

    ---------

    Co-authored-by: DLHTX <949729789@qq.com>
    Co-authored-by: DLHTX <35157091+DLHTX@users.noreply.github.com>
    Co-authored-by: osdodo <osdodo@qq.com>
    Co-authored-by: MORTAL <mortaldodo@proton.me>

---------

Co-authored-by: DLHTX <949729789@qq.com>
Co-authored-by: DLHTX <35157091+DLHTX@users.noreply.github.com>
Co-authored-by: osdodo <osdodo@qq.com>
Co-authored-by: MORTAL <mortaldodo@proton.me>
  • Loading branch information
5 people authored May 25, 2023
1 parent 406e410 commit 4714f87
Show file tree
Hide file tree
Showing 57 changed files with 855 additions and 611 deletions.
3 changes: 2 additions & 1 deletion src/components/DeveloperIDE/DeveloperDBTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const DeveloperDBTable = () => {

return (
<Flex pos="relative" w="100%" minH={'calc(100vh - 158px)'} >
<Box w="300px" minH={'100%'} paddingBottom={'100px'} border="1px solid rgba(230, 230, 230, 0.75)" borderRadius="8px">
<Box w="240px" minH={'100%'} paddingBottom={'100px'} border="1px solid rgba(230, 230, 230, 0.75)" borderRadius="8px">
<DBTableSideBar />
</Box>
<Box ml="20px" flex={1} borderRadius="8px">
Expand All @@ -23,6 +23,7 @@ const DeveloperDBTable = () => {
position="relative"
cursor="pointer"
onClick={() => {
w3s.dbTable.setDefaultSQL();
w3s.dbTable.setMode('QUERY_SQL');
}}
>
Expand Down
16 changes: 10 additions & 6 deletions src/components/DeveloperIDE/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { defaultButtonStyle } from '@/lib/theme';
import StarCount from '@/components/IDE/StarCount';
import { WalletConnectButton } from '@/components/WalletConnectButton';
import { MdRefresh } from 'react-icons/md';
import toast from 'react-hot-toast';

const getTabIndex = (showContent) => {
if (showContent === 'PROJECTS') {
Expand Down Expand Up @@ -51,7 +52,7 @@ const Header = observer(() => {
cursor={'pointer'}
>
<Image w="30px" src="/favicon.svg" alt="logo" />
<Text ml="10px" fontWeight={700}>
<Text ml="10px" fontWeight={600}>
w3bstream Devnet
</Text>
</Flex>
Expand Down Expand Up @@ -102,15 +103,18 @@ const Header = observer(() => {
</Tabs>
</Flex>
<Flex flex={{ base: 1, md: 'auto' }} justify="flex-end" alignItems="center">
<Button
{/* <Button
ml="auto"
size="sm"
onClick={(e) => {
w3s.init();
size="md"
bg="#F3F3F3"
borderRadius={100}
onClick={async(e) => {
await w3s.init();
toast.success('Refreshed');
}}
>
<MdRefresh />
</Button>
</Button> */}
{/* <ChakraLink href="https://github.com/machinefi/w3bstream-studio" isExternal>
<Image mr="20px" w="100px" src="https://img.shields.io/github/stars/machinefi/w3bstream-studio.svg?style=social&label=Star&maxAge=2592000" />
</ChakraLink> */}
Expand Down
3 changes: 1 addition & 2 deletions src/components/DeveloperIDE/Labs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React, { useEffect } from 'react';
import React, { useEffect } from 'react';
import { Flex, Box } from '@chakra-ui/react';
import { observer } from 'mobx-react-lite';
import { FilesItem } from '@/components/IDE/SideBar/filesItem';
import Editor from '@/components/IDE/Editor';
import { useStore } from '@/store/index';
import { SqlDB } from '@/server/wasmvm/sqldb';

const Labs = () => {
const { w3s } = useStore();
Expand Down
11 changes: 1 addition & 10 deletions src/components/DeveloperIDE/Metrics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,7 @@ const Metrics = () => {
w3s: { metrics }
} = useStore();

useEffect(() => {
const now = new Date();
now.setMinutes(0);
now.setSeconds(0);
now.setMilliseconds(0);
const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000)
metrics.activeDevices.call(yesterday, now);
metrics.dataMessages.call(yesterday, now);
metrics.blockchainTransaction.call(yesterday, now);
}, []);
metrics.use()

return (
<Box w="100%">
Expand Down
92 changes: 51 additions & 41 deletions src/components/DeveloperIDE/Projects/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import toast from 'react-hot-toast';
import { INSTANCE_STATUS } from '@/components/JSONTable/FieldRender';
import { MdRefresh } from 'react-icons/md';
import { FaFileImport } from 'react-icons/fa';
import { ImArrowUpRight2 } from 'react-icons/im';

const Projects = observer(() => {
const {
w3s,
base: { confirm }
base: { confirm },
lang: { t }
} = useStore();
const { allProjects, selectedNames } = w3s.project;

Expand All @@ -29,15 +31,15 @@ const Projects = observer(() => {
leftIcon={<AiOutlinePlus />}
{...defaultButtonStyle}
onClick={() => {
w3s.project.createProjectForDeleveloper();
w3s.project.createProjectForDeveloper.call();
}}
>
Create New Project
</Button>
<Button
ml="20px"
size="sm"
leftIcon={w3s.project.importProject.loading.value ? <Spinner size='sm' color="#946FFF" /> : <Icon as={FaFileImport} />}
leftIcon={w3s.project.importProject.loading.value ? <Spinner size="sm" color="#946FFF" /> : <Icon as={FaFileImport} />}
{...defaultOutlineButtonStyle}
onClick={() => {
w3s.project.importProject.call();
Expand All @@ -54,7 +56,7 @@ const Projects = observer(() => {
onClick={async () => {
await allProjects.call();
w3s.projectManager.sync();
toast.success('Reloaded');
toast.success(t('success.reloaded.msg'));
}}
>
Refresh
Expand All @@ -79,7 +81,7 @@ const Projects = observer(() => {
}
w3s.project.resetSelectedNames();
eventBus.emit('project.delete');
toast.success('Deleted successfully');
toast.success(t('success.delete.msg'));
}
});
}}
Expand Down Expand Up @@ -107,15 +109,15 @@ const Projects = observer(() => {
err = error.message;
}
} else {
err = 'Instance not found';
err = t('error.pause.msg');
}
}
if (err) {
toast.error('Instance not found');
toast.error(t('error.pause.msg'));
} else {
w3s.project.resetSelectedNames();
eventBus.emit('instance.handle');
toast.success('Suspended successfully');
toast.success(t('success.pause.msg'));
}
}}
>
Expand Down Expand Up @@ -151,15 +153,16 @@ const Projects = observer(() => {
});
}
}}
display="flex"
flexDirection={'column'}
>
<Flex alignItems="center" justifyContent="space-between">
<Flex alignItems="center" mr="5px">
<Box fontWeight={700} fontSize="16px">
{project.name}
</Box>
<Badge ml="10px" variant="outline" colorScheme={status.colorScheme} textTransform="none">
{status.text}
</Badge>
<Flex fontWeight={600} fontSize="16px" color={'rgba(15, 15, 15, 0.75)'} alignItems={'center'} gap="10px">
<Text>{project.name} </Text>
<ImArrowUpRight2 fontSize={14} color="#946FFF" />
</Flex>

{!instance && (
<Button
ml="20px"
Expand All @@ -178,6 +181,7 @@ const Projects = observer(() => {
</Button>
)}
</Flex>

<Flex
onClick={(e) => {
e.stopPropagation();
Expand Down Expand Up @@ -214,28 +218,29 @@ const Projects = observer(() => {
0
</Box>
</Flex> */}
<Flex mt="20px" flexWrap="wrap">
<Flex mt="10px" flexWrap="wrap" flex="1">
{project.f_description &&
project.f_description.split(',').map((tag) => {
return (
<Box key={tag} mb="5px" mr="5px" p="5px 10px" alignItems="center" color="#000" fontSize="xs" border="1px solid #EDEDED" borderRadius="6px">
<Box key={tag} mb="5px" mr="5px" p="5px 10px" alignItems="center" color="#946FFF" fontSize="xs" bg="#F2EEFF" borderRadius="6px">
{tag}
</Box>
);
})}
</Flex>

<Flex mt="10px" justifyContent="flex-end">
<Flex mt="10px" justifyContent="space-between">
<Flex color={status.color} alignItems="center">
<Box w="6px" h="6px" bg={status.color} mr="6px" borderRadius="50%"></Box>{' '}
<Text fontWeight={400} fontSize={'12px'}>
{status.text}
</Text>
</Flex>
{instance && (
<>
<Flex alignItems={'center'}>
{instance.f_state === 2 ? (
<Icon
ml="20px"
as={AiOutlinePauseCircle}
boxSize={'1rem'}
color="#946FFF"
cursor="pointer"
_hover={{ color: '#7D44FF' }}
<Flex
alignItems={'center'}
onClick={async (e) => {
e.stopPropagation();
try {
Expand All @@ -244,18 +249,18 @@ const Projects = observer(() => {
url: `/api/w3bapp/deploy/${instance.f_instance_id}/HUNGUP`
});
eventBus.emit('instance.handle');
toast.success('Successfully suspended');
} catch (error) { }
toast.success(t('success.suspended.msg'));
} catch (error) {}
}}
/>
>
<Icon ml="20px" as={AiOutlinePauseCircle} boxSize={'1.25rem'} color="#946FFF" cursor="pointer" _hover={{ color: '#7D44FF' }} />
<Text ml="10px" fontSize={14} color={'#946FFF'}>
Pause
</Text>
</Flex>
) : (
<Icon
ml="14px"
as={AiOutlinePlayCircle}
boxSize={'1rem'}
color="#946FFF"
cursor="pointer"
_hover={{ color: '#7D44FF' }}
<Flex
alignItems={'center'}
onClick={async (e) => {
e.stopPropagation();
try {
Expand All @@ -264,12 +269,17 @@ const Projects = observer(() => {
url: `/api/w3bapp/deploy/${instance.f_instance_id}/START`
});
eventBus.emit('instance.handle');
toast.success('Successfully started');
} catch (error) { }
toast.success(t('success.started.msg'));
} catch (error) {}
}}
/>
>
<Icon ml="14px" as={AiOutlinePlayCircle} boxSize={'1.25rem'} color="#946FFF" cursor="pointer" _hover={{ color: '#7D44FF' }} />
<Text ml="10px" fontSize={14} color={'#946FFF'}>
Start
</Text>
</Flex>
)}
</>
</Flex>
)}
</Flex>
</GridItem>
Expand Down Expand Up @@ -297,15 +307,15 @@ const Projects = observer(() => {
size={'md'}
{...defaultButtonStyle}
onClick={() => {
w3s.project.createProjectForDeleveloper();
w3s.project.createProjectForDeveloper.call();
}}
>
Create a project now
</Button>
<Button
ml="20px"
size={'md'}
leftIcon={w3s.project.importProject.loading.value ? <Spinner size='sm' color="#946FFF" /> : <Icon as={FaFileImport} />}
leftIcon={w3s.project.importProject.loading.value ? <Spinner size="sm" color="#946FFF" /> : <Icon as={FaFileImport} />}
{...defaultOutlineButtonStyle}
onClick={() => {
w3s.project.importProject.call();
Expand Down
17 changes: 9 additions & 8 deletions src/components/DeveloperIDE/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,20 @@ const Settings = () => {
</Flex>
</Flex>
<Box mt="10px" p="20px" border="1px solid #eee" borderRadius="8px">
<Text fontSize={'18px'} fontWeight={700}>
<Text fontSize={'18px'} fontWeight={600}>
General
</Text>
<Divider my="15px" />
<Divider my="10px" />
{datas.map((item) => {
return (
<Flex alignItems={'center'} mb="20px">
<Flex fontWeight={'bold'} fontSize="14px" alignItems={'center'} color="#0F0F0F" minWidth={150} textAlign={'left'}>
{item.title} {item.tips && <Tooltip label='The operator account is randomly generated and assigned to your project. It is used by W3bstream to sign transaction is that your applet sends to the blockchain. Please ensure that you fund this address with the tokens required for gas on the destination chain to which you are se nding your transactions.' placement='right'>
<Flex fontWeight={'500'} fontSize="14px" alignItems={'center'} color="blackAlpha.900" minWidth={150} textAlign={'left'}>
<Text>{item.title}</Text>
{item.tips && <Tooltip label='The operator account is randomly generated and assigned to your project. It is used by W3bstream to sign transaction that your applet sends to the blockchain. Please ensure that you fund this address with the tokens required for gas on the destination chain to which you are sending your transactions.' placement='right'>
<Box cursor={'pointer'}><FaRegQuestionCircle color='#797878' fontSize={14} style={{margin: 5}} /></Box>
</Tooltip>}:
</Flex>
<Text ml="10px" fontSize={'14px'} color="#0F0F0F">
<Text ml="10px" fontSize={'14px'} color="blackAlpha.700" >
{item.value}
</Text>
{item.extra}
Expand All @@ -145,8 +146,8 @@ const Settings = () => {
<Stack mt="10px" p="20px" border="1px solid #F9CFCE" borderRadius="8px">
<Flex justifyContent="space-between" alignItems="center">
<Stack>
<Box fontWeight={700}>Delete this project</Box>
<Box fontWeight={400} color="#7a7a7a" fontSize={"14px"}>Deleting a project is permanent and will erase all database data, triggers, and events routing. Please proceed with caution.</Box>
<Text fontWeight={600}>Delete this project</Text>
<Text fontWeight={400} color="#7a7a7a" fontSize={"14px"}>Deleting a project is permanent and will erase all database data, triggers, and events routing. Please proceed with caution.</Text>
</Stack>
<Button
ml="20px"
Expand Down Expand Up @@ -174,7 +175,7 @@ const Settings = () => {
});
}}
>
Delete this project
<Text>Delete this project</Text>
</Button>
</Flex>
</Stack>
Expand Down
16 changes: 12 additions & 4 deletions src/components/DeveloperIDE/ToolBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import toast from 'react-hot-toast';
interface ToolBar extends BoxProps {}

const ToolBar = (props: ToolBar) => {
const { w3s } = useStore();
const { w3s, lang:{t} } = useStore();
const { onOpen, onClose, isOpen } = useDisclosure();

const curProjectInstance = w3s.instances.table.dataSource.find((option) => option.project_name === w3s.project.curProject?.name);
const curProjectStatus = INSTANCE_STATUS[curProjectInstance?.f_state || 0];

return (
<Box position={'fixed'} h="100%" overflow={'auto'}>
<Flex minW="200px" direction="column" align="center" p="14px" bg="#fff" {...props}>
<Flex minW="200px" h="100%" direction="column" align="center" p="14px" bg="#fff" {...props}>
<Popover isOpen={isOpen} onOpen={onOpen} onClose={onClose}>
<PopoverTrigger >
<Flex w="168px" cursor={'pointer'} borderRadius={'8px'} px="14px" py="8px" alignItems={'center'} mb="20px" border={'1px solid #EDEDED'}>
Expand Down Expand Up @@ -58,8 +58,16 @@ const ToolBar = (props: ToolBar) => {
if (instance) {
w3s.project.allProjects.onSelect(index);
w3s.showContent = 'METRICS';
const now = new Date();
now.setMinutes(0);
now.setSeconds(0);
now.setMilliseconds(0);
const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000)
w3s.metrics.activeDevices.call(yesterday, now);
w3s.metrics.dataMessages.call(yesterday, now);
w3s.metrics.blockchainTransaction.call(yesterday, now);
} else {
toast.error('No instance found, please create one first');
toast.error(t('error.change.project.msg'));
}
onClose();
}}
Expand Down Expand Up @@ -126,7 +134,7 @@ const ToolBar = (props: ToolBar) => {
}}
>
<Icon as={TbHandClick} boxSize={5} />
<Box ml="15px" fontSize="16px">
<Box ml="15px" fontSize="14px">
Events
</Box>
</Flex>
Expand Down
Loading

0 comments on commit 4714f87

Please sign in to comment.