106 lines
5.5 KiB
PHP
106 lines
5.5 KiB
PHP
<?php
|
|
/**
|
|
* System Settings & 2FA Administration View (Glassmorphism)
|
|
*/
|
|
?>
|
|
<div x-data="settingsApp" class="space-y-6">
|
|
|
|
<!-- Header -->
|
|
<div class="glass-card p-6 rounded-2xl border">
|
|
<h1 class="text-2xl font-bold tracking-tight bg-gradient-to-r from-emerald-400 to-cyan-400 bg-clip-text text-transparent">
|
|
ตั้งค่าระบบ & ความปลอดภัย (System Settings & Security)
|
|
</h1>
|
|
<p class="text-sm text-subtle mt-1">กำหนดค่า SLA เวลารอคอย, เปิดปิดระบบ 2FA TOTP และตั้งค่าการเชื่อมต่อ HIS โรงพยาบาล</p>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
|
|
<!-- Box 1: SLA & Queue AI Configuration -->
|
|
<div class="glass-card p-6 rounded-2xl border space-y-4">
|
|
<h3 class="font-bold text-lg text-emerald-400 pb-2 border-b border-emerald-500/20 flex items-center gap-2">
|
|
<i class="bi bi-sliders"></i> พารามิเตอร์ระบบ Smart Queue AI
|
|
</h3>
|
|
|
|
<form @submit.prevent="saveSla()" class="space-y-4 text-sm">
|
|
<div>
|
|
<label class="block font-medium mb-1">เวลารอคอยเป้าหมายสูงสุด (SLA Target Wait Time - นาที):</label>
|
|
<input type="number" x-model.number="form.sla_target_wait_mins" required class="glass-input text-mono font-bold text-amber-400">
|
|
<p class="text-xs text-subtle mt-1">หากผู้ป่วยรอนานเกินเวลานี้ AI จะเร่งปรับระดับความสำคัญ (Queue Priority Escalation)</p>
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block font-medium mb-1">ชั่วโมงการทำงานสูงสุดต่อวันของหมอนวด (Max Daily Minutes):</label>
|
|
<input type="number" x-model.number="form.max_therapist_daily_mins" required class="glass-input font-mono">
|
|
<p class="text-xs text-subtle mt-1">ค่ามาตรฐาน 480 นาที (8 ชั่วโมง) เพื่อป้องกันหมอนวดเหนื่อยล้าสะสม</p>
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block font-medium mb-1">เวลาทำความสะอาดเตียงเฉลี่ย (Buffer Room Clean Mins):</label>
|
|
<input type="number" x-model.number="form.room_clean_buffer_mins" required class="glass-input font-mono">
|
|
</div>
|
|
|
|
<div class="pt-2 flex justify-end">
|
|
<button type="submit" class="glass-btn-primary px-6 py-2 rounded-xl text-sm">บันทึกการตั้งค่า AI</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Box 2: 2FA TOTP & Security Policy -->
|
|
<div class="glass-card p-6 rounded-2xl border space-y-4">
|
|
<h3 class="font-bold text-lg text-cyan-400 pb-2 border-b border-cyan-500/20 flex items-center gap-2">
|
|
<i class="bi bi-shield-lock-fill"></i> นโยบายความปลอดภัย & 2FA TOTP
|
|
</h3>
|
|
|
|
<div class="space-y-4 text-sm">
|
|
<div class="p-4 rounded-xl bg-slate-800/60 border border-slate-700 flex items-center justify-between">
|
|
<div>
|
|
<p class="font-bold">บังคับใช้ 2-Factor Authentication (TOTP)</p>
|
|
<p class="text-xs text-subtle">สำหรับแพทย์ หมอนวด และผู้ดูแลระบบทุกท่าน</p>
|
|
</div>
|
|
<input type="checkbox" x-model="form.enable_2fa_policy" @change="toast('เปลี่ยนนโยบาย 2FA แล้ว', 'info')" class="w-5 h-5 accent-emerald-500 rounded cursor-pointer">
|
|
</div>
|
|
|
|
<div class="p-4 rounded-xl bg-slate-800/60 border border-slate-700 flex items-center justify-between">
|
|
<div>
|
|
<p class="font-bold">นโยบายรหัสผ่านแบบแข็งแกร่ง (Argon2id)</p>
|
|
<p class="text-xs text-subtle">ความยาวขั้นต่ำ 8 ตัวอักษร พร้อมอักษรพิเศษ</p>
|
|
</div>
|
|
<span class="px-2.5 py-0.5 rounded bg-emerald-500/20 text-emerald-300 text-xs font-mono font-bold">ACTIVE</span>
|
|
</div>
|
|
|
|
<div class="p-4 rounded-xl bg-slate-800/60 border border-slate-700 flex items-center justify-between">
|
|
<div>
|
|
<p class="font-bold">เวลาหมดอายุเซสชัน JWT (Access Token TTL)</p>
|
|
<p class="text-xs text-subtle">ค่าเริ่มต้น: 60 นาที (1 ชั่วโมง)</p>
|
|
</div>
|
|
<select x-model="form.jwt_ttl" class="glass-input w-32 text-xs">
|
|
<option value="30">30 นาที</option>
|
|
<option value="60">60 นาที (แนะนำ)</option>
|
|
<option value="120">2 ชั่วโมง</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener('alpine:init', () => {
|
|
Alpine.data('settingsApp', () => ({
|
|
form: {
|
|
sla_target_wait_mins: 15,
|
|
max_therapist_daily_mins: 480,
|
|
room_clean_buffer_mins: 15,
|
|
enable_2fa_policy: true,
|
|
jwt_ttl: '60'
|
|
},
|
|
|
|
saveSla() {
|
|
this.toast('บันทึกการตั้งค่าพารามิเตอร์ Smart Queue AI เรียบร้อยแล้ว', 'success');
|
|
}
|
|
}));
|
|
});
|
|
</script>
|