diff --git a/README.ko.md b/README.ko.md index ccdb8f9..86458d2 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1,4 +1,4 @@ - + # vmsctl [![CI](https://github.com/with-developer/vmsctl/actions/workflows/ci.yml/badge.svg)](https://github.com/with-developer/vmsctl/actions/workflows/ci.yml) @@ -63,7 +63,7 @@ kisa-2026: 67 controls — 10 FAIL, 11 MANUAL, 29 PASS, 17 NOT_APPLICABLE 호스트가 스스로 점검하고 결과를 `vmsctl server`로 보내면, 서버가 이력을 쌓아 두고 웹 대시보드로 보여 줍니다. 영어와 한국어, 라이트·다크 테마, 휴대폰 화면을 지원합니다. -![vmsctl 대시보드 투어: 개요, 호스트, 근거와 조치 방법이 있는 호스트, 점검 항목, 매트릭스, 한국어](docs/demo/dashboard-tour.gif) +![vmsctl 대시보드 투어: 먼저 고칠 것과 기준별 현황이 있는 개요, 조치 화면, 호스트의 지난 스캔 이후 변화와 근거, 점검 항목, 매트릭스, 한국어](docs/demo/dashboard-tour.gif) ```sh vmsctl server demo # 가상의 호스트 12대로 둘러보기. 실제로 점검하거나 저장하지 않습니다. 출력된 주소를 여세요 diff --git a/README.md b/README.md index dbe55be..524cb3c 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ telnet service added (the host name is shortened). Hosts scan themselves and push the result to `vmsctl server`, which keeps the history and shows the fleet in a web dashboard (English and Korean, light and dark, fits a phone): -![A tour of the vmsctl dashboard: overview, hosts, a host with evidence and how to fix it, a control, the matrix, Korean](docs/demo/dashboard-tour.gif) +![A tour of the vmsctl dashboard: the overview with what to fix first and each standard, the remediation page, what changed on a host since its previous scan and the evidence, a control, the matrix, Korean](docs/demo/dashboard-tour.gif) ```sh vmsctl server demo # a made-up fleet of twelve hosts, nothing scanned, nothing written: open the address it prints diff --git a/docs/demo/dashboard-fix.png b/docs/demo/dashboard-fix.png index f748127..c02ac5c 100644 Binary files a/docs/demo/dashboard-fix.png and b/docs/demo/dashboard-fix.png differ diff --git a/docs/demo/dashboard-host.png b/docs/demo/dashboard-host.png index cf4fce4..7721718 100644 Binary files a/docs/demo/dashboard-host.png and b/docs/demo/dashboard-host.png differ diff --git a/docs/demo/dashboard-hosts.png b/docs/demo/dashboard-hosts.png index 4377f87..5f288e8 100644 Binary files a/docs/demo/dashboard-hosts.png and b/docs/demo/dashboard-hosts.png differ diff --git a/docs/demo/dashboard-images.png b/docs/demo/dashboard-images.png index 20e6992..45573aa 100644 Binary files a/docs/demo/dashboard-images.png and b/docs/demo/dashboard-images.png differ diff --git a/docs/demo/dashboard-matrix.png b/docs/demo/dashboard-matrix.png index acc0229..24b9186 100644 Binary files a/docs/demo/dashboard-matrix.png and b/docs/demo/dashboard-matrix.png differ diff --git a/docs/demo/dashboard-overview.png b/docs/demo/dashboard-overview.png index cd7a958..c5487e2 100644 Binary files a/docs/demo/dashboard-overview.png and b/docs/demo/dashboard-overview.png differ diff --git a/docs/demo/dashboard-tour.gif b/docs/demo/dashboard-tour.gif index e9b520a..97f8b5d 100644 Binary files a/docs/demo/dashboard-tour.gif and b/docs/demo/dashboard-tour.gif differ diff --git a/docs/fleet.ko.md b/docs/fleet.ko.md index bdbaf20..3e0886a 100644 --- a/docs/fleet.ko.md +++ b/docs/fleet.ko.md @@ -1,4 +1,4 @@ - + # 서버로 모아 보기 > 설계는 [ADR 0010](adr/0010-fleet-server-and-dashboard.md)에 있습니다. 호스트가 결과를 보내고, 서버가 저장해 두었다가 조회 @@ -288,7 +288,7 @@ server { 최신 스캔에 그 프로파일의 점검 항목이 하나도 없는 호스트는 숫자에 넣지 않습니다(보고를 멈춘 호스트는 어떤 프로파일로 스캔했든 보고가 끊긴(stale) 호스트로 셉니다). 대시보드는 이런 호스트가 몇 대인지 알려 주고 목록에 표시합니다. -프로파일이 둘 이상이면 사이드바의 선택기로 프로파일을 고르고, 고른 값은 기억합니다. +프로파일이 둘 이상이면 화면 위쪽의 선택기로 프로파일을 고르고, 고른 값은 기억합니다. 조회 토큰(`--scope api`)이 있으면 스크립트나 CI에서도 서버가 아는 것을 물어볼 수 있습니다. diff --git a/docs/fleet.md b/docs/fleet.md index 0a1b749..f09cda5 100644 --- a/docs/fleet.md +++ b/docs/fleet.md @@ -251,7 +251,7 @@ your proxy: check it against its documentation. Things to know: Hosts may scan with different profiles (`--profile`, `essentials`, a policy pack), so every number of the dashboard is of **one profile**: the overview, the host list, the matrix and the control list take `?profile=ID` and, without it, use the profile that most hosts scanned with (**a script that read these calls without `profile` before v0.19 now reads one profile: pass `?profile=all` for every profile added up, as before**). A host whose latest scan has none of its controls is not counted in the numbers (a silent host is still counted as stale, whatever it scanned with): the dashboard -says how many such hosts there are and marks them in the list. In the dashboard a selector in the sidebar picks the +says how many such hosts there are and marks them in the list. In the dashboard a selector in the top bar picks the profile (and remembers it) when there is more than one. A read token (`--scope api`) lets a script or CI ask the server what it knows: diff --git a/site/img/dashboard-fix.png b/site/img/dashboard-fix.png index f748127..c02ac5c 100644 Binary files a/site/img/dashboard-fix.png and b/site/img/dashboard-fix.png differ diff --git a/site/img/dashboard-host.png b/site/img/dashboard-host.png index cf4fce4..7721718 100644 Binary files a/site/img/dashboard-host.png and b/site/img/dashboard-host.png differ diff --git a/site/img/dashboard-hosts.png b/site/img/dashboard-hosts.png index 4377f87..5f288e8 100644 Binary files a/site/img/dashboard-hosts.png and b/site/img/dashboard-hosts.png differ diff --git a/site/img/dashboard-images.png b/site/img/dashboard-images.png index 20e6992..45573aa 100644 Binary files a/site/img/dashboard-images.png and b/site/img/dashboard-images.png differ diff --git a/site/img/dashboard-matrix.png b/site/img/dashboard-matrix.png index acc0229..24b9186 100644 Binary files a/site/img/dashboard-matrix.png and b/site/img/dashboard-matrix.png differ diff --git a/site/img/dashboard-overview.png b/site/img/dashboard-overview.png index cd7a958..c5487e2 100644 Binary files a/site/img/dashboard-overview.png and b/site/img/dashboard-overview.png differ diff --git a/site/img/ko/dashboard-fix.png b/site/img/ko/dashboard-fix.png index 55cf88a..7a23d8d 100644 Binary files a/site/img/ko/dashboard-fix.png and b/site/img/ko/dashboard-fix.png differ diff --git a/site/img/ko/dashboard-host.png b/site/img/ko/dashboard-host.png index dc89f76..4a042d9 100644 Binary files a/site/img/ko/dashboard-host.png and b/site/img/ko/dashboard-host.png differ diff --git a/site/img/ko/dashboard-hosts.png b/site/img/ko/dashboard-hosts.png index 3e6e6a9..b5cbfd1 100644 Binary files a/site/img/ko/dashboard-hosts.png and b/site/img/ko/dashboard-hosts.png differ diff --git a/site/img/ko/dashboard-images.png b/site/img/ko/dashboard-images.png index b058f5a..73d04c9 100644 Binary files a/site/img/ko/dashboard-images.png and b/site/img/ko/dashboard-images.png differ diff --git a/site/img/ko/dashboard-matrix.png b/site/img/ko/dashboard-matrix.png index dd3e6c7..391df68 100644 Binary files a/site/img/ko/dashboard-matrix.png and b/site/img/ko/dashboard-matrix.png differ diff --git a/site/img/ko/dashboard-overview.png b/site/img/ko/dashboard-overview.png index fe506ee..68d38f8 100644 Binary files a/site/img/ko/dashboard-overview.png and b/site/img/ko/dashboard-overview.png differ diff --git a/web/src/App.tsx b/web/src/App.tsx index 0c96d20..4663c5f 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -3,7 +3,8 @@ import { api, setUnauthorizedHandler } from "./lib/api"; import { useAsync, useHash } from "./lib/hooks"; import { ProfileProvider, useProfile } from "./lib/profile"; import { useI18n } from "./lib/i18n"; -import { parseRoute } from "./lib/format"; +import { hostsAddress, imagesAddress, parseHostsView, parseImagesView, parseRoute } from "./lib/format"; +import { lastListAddress } from "./lib/listAddress"; import { Login } from "./pages/Login"; import { OverviewPage } from "./pages/Overview"; import { HostsPage } from "./pages/Hosts"; @@ -12,7 +13,7 @@ import { MatrixPage } from "./pages/Matrix"; import { ImagesPage } from "./pages/Images"; import { ControlPage, ControlsPage } from "./pages/Controls"; import { FixPage } from "./pages/Fix"; -import { IconBox, IconGlobe, IconGrid, IconList, IconLogout, IconMoon, IconOverview, IconServer, IconShield, IconSun, IconWrench } from "./components/icons"; +import { IconBox, IconGlobe, IconGrid, IconList, IconLogout, IconMoon, IconOverview, IconSearch, IconServer, IconShield, IconSun, IconWrench } from "./components/icons"; type Auth = "checking" | "in" | "out" | "failed"; @@ -102,7 +103,7 @@ export function App() { ); } -/** The sidebar and the page, once the person is signed in and the profiles are known. */ +/** The top bar and the page, once the person is signed in and the profiles are known. */ function Shell({ hash, dark, toggleTheme, logout }: { hash: string; dark: boolean; toggleTheme: () => void; logout: () => void }) { const { t, toggle } = useI18n(); const { list, selected, select } = useProfile(); @@ -120,6 +121,7 @@ function Shell({ hash, dark, toggleTheme, logout }: { hash: string; dark: boolea else if (page === "fix") view = ; else view = ; const current = page === "hosts" || page === "matrix" || page === "controls" || page === "images" || page === "fix" ? page : "overview"; + const searchImages = current === "images"; // on the images, the top search looks for images const nav: [string, string, string, JSX.Element][] = [ ["overview", "#/", t("nav.overview"), ], @@ -133,49 +135,66 @@ function Shell({ hash, dark, toggleTheme, logout }: { hash: string; dark: boolea return (
-
- +
{DEMO && (

diff --git a/web/src/lib/i18n.tsx b/web/src/lib/i18n.tsx index 3c6f90a..21b6b5b 100644 --- a/web/src/lib/i18n.tsx +++ b/web/src/lib/i18n.tsx @@ -6,6 +6,8 @@ const en = { "app.name": "vmsctl", "nav.overview": "Overview", "nav.fix": "Fix", + "top.search": "Search hosts", + "top.searchImages": "Search images", "fix.title": "Fix", "fix.subtitle": "The failing controls in the order to fix them, with how to fix each and the hosts to fix it on.", "fix.queue": "Controls to fix", @@ -180,7 +182,7 @@ const en = { "profile.hosts": "{n} hosts", "profile.other": "{n} hosts scanned with another profile are not counted here. Pick that profile to see them.", "profile.otherHost": "another profile", - "profile.hostOther": "The latest scan of this host is of {profiles}. Choose that profile in the sidebar to see its controls.", + "profile.hostOther": "The latest scan of this host is of {profiles}. Choose that profile at the top of the page to see its controls.", "hosts.sortBy": "Sort", "hosts.more": "Show more", "hosts.showing": "Showing {n} of {total}", @@ -222,6 +224,8 @@ const ko: Record = { "app.name": "vmsctl", "nav.overview": "개요", "nav.fix": "조치", + "top.search": "호스트 검색", + "top.searchImages": "이미지 검색", "fix.title": "조치", "fix.subtitle": "실패한 점검 항목을 고칠 순서대로 놓고, 항목마다 고치는 방법과 고칠 호스트를 함께 보여 줍니다.", "fix.queue": "고칠 점검 항목", @@ -396,7 +400,7 @@ const ko: Record = { "profile.hosts": "호스트 {n}대", "profile.other": "다른 프로파일로 스캔한 호스트 {n}대는 여기에 집계하지 않습니다. 그 프로파일을 고르면 볼 수 있습니다.", "profile.otherHost": "다른 프로파일", - "profile.hostOther": "이 호스트의 최신 스캔은 {profiles} 프로파일 기준입니다. 사이드바에서 해당 프로파일을 고르면 점검 항목을 볼 수 있습니다.", + "profile.hostOther": "이 호스트의 최신 스캔은 {profiles} 프로파일 기준입니다. 화면 위쪽에서 해당 프로파일을 고르면 점검 항목을 볼 수 있습니다.", "hosts.sortBy": "정렬", "hosts.more": "더 보기", "hosts.showing": "{total}대 중 {n}대 표시", diff --git a/web/src/styles.css b/web/src/styles.css index 3071ba2..d0b137e 100644 --- a/web/src/styles.css +++ b/web/src/styles.css @@ -58,19 +58,32 @@ ul, ol { margin: 0; } .icon { flex: none; } /* Layout */ -.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; } -.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.25rem; padding: 1.1rem .9rem; background: var(--surface); border-right: 1px solid var(--border); } -.brand { display: flex; align-items: center; gap: .55rem; font-weight: 750; font-size: 1.1rem; color: var(--text); padding: .25rem .5rem; letter-spacing: -0.01em; } +.app { min-height: 100vh; } +/* --topbar-h: the sticky top bar's height, which what is brought into view and the remediation queue keep clear of */ +:root { --topbar-h: 4.25rem; } +html { scroll-padding-top: var(--topbar-h); } +/* The top bar: the brand, the pages, and on the right the profile, a host search and the settings */ +.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); } +.topbar-in { max-width: 1312px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .5rem clamp(16px, 3vw, 36px); } +.brand { display: flex; align-items: center; gap: .5rem; font-weight: 750; font-size: 1.05rem; color: var(--text); padding: .25rem .2rem; letter-spacing: -0.01em; flex: none; } .brand .icon { color: var(--accent); } .brand:hover { text-decoration: none; } -.sidebar nav { display: grid; gap: .15rem; } -.nav-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .4rem .6rem; } -.sidebar nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: var(--radius-sm); color: var(--muted); font-weight: 520; } -.sidebar nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; } -.sidebar nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); } -.sidebar-foot { margin-top: auto; display: grid; gap: .1rem; } -.sidebar-foot button { display: flex; align-items: center; gap: .65rem; text-align: left; width: 100%; } -main { padding: 1.6rem clamp(16px, 3vw, 36px) 3rem; max-width: 1240px; width: 100%; min-width: 0; } +.topnav { display: flex; gap: .1rem; min-width: 0; overflow-x: auto; scrollbar-width: none; } /* too narrow: it scrolls, nothing covers it */ +.topnav a { display: flex; align-items: center; gap: .4rem; padding: .45rem .55rem; border-radius: var(--radius-sm); color: var(--muted); font-weight: 560; white-space: nowrap; } +.topnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; } +.topnav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); } +.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: .3rem; flex: none; } +.topbar-tools .icon-only { padding: .45rem; } +.topbar-tools .lang-switch { display: flex; align-items: center; gap: .35rem; white-space: nowrap; } +.topbar-tools .topsearch { flex: none; min-width: 0; width: 12rem; } +@media (max-width: 1400px) { .topbar-tools .lang-switch span { display: none; } } +/* not wide enough for the pages and the settings on one line: the pages go to a second row, with their labels */ +@media (max-width: 1240px) { + :root { --topbar-h: 6.9rem; } + .topbar-in { flex-wrap: wrap; row-gap: .25rem; } + .topnav { order: 3; width: 100%; } +} +main { padding: 1.6rem clamp(16px, 3vw, 36px) 3rem; max-width: 1312px; width: 100%; min-width: 0; margin: 0 auto; } .pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; } .pagehead p { margin-top: .25rem; } .crumb { margin-bottom: .75rem; } @@ -261,18 +274,17 @@ table.matrix .cell:hover { outline: 2px solid var(--text); outline-offset: 0; } .hosthead .gauge { grid-column: 1 / -1; } } @media (max-width: 760px) { - /* a short page must not hand its spare height to the top bar: the rows keep their size and the page ends where it ends */ - .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; } .hero, .hosthead { min-width: 0; } .gauge svg { max-width: 180px; } .legend { justify-content: flex-start; } - .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: .6rem .9rem; gap: .5rem; } - /* four equal tabs that always fit: icon over label, like a tab bar */ - .sidebar nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; order: 3; width: 100%; gap: .25rem; } - .sidebar nav a { flex-direction: column; gap: .15rem; padding: .45rem .2rem; font-size: .76rem; text-align: center; } - .nav-section { display: none; } - .sidebar-foot { margin: 0 0 0 auto; display: flex; } - .sidebar-foot button span { display: none; } + /* two rows: the brand and the settings, then the pages as a tab bar (icon over label, equal widths) */ + .topbar { position: static; } + html { scroll-padding-top: 0; } + .topbar-tools .topsearch { display: none; } + .topbar-in { flex-wrap: wrap; gap: .5rem; padding: .5rem 16px; } + .topnav { order: 3; width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .2rem; } + .topnav a { flex-direction: column; gap: .15rem; padding: .4rem .15rem; font-size: .74rem; justify-content: center; } + .topbar-tools .profile-select select { max-width: 7.5rem; } .login { grid-template-columns: 1fr; } .login-art { display: none; } .control-row { grid-template-columns: 16px 3rem 1fr 6.2rem; } @@ -291,9 +303,8 @@ table.matrix .cell:hover { outline: 2px solid var(--text); outline-offset: 0; } } @media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } } -.profile-select { display: grid; gap: 4px; padding: 0 12px 12px; } -.profile-select label { font-size: 12px; color: var(--muted); } -.profile-select select { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: inherit; font: inherit; font-size: .85rem; text-overflow: ellipsis; } +.profile-select { display: flex; } +.profile-select select { max-width: 11rem; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: inherit; font: inherit; font-size: .85rem; text-overflow: ellipsis; } .scannow { display: grid; gap: .35rem; } .scannow-main { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; } @@ -411,7 +422,7 @@ html[lang="ko"] .evidence, html[lang="ko"] code, html[lang="ko"] .mono { word-br .standard .pill { justify-self: start; } /* The remediation page: the queue on the left, the chosen control on the right */ .workbench { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 1rem; align-items: start; } -.queue { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; } +.queue { position: sticky; top: calc(var(--topbar-h) + .5rem); max-height: calc(100vh - var(--topbar-h) - 1.5rem); display: flex; flex-direction: column; } .queue-filters { display: grid; gap: .5rem; padding: .8rem; border-bottom: 1px solid var(--border); } .workbench-main .fixhosts-head { margin: 0; padding: .9rem 1.1rem .5rem; font-size: .95rem; } .queue-filters .search { width: 100%; }