@@ -146,8 +151,8 @@ export async function renderEmployeeDashboard() {
${requests.map(r => `
| ${utils.formatDate(r.start_date)} - ${utils.formatDate(r.end_date)} |
- ${r.reason || ''} |
- ${r.status} |
+ ${esc(r.reason)} |
+ ${esc(r.status)} |
${r.status === 'pending' ? `
@@ -163,8 +168,16 @@ export async function renderEmployeeDashboard() {
- My Time Log
- | In | Out | Duration (Hours) | ${entries.map(e => `| ${utils.formatDateTime(e.punch_in_time)} | ${utils.formatDateTime(e.punch_out_time)} | ${e.status === 'in' ? 'Running...' : utils.formatDecimal(new Date(e.punch_out_time) - new Date(e.punch_in_time))} | `).join('') || '| No entries. | '}
+
+ My Time Log
+
+
+
+ | In | Out | Duration (Hours) | ${entries.map(e => `| ${utils.formatDateTime(e.punch_in_time)} | ${utils.formatDateTime(e.punch_out_time)} | ${e.status === 'in' ? 'Running...' : utils.formatDecimal(new Date(e.punch_out_time) - new Date(e.punch_in_time))} | `).join('') || '| No entries. | '}
@@ -177,12 +190,12 @@ export async function renderEmployeeDashboard() {
Calendar not configured.
- If the calendar doesn't display, use the “Open in new tab” link.
+ If the calendar doesn't display, use the "Open in new tab" link.
`;
-
+
attachEmployeeDashboardListeners();
if (punchedIn) {
@@ -224,7 +237,7 @@ export async function renderAdminDashboard() {
-
+
Pending Time Off Requests
@@ -233,9 +246,9 @@ export async function renderAdminDashboard() {
${pendingRequests.map(r => `
- | ${r.username} |
+ ${esc(r.username)} |
${utils.formatDate(r.start_date)} - ${utils.formatDate(r.end_date)} |
- ${r.reason||''} |
+ ${esc(r.reason)} |
@@ -252,28 +265,31 @@ export async function renderAdminDashboard() {
-
+
- Hours by Employee| Employee | Total Hours | ${Object.entries(employeeTotals).map(([username, totalMs]) => `| ${username} | ${utils.formatDecimal(totalMs)} | `).join('') || '| No data. | '}
- Detailed Logs| Employee | In | Out | Duration | Actions | ${allTimeEntries.map(e => `| ${e.username||'N/A'} | ${utils.formatDateTime(e.punch_in_time)} | ${utils.formatDateTime(e.punch_out_time)} | ${e.punch_out_time ? utils.formatDecimal(new Date(e.punch_out_time) - new Date(e.punch_in_time)) + ' hrs' : '...'} |
-${e.status === 'out' ? `` : ''} | `).join('')}
+
+
@@ -301,15 +317,16 @@ ${e.status === 'out' ? ` | |