loleaflet/html/loleaflet.html.m4 | 3 +-- loleaflet/src/core/Socket.js | 5 ++++- wsd/LOOLWSD.cpp | 24 +++++++++++++++++++----- 3 files changed, 24 insertions(+), 8 deletions(-)
New commits: commit 06bd1b1690b4c67c827d8aaa42adb6c4352aa147 Author: Michael Meeks <michael.me...@collabora.com> AuthorDate: Fri May 17 13:22:02 2019 +0100 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat May 25 12:39:43 2019 +0100 debug: cleanup ID display as a simple link. And cleanup debug printout in 'make run' too. Change-Id: I7a399eb00f15e43ceb230f66a2b17d437c5c79b0 diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4 index 1a44c00b6..997a47931 100644 --- a/loleaflet/html/loleaflet.html.m4 +++ b/loleaflet/html/loleaflet.html.m4 @@ -154,10 +154,9 @@ ifelse(MOBILEAPP,[true], <p id="product-string"></p> <h3>LOOLWSD</h3> <div id="loolwsd-version"></div> + <div id="loolwsd-id"></div> <h3>LOKit</h3> <div id="lokit-version"></div> - <h3>Id</h3> - <div id="loolwsd-id"></div> <p>Copyright _YEAR_, Collabora Productivity Limited.</p> </div> diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index c57d0b691..06fa5eb47 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -287,7 +287,10 @@ L.Socket = L.Class.extend({ $('#loolwsd-version').text(loolwsdVersionObj.Version); } - $('#loolwsd-id').html('<p>' + this.getWebSocketBaseURI(this._map) + '</p><p>' + loolwsdVersionObj.Id + '</p>'); + var idUri = this._map.options.server + this._map.options.serviceRoot + '/hosting/discovery'; + idUri = idUri.replace(/^ws:/, 'http:'); + idUri = idUri.replace(/^wss:/, 'https:'); + $('#loolwsd-id').html('<a href="' + idUri + '">' + loolwsdVersionObj.Id + '</a>'); // TODO: For now we expect perfect match in protocol versions if (loolwsdVersionObj.Protocol !== this.ProtocolVersionNumber) { diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index 7a32429b3..44652cb34 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -654,6 +654,17 @@ inline std::string getLaunchURI(const std::string &document) return oss.str(); } +inline std::string getServiceURI(const std::string &sub) +{ + std::ostringstream oss; + + oss << getLaunchBase(""); + oss << LOOLWSD::ServiceRoot; + oss << sub; + + return oss.str(); +} + inline std::string getAdminURI(const Poco::Util::LayeredConfiguration &config) { std::string user = config.getString("admin_console.username", ""); @@ -1184,13 +1195,16 @@ void LOOLWSD::initialize(Application& self) std::cerr << "\nLaunch one of these in your browser:\n\n" << " Writer: " << getLaunchURI(LOOLWSD_TEST_DOCUMENT_RELATIVE_PATH_WRITER) << '\n' << " Calc: " << getLaunchURI(LOOLWSD_TEST_DOCUMENT_RELATIVE_PATH_CALC) << '\n' - << " Impress: " << getLaunchURI(LOOLWSD_TEST_DOCUMENT_RELATIVE_PATH_IMPRESS) << '\n' - << std::endl; + << " Impress: " << getLaunchURI(LOOLWSD_TEST_DOCUMENT_RELATIVE_PATH_IMPRESS) << std::endl; const std::string adminURI = getAdminURI(config()); if (!adminURI.empty()) - std::cerr << "\nOr for the Admin Console:\n\n" - << adminURI << '\n' << std::endl; + std::cerr << "\nOr for the admin, capabilities & discovery:\n\n" + << adminURI << "\n" + << getServiceURI("/hosting/capabilities") << "\n" + << getServiceURI("/hosting/discovery") << "\n"; + + std::cerr << std::endl; #endif #endif @@ -2297,7 +2311,7 @@ private: auto socket = _socket.lock(); socket->send(oss.str()); socket->shutdown(); - LOG_INF("Sent cpabilities.json successfully."); + LOG_INF("Sent capabilities.json successfully."); } void handleRobotsTxtRequest(const Poco::Net::HTTPRequest& request) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits