-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPFS: Attach files and images in the chat #628
base: dev
Are you sure you want to change the base?
Conversation
…nts. Work in progress
feat(AChatAttachment): basic logic for interaction with Helia nodes
…-file-in-chat' into feat/info-service_health_check
…-service_health_check
…download_and_upload_files
Feat/download and upload files
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Deployed to https://msg-adamant-pr-628.surge.sh 🚀 |
import IpfsNodesTableItem from './IpfsNodesTableItem.vue' | ||
import { sortNodesFn } from '@/components/nodes/utils/sortNodesFn' | ||
|
||
const className = 'adm-nodes-table' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const className = 'adm-nodes-table' | |
const className = 'ipfs-nodes-table' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add this selector in <style> block. Leave empty if no styles
const computedResult = computed(() => { | ||
const baseUrl = new URL(url.value) | ||
const protocol = baseUrl.protocol | ||
const hostname = baseUrl.hostname | ||
const port = baseUrl.port | ||
const result = /^[\d.]+$/.test(hostname) | ||
|
||
let nodeName = null | ||
let domain = null | ||
|
||
if (!result) { | ||
const regex = /([^.]*)\.(.*)/ | ||
const parts = hostname.match(regex) | ||
if (parts !== null) { | ||
nodeName = parts[1] | ||
domain = parts[2] | ||
} | ||
} | ||
|
||
return { | ||
protocol, | ||
hostname, | ||
nodeName, | ||
domain, | ||
result, | ||
port | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you convert this part into a hook and reuse it in both components: IpfsNodesTableItem.vue
and AdmNodesTableItem.vue
?
Example of usage:
const { protocol, hostname, nodeName, domain, result, port } = useNodeUrl(url);
Put the hook in src/components/nodes/hooks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's important not to lose the reactivity of protocol
, hostname
, etc., after destructuring. You probably need to use toRefs
inside the hook.
/** | ||
* Provides methods for calling the ADAMANT API. | ||
* | ||
* The `ApiClient` instance automatically selects an ADAMANT node to | ||
* send the API-requests to and switches to another node if the current one | ||
* is not available at the moment. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update JSDoc: ADAMANT API -> IPFS NODE API
No description provided.