Hub 2.21.0: install the Church Website; Website storage bought in steps
- New install offers the Church Website: Accounts first when the church has none, at accounts.<its address> (www. dropped); the FastPanel email sends a www. site's bare domain to www. with a 301. - Licence.extraStorageSteps (migration): the token sends a Website its limit (5 GB + steps, limits.storageBytes, contracts 1.17.0); invoices bill the steps bought instead of the storage reported. Edit popup field 0-99. - A Website/App licence starts on its plan however it's made (New install too). - Vendored @crosscode/contracts 1.17.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,12 @@ type Msg = { type: "ok" | "err"; text: string } | null;
|
||||
type Customer = { id: string; name: string; domain?: string | null };
|
||||
type InstallRow = { id: string; name: string; url: string; customer: { id: string; name: string } | null; version: string | null };
|
||||
|
||||
/** The Accounts domain the Hub makes when none is given (backend accountsDomainFor). */
|
||||
function accountsPlaceholder(product: string, domain: string) {
|
||||
if (!domain) return "accounts.hope.co.za";
|
||||
return product === "website" ? `accounts.${domain.replace(/^www\./, "")}` : domain.replace(/^[^.]+./, "accounts.");
|
||||
}
|
||||
|
||||
const emptyNew = { product: "events", customerId: "", serverId: "", shortName: "", domain: "", accountsDomain: "", timezone: "", adminName: "", adminEmail: "", version: "" };
|
||||
const emptyLink = { installId: "", serverId: "", shortName: "", webPort: "", apiPort: "" };
|
||||
const changedFrom = <T extends Record<string, string>>(form: T, empty: T) => (Object.keys(empty) as (keyof T)[]).some(k => form[k] !== empty[k]);
|
||||
@@ -57,18 +63,21 @@ function NewInstallModal({ servers, onClose }: { servers: ServerSummary[]; onClo
|
||||
<select id="n-product" className="input" value={form.product} onChange={e => setForm({ ...form, product: e.target.value, version: "" })}>
|
||||
<option value="events">Cross Events</option>
|
||||
<option value="accounts">Accounts (the church's sign-in)</option>
|
||||
<option value="website">Church Website</option>
|
||||
</select>
|
||||
<p className="mt-1 text-xs text-slate-500">
|
||||
{form.product === "accounts"
|
||||
? "Install Accounts before the Website, the App or Cross Events 3.0. Use the church's short name to add it next to its Events on the same server."
|
||||
: "A church that already has a product here keeps its short name: the new one is added next to it on the same server."}
|
||||
: form.product === "website"
|
||||
? "On the church's own address: www.hope.co.za (its bare domain is sent to www.), or a Cross Code address like hope.crosscode.co.za. A church that already has a product here keeps its short name."
|
||||
: "A church that already has a product here keeps its short name: the new one is added next to it on the same server."}
|
||||
</p>
|
||||
</div>
|
||||
<div><label className="label" htmlFor="n-cust">Customer</label><select id="n-cust" className="input" required {...f("customerId")}><option value="">Choose…</option>{customers.map(c => <option key={c.id} value={c.id}>{c.name}</option>)}</select></div>
|
||||
<div><label className="label" htmlFor="n-short">Short name</label><input id="n-short" className="input" required pattern="[a-z][a-z0-9-]{1,30}" placeholder="hope" {...f("shortName")} /><p className="mt-1 text-xs text-slate-500">Folders, database and tunnels: a-z, 0-9 and -.</p></div>
|
||||
<div><label className="label" htmlFor="n-domain">Domain</label><input id="n-domain" className="input" required placeholder={form.product === "accounts" ? "accounts.hope.co.za" : "events.hope.co.za"} {...f("domain")} /></div>
|
||||
{form.product === "events" && (
|
||||
<div><label className="label" htmlFor="n-acc">Accounts domain</label><input id="n-acc" className="input" placeholder={form.domain ? form.domain.replace(/^[^.]+./, "accounts.") : "accounts.hope.co.za"} {...f("accountsDomain")} /><p className="mt-1 text-xs text-slate-500">Cross Events 3 signs in through the church's Accounts: a church without it gets it installed first, here.</p></div>
|
||||
<div><label className="label" htmlFor="n-domain">Domain</label><input id="n-domain" className="input" required placeholder={form.product === "accounts" ? "accounts.hope.co.za" : form.product === "website" ? "www.hope.co.za" : "events.hope.co.za"} {...f("domain")} /></div>
|
||||
{(form.product === "events" || form.product === "website") && (
|
||||
<div><label className="label" htmlFor="n-acc">Accounts domain</label><input id="n-acc" className="input" placeholder={accountsPlaceholder(form.product, form.domain)} {...f("accountsDomain")} /><p className="mt-1 text-xs text-slate-500">{form.product === "website" ? "The Website" : "Cross Events 3"} signs in through the church's Accounts: a church without it gets it installed first, here.</p></div>
|
||||
)}
|
||||
<div><label className="label" htmlFor="n-tz">Time zone</label><input id="n-tz" className="input" placeholder="Africa/Johannesburg" {...f("timezone")} /></div>
|
||||
<div><label className="label" htmlFor="n-an">Site admin name</label><input id="n-an" className="input" {...f("adminName")} /></div>
|
||||
@@ -177,6 +186,7 @@ export default function InstallsPage() {
|
||||
<option value="">Every product</option>
|
||||
<option value="events">{PRODUCT_NAMES.events}</option>
|
||||
<option value="accounts">{PRODUCT_NAMES.accounts}</option>
|
||||
<option value="website">{PRODUCT_NAMES.website}</option>
|
||||
</select>
|
||||
<SearchInput className="w-full sm:w-72" value={query} onChange={setQuery} placeholder="Search a church, domain or server" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user