✨ Also test if DNS works in connectivity check

Should hopefully unearth cases where the system has a connection to the
internet but name resolution is broken in some way.

We default to resolving octoprint.org.
This commit is contained in:
Gina Häußge committed 2020-04-17 14:21:12 +02:00
1 parent b930fb0edb
commit aab012d530
16 files changed
+460 -199

No files matched your search

+25 -1
View File
@@ -187,7 +187,7 @@
.. code-block:: javascript
OctoPrint.util.testUrl("127.0.0.1", 1234, {"protocol": "udp"})
OctoPrint.util.testServer("127.0.0.1", 1234, {"protocol": "udp"})
.done(function(response) {
if (response.result) {
// check passed
@@ -203,6 +203,30 @@
:param object opts: Additional options for the request
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
.. js:function:: OctoPrintClient.util.testResolution(name, additional, opts)
Test if a host name can be resolved.
**Example**
Test if ``octoprint.org`` can be resolved.
.. code-block:: javascript
OctoPrint.util.testResolution("octoprint.org")
.done(function(response) {
if (response.result) {
// check passed
} else {
// check failed
}
});
:param string name: Host name to test
:param object additional: Additional parameters for the test command
:param object opts: Additional options for the request
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
.. seealso::
:ref:`Util API <sec-api-util>`