feat: integrate role-aware settings directly into dashboard
Build MCP Services / build-mcp-filesystem (push) Successful in 1m16s
Details
Build MCP Services / build-mcp-filesystem (push) Successful in 1m16s
Details
This commit is contained in:
parent
0e71c0dc27
commit
56c7a1508d
|
|
@ -27,7 +27,7 @@
|
||||||
<a href="#" data-section="lab"><span>🔬</span> Lab</a>
|
<a href="#" data-section="lab"><span>🔬</span> Lab</a>
|
||||||
<a href="billing.html" data-section="billing" data-external><span>💳</span> Billing & Accounts</a>
|
<a href="billing.html" data-section="billing" data-external><span>💳</span> Billing & Accounts</a>
|
||||||
<a href="staff.html" data-section="staff" data-external><span>👔</span> Staff & Payroll</a>
|
<a href="staff.html" data-section="staff" data-external><span>👔</span> Staff & Payroll</a>
|
||||||
<a href="settings.html" data-section="settings" data-external><span>⚙️</span> Settings</a>
|
<a href="#" data-section="settings"><span>⚙️</span> Settings</a>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="user-profile">
|
<div class="user-profile">
|
||||||
<div class="avatar">DS</div>
|
<div class="avatar">DS</div>
|
||||||
|
|
@ -61,6 +61,56 @@
|
||||||
<p id="sectionPageSubtitle"></p>
|
<p id="sectionPageSubtitle"></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Settings Section (Internal) -->
|
||||||
|
<div id="settings-section" class="section-container hidden">
|
||||||
|
<div class="settings-grid doctor-only">
|
||||||
|
<div class="section-card">
|
||||||
|
<h2>Clinical Profile</h2>
|
||||||
|
<div class="input-group">
|
||||||
|
<label>Full Name</label>
|
||||||
|
<input type="text" value="Dr. Sharma">
|
||||||
|
</div>
|
||||||
|
<div class="input-group">
|
||||||
|
<label>Specialization</label>
|
||||||
|
<input type="text" value="Cardiologist">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section-card">
|
||||||
|
<h2>Zen Scribe Preferences</h2>
|
||||||
|
<div class="input-group">
|
||||||
|
<label>Default Scribe Language</label>
|
||||||
|
<select id="scribeLangPref">
|
||||||
|
<option value="en-US">English (US)</option>
|
||||||
|
<option value="hi-IN">Hindi</option>
|
||||||
|
<option value="te-IN">Telugu</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="input-group">
|
||||||
|
<label>Auto-Generate Clinical Summary</label>
|
||||||
|
<select>
|
||||||
|
<option>Enabled</option>
|
||||||
|
<option>Disabled</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="settings-grid admin-only hidden">
|
||||||
|
<div class="section-card">
|
||||||
|
<h2>Hospital Configuration</h2>
|
||||||
|
<div class="input-group">
|
||||||
|
<label>Consultation Fee (₹)</label>
|
||||||
|
<input type="number" value="500">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="margin-top: 2rem;">
|
||||||
|
<button class="btn-primary" onclick="alert('Settings saved!')">Save Preferences</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- DOCTOR ZEN VIEW (Clinical Focus) -->
|
<!-- DOCTOR ZEN VIEW (Clinical Focus) -->
|
||||||
<div id="doctor-zen-section" class="hidden">
|
<div id="doctor-zen-section" class="hidden">
|
||||||
<div class="zen-layout">
|
<div class="zen-layout">
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,11 @@ const SECTION_META = {
|
||||||
target: 'doctor-zen-section',
|
target: 'doctor-zen-section',
|
||||||
title: 'Clinical Workspace',
|
title: 'Clinical Workspace',
|
||||||
subtitle: 'Document visits, prescribe, and review vitals.'
|
subtitle: 'Document visits, prescribe, and review vitals.'
|
||||||
|
},
|
||||||
|
settings: {
|
||||||
|
target: 'settings-section',
|
||||||
|
title: 'Preferences',
|
||||||
|
subtitle: 'Manage your profile and clinical tool settings.'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -198,12 +203,19 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
|
||||||
// 3. Section Switching Logic
|
// 3. Section Switching Logic
|
||||||
window.showSection = (sectionId) => {
|
window.showSection = (sectionId) => {
|
||||||
const sections = ['overview-section', 'patients-section', 'pharmacy-section', 'lab-section', 'doctor-zen-section'];
|
const sections = ['overview-section', 'patients-section', 'pharmacy-section', 'lab-section', 'doctor-zen-section', 'settings-section'];
|
||||||
sections.forEach(id => {
|
sections.forEach(id => {
|
||||||
const el = document.getElementById(id);
|
const el = document.getElementById(id);
|
||||||
if (el) el.classList.add('hidden');
|
if (el) el.classList.add('hidden');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const role = getUserRole();
|
||||||
|
if (sectionId === 'settings') {
|
||||||
|
const isDoctor = role === 'DOCTOR';
|
||||||
|
document.querySelector('#settings-section .doctor-only')?.classList.toggle('hidden', !isDoctor);
|
||||||
|
document.querySelector('#settings-section .admin-only')?.classList.toggle('hidden', isDoctor);
|
||||||
|
}
|
||||||
|
|
||||||
const target = resolveSectionTarget(sectionId);
|
const target = resolveSectionTarget(sectionId);
|
||||||
const targetEl = document.getElementById(target);
|
const targetEl = document.getElementById(target);
|
||||||
if (targetEl) targetEl.classList.remove('hidden');
|
if (targetEl) targetEl.classList.remove('hidden');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue