Skip to content
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

Open
wants to merge 34 commits into
base: dev
Choose a base branch
from
Open

IPFS: Attach files and images in the chat #628

wants to merge 34 commits into from

Conversation

bludnic
Copy link
Member

@bludnic bludnic commented May 7, 2024

No description provided.

juliahermak and others added 26 commits March 28, 2024 05:50
feat(AChatAttachment): basic logic for interaction with Helia nodes
…-file-in-chat' into feat/info-service_health_check
Copy link

vercel bot commented May 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
adamant-im ❌ Failed (Inspect) May 27, 2024 11:52pm

@bludnic bludnic changed the title IPFS IPFS: Attach files and images in the chat May 7, 2024
Copy link

github-actions bot commented May 7, 2024

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'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const className = 'adm-nodes-table'
const className = 'ipfs-nodes-table'

Copy link
Member Author

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

Comment on lines 69 to 96
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
}
})
Copy link
Member Author

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

Copy link
Member Author

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.

Comment on lines +5 to +11
/**
* 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.
*/
Copy link
Member Author

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

@bludnic
Copy link
Member Author

bludnic commented May 24, 2024

@bludnic
Copy link
Member Author

bludnic commented May 24, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants