Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ pages.db-shm
pages.db-wal
.idea
node_modules
.vscode
.vscode
update.md
aquafier.db
Binary file removed aquafier.db
Binary file not shown.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
services:
aqua-container:
# image: ghcr.io/inblockio/aqua-container:github-action
image: ghcr.io/inblockio/aqua-container:main
pull_policy: always
# build:
Expand Down
14 changes: 7 additions & 7 deletions src/controllers/api_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,11 @@ pub async fn explorer_aqua_file_upload(
}
};

tracing::debug!(
"Processing aqua upload Account {} - File data {:#?} ",
account,
aqua_json,
);
// tracing::debug!(
// "Processing aqua upload Account {} - File data {:#?} ",
// account,
// aqua_json,
// );

let mut mode = "private".to_string();
let file_mode = env::var("FILE_MODE").unwrap_or_default();
Expand All @@ -461,7 +461,7 @@ pub async fn explorer_aqua_file_upload(
let chain: Option<&HashChain> = aqua_json.pages.get(0);

if (chain.is_none()) {
tracing::error!("Aqua JSON data erorr first chain not found");
// tracing::error!("Aqua JSON data erorr first chain not found");
res.logs
.push("Aqua data data erorr first chain not found".to_string());
return (StatusCode::BAD_REQUEST, Json(res));
Expand All @@ -481,7 +481,7 @@ pub async fn explorer_aqua_file_upload(
}
});
if (genesis_revision.is_none()) {
tracing::error!("Aqua JSON data erorr genesis revision not found");
// tracing::error!("Aqua JSON data erorr genesis revision not found");
res.logs
.push("Aqua data data erorr genesis revision not found".to_string());
return (StatusCode::BAD_REQUEST, Json(res));
Expand Down
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ async fn status_handler() -> Json<serde_json::Value> {
///
/// The react js project shows example of how the aqua protocol can be utilised it
/// enables generation of aqua chain json file, witnessing and validation of the qua chain file
#[tokio::main]
// #[tokio::main]
#[tokio::main(flavor = "multi_thread", worker_threads = 4)]
async fn main() {
tracing_subscriber::fmt()
.with_max_level(tracing::Level::DEBUG)
Expand Down Expand Up @@ -145,7 +146,7 @@ async fn main() {
.with_state(server_database)
.layer(CorsLayer::permissive())
.layer(TraceLayer::new_for_http())
.layer(DefaultBodyLimit::max(20 * 1024 * 1024));
.layer(DefaultBodyLimit::max(50 * 1024 * 1024));

let listener = tokio::net::TcpListener::bind("0.0.0.0:3600")
.await
Expand Down
4 changes: 2 additions & 2 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/images/ico.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Inblock PKC</title>
<title>Aquafier</title>
</head>
<body>
<div id="root"></div>
Expand Down
Binary file added web/public/images/ico.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion web/public/vite.svg

This file was deleted.

130 changes: 65 additions & 65 deletions web/src/components/Stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,67 +18,68 @@ interface IStatistic {

const Statistic = (props: IStatistic) => {

// <StatRoot shadow={'sm'} borderRadius={'xl'} px={'4'} py="6" h={'100%'}>
// <Group>
// <Box>
// <Image src={props.image} w={'60px'} h={'60px'} />
// </Box>
// <VStack gap={0} alignItems={'start'}>
// <Text fontWeight={500} fontSize={'xl'}>{props.title}</Text>
// <StatLabel fontWeight={400} fontSize={'small'}>{props.tagline}</StatLabel>
// </VStack>
// </Group>
// <StatHelpText mt={'2'} fontWeight={400} fontSize={'medium'} display={'inline-flex'}>
// {props.size}
// <LuDot />
// {`${props.files} Files`}
// </StatHelpText>
// </StatRoot>
// <StatRoot shadow={'sm'} borderRadius={'xl'} px={'4'} py="6" h={'100%'}>
// <Group>
// <Box>
// <Image src={props.image} w={'60px'} h={'60px'} />
// </Box>
// <VStack gap={0} alignItems={'start'}>
// <Text fontWeight={500} fontSize={'xl'}>{props.title}</Text>
// <StatLabel fontWeight={400} fontSize={'small'}>{props.tagline}</StatLabel>
// </VStack>
// </Group>
// <StatHelpText mt={'2'} fontWeight={400} fontSize={'medium'} display={'inline-flex'}>
// {props.size}
// <LuDot />
// {`${props.files} Files`}
// </StatHelpText>
// </StatRoot>
return (
<StatRoot
shadow={'sm'}
borderRadius={'xl'}
px={'4'}
py="6"
h={'100%'}
>
<Group align="center" gap="md">
<Box
display="flex"
alignItems="center"
justifyContent="center"
w={'60px'}
h={'60px'}
borderRadius="md"
>
<Image
src={props.image}
alt={`${props.title} icon`}
objectFit="contain"
w={'100%'}
h={'100%'}
maxWidth={'60px'}
maxHeight={'60px'}
/>
</Box>
<VStack gap={0} alignItems={'start'} flex={1}>
<Text fontWeight={500} fontSize={'xl'}>{props.title}</Text>
<StatLabel fontWeight={400} fontSize={'small'}>{props.tagline}</StatLabel>
</VStack>
</Group>
<StatHelpText
mt={'2'}
fontWeight={400}
fontSize={'medium'}
display={'inline-flex'}
alignItems="center"
<StatRoot
shadow={'sm'}
borderRadius={'xl'}
px={'4'}
py="6"
h={'100%'}
>
{props.size}
<LuDot />
{`${props.files} Files`}
</StatHelpText>
</StatRoot>

<Group align="center" gap="md">
<Box
display="flex"
alignItems="center"
justifyContent="center"
w={{ base: '40px', md: '60px' }}
h={{ base: '40px', md: '60px' }}
overflow={"hidden"}
borderRadius="md"
>
<Image
src={props.image}
alt={`${props.title} icon`}
objectFit="contain"
w={'100%'}
h={'100%'}
maxWidth={'60px'}
maxHeight={'60px'}
/>
</Box>
<VStack gap={0} alignItems={'start'} flex={1}>
<Text fontWeight={500} fontSize={'xl'}>{props.title}</Text>
<StatLabel fontWeight={400} fontSize={'small'}>{props.tagline}</StatLabel>
</VStack>
</Group>
<StatHelpText
mt={'2'}
fontWeight={400}
fontSize={'medium'}
display={'inline-flex'}
alignItems="center"
>
{props.size}
<LuDot />
{`${props.files} Files`}
</StatHelpText>
</StatRoot>

)
}

Expand Down Expand Up @@ -112,15 +113,14 @@ const getFileTypeProportions = (files: ApiFileInfo[]) => {
}

// Handle potential division by zero or NaN scenarios
const percentage = totalFilesSize > 0
const percentage = totalFilesSize > 0
? (size / totalFilesSize * 100)
: 0;

const usingText = `Using ${
isNaN(percentage)
? "0.00"
const usingText = `Using ${isNaN(percentage)
? "0.00"
: percentage.toFixed(2)
}% of storage`
}% of storage`

const hSize = humanReadableFileSize(size)

Expand All @@ -140,7 +140,7 @@ const getFileTypeProportions = (files: ApiFileInfo[]) => {
export default function Statistics() {
const { files } = useStore(appStore)
const storageUsage = getFileTypeProportions(files)

return (
<SimpleGrid columns={{ base: 2, md: 2, lg: 4 }} gapX={'4'} gapY={'4'}>
<GridItem>
Expand Down
14 changes: 7 additions & 7 deletions web/src/components/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ const LoadConfiguration = () => {
formData.append('nonce', nonce);

const url = `${backend_url}/fetch_nonce_session`;
console.log("url is ", url)
console.log("url is ", url)
const response = await axios.post(url, formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});

if (response.status === 200) {
const url2 = `${backend_url}/explorer_files`;
const url2 = `${backend_url}/explorer_files`;
const _address = response.data?.address
if (_address) {
const address = ethers.getAddress(_address)
Expand Down Expand Up @@ -53,16 +53,16 @@ const LoadConfiguration = () => {
setAvatar(undefined)
setFiles([])
} else {
console.log("An error from the api ", error);
console.log("An error from the api ", error);
}
}
}

const fetchUserProfile = async (address: string) => {

const url = `${backend_url}/explorer_fetch_user_profile`;
console.log("url is ", url);
const url = `${backend_url}/explorer_fetch_user_profile`;
console.log("url is ", url);

const response = await axios.get(url, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
Expand Down Expand Up @@ -92,7 +92,7 @@ console.log("An error from the api ", error);
type: "info",
})
}
}, []);
}, [backend_url]);

// useEffect(() => {
// //fetch user profile
Expand Down
6 changes: 3 additions & 3 deletions web/src/components/ui/navigation/CustomDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ItemDetail = ({ label, value, displayValue, showCopyIcon }: IItemDetail) =
<Group>
<Text>{label}</Text>
<Group>
<Text fontFamily={"monospace"}>{displayValue}</Text>
<Text fontFamily={"monospace"} textWrap={'wrap'} wordBreak={'break-word'}>{displayValue}</Text>
<ClipboardRoot value={value} hidden={!showCopyIcon}>
<ClipboardIconButton size={'xs'} />
</ClipboardRoot>
Expand Down Expand Up @@ -337,7 +337,7 @@ const ChainDetails = ({ fileInfo }: IPageDataDetails) => {
<DrawerHeader bg={{ base: verificationResult ? verificationResult?.successful ? 'green.100' : 'red.100' : 'rgb(188 220 255 / 22%)', _dark: verificationResult ? verificationResult?.successful ? 'green.900' : 'red.900' : 'rgba(0, 0, 0, 0.3)' }}>
<DrawerTitle>{pageData?.pages[0]?.title}</DrawerTitle>
</DrawerHeader>
<DrawerBody py={'lg'}>
<DrawerBody py={'lg'} px={1}>
<Card.Root border={'none'} shadow={'md'} borderRadius={'xl'}>
<Card.Body>
<FilePreview fileInfo={fileInfo} />
Expand All @@ -363,7 +363,7 @@ const ChainDetails = ({ fileInfo }: IPageDataDetails) => {
{/* )}
</For> */}
</DrawerBody>
<DrawerFooter>
<DrawerFooter flexWrap={'wrap'}>
<DrawerActionTrigger asChild>
<Button variant="outline" size={'sm'}>Close</Button>
</DrawerActionTrigger>
Expand Down
11 changes: 6 additions & 5 deletions web/src/components/ui/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const fileModes = createListCollection({
})

const SettingsForm = () => {
const { setUserProfile, user_profile , backend_url} = useStore(appStore)
const { setUserProfile, user_profile , backend_url, metamaskAddress} = useStore(appStore)
const [activeNetwork, setActiveNetwork] = useState<string>(user_profile.network)
const [domain, setDomain] = useState<string>(user_profile.domain)
const [mode, setMode] = useState<string>(user_profile.fileMode)
Expand All @@ -36,14 +36,15 @@ const SettingsForm = () => {
const updateUserProfile = async () => {
const formData = new URLSearchParams();
formData.append('chain', activeNetwork);
formData.append('domain', domain);
formData.append('mode', mode);
formData.append('contract', contract);
formData.append('domain_name', domain);
formData.append('file_mode', mode);
formData.append('contract_address', contract);
formData.append("address", metamaskAddress ?? "")
formData.append('theme', 'light');


const url = `${backend_url}/explorer_update_user_profile`;
console.log("url is ", url);

const response = await axios.post(url, formData, {
headers: {
// 'Content-Type': 'application/x-www-form-urlencoded'
Expand Down
Loading
Loading