pinokiod 8.2.17 → 8.2.18
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/package.json +1 -1
- package/server/index.js +2 -1
- package/test/anywhere-api.test.js +4 -2
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -1140,7 +1140,8 @@ class Server {
|
|
|
1140
1140
|
id: app.id,
|
|
1141
1141
|
name: app.name,
|
|
1142
1142
|
icon: app.icon,
|
|
1143
|
-
|
|
1143
|
+
// Anywhere's own states: ready once a Serve route carries the app, publishing while it is up locally without one
|
|
1144
|
+
state: entry ? "ready" : (app.ready_url || app.url ? "publishing" : "starting"),
|
|
1144
1145
|
remote: entry ? rewriteAnywhereHref(app.ready_url || app.url, snap.serve) : null,
|
|
1145
1146
|
exposed: !!entry,
|
|
1146
1147
|
})
|
|
@@ -22,9 +22,11 @@ test('status carries app ids and complete remote addresses, and no installed cou
|
|
|
22
22
|
let readyUrl
|
|
23
23
|
const fake = {
|
|
24
24
|
kernel: { anywhere, api: { listApps: async () => [{ id: 'comfy' }, { id: 'forge' }, { id: 'idle' }] } },
|
|
25
|
+
// Home Server states (pending: up locally, no external address) never leak into Anywhere's
|
|
25
26
|
collectHomeServerApps: async () => [
|
|
26
|
-
{ id: 'comfy', name: 'ComfyUI', icon: '/c.png', ready_url: readyUrl, state: '
|
|
27
|
+
{ id: 'comfy', name: 'ComfyUI', icon: '/c.png', ready_url: readyUrl, state: 'pending' },
|
|
27
28
|
{ id: 'forge', name: 'Forge', icon: '/f.png', ready_url: '', state: 'starting' },
|
|
29
|
+
{ id: 'unrouted', name: 'Unrouted', icon: '/u.png', ready_url: 'http://127.0.0.1:9999', state: 'pending' },
|
|
28
30
|
],
|
|
29
31
|
portFromUrl: Server.prototype.portFromUrl,
|
|
30
32
|
}
|
|
@@ -35,7 +37,7 @@ test('status carries app ids and complete remote addresses, and no installed cou
|
|
|
35
37
|
readyUrl = url
|
|
36
38
|
const status = await Server.prototype.composeAnywhereStatus.call(fake, {})
|
|
37
39
|
assert.equal(status.installed, undefined)
|
|
38
|
-
assert.deepEqual(status.apps.map((a) => [a.id, a.remote]), [['comfy', expected], ['forge', null]])
|
|
40
|
+
assert.deepEqual(status.apps.map((a) => [a.id, a.state, a.remote]), [['comfy', 'ready', expected], ['forge', 'starting', null], ['unrouted', 'publishing', null]])
|
|
39
41
|
}
|
|
40
42
|
const light = await Server.prototype.composeAnywhereStatus.call(fake, { light: true })
|
|
41
43
|
assert.equal(light.apps, undefined, 'the light status is unchanged')
|