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:
+18
-6
@@ -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, ¤cy,
|
||||
&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 = ¤cy.String
|
||||
}
|
||||
employees = append(employees, e)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user