@crystaltech/hsms-shared-ui 0.7.26 → 0.7.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/useNetworkStatus.d.ts +13 -0
- package/dist/index.es.js +3 -3
- package/dist/index.js +1 -1
- package/dist/sw.js +1 -1
- package/package.json +1 -1
|
@@ -11,6 +11,19 @@
|
|
|
11
11
|
export type NetworkStatus = "checking" | "online" | "offline" | "unreachable";
|
|
12
12
|
/** How often the server is asked while the browser says it is online. */
|
|
13
13
|
export declare const NETWORK_PROBE_INTERVAL_MS = 30000;
|
|
14
|
+
/**
|
|
15
|
+
* What is asked: the API's public `/ping` when an API has been configured, else the site the app
|
|
16
|
+
* was served from. Any answer at all - an error page or a 401 included - means the server is
|
|
17
|
+
* there; only a failed request means it is not. `no-cors` keeps a cross-origin API from turning a
|
|
18
|
+
* reachable server into a CORS failure.
|
|
19
|
+
*
|
|
20
|
+
* It used to ask the API's bare root. That needs a session, so every open workstation logged a
|
|
21
|
+
* red `401 Unauthorized` every 30 seconds and the service logged "Unauthorized access: Not
|
|
22
|
+
* Authenticated" for each one (OPD on skh-proxmox, 2026-10-12). The services answer `/ping`
|
|
23
|
+
* without a session and without touching their database; one that has no `/ping` still answers
|
|
24
|
+
* something, which is all this asks.
|
|
25
|
+
*/
|
|
26
|
+
export declare const probeUrl: (now?: number) => string;
|
|
14
27
|
export declare function probeServer(): Promise<boolean>;
|
|
15
28
|
/**
|
|
16
29
|
* The workstation's network status, kept current: the browser's online/offline events answer at
|
package/dist/index.es.js
CHANGED
|
@@ -29677,9 +29677,9 @@ const kQ = (e) => {
|
|
|
29677
29677
|
)
|
|
29678
29678
|
}
|
|
29679
29679
|
);
|
|
29680
|
-
}, jQ = 3e4, VQ = 5e3, YQ = () => {
|
|
29681
|
-
const
|
|
29682
|
-
return `${
|
|
29680
|
+
}, jQ = 3e4, VQ = 5e3, YQ = (e = Date.now()) => {
|
|
29681
|
+
const t = rr(), n = t ? `${t.replace(/\/+$/, "")}/ping` : window.location.origin, r = n.includes("?") ? "&" : "?";
|
|
29682
|
+
return `${n}${r}_hsms_ping=${e}`;
|
|
29683
29683
|
};
|
|
29684
29684
|
async function qQ() {
|
|
29685
29685
|
const e = new AbortController(), t = window.setTimeout(() => e.abort(), VQ);
|