diff options
Diffstat (limited to 'web/static')
| -rw-r--r-- | web/static/app.mjs | 164 | ||||
| -rw-r--r-- | web/static/catalog.mjs | 105 | ||||
| -rw-r--r-- | web/static/client.mjs | 3 | ||||
| -rw-r--r-- | web/static/index.html | 54 | ||||
| -rw-r--r-- | web/static/style.css | 33 |
5 files changed, 262 insertions, 97 deletions
diff --git a/web/static/app.mjs b/web/static/app.mjs index 429bef7..33d5a08 100644 --- a/web/static/app.mjs +++ b/web/static/app.mjs @@ -1,8 +1,40 @@ import { Client } from './client.mjs'; +import { catalogViews } from './catalog.mjs'; const $ = id => document.getElementById(id); const text = new TextDecoder('utf-8', { fatal: true }); let client = null, current = null, currentPath = '/', busy = false, dirty = false; let configuration = null; +let activeView = 'files'; +const catalog = catalogViews(pathLink); + +async function loadConfiguration() { + if (!configuration) { + const response = await fetch('/_cloud9/config.json'); + if (!response.ok) throw new Error('Unable to load server settings. Reload to try again.'); + configuration = await response.json(); + for (const view of ['sites', 'services']) $(`view-${view}`).hidden = !configuration.catalog; + } + return configuration; +} +function locationView() { + const view = new URLSearchParams(location.search).get('view'); + return configuration?.catalog && ['sites', 'services'].includes(view) ? view : 'files'; +} +function viewURL(view, path = currentPath) { + return pathURL(path) + (view === 'files' ? (current?.stream && path === currentPath ? '?follow=1' : '') : `?view=${view}`); +} +function showView(view) { + activeView = view; + for (const name of ['files', 'sites', 'services']) { + $(`${name}-view`).hidden = view !== name; + const link = $(`view-${name}`); + link.classList.toggle('selected', view === name); + if (view === name) link.setAttribute('aria-current', 'page'); else link.removeAttribute('aria-current'); + link.href = viewURL(name); + } + document.title = `${view === 'files' ? currentPath : view} — 9web`; + catalog.show(view); +} function status(message, error = false) { $('status').textContent = message; @@ -11,13 +43,13 @@ function status(message, error = false) { function controls() { for (const id of ['go', 'reload', 'newfile', 'newdir', 'upload']) $(id).disabled = busy; $('save').disabled = busy || !current || current.stat.directory || $('editor').hidden || !dirty; - $('download').disabled = busy || !current || current.stat.directory; + $('download').disabled = busy || !current || current.stat.directory || current.stream; $('follow').disabled = busy || !current || current.stat.directory; $('rename').disabled = busy || currentPath === '/'; $('delete').disabled = busy || currentPath === '/'; $('editor').readOnly = busy; $('edit-status').textContent = dirty ? 'Unsaved changes.' : 'No unsaved changes.'; - document.querySelector('main').setAttribute('aria-busy', String(busy)); + document.querySelector('#files-view main').setAttribute('aria-busy', String(busy)); } async function action(operation) { if (busy) return; @@ -29,23 +61,19 @@ async function action(operation) { } async function connectedClient() { if (client && !client.closed) return client; - if (!configuration) { - const response = await fetch('/_cloud9/config.json'); - if (!response.ok) throw new Error('Unable to load server settings. Reload to try again.'); - configuration = await response.json(); - } + await loadConfiguration(); try { client = await Client.connect('/_cloud9/9p', configuration.user, configuration.tree); } catch { throw new Error('Unable to reach the file server. Reload to try again.'); } return client; } -async function readPath(path) { +async function readPath(path, metadataOnly = false) { const active = await connectedClient(); - try { return await active.readPath(path); } + try { return await active.readPath(path, metadataOnly); } catch (error) { // A timed-out/closed transport has lost its fids. Retry reads once on a // fresh session. Writes are never replayed after an uncertain result. if (!active.closed) throw error; - return (await connectedClient()).readPath(path); + return (await connectedClient()).readPath(path, metadataOnly); } } function normalizePath(path) { @@ -103,16 +131,18 @@ function breadcrumbs(path) { $('up').href = pathURL(parent); $('up').dataset.path = parent; } -async function navigate(path, historyMode = 'push') { +async function navigate(path, historyMode = 'push', follow = false) { path = normalizePath(path); + showView('files'); stopFollow(); status('Loading…'); - const result = await readPath(path); + const result = await readPath(path, follow); current = result; currentPath = path; dirty = false; + for (const view of ['files', 'sites', 'services']) $(`view-${view}`).href = viewURL(view); $('path').value = path; - const url = pathURL(path); + const url = pathURL(path) + (follow ? '?follow=1' : ''); if (historyMode === 'push' && location.pathname + location.search + location.hash !== url) history.pushState(null, '', url); - document.title = `${path} — cloud9`; + document.title = `${path} — 9web`; breadcrumbs(path); $('directory').hidden = !result.stat.directory; $('file').hidden = result.stat.directory; @@ -124,6 +154,11 @@ async function navigate(path, historyMode = 'push') { const permissions = document.createElement('td'), name = document.createElement('td'), size = document.createElement('td'); permissions.className = 'mode'; permissions.textContent = mode(entry); name.append(pathLink(entry.name + (entry.directory ? '/' : ''), child(path, entry.name), 'entry' + (entry.directory ? ' directory' : ''))); + if (!entry.directory) { + const followLink = pathLink('follow', child(path, entry.name), 'follow-link'); + followLink.dataset.follow = 'true'; followLink.href += '?follow=1'; + name.append(followLink); + } size.className = 'size'; size.textContent = entry.directory ? '—' : entry.length.toLocaleString(); row.append(permissions, name, size); rows.append(row); } @@ -133,7 +168,7 @@ async function navigate(path, historyMode = 'push') { } else { $('filename').textContent = result.stat.name; $('file-mode').textContent = mode(result.stat); - $('file-size').textContent = `${result.bytes.length.toLocaleString()} bytes`; + $('file-size').textContent = result.stream ? 'stream' : `${result.bytes.length.toLocaleString()} bytes`; let editable = true; try { if (result.bytes.includes(0)) throw new Error('Binary'); @@ -145,20 +180,31 @@ async function navigate(path, historyMode = 'push') { status('File loaded.'); } updateStat(result); - markTree(path); + if (follow && !result.stat.directory) startFollow(); } function mayLeave() { return !dirty || window.confirm('Discard unsaved changes?'); } document.addEventListener('click', event => { + const tab = event.target.closest('a[data-view]'); + if (tab && event.button === 0 && !event.ctrlKey && !event.metaKey && !event.shiftKey && !event.altKey) { + event.preventDefault(); + if (busy || tab.hidden) return; + const view = tab.dataset.view; + if (view === activeView) return; + history.pushState(null, '', viewURL(view)); + showView(view); + if (view === 'files' && !current) action(() => navigate(currentPath, 'none')); + return; + } const link = event.target.closest('a[data-path]'); if (!link || event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) return; event.preventDefault(); - if (!busy && mayLeave()) action(() => navigate(link.dataset.path)); + if (!busy && mayLeave()) action(() => navigate(link.dataset.path, 'push', link.dataset.follow === 'true')); }); $('path-form').onsubmit = event => { event.preventDefault(); if (mayLeave()) action(() => navigate($('path').value)); }; -$('reload').onclick = () => { if (mayLeave()) action(() => navigate(current ? currentPath : locationPath(), 'none')); }; +$('reload').onclick = () => { if (mayLeave()) action(() => navigate(current ? currentPath : locationPath(), 'none', Boolean(current?.stream))); }; $('editor').oninput = () => { dirty = true; controls(); }; $('save').onclick = () => action(async () => { const bytes = new TextEncoder().encode($('editor').value); @@ -180,27 +226,23 @@ $('download').onclick = () => { setTimeout(() => URL.revokeObjectURL(url), 1000); }; window.addEventListener('popstate', () => { - if (busy || !mayLeave()) { history.pushState(null, '', pathURL(currentPath)); return; } - action(() => navigate(locationPath(), 'none')); + const view = locationView(), path = locationPath(); + if (busy || (view === 'files' && path !== currentPath && !mayLeave())) { history.pushState(null, '', viewURL(activeView)); return; } + showView(view); + const follow = new URLSearchParams(location.search).get('follow') === '1'; + if (view === 'files' && (!current || path !== currentPath || Boolean(current.stream) !== follow)) action(() => navigate(path, 'none', follow)); }); window.addEventListener('beforeunload', event => { if (dirty) { event.preventDefault(); event.returnValue = ''; } }); -// ---- HTTP /fs view: tree, stat panel, create/rename/delete/upload, follow ---- +// ---- HTTP /fs view: stat panel, create/rename/delete/upload, follow ---- // These operate over the gateway's HTTP mapping of the same 9P tree, so they // stay independent of the WebSocket editing session above. function fsURL(path) { return '/fs' + path.split('/').map(encodeURIComponent).join('/'); } function parentOf(path) { return path.replace(/\/[^/]+$/, '') || '/'; } function baseName(path) { return path.split('/').filter(Boolean).pop() || ''; } function dirContext() { return current && current.stat.directory ? currentPath : parentOf(currentPath); } -function sortEntries(a, b) { return Number(b.dir) - Number(a.dir) || a.name.localeCompare(b.name); } - -async function fetchDir(path) { - const response = await fetch(fsURL(path) + (path.endsWith('/') ? '' : '/'), { headers: { accept: 'application/json' } }); - if (!response.ok) throw new Error(`list failed: ${response.status}`); - return response.json(); -} function renderStat(rows) { const dl = $('stat'); @@ -233,72 +275,37 @@ function updateStat(result) { }).catch(() => {}); } -function treeItem(entry, path) { - const li = document.createElement('li'); - const node = document.createElement('span'); - node.className = 'node' + (entry.dir ? ' dir' : ''); - node.dataset.node = path; - const twist = document.createElement('span'); - twist.className = 'twist'; - twist.textContent = entry.dir ? '▸' : ' '; - node.append(twist, document.createTextNode(entry.name)); - li.append(node); - node.onclick = () => { - if (entry.dir) toggleTree(li, path, twist); - else if (!busy && mayLeave()) action(() => navigate(path)); - }; - return li; -} -async function toggleTree(li, path, twist) { - const open = li.querySelector(':scope > ul'); - if (open) { open.remove(); twist.textContent = '▸'; return; } - twist.textContent = '▾'; - const ul = document.createElement('ul'); - li.append(ul); - try { - for (const entry of (await fetchDir(path)).sort(sortEntries)) ul.append(treeItem(entry, child(path, entry.name))); - } catch (error) { ul.textContent = '(unavailable)'; } -} -async function loadTree() { - const root = $('filetree'); - try { - const entries = (await fetchDir('/')).sort(sortEntries); - root.replaceChildren(...entries.map(entry => treeItem(entry, '/' + entry.name))); - } catch { /* upstream not ready; leave the last tree in place */ } -} -function markTree(path) { - for (const node of $('filetree').querySelectorAll('.node.current')) node.classList.remove('current'); - const match = $('filetree').querySelector(`.node[data-node="${CSS.escape(path)}"]`); - if (match) match.classList.add('current'); -} let stream = null; -function stopFollow() { +function stopFollow(clear = true) { if (stream) { stream.close(); stream = null; } $('follow').classList.remove('active'); - $('stream').hidden = true; - $('stream').textContent = ''; + if (clear) { $('stream').hidden = true; $('stream').textContent = ''; } } function startFollow() { if (!current || current.stat.directory) return; + current.stream = true; + history.replaceState(null, '', viewURL('files')); + controls(); $('editor').hidden = true; $('binary').hidden = true; $('edit-actions').hidden = true; const view = $('stream'); view.hidden = false; view.textContent = ''; $('follow').classList.add('active'); + status('Following stream…'); stream = new EventSource(fsURL(currentPath) + '?follow=1'); stream.onmessage = event => { view.textContent += event.data + '\n'; view.scrollTop = view.scrollHeight; }; - stream.addEventListener('eof', stopFollow); - stream.onerror = () => { status('Stream ended.'); stopFollow(); }; + stream.addEventListener('eof', () => { stopFollow(false); status('End of stream.'); }); + stream.onerror = () => { status('Stream ended.'); stopFollow(false); }; } $('follow').onclick = () => { - if ($('follow').classList.contains('active')) { stopFollow(); action(() => navigate(currentPath, 'none')); } + if ($('follow').classList.contains('active')) { stopFollow(false); status('Stream stopped.'); } else startFollow(); }; async function mutate(fn, done) { if (busy) return; busy = true; controls(); - try { await fn(); await loadTree(); status(done); } + try { await fn(); status(done); } catch (error) { status(error.message, true); } finally { busy = false; controls(); } } @@ -357,4 +364,13 @@ $('upload-input').onchange = () => { $('upload-input').value = ''; }; -action(() => navigate(locationPath(), 'none')).then(loadTree); +async function start() { + try { + await loadConfiguration(); + currentPath = locationPath(); + const view = locationView(); + showView(view); + if (view === 'files') await action(() => navigate(currentPath, 'none', new URLSearchParams(location.search).get('follow') === '1')); + } catch (error) { status(error.message, true); } +} +start(); diff --git a/web/static/catalog.mjs b/web/static/catalog.mjs new file mode 100644 index 0000000..2897389 --- /dev/null +++ b/web/static/catalog.mjs @@ -0,0 +1,105 @@ +// Sites and services are views of the same 9web application. File/log links +// use app.mjs navigation; control writes use the normal HTTP-to-9P mapping. +const $ = id => document.getElementById(id); +const element = (tag, text = '') => { const e = document.createElement(tag); e.textContent = text; return e; }; +function url(address, port, protocol = 'http') { + let host = address; + if (!host || host === '0.0.0.0' || host === '::') host = location.hostname; + host = host.replace(/^\[|\]$/g, ''); + return `${protocol}://${host.includes(':') ? `[${host}]` : host}:${port}/`; +} + +export function catalogViews(pathLink) { + let active = 'files', timer = null, request = null, revision = 0, pending = new Set(); + const rows = new Map(); + let namespace = ''; + function status(view, text, error = false) { + const p = $(`${view}-status`); p.textContent = text; p.classList.toggle('error', error); + } + async function control(site, command) { + if (pending.has(site.name)) return; + pending.add(site.name); updateSite(site); + try { + const r = await fetch(`/fs${namespace}/sites/${encodeURIComponent(site.name)}/ctl`, { method: 'PUT', body: command }); + if (!r.ok) throw new Error(await r.text()); + status('sites', `${site.title}: ${command} requested.`); + } catch (error) { status('sites', error.message, true); } + finally { pending.delete(site.name); updateSite(site); if (active === 'sites') await refresh(false); } + } + function updateSite(site) { + let row = rows.get(site.name); + if (!row) { + const tr = element('tr'); tr.dataset.site = site.name; + const name = element('td'), phase = element('td'), finished = element('td'), actions = element('td'); + const link = element('a'); link.className = 'site-name'; + const root = element('span'); root.className = 'site-root'; name.append(link, root); + const tools = element('div'); tools.className = 'site-actions'; + const build = element('button', 'build'), watch = element('button', 'watch'), cancel = element('button', 'cancel'); + for (const b of [build, watch, cancel]) b.type = 'button'; + tools.append(build, watch, cancel, pathLink('files', `${namespace}/sites/${site.name}/public`), pathLink('log', `${namespace}/sites/${site.name}/log`)); + actions.append(tools); tr.append(name, phase, finished, actions); + row = { tr, link, root, phase, finished, build, watch, cancel }; rows.set(site.name, row); + $('sites-entries').append(tr); + } + const s = site.status; + row.link.textContent = site.title; row.link.href = site.port ? url('', site.port) : `/sites/${encodeURIComponent(site.name)}/`; row.root.textContent = site.root; + row.phase.textContent = `${s.phase}${s.watching ? ' · watch on' : ''}${s.queued ? ' · queued' : ''}${s.exit_code !== null ? ` · exit ${s.exit_code}` : ''}`; + row.phase.className = `site-phase${s.phase === 'failed' ? ' failed' : ''}`; + row.finished.textContent = s.finished ? new Date(s.finished * 1000).toLocaleString() : '—'; + row.build.disabled = pending.has(site.name) || !site.build; + row.watch.disabled = pending.has(site.name) || !site.watch; + row.watch.textContent = s.watching ? 'stop watching' : 'watch'; + row.cancel.disabled = pending.has(site.name) || (!s.pid && !s.queued && !s.watching); + row.build.onclick = () => control(site, 'build'); + row.watch.onclick = () => control(site, s.watching ? 'watch off' : 'watch on'); + row.cancel.onclick = () => control(site, 'cancel'); + } + function listenerRow(item, sites) { + const tr = element('tr'), name = element('td'); + if (item.protocol !== 'unknown') { + const site = item.service === '9web' && sites.find(s => s.port === item.port); + const a = element('a', site ? site.title : item.service); a.href = url(item.address, item.port, item.protocol); name.append(a); + } else name.textContent = item.process || 'Unknown'; + const address = element('td', `${item.address.includes(':') ? `[${item.address}]` : item.address}:${item.port}${item.local ? ' · local only' : ''}`); + address.className = 'listener-address'; + tr.append(name, address, element('td', item.pid ? `${item.process || ''} (${item.pid})` : 'Unavailable'), element('td', item.evidence)); + return tr; + } + async function refresh(showCount = true) { + if (active === 'files' || document.hidden) return; + request?.abort(); request = new AbortController(); + const ticket = ++revision, view = active; + $(`${view}-reload`).disabled = true; + try { + const r = await fetch('/_cloud9/catalog.json', { signal: request.signal }); + if (!r.ok) throw new Error(`Unable to load ${view}: HTTP ${r.status}`); + const data = await r.json(); + if (ticket !== revision || active !== view) return; + namespace = data.namespace || ''; + if (view === 'sites') { + const names = new Set(data.sites.map(s => s.name)); + for (const [name, row] of rows) if (!names.has(name)) { row.tr.remove(); rows.delete(name); } + for (const site of data.sites) updateSite(site); + $('sites-empty').hidden = data.sites.length !== 0; + if (showCount) status(view, `${data.sites.length} ${data.sites.length === 1 ? 'site' : 'sites'} · generated files are served continuously`); + } else { + const known = data.listeners.filter(x => x.protocol !== 'unknown'), unknown = data.listeners.filter(x => x.protocol === 'unknown'); + $('services-entries').replaceChildren(...known.map(x => listenerRow(x, data.sites))); + $('other-listeners-entries').replaceChildren(...unknown.map(x => listenerRow(x, data.sites))); + $('services-empty').hidden = known.length !== 0; + $('other-listeners-title').textContent = `Other listeners (${unknown.length})`; + status(view, data.discovery_error || `${known.length} HTTP services · refreshed every 5 seconds`, Boolean(data.discovery_error)); + } + } catch (error) { if (error.name !== 'AbortError' && ticket === revision) status(view, error.message, true); } + finally { if (ticket === revision) $(`${view}-reload`).disabled = false; } + } + function show(view) { + clearInterval(timer); request?.abort(); revision++; + active = view; + for (const name of ['sites', 'services']) $(`${name}-reload`).disabled = false; + if (view !== 'files') { refresh(); timer = setInterval(refresh, 5000); } + } + for (const name of ['sites', 'services']) $(`${name}-reload`).onclick = () => refresh(); + document.addEventListener('visibilitychange', () => { if (!document.hidden) refresh(); }); + return { show }; +} diff --git a/web/static/client.mjs b/web/static/client.mjs index 69f44d2..c012fc0 100644 --- a/web/static/client.mjs +++ b/web/static/client.mjs @@ -96,9 +96,10 @@ export class Client { if (live && !this.closed) await this.ask('clunk', 1); } } - readPath(path) { + readPath(path, metadataOnly = false) { return this.serial(() => this.withFile(path, async () => { const stat = JSON.parse(decoder.decode((await this.ask('stat', 1)).data)); + if (metadataOnly && !stat.directory) return { stat, entries: [], bytes: new Uint8Array(), stream: true }; const opened = await this.ask('open', 1, 0); const count = Math.min(this.wasm.max_read(), opened.number || Infinity); let offset = 0; diff --git a/web/static/index.html b/web/static/index.html index b012b3c..c392e65 100644 --- a/web/static/index.html +++ b/web/static/index.html @@ -3,17 +3,22 @@ <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> - <title>cloud9 — files</title> + <title>9web — files</title> <link rel="stylesheet" href="/_cloud9/style.css"> <script type="module" src="/_cloud9/app.mjs"></script> </head> <body> <header> - <a class="brand" href="/" data-path="/">cloud9</a> + <a class="brand" href="/" data-path="/">9web</a> <div class="description">A web interface to your file server.</div> </header> - <nav class="toolbar" aria-label="File actions"> - <a class="selected" href="/" data-path="/">files</a> + <nav class="toolbar" id="views" aria-label="Views"> + <a class="selected" id="view-files" href="/" data-view="files" aria-current="page">files</a> + <a id="view-sites" href="/?view=sites" data-view="sites" hidden>sites</a> + <a id="view-services" href="/?view=services" data-view="services" hidden>services</a> + </nav> + <div id="files-view"> + <nav class="toolbar file-tools" aria-label="File actions"> <button id="reload" type="button">reload</button> <button id="newfile" type="button">new file</button> <button id="newdir" type="button">new folder</button> @@ -28,10 +33,6 @@ </form> </nav> <div class="layout"> - <aside id="sidebar" aria-label="Tree"> - <div class="tree-head">tree</div> - <ul id="filetree" role="tree"></ul> - </aside> <main> <nav id="breadcrumbs" aria-label="Breadcrumb"><a href="/" data-path="/">root</a></nav> <div class="summary"> @@ -66,6 +67,41 @@ </section> </main> </div> - <footer>served by cloud9</footer> + </div> + <main id="sites-view" class="catalog-view" aria-label="Sites" hidden> + <div class="summary"> + <p id="sites-status" role="status" aria-live="polite">Loading sites…</p> + <button id="sites-reload" type="button">reload</button> + </div> + <div class="table-scroll"> + <table> + <thead><tr><th scope="col">Site</th><th scope="col">Status</th><th scope="col">Last build</th><th scope="col">Actions</th></tr></thead> + <tbody id="sites-entries"></tbody> + </table> + </div> + <p id="sites-empty" class="muted" hidden>No sites configured.</p> + </main> + <main id="services-view" class="catalog-view" aria-label="Services" hidden> + <div class="summary"> + <p id="services-status" role="status" aria-live="polite">Loading services…</p> + <button id="services-reload" type="button">reload</button> + </div> + <p class="muted">Listeners identified from process metadata, without endpoint probes. Local-only links work on this computer.</p> + <div class="table-scroll"> + <table> + <thead><tr><th scope="col">Service</th><th scope="col">Address</th><th scope="col">Process</th><th scope="col">Evidence</th></tr></thead> + <tbody id="services-entries"></tbody> + </table> + </div> + <p id="services-empty" class="muted" hidden>No HTTP services identified.</p> + <details id="other-listeners"> + <summary id="other-listeners-title">Other listeners</summary> + <div class="table-scroll"><table> + <thead><tr><th scope="col">Process</th><th scope="col">Address</th><th scope="col">PID</th><th scope="col">Evidence</th></tr></thead> + <tbody id="other-listeners-entries"></tbody> + </table></div> + </details> + </main> + <footer>served by 9web</footer> </body> </html> diff --git a/web/static/style.css b/web/static/style.css index 965406b..e17f1e5 100644 --- a/web/static/style.css +++ b/web/static/style.css @@ -8,6 +8,7 @@ body { margin: 0; padding: 22px 3%; } a { color: #07539b; text-decoration: none; } a:hover { text-decoration: underline; } +.follow-link { margin-left: 14px; font-size: 11px; color: #777; } header { padding: 0 8px 17px; } .brand { font-size: 30px; font-weight: bold; color: #222; letter-spacing: -1px; } .description { color: #777; margin-top: 1px; } @@ -26,6 +27,21 @@ header { padding: 0 8px 17px; } font-size: 15px; } .toolbar .selected { background: #ccc; color: #111; } +.file-tools { border-bottom: 1px solid #ddd; padding-top: 7px; } +.catalog-view { padding-top: 13px; } +.catalog-view .summary p { margin: 0; color: #777; } +.catalog-view .summary .error { color: #a22; } +.catalog-view td { padding-top: 8px; padding-bottom: 8px; } +.catalog-view .site-name { font-weight: bold; } +.catalog-view .site-root { display: block; color: #777; font: 12px/1.6 monospace; overflow-wrap: anywhere; } +.catalog-view .site-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; font-size: 12px; } +.catalog-view .site-phase { white-space: nowrap; } +.catalog-view .site-phase.failed { color: #a22; } +.catalog-view .listener-address { font-family: monospace; overflow-wrap: anywhere; } +.catalog-view .muted { color: #777; font-size: 12px; } +.table-scroll { overflow-x: auto; } +#other-listeners { margin-top: 20px; } +#other-listeners summary { cursor: pointer; padding-bottom: 8px; color: #777; } button, input, textarea { font: inherit; color: inherit; } button { cursor: pointer; @@ -66,17 +82,7 @@ textarea { display: block; width: 100%; min-height: 420px; resize: vertical; bor #binary { color: #777; padding: 16px 8px; } .actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px; } #edit-status { color: #777; } -.layout { display: flex; align-items: flex-start; gap: 16px; } -#sidebar { flex: 0 0 220px; border-right: 1px solid #e2e2e2; padding: 8px 10px 0 0; min-width: 0; } -.tree-head { color: #999; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 4px; } -#filetree, #filetree ul { list-style: none; margin: 0; padding: 0; } -#filetree ul { margin-left: 12px; } -#filetree li { line-height: 1.7; white-space: nowrap; } -#filetree .node { cursor: pointer; font-family: monospace; overflow-wrap: anywhere; } -#filetree .node.dir { font-weight: bold; } -#filetree .node.current { background: #ccc; } -#filetree .twist { display: inline-block; width: 12px; color: #999; } -.layout main { flex: 1 1 auto; min-width: 0; } +.layout main { min-width: 0; } #stat-panel { margin-top: 18px; border-top: 1px solid #eee; padding-top: 8px; } #stat-panel h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #999; margin: 0 0 6px; } #stat { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; font: 12px monospace; margin: 0; } @@ -90,6 +96,9 @@ footer { margin: 30px 8px 0; padding-top: 7px; border-top: 1px solid #ddd; text- a:focus-visible, button:focus-visible { outline: 2px solid #07539b; outline-offset: 2px; } [hidden] { display: none !important; } @media (max-width: 600px) { + #sites-view .site-root, #sites-view th:nth-child(3), #sites-view td:nth-child(3) { display: none; } + .catalog-view .site-phase { white-space: normal; } + #services-view table { min-width: 600px; } body { padding: 14px 10px; } header { padding-left: 3px; } .brand { font-size: 26px; } @@ -104,6 +113,4 @@ a:focus-visible, button:focus-visible { outline: 2px solid #07539b; outline-offs .summary { align-items: start; } .file-heading { gap: 7px 12px; } textarea { min-height: 350px; } - .layout { flex-direction: column; } - #sidebar { flex: none; width: 100%; border-right: 0; border-bottom: 1px solid #e2e2e2; max-height: 180px; overflow: auto; padding: 0 0 6px; } } |
