Commit graph

507 commits

Author SHA1 Message Date
Aditya Dewan
9502741590 tdf#107278 admin console: adding graph to track CPU load
Change-Id: Idb07fe4139dd639a49ce1545cc15895f74876b06
Reviewed-on: https://gerrit.libreoffice.org/38425
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-06-08 12:58:12 +02:00
Jan Holesovsky
fe6ad56241 The arrows in Next / Prev don't show for me.
Using it this way looks very fragile to me; let's just avoid this.

Change-Id: I7459f3b215f5f9930287566a1bd946a94e9b343b
Reviewed-on: https://gerrit.libreoffice.org/38512
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-06-07 16:12:44 +02:00
Pranav Kant
3867bbe56e Allow adding custom buttons to our toolbar from host; save result resp.
... with no functionality attached to it except notifying the WOPI host
that button was clicked. Host is supposed to do the action thereafter
itself.

Also, notify the host when a save succeeds or fails.

Change-Id: I0daa2690af2259233840ea7ab4326b9b80d5fa87
2017-06-07 13:19:12 +05:30
Pranav Kant
ee026723ed Bin redundant code
Change-Id: Id691052e343cea73f3dec512ee6f4d4960f9614b
2017-06-07 10:15:54 +05:30
Pranav Kant
4711debd9a Some error strings tweaks
Change-Id: I8ce174dfc6d67f467770c1c9804f2bf830fedaf7
2017-06-07 10:15:54 +05:30
Pranav Kant
71387065e8 This should be obsolete after PostMessage API and WOPI
In richdocuments, it was added in aa0a8f666ada8f1d1edae17b906089cc03ba473d
and then removed in 87f7720d12e130bd1c3cd9306ad1b1f4d784f9e6

It was added firstly way before WOPI was even there. But now since we
have WOPI, we wouldn't need it.

Change-Id: I786a3f7b2103a43995a70b53438d88a829d13265
2017-06-05 15:41:05 +05:30
Aditya Dewan
ccca292d7d tdf#97020 Adding find&replace functionality
Change-Id: I4d8d22368e6f8ee85873c86f9e80fbdffc2ad17a
Reviewed-on: https://gerrit.libreoffice.org/38287
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-06-05 11:54:59 +02:00
Ashod Nakashian
80b6e97824 Set EverModified on saving the document
When saving while editing a cell, the
document is saved with the new cell contents
(as the cell editing is interrupted and applied),
but the modified status is not published to the
client (loleaflet).

This has the unfortunate side-effect that the
EverModified flag is not set in this scenario.

To avoid this, this patch sets the EverModified
upon successful saving. This is easier than
forcing LO Core to emit ModifiedStatus=true
in the scenario above. Though it suffers from
the false-positive result when the user forces
a save. Although this is probably defensible,
since technically the document changes upon
saving (though not the content if there was
nothing new to save). On the other hand,
it's less harmful to signal modification
due to save than to ignore genuine
modification to the document.

Change-Id: I7ccba62731f534b69819f7924eeb9231d874c111
Reviewed-on: https://gerrit.libreoffice.org/38398
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-05 06:52:24 +02:00
Michael Meeks
eeaf436d53 Admin: show cumulative bandwidth sent / recv'd over all time.
Change-Id: I3f9f398d1de19d54e0aa4c51bc44c597019dc839
2017-06-03 22:53:57 +01:00
Pranav Kant
ba4e75cfae Inform all clients when document changed behind our back
Introduce a new header X-LOOL-WOPI-Timestamp

This is a WOPI header extension to detect any external document change. For
example, when the file that is already opened by LOOL is changed
in storage.

The WOPI host sends LastModifiedTime field (in WOPI specs) as part
of the CheckFileInfo response. It also expects wsd to send the
same timestamp in X-LOOL-WOPI-Timestamp header during WOPI::PutFile. If
this header is present, then WOPI host checks, before saving the
document, if the timestamp in the header is equal to the timestamp of
the file in its storage. Only upon meeting this condition, it saves the
file back to storage, otherwise it informs us about some change
to the document.

We are supposed to inform the user accordingly. If user is okay
with over-writing the document, then we can omit sending
X-LOOL-WOPI-Timestamp header, in which case, no check as mentioned above
would be performed while saving the file and document will be
overwritten.

Also, use a separate list of LOOL status codes to denote such a change.
It would be wrong to use HTTP_CONFLICT status code for denoting doc
changed in storage scenario. WOPI specs reserves that for WOPI locks
which are not yet implemented. Better to use a separate LOOL specific
status codes synced across WOPI hosts and us to denote scenario that we
expect and are not covered in WOPI specs.

Change-Id: I61539dfae672bc104b8008f030f96e90f9ff48a5
2017-06-01 16:17:07 +05:30
Ashod Nakashian
935abfacd9 loleaflet: user avatar-specific css for the user list
Change-Id: I5540c3267efcb23513d7df25427af8a8ff0d8909
Reviewed-on: https://gerrit.libreoffice.org/38293
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-06-01 12:40:53 +02:00
Ashod Nakashian
a59f78b656 wsd: UserExtraInfo is a map, not array
Change-Id: I64ef04c96223ee74099697cb2276307d834db329
Reviewed-on: https://gerrit.libreoffice.org/38291
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-01 07:48:15 +02:00
Pranav Kant
d840e8720a Handle WOPI PutFile unauthorized access token
Change-Id: I29ee8cc0c9f3ea42f70628eca6f74d161d1a38f9
2017-05-31 12:08:31 +05:30
Pranav Kant
ac8e458bda User save should terminate edit in calc; and save if unmodified
Only autosave should do the opposite which it already does in
DocumentBroker.

Change-Id: Ibb86e0b29fc058318de96d2684c326dbe958e6fb
2017-05-31 11:27:14 +05:30
Ashod Nakashian
d0ac8a4b96 loleaflet: add user avatar to useritem
Change-Id: I0b366ab4b92fb9b1d5f7aa0ea6fe51ac9897bdce
Reviewed-on: https://gerrit.libreoffice.org/38121
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-29 06:45:58 +02:00
Aditya Dewan
66a3e1c273 tdf#106449 Admin console: adding user list
Change-Id: I41b15c6a73fa61c21ef5ab79de149b445014c99a
Reviewed-on: https://gerrit.libreoffice.org/38017
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-27 07:08:25 +02:00
Jan Holesovsky
82704ed777 loleaflet: Let's not use a 'disableabout' param.
Instead, just disable the Help -> About choice if the 'about-dialog' div was
removed from loleaflet.html.

Change-Id: I997aa5489bcfbd02f56feb79bea14e92d3666bf2
2017-05-26 10:18:05 +02:00
Jan Holesovsky
9aecf428f6 Revert "wsd: enable option to remove About dialog elements"
The request was meant the other way around; let's just not present "About" in
the menu when there is no element with "about-dialog" id.

This reverts commit b9305d17ce.
2017-05-26 10:03:33 +02:00
Henry Castro
b9305d17ce wsd: enable option to remove About dialog elements
Change-Id: I33c351cbc7373255a22f44cb31e53f21a00869bf
2017-05-25 17:43:11 -04:00
Marco Cecchetti
061c720ee1 loleaflet: calc: styles are visible in fonts dropdown
Change-Id: Ia909ed9f35d6a1c80f6696abeddefe2d4ad2d6a0
Reviewed-on: https://gerrit.libreoffice.org/38001
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-05-25 11:05:21 +02:00
Henry Castro
05deed08b4 loleaflet: fix undo repair document popup
UNDO_CONFLICT was intented to notify views, but
the constant value changed with latest patch upstream

Change-Id: I09062725539df3d974a47d89374d822d1d852770
2017-05-23 16:42:49 -04:00
Aditya Dewan
9db39ce741 tdf#107752 admin console: indicating whether a document is modified.
Change-Id: I6055a601c1dd3b5e9700ef75d7c07d7e0b13d663
2017-05-23 19:00:53 +05:30
Pranav Kant
bcf958c500 wsd: Fail gracefully when storage misbehaves
When WOPI's CheckFileInfo or GetFile responds with status code other
than HTTP 200, show a message to the user indicating some problem in the
storage.

Currently, we open an empty document if storage doesn't return a
document which surely is not correct.

Mention the storage server address when asking user to contact the
server administrator to be more friendly.

Change-Id: I15f0489f36db8689b43d42f6b691fdd21815e4fa
2017-05-19 20:53:42 +05:30
Pranav Kant
1cb75cbcb8 wsd: Save wrapper over .uno:Save
Document broker needs to know when the save request is sent and when the
save finished. It uses these parameters to avoid shutting down document,
in the document broker main polling loop, if save is already going on.
But direct .uno:Save commands issued from
loleaflet precludes document broker to keep track of it - in this case a
.uno:Save command issued from loleaflet followed by closing the
session will prevent saving the document to storage, if document is huge
enough and LO core takes a bit of time to save it. A save wrapper
command, 'save', ensures that document broker is aware of all such save
requests (_saveRequestTime member variable) and doesn't close the
document until we completely save it (to storage and other cleanups).

Change-Id: I5ec73d45adff23b2e7543e93dfd0624a5e5af46d
2017-05-15 11:41:52 +05:30
Marco Cecchetti
024e786e85 calc: added an address input field
Change-Id: Ic030724e392693847a195b5e53866b40ebad7435
Reviewed-on: https://gerrit.libreoffice.org/37359
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-11 17:55:23 +02:00
Ashod Nakashian
954a37a06c Configurable timeouts
Timeouts to dimming the doc in the browser
are now configurable from WSD and is relayed
to loleflet as expected.

Out of focus timeout is now 60 seconds.

Change-Id: I8452e30976f6a81b0c3bb3ba5774daa244c1640c
Reviewed-on: https://gerrit.libreoffice.org/37489
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-11 08:01:30 +02:00
Pranav Kant
e032cb72fa tdf#106447: Support checked items in menubar
Bin the internal command state recorder to Menubar and use the global
state recorder available in the map.

Change-Id: I32e81700e38c2d544b2d874e6a30fbe58e8d43bd
2017-05-03 21:21:28 +05:30
Pranav Kant
ffaf424103 loleaflet: Store state change handlers in new stateChangeHandler class
... instead of having this logic in our toolbar. All the elements like
menubar or toolbar can then use the map store to see the value of last
state change event for any particular uno command. We will be using it
when menubar starts using this store.

The frivolous logic in toolbar of reading the value of last uno command
should be removed. We don't expect loleaflet to change the permission
dynamically after loading the document anymore. But for now, just change
it accordingly and defer the task of removing it when we refactor
loleaflet codebase to trim our permission model (remove the 'view'
mode).

Change-Id: I1be54a62e96179b7db3f61470a92e3ddc745f52d
2017-05-03 21:21:22 +05:30
Pranav Kant
163e04af0b Make admin l10n work again
The localization.json file contains path like 'l10n/lang.json' which
means path relative the html file being accessed. This works when we
access .../loleaflet.html but not so when we access .../admin/admin.html because
then it tries to access .../admin/l10n/lang.json while it should look for
this file one directory up. One could think to change the paths in
localization.json file to something like '/loleaflet/dist/l10n/lang.json' so
that same path is accessed always for loleaflet UI as well as admin, but
it has repercussions that we access l10n data always using 'dist' prefix
and not using git hash, so browser caching the l10n data across multiple
versions.

Ideal would be to split the admin localization completely from the
loleaflet-ui localization. No point in fetching whole of the loleaflet
localizations strings when we are only accessing the admin console. This
would also solve problem mentioned previously.

For now, just split the admin localization file only while still
allowing admin console to fetch the same l10n files.

Change-Id: I0824fb05b9b4123b58d6fd8edafb374ee7128229
2017-05-02 19:52:47 +05:30
Pranav Kant
5858f4e856 Don't eat new lines
Change-Id: Idaa1af9a0bc12d9967d3807ebca95ec1ca755ae3
2017-04-27 11:09:55 +05:30
Pranav Kant
56c49af98a loleaflet: Bin client side cell annotation marker
No need as core renders its in-tile annotation marker now, if comment
indicator setting is on in the document.

Change-Id: I213827fc089790398e02b0fd9cba464ab62b0d8d
2017-04-27 10:40:47 +05:30
Pranav Kant
759b0945d4 loleaflet: Don't allow inserting breaks anywhere
overflow-break property is enough for us which still allows inserting
line breaks arbitrarily anywhere but only if there is no otherwise
acceptable break points in the line.

Change-Id: I8ea94daba258b00caa259c97597cf1206a89fa64
2017-04-25 19:40:30 +05:30
Pranav Kant
2d55476b20 loleaflet: Don't overflow long names, align author names properly
Change-Id: I0d833291fc996ecb4007bcb58b588967afa6ea58
2017-04-25 14:48:23 +05:30
Pranav Kant
0c53975f18 loleaflet: New comment size/width
Change-Id: Ief2d9c942dffab7a98dc5a7de2208e511f45df78
2017-04-25 13:32:51 +05:30
Pranav Kant
2b38191e3b loleaflet: Wrap both comments and redlines
Change-Id: Iee0c61340cc78b93a2d3d23157bab715c3e7411e
2017-04-24 20:31:06 +05:30
Pranav Kant
ca482f0065 loleaflet: Fix width of the redlines too
... otherwise with very long comments, they keep increasing their width
which looks ugly.

Change-Id: I5cd67258b251a9d522716433d5e190cd29fef078
2017-04-24 20:31:06 +05:30
Pranav Kant
c88f1156b2 loleaflet: Increase the annotation height a bit more
Change-Id: Ibd04cfe3e17354244a31177edca23467e0f8e9c8
2017-04-24 20:31:06 +05:30
Pranav Kant
ecdb7e2645 loleaflet: Enable vertical scroll on annotations
Change-Id: I6ff7a29bd22f57b4d9bbdbb824619030cf5f2e43
2017-04-24 20:31:06 +05:30
Aron Budea
33a562515b Show font/highlight color on toolbar in IE 11 as well
.repeat is not supported.

Change-Id: I4f9d75f851f73e4cc626ca6f0a13aa1877308e70
Reviewed-on: https://gerrit.libreoffice.org/36553
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2017-04-20 02:27:24 +02:00
Pranav Kant
b864b562cf Revert "loleaflet: Remove box-shadow from comments"
This reverts commit 86be5a24a5.

Change-Id: I272b9a88e29a8ab77e93dfc36c6e3aec9c91a1a6
2017-04-19 15:22:18 +05:30
Aditya Dewan
41ed318de8 tdf#106449 admin:adding user list for each document
Change-Id: Ia5c382f469a80464d0435e1e2e4de3daaba8a690
Reviewed-on: https://gerrit.libreoffice.org/36275
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-04-19 08:17:11 +02:00
Marco Viscido
0bb650e7c4 keep expired document and query them to get the historical content
A Document has its own snapshots set.
A snapshot is a string representation of a JSON object.
AdminModel keeps also the expired document objects.
Query each document object in order to get their own history.
Admin accepts an "history" command then returns a json object.
An administrator checks the history by dashboard.

Change-Id: I73c87eff334cdb5a4a58043b2b66f18a56240b3a
Reviewed-on: https://gerrit.libreoffice.org/35926
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-04-19 04:08:38 +02:00
Pranav Kant
86be5a24a5 loleaflet: Remove box-shadow from comments
This box-shadow interferes with direct comment children and breaks the
root-children comment block UI. Lets remove the shadow for now.

Change-Id: Idda659bcfca76093c148400b2ab311bc39861e84
2017-04-14 13:46:01 +05:30
Pranav Kant
043ec94bef loleaflet: Same width for all comments, different from redline comments
Separate css classes for these different types of annotations.

Change-Id: I2013a05a2f7095956765661169670e0bb87bb372
2017-04-14 11:46:12 +05:30
Jan Holesovsky
7b7c73f8be Align the Accept / Reject buttons with the kebab menu.
And few other improvemnts inluding:

* use svg instead of png for the menu
* add title (caption) for the Accept / Reject change.

Change-Id: Ic7e781d7e93d319f766b387a8eddfa70c1920760
2017-04-12 17:43:49 +02:00
Pranav Kant
b7eafb1e4a Move CSP to response headers from meta tag in html
Some older browsers don't have meta tag support for CSP. Lets put all of
the CSP in response headers to be compatible with oldies.

Change-Id: I7f0d7c294e492b3c69ebea6fbd820d6558b9c3b3
2017-04-12 19:24:51 +05:30
Pranav Kant
63631dff24 security: CSP: add frame-src 'self'
We need to be able to create iframes sometimes with same origin as ours,
eg: when loading the 'loading' page during slideshow or downloading the
file (in different formats). The 'blob:' is only used for printing
purposes.

Change-Id: I93666ee45e707997969e151af5142efeeca0d177
2017-04-09 23:32:06 +05:30
Pranav Kant
54d0ff9c21 Stop using inline event handlers wherever possible
Unfortunately, our dependencies (various plugins etc.) still make heavy
use of inline event handlers, so not possible get rid of all of them in
our bundled js. This is the reason we still have to use 'unsafe-inline'
in our CSP.

Change-Id: I519dec0834606ab3c56e090c882a93160ddcb52c
2017-04-07 13:46:04 +05:30
Pranav Kant
0f2c6d8e06 Bin unused function
Change-Id: I57bc98cd382081e776e1ed58da095a404834b431
2017-04-07 13:46:04 +05:30
Pranav Kant
328df11a68 Bin this unused inline style
Change-Id: Ib4ae0cde13acea0e04526cda925f3d4528bb6605
2017-04-07 13:46:04 +05:30