code wiki / _hdl_build / nx_hr_admin_page.nx

nx_hr_admin_page.nx

buildroot/runtime/_hdl_build/nx_hr_admin_page.nx

6761 B98 linesdepth 11pulls 22 transitivereach 5 importersview sourcekind librarytopic hr
docsdependenciesstructsconstsfunctions

about

nx_hr_admin_page.nx -- the sovereign /hr ADMIN CONSOLE page (server-rendered, ZERO third-party JS). It renders the live roster from the HR store -- the "logins you see" the operator asked for -- and the invite/suspend controls, so Nishi HR does the admin work through a real surface. OWNER-GATED: the daemon serves this ONLY to an active superadmin (it passes viewer_is_super, computed from the caller's session uid == HR cred_id); a non-owner gets an "owner-only" stub with NO roster (leak-check). The owner row shows no suspend control (no self-lockout, by construction). Forms POST to /hr/invite and /hr/suspend (the daemon's owner-gated handlers). roster row source: distinct cred_ids in the append-only store, LATEST record wins (handle/level/status).

dependencies 3 imports · 3 importers

nx_hr.nx nx_hr_sov.nx nx_syscalls.nx nx_hr_admin_page.nx nx_hr_admin_page_gate.nx nx_hr_console_render.nx nx_lan_signup_routes.nx

imports: nx_hr.nxnx_hr_sov.nxnx_syscalls.nx

imported by: nx_hr_admin_page_gate.nxnx_hr_console_render.nxnx_lan_signup_routes.nx

structs

none

consts

14const HAP_MAX: i64 = 256
15const HAP_BUF: i64 = 1048576
26const HAP_HEAD: *u8 = "<!doctype html><html><head><meta charset=utf-8><meta name=viewport content=\"width=device-width,initial-scale=1\"><title>Nishi HR</title><style>body{font-family:system-ui,sans-serif;max-width:680px;margin:5vh auto;padding:0 18px;color:#16202e}h1{font-size:1.25rem}table{border-collapse:collapse;width:100%;margin:12px 0}th,td{text-align:left;padding:8px 10px;border-bottom:1px solid #e1e6f0}th{color:#667;font-size:.85rem}.b{font-weight:600}.s-active{color:#137333}.s-invited{color:#a56300}.s-suspended{color:#a50e0e}form{display:inline;margin:0}input,select{padding:7px;border:1px solid #b9c2d6;border-radius:5px}button{padding:7px 12px;background:#0b2545;color:#fff;border:0;border-radius:5px;cursor:pointer}.sus{background:#a50e0e;padding:4px 9px;font-size:.85rem}</style></head><body>" as *u8

functions

12func hap_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v }
called by 1: hap_emit
17func hap_eq64(a: *u8, b: *u8) -> i64 { var i: i64=0; while i<64 { if a[i]!=b[i] { return 0 } i=i+1 } return 1 }
18func hap_cpy(dst: *u8, src: *u8, n: i64) -> i64 { var i: i64=0; while i<n { dst[i]=src[i]; i=i+1 } return 0 }
called by 1: hap_emit
19func hap_putrange(out: *u8, o: i64, src: *u8, s: i64, e: i64) -> i64 { var oo: i64=o; var i: i64=s; while i<e { out[oo]=src[i]; oo=oo+1; i=i+1 } return oo }
called by 1: hap_emit
20func hap_role(out: *u8, o: i64, lvl: i64) -> i64
called by 1: hap_emit calls 1: hr_puts
29func hap_emit(hr_store: *u8, viewer_is_super: i64, out: *u8, cap: i64) -> i64