Commit graph

113 commits

Author SHA1 Message Date
Joey Hess
a498be7f98 renamed /status to /transfers
Also fixed a bug; the ident for the div was regnerated each time
/status was called. This only was the same as the original ident due to
luck.
2012-07-28 23:55:41 -04:00
Joey Hess
9b18dc2a39 tune javascript refresh delays
WebApp now shows changes with no delay. Comparing a running git-annex get
and the webapp side-by-side, they both show each new transfer at the same
time.
2012-07-28 21:25:56 -04:00
Joey Hess
6a9abf6526 add NotificationID to StatusR, and use it to block 2012-07-28 21:21:22 -04:00
Joey Hess
e31277d38a send notifications when the TransferQueue is changed
The fun part was making it move things from TransferQueue to currentTransfers
entirely atomically. Which will avoid inconsistent display if the WebApp
renders the current status at just the wrong time. STM to the rescue!
2012-07-28 18:47:24 -04:00
Joey Hess
3cc1885793 move DaemonStatus manipulation out of the Annex monad to IO
I've convinced myself that nothing in DaemonStatus can deadlock,
as it always keepts the TMVar full. That was the only reason it was in the
Annex monad.
2012-07-28 18:02:11 -04:00
Joey Hess
a17fde22fa add a NotificationBroadcaster to DaemonStatus
First use of it is to make the status checkpointer thread block until
there is really a change to the status.
2012-07-28 16:09:34 -04:00
Joey Hess
c0ca6f44ac template reorg 2012-07-27 20:47:48 -04:00
Joey Hess
ecd63e2981 template cleanup
use julius's nice #id and .class things
2012-07-27 20:25:28 -04:00
Joey Hess
7717501fee add alert close buttons 2012-07-27 16:28:00 -04:00
Joey Hess
02ec8ea012 much better webapp startup of the assistant
This avoids forking another process, avoids polling, fixes a race,
and avoids a rare forkProcess thread hang that I saw once time
when starting the webapp.
2012-07-27 15:33:24 -04:00
Joey Hess
0f6292920a webapp now displays the real running and queued transfers
yowza!!!
2012-07-27 11:47:34 -04:00
Joey Hess
7e3c1e008d webapp now uses twitter bootstrap
mocked up the main screen, and am actually pretty happy with it!
2012-07-27 04:48:50 -04:00
Joey Hess
1983ca2852 added jquery to static site
Had to switch to toWaiAppPlain to avoid a seeming bug in toWaiApp;
chromium only received a partial copy of jquery. Always the same length
each time, which makes me think it's a bug in the compression, although
a bug in the autohead middleware is also a possibility.

Anyway, there's little need for compression for a local webapp. Not wasting
time compressing things is probably a net gain.

Similarly, I've not worried about minifying this yet. Although that would
avoid bloating the git-annex binary quite so much.
2012-07-26 23:55:51 -04:00
Joey Hess
615dc09ffc use widgetFile 2012-07-26 22:54:31 -04:00
Joey Hess
e40f94cbcd add threadState member, will need this later to access the daemonStatus 2012-07-26 21:51:56 -04:00
Joey Hess
f5ef46d01e cleaned up refreshing code into a widget
Very happy to have a reusable autoUpdate widget that can make any Yesod
widget automatically refresh!

Also added support for non-javascript browsers, falling back to meta
refresh.

Also, the home page is now rendered with the webapp status on it, before
any refreshing is done.
2012-07-26 21:03:46 -04:00
Joey Hess
9fd03c65f9 webapp now does long polling
The webapp is now a constantly updating clock! I accomplished this amazing
feat using "long polling", with some jquery and a little custom java
script.

There are more modern techniques, but this one works everywhere.
2012-07-26 17:56:24 -04:00
Joey Hess
95f4b192f0 on second thought, the session cookie is still useful to support setMessage 2012-07-26 12:41:20 -04:00
Joey Hess
a453be4195 disable client session cookie 2012-07-26 12:10:53 -04:00
Joey Hess
b89b801567 update 2012-07-26 05:20:52 -04:00
Joey Hess
9d6b59d0e2 use the secret token for authentication, and add to all dynamic urls 2012-07-26 04:50:09 -04:00
Joey Hess
b36804d648 generate random token and launch webapp using it 2012-07-26 03:38:20 -04:00
Joey Hess
3ac2cf09e5 added a custom defaultLayout, static site, and favicon
Broke hamlet out into standalone files.

I don't like the favicon display; it should be served from /favicon.ico,
but I could only get the static site to serve /static/favicon.ico, so
I had to use a <link rel=icon> to pull it in. I looked at
Yesod.Default.Handlers.getFaviconR, but it doesn't seem to embed
the favicon into the binary?
2012-07-26 02:45:01 -04:00
Joey Hess
6a8540c1a2 tweak 2012-07-26 00:39:25 -04:00
Joey Hess
805d50c69d use hamlet at least for the static html 2012-07-25 23:50:29 -04:00
Joey Hess
1ffef3ad75 git annex webapp now opens a browser to the webapp
Also, starts the assistant if it wasn't already running.
2012-07-25 23:13:01 -04:00
Joey Hess
e6ce54de82 build fixes 2012-07-25 22:04:10 -04:00
Joey Hess
32d3cffc4c run yesod, and launch webapp on startup 2012-07-25 21:26:13 -04:00
Joey Hess
95c80b6440 laziness fix
Now scanning runs fully interleaved with transferring.
2012-07-25 14:54:09 -04:00
Joey Hess
b665ffe36f implement simple working copy based scan
Works.. could be more efficient.
2012-07-25 14:16:53 -04:00
Joey Hess
2b7f9c8442 fix including of remote in TransferInfo when queueing new transfers 2012-07-25 14:02:50 -04:00
Joey Hess
a9dbfdf28d better transfer queue management
Allow transfers to be added with blocking until the queue is sufficiently
small.

Better control over which end of the queue to add a transfer to.
2012-07-25 13:12:34 -04:00
Joey Hess
6107328a6b avoid spawning new transfer thread until a slot becomes available 2012-07-25 12:07:30 -04:00
Joey Hess
522f568450 add TransferScanner thread
Efficiently finding transfers that need to be done to get two repos back
in sync seems like an interesting problem.
2012-07-22 23:16:56 -04:00
Joey Hess
26e4e65307 filter out special remotes when pulling 2012-07-22 15:09:40 -04:00
Joey Hess
e4f714d1be pull from newly mounted git remotes 2012-07-22 15:06:18 -04:00
Joey Hess
b48d7747a3 debugging improvements
add timestamps to debug messages

Add lots of debug output in the assistant's threads.
2012-07-20 19:29:59 -04:00
Joey Hess
42e73537d1 detect KDE automounting
Best dbus events I could find were setupDone from org.kde.Solid.Device.
There may be some spurious events, but that's ok, the code will only
check to see if new mounts are available.

It does not try to auto-start this service if it's not running.
2012-07-20 18:14:57 -04:00
Joey Hess
2fce3940b5 catch all errors 2012-07-20 02:16:09 -04:00
Joey Hess
d9f26115c3 use dbus to activate GduVolumeMonitor if it's not already running 2012-07-20 01:59:21 -04:00
Joey Hess
6b4fe507f6 only use dbus when there's a client connected we know will send mount events 2012-07-19 23:34:33 -04:00
Joey Hess
0496a3971d store whole Mntents
This way, if a mount point was already mounted, but something else
gets mounted there, it'll be seen as a new mount.
2012-07-19 21:25:26 -04:00
Joey Hess
107a7b9388 try to make Utility.Mounts portable
This is an unholy mashup, but it just might work. It works on Linux,
that's all I've tested. :)
2012-07-19 20:38:58 -04:00
Joey Hess
f20a40f9d4 MountWatcher thread
Currently only prints mount points when mounts happen.
2012-07-19 13:04:33 -04:00
Joey Hess
cf47bb3f50 run file transfers in threads, not processes
This should fix OSX/BSD issues with not noticing transfer information
files with kqueue. Now that threads are used, the thread can manage the
transfer slot allocation and deallocation by itself; much cleaner.
2012-07-18 19:15:34 -04:00
Joey Hess
eea0a3616c add thread id field to transferinfo
Also converted its timestand to posix seconds, like is used in the other
log files.
2012-07-18 18:42:41 -04:00
Joey Hess
f520a2c103 add missing imports 2012-07-18 18:29:33 -04:00
Joey Hess
c34d8ae088 avoid enqueing downloads from remotes that don't have the key 2012-07-17 12:17:01 -04:00
Joey Hess
b7d3cefde9 merge two shouldTransfer checks 2012-07-17 12:06:35 -04:00
Joey Hess
c8691d76aa bugfix 2012-07-07 11:17:20 -06:00