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

Config network #76

Merged
merged 8 commits into from Jun 13, 2023
Merged

Config network #76

merged 8 commits into from Jun 13, 2023

Conversation

zelfroster
Copy link
Contributor

Added features to set Dynamic DNS, configure TOR/I2P SOCKS Proxy from the webui.
Fixed some UI issues and refactored code.

Some issues are still there but not from webui, they need to be fixed/implemented on the libretroshare, probably.

@zelfroster
Copy link
Contributor Author

Here is what it looks like from the webui.
1686047390_Jun06_15:59:50

@zelfroster
Copy link
Contributor Author

Now, Everything is working perfectly. This PR is also ready for review.
1686334902_Jun09_23:51:42

Copy link
Member

@rottencandy rottencandy left a comment

Choose a reason for hiding this comment

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

Looks good, thanks

@zelfroster
Copy link
Contributor Author

Looks good, thanks

Thanks to you, And I had a question about mithril.js.
In config_network.js, line number 366, in main component Component.
We have two variables sslId and component and we are using oninit to fetch the data and store in the variables. So, I tried passing sslId and details to the other components as props from the main component, which were doing the same fetch call for sslId and details inside them using oninit.
But after fetching the data in the main Component, they didn't seem to update the props (variables). Since, after fetching only the view UI is redrawn, so I tried updating them in the view, but that resulted in an infinite re-rendering.

After researching, I found that, m.stream() could be used to have a state like functionality like what we have in React. But I think the version of mithril.js used in webui doesn't have m.stream() functionality.

Is there any way to do it, so we could make the code more reusable and reduce the number of data fetching? @rottencandy

@rottencandy
Copy link
Member

rottencandy commented Jun 12, 2023

Mithril has an automatic redrawing system that should trigger rerender once any m.request promise chain completes (which is what rsJsonApiRequest is using) but looks like in this case you're making nested calls so that might be the reason.
You could try promise-chaining the requests so that there are no nested requests.
If that doesn't work you could try manually triggering a rerender with m.redraw.

m.stream seems to be a separate package so you'll have to add it separately if you want to use it.

But I'm not entirely sure if nested calls is the reason, I'll also try to reproduce this and see if I can figure out what's happening.

@zelfroster
Copy link
Contributor Author

You could try promise-chaining the requests so that there are no nested requests. If that doesn't work you could try manually triggering a rerender with m.redraw.

I had already tried promise-chaining + manual rerender with m.redraw(). But It didn't work.

@csoler csoler merged commit 2846170 into RetroShare:master Jun 13, 2023
@zelfroster zelfroster mentioned this pull request Jun 13, 2023
@zelfroster zelfroster deleted the config-network branch June 13, 2023 09:04
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