Commit graph

5774 commits

Author SHA1 Message Date
Ashod Nakashian
9e11cd7db7 Support setting rlimits from Admin Console
Change-Id: Ia0d45948998d7a5612a1828a90ad20908d07639e
Reviewed-on: https://gerrit.libreoffice.org/38677
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-12 06:19:53 +02:00
Ashod Nakashian
36fb1e64f0 wsd: new internal command to change config values
Change-Id: I8b4a573ba7b01ee6e7b3b91a00e12cc744f85fa8
Reviewed-on: https://gerrit.libreoffice.org/38676
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-12 06:18:53 +02:00
Ashod Nakashian
6de3adcf9c wsd: pass default rlimits to forkit from config
Change-Id: I84d271f460f0fb1d03a973107c32265d84bf2841
Reviewed-on: https://gerrit.libreoffice.org/38675
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-12 06:18:31 +02:00
Ashod Nakashian
42969b732c wsd: log the relevant rlimits at Kit startup
Change-Id: I6ada56d9bda80301ab55de2c831452b21aa362c1
Reviewed-on: https://gerrit.libreoffice.org/38674
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-12 06:17:58 +02:00
Ashod Nakashian
9cb82cebe3 wsd: add rlimit config entries and defaults
Change-Id: I8cb498d01bc1a7a55d168e49c754bb1bba80aea1
Reviewed-on: https://gerrit.libreoffice.org/38673
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-12 06:17:44 +02:00
Ashod Nakashian
92d29b1ce7 wsd: support setting process rlimits
Change-Id: I7117e6843d2ebc919d7d2303cc593de888cc54b1
Reviewed-on: https://gerrit.libreoffice.org/38672
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-12 06:17:21 +02:00
Jan Holesovsky
637eecb948 loleaflet: Need to distinguish between comments and redlines here.
Change-Id: I3a3111dc6c98bbc0a3ab47e92619f95c0fc65516
Reviewed-on: https://gerrit.libreoffice.org/38566
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-06-08 13:17:32 +02:00
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
27fdb9b864 loleaflet: Position the Find & replace consistently, and in line with desktop.
Change-Id: I5d9d93339d74f5a9cda304fba876c76cb5391408
Reviewed-on: https://gerrit.libreoffice.org/38519
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-06-07 17:43:04 +02:00
Henry Castro
075b3b5d1f gitignore: *.lo files
Change-Id: I26fd7381ed30592caefa8f515bbdc3e19defdbab
2017-06-07 10:57:55 -04:00
Jan Holesovsky
ca39f61330 Don't crash on Shift+reload.
Change-Id: I1706fc0ff748fa74f2d2b29f103c167acf36c706
Reviewed-on: https://gerrit.libreoffice.org/38516
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-06-07 16:35:57 +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
05c12733a6 PostMessage API - allow showing/hiding custom progress bar
Change-Id: Ide9c83018938d1195b87153fe78e3924c2d49d4a
2017-06-07 13:28:57 +05:30
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
00f4b4c0f2 No need to specify the full path
Moreover, its ideal to use the same URL to get this *-help.html file with
which loleaflet.html is loaded, and not the one with 'dist' in it.

Change-Id: I2e25f9a2ef41bb1d23fc09878b0726d6b4019cee
2017-06-07 10:15:54 +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
Ashod Nakashian
194faa6d69 wsd: force readonly for view file types per discovery.xml
File extensions marked as view (as opposed to edit)
in discovery.xml are now forced to be read-only,
regardless of what the client tries to request.

Change-Id: I3eb00c33ff716800dc317f7377281c6d5f0909d7
Reviewed-on: https://gerrit.libreoffice.org/38480
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-07 06:02:30 +02:00
Ashod Nakashian
44f4ba2730 wsd: discovery.xml now preprocessed and cached
Change-Id: Ie2f274452e9bd3a65061e24582a7280646162cdf
Reviewed-on: https://gerrit.libreoffice.org/38479
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-07 06:01:13 +02:00
Henry Castro
5ab255c957 loleaflet: prevent default context menu of the corner column header
Change-Id: I27d78e0ef9946776e1311da12ac0116a16a861f7
2017-06-06 17:50:39 -04:00
Pranav Kant
5e9ed0c8cb Allow links in comments
Change-Id: I033ab7fe09ece8da10bc61fc2102cce80c1e24b0
2017-06-06 18:21:24 +05:30
Pranav Kant
2d0ec13249 CSP - allow WOPI host as image sources
This is needed to avoid CSP error when loading the avatar image URL from
the WOPI hosts.

Change-Id: I6bd8bd846f81bc799192e7fbc16b2d7ecc9f555e
2017-06-06 17:36:47 +05:30
Aditya Dewan
3c121dad37 tdf#97020 follow up - Adding find&replace functionality
added option for calc and impress
draggable operation now smoother

Change-Id: I46210689a1592478827271385da48a854aece766
Reviewed-on: https://gerrit.libreoffice.org/38405
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-06-06 13:22:54 +02:00
Andras Timar
1859bad328 loleaflet: Updated loleaflet-ui.pot
Change-Id: I8eafebdc991f64852bee79e210d845f28b44c86b
2017-06-06 13:13:12 +02:00
Andras Timar
865cd4a79d loolnb was killed earlier
Change-Id: Ie4b1f3c890c59a8b9204af5a25842c74929ecad8
Reviewed-on: https://gerrit.libreoffice.org/38314
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2017-06-06 13:11:10 +02:00
László Németh
51840fcb36 wsd: add test.hpp to dist tarball
Change-Id: I378fb4ac6db79f5ef661cfb8ecef2a7e5c10dfc5
2017-06-06 12:14:43 +02:00
Michael Meeks
5e2166bfd7 Add missing UnitClient.cpp
Change-Id: I267c5538faac695be7105ce4c81f1d247eb07595
2017-06-06 08:53:57 +01:00
Jan Holesovsky
c1a302a182 loleaflet: Advise the user what to do.
Change-Id: I1ecd0a981bd8e277a53e6af9dc2f7ab1e2ee2099
2017-06-05 19:30:00 +02:00
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
Michael Meeks
3101fa510d Accumulate I/O stats per document.
Change-Id: Ie2f5647e65070ddd828f048820efd38b600f9133
2017-06-02 20:41:25 +01:00
Michael Meeks
097cc58d53 Run old-style unit tests as a new-style unit test.
This moves the code into the same process, for easier logging & debugging.

Disabled initially.

Change-Id: Id48b5649ba14deb0a2159ca59e321c7d0ae66dad
2017-06-02 18:33:26 +01:00
Ashod Nakashian
d4b2badd4e loleaflet: click to reload idle document
Change-Id: I29275e71d8ca7ef9aa25ef4697ba5c6f414aa0bb
Reviewed-on: https://gerrit.libreoffice.org/38336
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-02 05:07:54 +02:00
Jan Holesovsky
0033607f01 loleaflet: Many of the WOPI impls. do not provide avatars yet.
Change-Id: If72a6be9102cb96fe1a6b31f85c0e47bb0622558
2017-06-01 22:07:08 +02:00
Pranav Kant
a0710c9613 Inform the current session about document change too
Change-Id: I9947eb8b23e5a698cc2cbf39bfde4e1941aae0f0
2017-06-01 22:07:25 +05:30
Pranav Kant
f4b22bbb3c Broadcast command result back to clients
This is required to tell the clients if the command they issued was
successfull or not. In this case 'savetostorage' is the command that we
are interested in knowing the success status of.

With this, now if the user commands to overwrite the document, dialog
boxes of all other users are automatically closed.

Can easily more commands in future for this kind of thing. Its similar
to unocommandresult, except its not a uno command, but our internal
command.

Change-Id: I2e7e1fd5edbd55c13ee4bf9bce24284483d6507f
2017-06-01 21:42:29 +05:30
Pranav Kant
dce714efb8 Toggle this flag after a successfull save
Change-Id: Id1bf5bc5e32e24f68094f3020f4a7c4c4117f18a
2017-06-01 21:07:52 +05:30
Pranav Kant
9f535580a6 Close the dialog before showing a confirmation dialog
Change-Id: If7220c37f8456627181500d7428caf3657816a16
2017-06-01 21:07:21 +05:30
Pranav Kant
41234773e3 If user permits, save to storage force-fully in case of doc conflict
There is one known problem still - after any user decides to overwrite
the file to storage, other users are not informed, so their dialog keeps
hanging on the screen until they press the cancel or reload button.

Change-Id: I6dad1585e4c53eeed79cd38316892a7f239d44ef
2017-06-01 19:53:10 +05:30
Pranav Kant
4d61cae4c8 If user commands, refresh the document for all in case of doc conflict
Change-Id: I42c61fb8099b0bcc60f942e602561cc97486a918
2017-06-01 19:46:38 +05:30
Pranav Kant
d6ef241cf5 Don't be so rude
If we are rude, then we don't tell the reason behind closing the
document to our clients.

This method earlier was used to do 'ownertermination', but without this
patch, ownertermination is not going to work. We regressed somewhere in
the past.

Change-Id: I7a2513e567f72b1adf00d5a74b118e116d6d99d3
2017-06-01 18:17:39 +05:30
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
Pranav Kant
15a4474572 Remove superfluous WOPI calls to getFileInfo to check timestamp
One can add the timetamp information in the PutFile call itself. This
way we can avoid making an extra CheckFileInfo call here.

Change-Id: Iae180262e648c36b9cfeb6d5fabdf5d243b93afb
2017-06-01 16:17:07 +05:30
Pranav Kant
cf968e6768 Factor out iso8601 to Poco::Timestamp parsing
Change-Id: I627a7b6b72899371e880e461685f99a86a858232
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
402c2ce2ad loleaflet: show avatar in comments
Change-Id: I97a781a2faf626c2ac6f4b178127aaa77c7775d0
Reviewed-on: https://gerrit.libreoffice.org/38292
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-06-01 12:39:33 +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
073b58269b tdf#103673 - Use hex color value in API
Change-Id: I51e2431e9253a625fb590af276d991a34e720141
2017-05-31 14:20:58 +05:30