spinuptui 1.3.0-alpha.1 → 1.3.0-alpha.3
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/CHANGELOG.md +32 -1
- package/README.md +13 -3
- package/package.json +1 -1
- package/src/config.ts +25 -0
- package/src/index.tsx +26 -38
- package/src/lib/cliHome.ts +107 -0
- package/src/lib/cliScheduler.ts +630 -0
- package/src/lib/flock.ts +51 -0
- package/src/lib/heartbeat.test.ts +86 -0
- package/src/lib/heartbeat.ts +245 -0
- package/src/lib/home.test.ts +102 -0
- package/src/lib/home.ts +442 -0
- package/src/lib/schedule.ts +156 -0
- package/src/lib/scheduler.test.ts +353 -0
- package/src/lib/schedulerGit.ts +119 -0
- package/src/lib/schedulerInstall.ts +325 -0
- package/src/lib/schedulerJobs.ts +290 -0
- package/src/lib/schedulerRun.ts +247 -0
- package/src/lib/schedulerTick.ts +322 -0
- package/src/lib/spinupweb.test.ts +22 -0
- package/src/lib/spinupweb.ts +11 -0
- package/src/lib/stackCache.test.ts +43 -0
- package/src/lib/stackCache.ts +35 -1
- package/src/modules/beacon.ts +2 -1
- package/src/modules/contract.ts +22 -1
- package/src/modules/index.ts +2 -7
- package/src/modules/scheduler.ts +159 -0
- package/src/ui/App.tsx +19 -1
- package/src/ui/Details.tsx +7 -1
- package/src/ui/Onboarding.tsx +71 -3
- package/src/ui/main.tsx +42 -0
- package/src/ui/store.tsx +87 -3
- package/src/ui/views/AccountSlugPrompt.tsx +102 -0
- package/src/ui/views/Browser.tsx +5 -5
- package/src/ui/views/HeartbeatSetup.tsx +284 -0
- package/src/ui/views/HomeSync.tsx +299 -0
- package/src/ui/views/Modules.tsx +69 -5
- package/src/ui/views/SchedulerInstall.tsx +172 -0
- package/src/ui/views/Search.tsx +5 -6
- package/src/ui/views/ServerActions.tsx +6 -4
- package/src/ui/views/Stacks.tsx +22 -9
package/src/ui/views/Stacks.tsx
CHANGED
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
import { useEffect, useMemo, useRef, useState } from "react"
|
|
17
17
|
import { useKeyboard } from "@opentui/react"
|
|
18
18
|
import { theme, statusColor, statusDot } from "../../lib/theme.ts"
|
|
19
|
-
import { bar, truncate } from "../../lib/format.ts"
|
|
19
|
+
import { bar, timeAgo, truncate } from "../../lib/format.ts"
|
|
20
|
+
import { isVersionOld } from "../../lib/stackCache.ts"
|
|
20
21
|
import { STACKS, effectiveStack, stackColor, type Stack } from "../../lib/stack.ts"
|
|
21
22
|
import { phpSortKey } from "../../lib/phpEol.ts"
|
|
22
23
|
import { probeKindColor, type ProbeKind } from "../../lib/probe.ts"
|
|
@@ -75,7 +76,7 @@ function nonWpSub(kind: ProbeKind | null, vanity: boolean): NonWpSub {
|
|
|
75
76
|
export function Stacks({ rows }: { rows: number }) {
|
|
76
77
|
const store = useStore()
|
|
77
78
|
const wpCoreJobs = useWpCoreJobs()
|
|
78
|
-
const { sites, serverById, route, inputMode, overlayOpen, probes, probingIds, probeErrors, runProbe, runProbeMany, isProbeStale, isPhpEol,
|
|
79
|
+
const { sites, serverById, route, inputMode, overlayOpen, probes, probingIds, probeErrors, runProbe, runProbeMany, isProbeStale, isPhpEol, openInSpinupWP, setPhpUpgradeSite, setBulkWpGroup, phpUpgrades, setHttpsToggleSite, setPurgeCacheSite, setSiteOfflineSite, setLocalLinkSite, openLocalTerminal, openLocalUrl, localLinks, setDiscoverOpen, setForgottenOpen, setForgottenStack, sshSite, setKumaSite } =
|
|
79
80
|
store
|
|
80
81
|
|
|
81
82
|
const [groupIndex, setGroupIndex] = useState(0)
|
|
@@ -218,8 +219,8 @@ export function Stacks({ rows }: { rows: number }) {
|
|
|
218
219
|
case "w":
|
|
219
220
|
// Open the selected site in the SpinupWP web app.
|
|
220
221
|
if (focus === "sites" && groupSites[siteIndex]) {
|
|
221
|
-
|
|
222
|
-
|
|
222
|
+
const id = groupSites[siteIndex].id
|
|
223
|
+
if (openInSpinupWP((slug) => siteWebUrl(id, slug))) flashMsg("Opening in SpinupWP…")
|
|
223
224
|
}
|
|
224
225
|
return
|
|
225
226
|
case "d":
|
|
@@ -421,11 +422,23 @@ export function Stacks({ rows }: { rows: number }) {
|
|
|
421
422
|
) : vanity ? (
|
|
422
423
|
<text content="Vanity Site" fg={selected ? theme.text : VANITY_COLOR} wrapMode="none" />
|
|
423
424
|
) : cached ? (
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
425
|
+
<>
|
|
426
|
+
<text
|
|
427
|
+
content={truncate(cached.result.label, 20) + (isProbeStale(s) ? "*" : "")}
|
|
428
|
+
fg={probeKindColor(cached.result.kind, selected)}
|
|
429
|
+
wrapMode="none"
|
|
430
|
+
/>
|
|
431
|
+
{/* A version past its re-check age (the background re-probe
|
|
432
|
+
failed or hasn't run) says how old it is, so it can't
|
|
433
|
+
pass for current. */}
|
|
434
|
+
{isVersionOld(cached) && (
|
|
435
|
+
<text
|
|
436
|
+
content={" " + timeAgo(new Date(cached.detectedAt).toISOString()).replace(/ ago$/, "")}
|
|
437
|
+
fg={selected ? theme.text : theme.warn}
|
|
438
|
+
wrapMode="none"
|
|
439
|
+
/>
|
|
440
|
+
)}
|
|
441
|
+
</>
|
|
429
442
|
) : errored ? (
|
|
430
443
|
<text content="probe failed" fg={selected ? theme.text : theme.bad} wrapMode="none" />
|
|
431
444
|
) : (
|