หน้าตัวอย่าง
เข้าสู่ระบบ
หน้าแรกที่ทุกคนเห็นก่อนใช้ BSRU ERP หรือคอนโซล ตาม ADR 0024 ผู้ใช้พิมพ์รหัสผ่านในหน้าของเซิร์ฟเวอร์เข้าสู่ระบบ bsru-erp-auth เท่านั้น เว็บและคอนโซลส่งผู้ใช้ไปที่นั่น หน้าของ bsru-erp-auth ใช้ markup และคลาสเดียวกับ SignInLayout และคอมโพเนนต์ในหน้านี้ ตัวอย่างด้านล่างจึงเป็นต้นแบบของหน้านั้น และหน้าก่อนเข้าสู่ระบบอื่น ๆ ใช้โครงเดียวกัน
คอมโพเนนต์ที่ใช้
- SignInLayoutThe sign-in page and the other pages before sign-in, such as the first-login password change.
- TextInputA one-line text field, with an optional leading icon.
- PasswordInputA password field with a leading icon and a button that shows or hides what was typed.
- ButtonA button, or a link that looks like one with href.
- AlertA message that stays on the page: what happened and what to do next.
- SegmentedA small set of choices in one bar, such as Day, Month and Year.
import { SignInLayout, TextInput, PasswordInput, Button, Alert, Segmented } from "@bsru/ui";กฎของหน้านี้
ถ้อยคำ
- หัวข้อคือ เข้าสู่ระบบ บอกในบรรทัดรองว่าใช้บัญชีอะไร
- เมื่อเข้าสู่ระบบไม่สำเร็จ ใช้ข้อความเดียวกันเสมอ ไม่ว่าอีเมลผิด รหัสผ่านผิด หรือบัญชีถูกล็อก เพื่อไม่ให้รู้ว่ามีอีเมลใดในระบบ (ADR 0024)
- ลืมรหัสผ่าน: ยังไม่มีการตั้งรหัสใหม่ทางอีเมล บอกให้ติดต่อผู้ดูแลระบบของหน่วยงาน
ปุ่มและช่องกรอก
- อีเมลและรหัสผ่านเท่านั้น ปุ่มหลักเต็มความกว้างหนึ่งปุ่ม ใส่ autoComplete username และ current-password ให้ตัวจัดการรหัสผ่านเติมได้
- ไม่มีช่องจำฉันไว้ เพราะการเข้าสู่ระบบมีอายุไม่เกิน 8 ชั่วโมงสำหรับผู้ใช้ ERP และ 4 ชั่วโมงสำหรับผู้ดูแลระบบ (ADR 0024)
- ไม่มีลิงก์สมัครสมาชิก ผู้ดูแลระบบเป็นผู้สร้างบัญชี
- เข้าสู่ระบบครั้งแรกด้วยรหัสชั่วคราว ต้องตั้งรหัสผ่านของตัวเองในหน้าเดียวกันนี้ก่อนใช้งาน อย่างน้อย 12 ตัวอักษร
- ปุ่มบัญชีมหาวิทยาลัย (SSO) เป็นทางเลือกในอนาคต ใช้ alternatives และเป็นปุ่มรองเสมอ
ห้ามแสดง
- รหัสผ่านที่พิมพ์ไว้หลังส่งฟอร์มไม่สำเร็จ เก็บไว้เฉพาะอีเมล
- ข้อความที่บอกว่าอีเมลนี้ไม่มีในระบบ หรือเหลือจำนวนครั้งที่ลองได้กี่ครั้ง
- ปุ่ม Google Facebook หรือบริการภายนอกอื่น
หน้าตา
- แผงซ้ายใช้สีไล่ --g-rail แบบเดียวกับเมนู ตราอยู่บนแผ่นสีขาว ใช้ภาพมหาวิทยาลัยได้ทาง image เมื่อได้รับอนุญาตแล้ว
- บนโทรศัพท์แผงสีหลักของแอปย่อเป็นหัวหน้าเล็ก ๆ มีตรา ชื่อ และหัวข้อ ไม่มีจุดสลับข้อความ
- แสดงแถบระบบจำลองด้วย notice ทุกครั้งในระบบทดสอบ
ตัวอย่างทั้งหน้า
แต่ละตัวอย่างเป็นหน้าเต็ม แสดงในกรอบจอคอมพิวเตอร์ เลือกโทรศัพท์หรือแท็บเล็ตที่แถบบนเพื่อดูบนจอนั้น ข้อมูลทั้งหมดเป็นข้อมูลสมมติ
ERP: เข้าสู่ระบบ
หน้าเข้าสู่ระบบของ BSRU ERP แผงซ้ายมีสามข้อความสลับกันด้วยจุด ปุ่มภาษาอยู่มุมขวาบน
const t = useTranslations();
<SignInLayout
brand={{ name: "BSRU ERP", caption: t("brand.university"), logo: "/bsru-logo.png", alt: t("brand.seal") }}
slides={[
{ headline: t("signIn.slide1"), description: t("signIn.slide1Text") },
{ headline: t("signIn.slide2"), description: t("signIn.slide2Text") },
{ headline: t("signIn.slide3"), description: t("signIn.slide3Text") },
]}
title={t("signIn.title")}
subtitle={t("signIn.subtitle")}
topAction={<LanguageSwitch />}
footer={t("signIn.forgot")}
notice={demo ? t("shell.demo") : undefined}
>
<form method="post" className="flex flex-col gap-4">
<TextInput label={t("signIn.email")} name="email" type="email" icon={Mail} autoComplete="username" required />
<PasswordInput label={t("signIn.password")} name="password" autoComplete="current-password" required />
<Button tone="primary" type="submit" icon={LogIn} label={t("signIn.submit")} wide />
</form>
</SignInLayout>| Prop | ค่าในตัวอย่างนี้ | ชนิดข้อมูล | คำอธิบาย |
|---|---|---|---|
| brand* จำเป็น | ออบเจกต์ 4 ฟิลด์{
name: "BSRU ERP",
caption: "มหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
logo: "/bsru-logo.png",
alt: "ตรามหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
} | PageBrand | The logo, the system's name and a caption, at the top of the brand panel. |
| slides | รายการ 4 รายการ[
{
headline: "ระบบบริหารมหาวิทยาลัย",
description: "งบประมาณ พัสดุ บุคลากร ในที่เดียว",
},
{
headline: "อนุมัติได้ทุกที่",
description: "ตรวจและอนุมัติคำขอจากโทรศัพท์ได้ทันที",
},
{
headline: "ตรวจสอบได้ทุกขั้นตอน",
description: "ทุกการเปลี่ยนแปลงมีผู้รับผิดชอบและเวลาบันทึกไว้",
},
{
headline: "เชื่อมต่อ AI ผ่าน MCP",
description: "ผู้ช่วย AI ทำงานกับข้อมูล ERP ด้วยสิทธิ์ของคุณเท่านั้น",
},
] | readonly SignInSlide[] | Several headlines for the brand panel, in order. With more than one, dots below them switch between them. They move on by themselves every nine seconds only when the person hasn't asked for reduced motion, and stop once a dot is pressed or while the pointer or focus is on the panel. |
| title* จำเป็น | "เข้าสู่ระบบ" | string | The form's heading, the page's level 1 heading, such as เข้าสู่ระบบ. |
| subtitle | "ใช้อีเมลของมหาวิทยาลัยและรหัสผ่านของคุณ" | string | A short line under the title, such as what to sign in with. |
| footer | "ลืมรหัสผ่าน? ติดต่อผู้ดูแลระบบของหน่วยงาน" | ReactNode | Small text below the form, such as who to contact when the password is forgotten. |
| notice | "ระบบจำลอง ใช้ข้อมูลทดสอบเท่านั้น" | string | The gold strip across the top of the page, for demo and test systems, such as ระบบจำลอง. |
เข้าสู่ระบบไม่สำเร็จ
Alert สีแดงอยู่เหนือช่องกรอก ข้อความเดียวกันสำหรับทุกสาเหตุ อีเมลยังอยู่ ช่องรหัสผ่านว่าง
<SignInLayout brand={brand} slides={slides} title={t("signIn.title")} subtitle={t("signIn.subtitle")} topAction={<LanguageSwitch />} footer={t("signIn.forgot")} notice={notice}>
{failed ? (
<Alert tone="danger" title={t("signIn.failed")}>
{t("signIn.failedBody")}
</Alert>
) : null}
<form method="post" className="flex flex-col gap-4">
{/* Keep the email address. Never send the password back. */}
<TextInput label={t("signIn.email")} name="email" type="email" icon={Mail} autoComplete="username" defaultValue={email} required />
<PasswordInput label={t("signIn.password")} name="password" autoComplete="current-password" required />
<Button tone="primary" type="submit" icon={LogIn} label={t("signIn.submit")} wide />
</form>
</SignInLayout>| Prop | ค่าในตัวอย่างนี้ | ชนิดข้อมูล | คำอธิบาย |
|---|---|---|---|
| tone* จำเป็น | "danger" | AlertTone ค่าที่ใช้ได้: "danger""warning""success""info" | The kind of message, which sets the colour and the icon. |
| title* จำเป็น | "อีเมลหรือรหัสผ่านไม่ถูกต้อง" | ReactNode | What happened, in one short line. |
ตั้งรหัสผ่านใหม่เมื่อเข้าสู่ระบบครั้งแรก
โครงเดียวกัน หลังเข้าสู่ระบบด้วยรหัสชั่วคราว ช่องตรวจความยาวและความตรงกันขณะพิมพ์ ลองพิมพ์ในช่องได้
const [password, setPassword] = useState("");
const [again, setAgain] = useState("");
<SignInLayout brand={brand} slides={slides} title={t("newPassword.title")} subtitle={t("newPassword.subtitle")} topAction={<LanguageSwitch />} footer={t("newPassword.footer")} notice={notice}>
<form method="post" className="flex flex-col gap-4">
{/* For password managers: the account the new password belongs to. */}
<TextInput label={t("signIn.email")} name="email" type="email" icon={Mail} autoComplete="username" value={email} readOnly />
<PasswordInput
label={t("newPassword.new")}
name="newPassword"
hint={t("newPassword.rules")}
icon={KeyRound}
autoComplete="new-password"
value={password}
onValueChange={setPassword}
error={password.length > 0 && password.length < 12 ? t("newPassword.short") : undefined}
required
/>
<PasswordInput
label={t("newPassword.again")}
name="confirmPassword"
icon={KeyRound}
autoComplete="new-password"
value={again}
onValueChange={setAgain}
error={again.length > 0 && again !== password ? t("newPassword.mismatch") : undefined}
required
/>
<Button tone="primary" type="submit" label={t("newPassword.submit")} wide />
</form>
</SignInLayout>| Prop | ค่าในตัวอย่างนี้ | ชนิดข้อมูล | คำอธิบาย |
|---|---|---|---|
| brand* จำเป็น | ออบเจกต์ 4 ฟิลด์{
name: "BSRU ERP",
caption: "มหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
logo: "/bsru-logo.png",
alt: "ตรามหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
} | PageBrand | The logo, the system's name and a caption, at the top of the brand panel. |
| title* จำเป็น | "ตั้งรหัสผ่านใหม่" | string | The form's heading, the page's level 1 heading, such as เข้าสู่ระบบ. |
| subtitle | "นี่เป็นการเข้าสู่ระบบครั้งแรก ตั้งรหัสผ่านของคุณเองก่อนเริ่มใช้งาน" | string | A short line under the title, such as what to sign in with. |
คอนโซล: เข้าสู่ระบบ
หน้าเดียวกันสำหรับคอนโซลผู้ดูแลระบบ ชื่อระบบ ข้อความในแผง และบรรทัดรองเปลี่ยนไป ส่วนอื่นเหมือนเดิม
<SignInLayout
brand={{ name: t("brand.console"), caption: t("brand.university"), logo: "/bsru-logo.png", alt: t("brand.seal") }}
slides={[
{ headline: t("console.slide1"), description: t("console.slide1Text") },
{ headline: t("console.slide2"), description: t("console.slide2Text") },
]}
title={t("console.signInTitle")}
subtitle={t("console.signInSubtitle")}
topAction={<LanguageSwitch />}
footer={t("signIn.forgot")}
notice={demo ? t("shell.demo") : undefined}
>
<form method="post" className="flex flex-col gap-4">…</form>
</SignInLayout>| Prop | ค่าในตัวอย่างนี้ | ชนิดข้อมูล | คำอธิบาย |
|---|---|---|---|
| brand* จำเป็น | ออบเจกต์ 4 ฟิลด์{
name: "BSRU ERP คอนโซลผู้ดูแลระบบ",
caption: "มหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
logo: "/bsru-logo.png",
alt: "ตรามหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
} | PageBrand | The logo, the system's name and a caption, at the top of the brand panel. |
| slides | รายการ 2 รายการ[
{
headline: "ดูแลระบบอย่างปลอดภัย",
description: "จัดการผู้ใช้ สิทธิ์ และการตั้งค่า ในที่เดียว",
},
{
headline: "ทุกการแก้ไขมีบันทึก",
description: "ดูได้ว่าใครเปลี่ยนอะไรและเมื่อไร",
},
] | readonly SignInSlide[] | Several headlines for the brand panel, in order. With more than one, dots below them switch between them. They move on by themselves every nine seconds only when the person hasn't asked for reduced motion, and stop once a dot is pressed or while the pointer or focus is on the panel. |
| title* จำเป็น | "เข้าสู่ระบบคอนโซล" | string | The form's heading, the page's level 1 heading, such as เข้าสู่ระบบ. |
| subtitle | "สำหรับผู้ดูแลระบบเท่านั้น" | string | A short line under the title, such as what to sign in with. |
| footer | "ลืมรหัสผ่าน? ติดต่อผู้ดูแลระบบของหน่วยงาน" | ReactNode | Small text below the form, such as who to contact when the password is forgotten. |
| notice | "ระบบจำลอง ใช้ข้อมูลทดสอบเท่านั้น" | string | The gold strip across the top of the page, for demo and test systems, such as ระบบจำลอง. |
ทางเลือกในอนาคต: บัญชีมหาวิทยาลัย (SSO)
ยังไม่ได้ใช้ เมื่อเชื่อมผู้ให้บริการยืนยันตัวตนของมหาวิทยาลัยแล้ว alternatives แสดงปุ่มรองใต้เส้น หรือ ปุ่มหลักยังเป็นการเข้าสู่ระบบด้วยอีเมล
<SignInLayout
brand={brand}
slides={slides}
title={t("signIn.title")}
footer={t("signIn.forgot")}
alternatives={<Button icon={Building2} label={t("signIn.university")} href="/auth/sso" wide />}
>
<form method="post" className="flex flex-col gap-4">…</form>
</SignInLayout>| Prop | ค่าในตัวอย่างนี้ | ชนิดข้อมูล | คำอธิบาย |
|---|---|---|---|
| brand* จำเป็น | ออบเจกต์ 4 ฟิลด์{
name: "BSRU ERP",
caption: "มหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
logo: "/bsru-logo.png",
alt: "ตรามหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา",
} | PageBrand | The logo, the system's name and a caption, at the top of the brand panel. |
| slides | รายการ 4 รายการ[
{
headline: "ระบบบริหารมหาวิทยาลัย",
description: "งบประมาณ พัสดุ บุคลากร ในที่เดียว",
},
{
headline: "อนุมัติได้ทุกที่",
description: "ตรวจและอนุมัติคำขอจากโทรศัพท์ได้ทันที",
},
{
headline: "ตรวจสอบได้ทุกขั้นตอน",
description: "ทุกการเปลี่ยนแปลงมีผู้รับผิดชอบและเวลาบันทึกไว้",
},
{
headline: "เชื่อมต่อ AI ผ่าน MCP",
description: "ผู้ช่วย AI ทำงานกับข้อมูล ERP ด้วยสิทธิ์ของคุณเท่านั้น",
},
] | readonly SignInSlide[] | Several headlines for the brand panel, in order. With more than one, dots below them switch between them. They move on by themselves every nine seconds only when the person hasn't asked for reduced motion, and stop once a dot is pressed or while the pointer or focus is on the panel. |
| title* จำเป็น | "เข้าสู่ระบบ" | string | The form's heading, the page's level 1 heading, such as เข้าสู่ระบบ. |
| subtitle | "ใช้อีเมลของมหาวิทยาลัยและรหัสผ่านของคุณ" | string | A short line under the title, such as what to sign in with. |
| footer | "ลืมรหัสผ่าน? ติดต่อผู้ดูแลระบบของหน่วยงาน" | ReactNode | Small text below the form, such as who to contact when the password is forgotten. |
| notice | "ระบบจำลอง ใช้ข้อมูลทดสอบเท่านั้น" | string | The gold strip across the top of the page, for demo and test systems, such as ระบบจำลอง. |
| alternatives | <Button
icon={BuildingComplex}
label="เข้าสู่ระบบด้วยบัญชีมหาวิทยาลัย"
href="/auth/sso"
wide
/> | ReactNode | Other ways to sign in, such as a secondary Button for the university account (SSO), shown below the form after an "or" divider. |