feat: integrate Grafana dashboards into BOC DashboardPage

- Add Infrastructure Health section with CPU/Memory/Disk panels
- Add Service Status section with PM2/Docker panels
- Create GrafanaPanel component for iframe embedding
- Build passes successfully
This commit is contained in:
Bernt
2026-07-29 19:03:06 +00:00
parent af874040ca
commit e5623d2f84
77 changed files with 11338 additions and 779 deletions
+18 -6
View File
@@ -22,12 +22,12 @@ type Employee struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Email string `json:"email"`
Phone string `json:"phone"`
Phone *string `json:"phone,omitempty"`
Department string `json:"department"`
Position string `json:"position"`
EmploymentType string `json:"employment_type"`
Salary float64 `json:"salary"`
Currency string `json:"currency"`
Salary *float64 `json:"salary,omitempty"`
Currency *string `json:"currency,omitempty"`
StartDate *time.Time `json:"start_date"`
Status string `json:"status"`
CreatedAt time.Time `json:"created_at"`
@@ -61,7 +61,7 @@ func (h *HRHandler) ListEmployees(w http.ResponseWriter, r *http.Request) {
SELECT id, first_name, last_name, email, phone, department, position,
employment_type, salary, currency, start_date, status, created_at
FROM boc_employees
WHERE status = 'active'
WHERE status != 'deleted'
ORDER BY created_at DESC
`)
if err != nil {
@@ -73,11 +73,23 @@ func (h *HRHandler) ListEmployees(w http.ResponseWriter, r *http.Request) {
employees := []Employee{}
for rows.Next() {
var e Employee
if err := rows.Scan(&e.ID, &e.FirstName, &e.LastName, &e.Email, &e.Phone,
&e.Department, &e.Position, &e.EmploymentType, &e.Salary, &e.Currency,
var phone sql.NullString
var salary sql.NullFloat64
var currency sql.NullString
if err := rows.Scan(&e.ID, &e.FirstName, &e.LastName, &e.Email, &phone,
&e.Department, &e.Position, &e.EmploymentType, &salary, &currency,
&e.StartDate, &e.Status, &e.CreatedAt); err != nil {
continue
}
if phone.Valid {
e.Phone = &phone.String
}
if salary.Valid {
e.Salary = &salary.Float64
}
if currency.Valid {
e.Currency = &currency.String
}
employees = append(employees, e)
}