Commit Graph

6 Commits

Author SHA1 Message Date
mpl 49b97b2244 server/camlistored/ui: use search.MapSort in map aspect
Also make use of the new "locrect" search predicate, which allows us to
drop support for raw query with coordinates.

Also revert for now to using the native leaflet markers instead of the
AwesomeMarkers icons, as something in their style seems to be interfering
badly with the UI.

Fixes #934

Change-Id: Idd85eeb42673c43a216bce81c26a6bff5ad0c08a
2017-08-01 02:04:32 +02:00
mpl e4b7db8274 server/camlistored/ui: improve map aspect search and markers
Notably:

-do not load any markers on an empty search query, because that would
mean loading absolutely all of the items with a location, which seems
like a bad idea.

-use different markers for different nodes. For now, foursquare
checkins, file images, and files have their own marker.

-vendor in https://github.com/lvoogdt/Leaflet.awesome-markers to achieve
the above, which relies on Font Awesome, which we already have in.
icons available for the markers: http://fontawesome.io/icons/

-when no location can be inferred from the search query, set the view to
encompass all markers that were drawn.

-when a location search is known, draw a rectangle representing the
results zone.

-use thumber for image in marker popup

-use title, if possible, instead of blobRef for link text in marker
popup

-switch to directly using OpenStreetMap tiles, instead of MapBox ones.

https://storage.googleapis.com/camlistore-screenshots/Screenshot_20170622-232359.png

Change-Id: Ibc84fa988aea8b8d3a2588ee8790adf6d9b5ad7a
2017-07-06 01:03:03 +02:00
mpl d2ced13e5e server/camlistored/ui: add map aspect
To display permanodes with a location on a map graphical interface (like
Google Maps, Open Street Map, etc).

Screenshots:
https://storage.googleapis.com/camlistore-screenshots/Screenshot_20170620-230922.png
https://storage.googleapis.com/camlistore-screenshots/Screenshot_20170620-231221.png
https://storage.googleapis.com/camlistore-screenshots/Screenshot_20170620-235006.png

Lots more features possible, but I think this is a good point to add it
as an mvp. TODOs in the code.

Using leaflet.js version 1.0.3, and tiles from mapbox.com (Open Street
Map).

Change-Id: Ib31610c122de633c5268174928c22c1cc481f388
2017-06-21 00:21:02 +02:00
mpl 77dfe8046d server/camlistored/ui: add "Share" feature
To share a file or directory through Camlistore's sharing
mechanism (https://camlistore.org/doc/sharing).

Only single-item sharing supported for now.

On success, the share URL is displayed in a dialog.
If the item is a file, it can be fetched with any HTTP client through
that URL. If the item is a dir, the share URL is of the claim, so one
must follow the transitive chain of sharing to get the directory's
children, i.e. use camget -shared.

Fixes #880

Change-Id: I324a684dec10225e5b8314dda7f1b77a0de6f727
2017-03-23 00:44:18 +01:00
mpl 71090f7c80 pkg/server: add files "zipper" to DownloadHandler
We want to add a feature for clients (the web UI), where they can select
a bunch of files and ask the server for a zip archive of all these files.

This CL modifies the DownloadHandler so it does exactly that upon
reception of a POST request with a query parameter of the form
files=sha1-foo,sha1-bar,sha1-baz

This CL also adds a new button to the contextual sidebar of the web UI,
that takes care of sending the download request to the server.

known limitations: only permanodes with file as camliContent are
accepted as a valid selection (i.e. no sets, or static-dirs, etc) for
now.

Implementation detail:
We're creating an ephemeral DOM form on the fly to send the request.
The reason is: if we sent it as a Go http request, we'd have to read
the response manually and then we'd have no way of writing it to disk.
If we did it with an xhr, we could write the response to disk by
creating a File or Blob and then using URL.createObjectURL(), but we'd
have to keep the response in memory while doing so, which is
unacceptable for large enough archives.

Fixes #899

Change-Id: I104f7c5bd10ab3369e28d33752380dd12b5b3e6b
2017-03-17 00:59:19 +01:00
mpl ceb5ea5b10 web UI: add "About" menu entry and dialog
This change adds an "About" entry to the header menu, that pops up an
"About" dialog when clicked on.

But, under this innocent sounding feature is actually a more important
change: this feature is partly added through the use of gopherjs
generated code. In addition, the element added (a menu item) is
integrated
seamlessly into the menu as a React element, thanks to the use of
github.com/myitcv/gopherjs/react.

pkg/env had to be broken with build tags, because importing
"cloud.google.com/go/compute/metadata" (or one of its deps) seems to be
breaking the generated javascript.
https://github.com/camlistore/camlistore/issues/904

github.com/myitcv/gopherjs/react at rev
c04b811da4a086defd882a94cc1901da2d2158b0

honnef.co/go/js/dom at rev 24aa052bc5c63cfb9383bf59493ee48621ca788c

Issue #904
Fixes #798

Change-Id: Ic09b94014d520277f8178727293787ece468babd
2017-03-07 00:24:07 +01:00