Coder Social home page Coder Social logo

Comments (16)

AudriusButkevicius avatar AudriusButkevicius commented on June 9, 2024

Can you check if the web ui shows correct data?

from syncthing-gtk.

AudriusButkevicius avatar AudriusButkevicius commented on June 9, 2024

Also the rates in the web ui changed units, hence why there could be discrepancies.

from syncthing-gtk.

 avatar commented on June 9, 2024

@AudriusButkevicius

Sorry for the delay ... xmas, xmas family dinner and stuff got in the way ... ;)

The WebUI shows me the the correct amount of data received (~18.5GB) and the correct amount of data sent (~21.4MB) in the box on the top/right. The "box" for the corresponding repo also reflects the correct count of files as well as the correct overall size (same is true for all the other repos configured).

Speaking about bugs ... lately Windows (both, W7SP1x64 and W8.1x64 fully updated) started throwing memory access violations when I shutdown/reboot the system without terminating syncthing (the daemon, not the UI) first (by exiting STGTK therefore also quitting the daemon). STGTK also caused the same issue with 0.5.1, but that went away with 0.5.3; now it's only syncthing. Just to be clear - the memory access violation error doesn't happen when I exit manually, it only happens when syncthing runs and I reboot/shutdown the system (or let a installer issue a reboot to activate changes). I think that started as you switched to Go 1.4, but don't quote me on that.

from syncthing-gtk.

kozec avatar kozec commented on June 9, 2024

Hi there and sorry for late response (holidays and stuff) If there were any change in webui / api, this could be caused by them. I'll check what could gone wrong, but probably not this year :-)

from syncthing-gtk.

 avatar commented on June 9, 2024

Don't worry, we're in no particular rush and STGTK still serves the purpose of starting/stopping syncthing itself very well. There's still the WebUI to look at when stats are of importance.

So, take your time and let me wish you a Happy New Year in advance (I won't be near a computer till January 3rd or 4th).

from syncthing-gtk.

kozec avatar kozec commented on June 9, 2024

@AudriusButkevicius Can you, please, direct me to some doc / commit on how were units changed? ST-GTK does unit conversion as well, so it probably displays values in microbits right now :D

Edit: Probably this one? syncthing/syncthing@34cb305

from syncthing-gtk.

AudriusButkevicius avatar AudriusButkevicius commented on June 9, 2024

I am sure there was another one called Harmonize units, but I cannot seem to find it anymore.
But this is the right one I guess.

Edit: Nvm the ticket it closed had the word harmonize, so yes, this is the one.

from syncthing-gtk.

kozec avatar kozec commented on June 9, 2024

Ok, I pretty-much copied code from syncthingController.js source and now ST-GTK gives roundly same rates as WebUI does.

It's probably impossible to get identical values at any given time, as refresh rates of WebUI and ST-GTK are different and sampled at different times, but that shouldn't be a big problem. Thanks to delays in HTTP response is neither value 100% accurate anyway :)

from syncthing-gtk.

 avatar commented on June 9, 2024

I wouldn't worry about the transfer rate values being non-identical between the web ui and the app - as you said they are rough estimates anyway, and polling more frequently only increases overall load (to draw a somewhat related comparison: Torrent clients usually poll / refresh the UI in 1000ms intervals by default).

Speaking about: A more direct API to Syncthing would be a nice thing to have... having to wrap around the HTTP interface is not a very elegant solution.

However, one thing that popped into mind while tinkering around in C# (should be doable in Python/GTK as well) ...
If we already wrap around the HTTP interface, why don't we simply do it losely like some other closed-source P2P synchronizer, who shall remain unnamed, does: create a customized "asset" for the WebUI (to trim it down to some sane-sized layout so it would fit nice and snuggly into a not-too-overly-large window) and render that in an app window through an integrated render engine (i.e. webkit, gecko - to not depend on the horror that is IE/Trident). Starting/Stopping the daemon remains the same ... and ... auto-update plus daemon config also remains the same ... the only thing that effectively changes is that the UI is, more-or-less, passed-through through a custom asset, and that way it would even be possible to setup a "Monitor other instances" on remote systems to where the user has access. I'd like to give that idea a try (early stage of development leaves some freedom for experiments).

from syncthing-gtk.

kozec avatar kozec commented on June 9, 2024

@JochenB

some other closed-source P2P synchronizer, who shall remain unnamed

Unnamed and thus unrecognized :D Sorry, I only used Dropbox before Syncthing.

I see three problems with "customized webapp in browser frame" approach:

1st, it's much more resource-heavy. Browser frame will end taking CPU and memory for application plus original WebUI.
2nd, it prevents UI from accessing daemon that is not made ready for it. Just starting Syncthing as rc.d service would break UI completely.
And third, it's very, very limited. Even "browse directory" menu would be problematic (although probably not impossible) from javascript...

// edit: In fact, I'm experimenting with Aero glass theme on Windows right now and that's plainly impossible to use with webkit/gecko rendering as well :(

from syncthing-gtk.

AudriusButkevicius avatar AudriusButkevicius commented on June 9, 2024

@JochenB I have a proof of concept of that in C# using CefSharp in case you are interested messing around with it.
Never finished it though.

from syncthing-gtk.

 avatar commented on June 9, 2024

@kozec

Unnamed and thus unrecognized :D Sorry, I only used Dropbox before Syncthing.

The software I mean is "BTSync". With their v1.4 trainwreck (which drove a good amount of users over to Syncthing) they render the interface through IE/Trident (therefore making IE8+ mandatory on Windows) so they don't need to employ manly coding monkeys (though they formerly had a very nice C++ control interface they simply did away with).

I see three problems with "customized webapp in browser frame" approach:
1st, it's much more resource-heavy. Browser frame will end taking CPU and memory for application plus original WebUI.

Not really. It only increases the installation size due to having to ship the internal render engine (not much of a problem with Linux where gecko/xulrunner is part of a Cinnamon/Gnome3/MATE/Unity install anyway) - though, let's be honest ... who cares about a couple of MB at the days and and age of Terabyte drives? As for being more resource heavy: It's just the render engine (the very core part that renders HTML/CSS and executes JavaScript/AJAX), doesn't really hog resources as there's no full-blown browser framework glued around it. That's orders of magnitude below the usage and resource.-hogginess of Firefox or Chrome (we're talking a few MB RAM usage here, not several hundred of MB).

2nd, it prevents UI from accessing daemon that is not made ready for it. Just starting Syncthing as rc.d service would break UI completely.

That sounds more like a Linux specific headache than a cross-platform headache (syncthing doesn't come as a Service on Windows, you need "messing about with Windows" skills or third party tools to strap syncthing in as a Service.

And third, it's very, very limited. Even "browse directory" menu would be problematic (although probably not impossible) from javascript...

"Browse Directory"? You got somethin' cookin' there? Unless I miss out on something there's no "Open repo directory" button in STGTK yet. ;)

However, firing up explorer.exe (on Windows, obviously) with the corresponding repo directory is a piece of cake... just a slightly unholy mess because Java(Script).

@AudriusButkevicius

Well, I love to look through pieces of code to maybe find the one or another inspiration or "better practice" idea ... at the moment I'm just toying around in Visual Studio with a "bare skeleton concept" to a) try to replicate STGTK in C# so kozec can be freed from maintaining "the_hell" ;) and b) throwing around some ideas to maybe cough up a better UI (like "why not do it the 'BTSync' way and simply render the UI through custom assets and some regex magic oneself").

If you want to share the code ZIP the VS project up and put it on some file host.

Mono would actually be the way to go if kozec would know C#, but I dare to bet the Mono idea will most likely only get me "yea, let's depend on 100MB+ of patent-encumbered dependecies on Linux" complaint. ;) ducks

Anyhow, I'll pursue the "embed the HTML UI" idea for a few days to see how problematic it would really be (by keeping the "Browse repo" idea in mind).

from syncthing-gtk.

kozec avatar kozec commented on June 9, 2024

@JochenB

"Browse Directory"? You got somethin' cookin' there? Unless I miss out on something there's no "Open repo directory" button in STGTK yet. ;)

True, there is no such button, but it's last option in context menu. Just right-click on folder and select Browse ;-)
But yeah, I guess there is some method how to call native method from javascript running in browser frame, so it may be not as big problem as I imagine.

By the way, after porting is done, it's not that big problem to maintain windows port. And I had "THE_HELL" variable resreved for Ubuntu actually :D

Using Mono + WindowsForm on Linux Windows is pretty-much same mess as using GTK on Windows, so although I know some of C#, it's not way I would go for multiplatform app.

from syncthing-gtk.

 avatar commented on June 9, 2024

True, there is no such button, but it's last option in context menu. Just right-click on folder and select Browse ;-)

Whoa... I totally missed out on that. X-|

By the way, after porting is done, it's not that big problem to maintain windows port. And I had "THE_HELL" variable resreved for Ubuntu actually :D

I was only browsing through your sources on the surface... seems I misunderstood that "if" (thought it would refer to Windows). Though... Ubuntu isn't as bad... once you use Linux Mint (Cinnamon) - or Ubuntu with Cinnamon instead of Unity - all of that "UI Hell" headache goes away.

from syncthing-gtk.

AudriusButkevicius avatar AudriusButkevicius commented on June 9, 2024

@kozec most browser components (even the shitty WinForms built-in one which relies on IE) have some way of injecting a javascript object to the browser window which when accessed bubbles through to native code (C# in my case).

Further, CefSharp has a way to manipulate the Dom, so what I did, was wrote my own angular controller which I then at load time replaced syncthings controller with which then called methods on this "injected" object which as a result triggered stuff in the native code.

I did it a while ago so some of what I said might be my imagination, but I'll put it up on github for hackery inspiration.

EDIT: I actually used Awesomium rather than CefSharp.

from syncthing-gtk.

AudriusButkevicius avatar AudriusButkevicius commented on June 9, 2024

https://github.com/AudriusButkevicius/syncthing4windows

from syncthing-gtk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.