const kinds = await api.hosts.kinds();
// [{ kind: "site", hostSuffix: "…", deploy: "files", available: true, reason: null }, …]
const usable = kinds.filter((k) => k.available);kinds = api.hosts.kinds()
# [{"kind": "site", "hostSuffix": "…", "deploy": "files", "available": True, "reason": None}, …]
usable = [k for k in kinds if k["available"]]kindstringالـ مُمَر إلى create().
hostSuffixstringالعنوان المستوى هذا النوع هو.
deploystringما يتطلبه الانتشار -- ملفات ، او رموز .
availablebooleanهل يمكن إنشاءه؟
reasonstring|nullلماذا لا، عندما لا يمكن.
لماذا التوافر هو ميدان
A kind that cannot serve is refused at creation
لم يُنشأ قطّ ‹ في الوقت الحاضر : عنوان لا يجيب على هذا السؤال يقرأ على أنه انقطاع عن العمل .
لا تُثبِّر المُشفر
المستوى الواحد لكل نوع هو متعمد - وهذا هو ما يمنع الزبون من أخذ اسم من أي وقت مضى من المنصة نفسها. يتم إعادة الملاحق هنا بالضبط حتى لا تكررها صفحة.
مُنشئ مُقِر
for (const k of await api.hosts.kinds()) {
render({ value: k.kind, label: k.kind, hint: k.hostSuffix, disabled: !k.available, why: k.reason });
}for k in api.hosts.kinds():
render(value=k["kind"], label=k["kind"], hint=k.get("hostSuffix"), disabled=not k["available"], why=k.get("reason"))