1621 lines
80 KiB
Go Template
1621 lines
80 KiB
Go Template
{{ define "config.gohtml" }}
|
||
<!DOCTYPE html>
|
||
<html lang="{{ .Locale }}">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<script defer src="/static/js/config-panels.js"></script>
|
||
<script defer src="/static/js/bookmarks.js"></script>
|
||
<script defer src="/static/js/bookmark-manager.js"></script>
|
||
<script defer src="/static/js/path-picker.js?v=1"></script>
|
||
<link rel="stylesheet" href="/static/css/bookmarks.css?v=2">
|
||
<title>{{ T "config.title" }}</title>
|
||
<link rel="stylesheet" href="/static/css/main.css">
|
||
<link rel="stylesheet" href="/static/css/modes.css">
|
||
|
||
<link rel="stylesheet" href="/static/css/theme/base.css">
|
||
<link rel="stylesheet" href="{{ .ThemeCSS }}">
|
||
<link rel="stylesheet" href="/static/css/config.css?v=home-palette-1">
|
||
</head>
|
||
|
||
<body class="mode-config">
|
||
|
||
<header class="topbar">
|
||
<div class="brand">
|
||
<a href="/">{{ .WikiName }}</a>
|
||
</div>
|
||
|
||
|
||
<nav>
|
||
{{ range .NavItems }}
|
||
<a href="{{ .ResolvedHref }}">{{ .Label }}</a>
|
||
{{ end }}
|
||
</nav>
|
||
|
||
{{ template "auth-menu" . }}</header>
|
||
|
||
<main class="config-main">
|
||
|
||
<div class="config-layout">
|
||
|
||
<aside
|
||
id="config-sidebar"
|
||
class="config-sidebar"
|
||
>
|
||
|
||
<button
|
||
type="button"
|
||
class="sidebar-toggle"
|
||
aria-expanded="true" aria-controls="config-sidebar" aria-label="{{ T "config.toggle_sidebar" }}"
|
||
onclick="toggleSidebar()"
|
||
>
|
||
☰
|
||
</button>
|
||
|
||
<nav class="sidebar-nav" aria-label="{{ T "config.title" }}">
|
||
{{ range .ConfigGroups }}
|
||
<details class="config-nav-group" data-config-group="{{ .ID }}" open>
|
||
<summary>{{ .Label }}</summary>
|
||
{{ range .Panels }}<a href="/-/sys/config?panel={{ .ID }}" {{ if ne .ID "organizer" }}data-panel="{{ .ID }}"{{ end }}>{{ .Label }}</a>{{ end }}
|
||
</details>
|
||
{{ end }}
|
||
</nav>
|
||
|
||
</aside>
|
||
|
||
<section class="config-content">
|
||
|
||
<section
|
||
id="panel-home"
|
||
class="config-section config-panel active"
|
||
>
|
||
|
||
<h1>{{ T "config.title" }}</h1>
|
||
|
||
<p class="muted">
|
||
{{ T "config.current_campus" }}:
|
||
<span class="mono">{{ .Context.Campus.Name }}</span>
|
||
/
|
||
<span class="mono">{{ .Context.Campus.Title }}</span>
|
||
<br>
|
||
{{ T "config.current_domain" }}:
|
||
<span class="mono">{{ .Context.Domain.Name }}</span>
|
||
/
|
||
<span class="mono">{{ .Context.Domain.Title }}</span>
|
||
</p>
|
||
|
||
<h2>{{ T "config.home" }}</h2>
|
||
|
||
<form method="post" action="/-/sys/config" class="settings-form">
|
||
<input type="hidden" name="section" value="home">
|
||
<fieldset><legend>{{ T "config.group_appearance" }}</legend>
|
||
<label>{{ T "config.locale" }}<select name="locale"><option value="en" {{ if eq .Locale "en" }}selected{{ end }}>English</option><option value="ja" {{ if eq .Locale "ja" }}selected{{ end }}>日本語</option></select></label>
|
||
<label>{{ T "config.timezone" }}<input name="timezone" value="{{ .Timezone }}" placeholder="Asia/Tokyo"></label>
|
||
<label>{{ T "config.theme" }}<select name="theme">{{ range .ThemeOptions }}<option value="{{ .ID }}" {{ if eq $.Theme .ID }}selected{{ end }}>{{ .Label }}</option>{{ end }}</select></label>
|
||
</fieldset>
|
||
<fieldset><legend>{{ T "config.home" }}</legend>
|
||
<label>{{ T "home.layout" }}<select name="home_layout">
|
||
<option value="classic" {{ if eq .HomeLayout "classic" }}selected{{ end }}>{{ T "home.layout_classic" }}</option>
|
||
<option value="search" {{ if eq .HomeLayout "search" }}selected{{ end }}>{{ T "home.layout_search" }}</option>
|
||
<option value="directory" {{ if eq .HomeLayout "directory" }}selected{{ end }}>{{ T "home.layout_directory" }}</option>
|
||
<option value="diary" {{ if eq .HomeLayout "diary" }}selected{{ end }}>{{ T "periodical.diary" }}</option>
|
||
<option value="blog" {{ if eq .HomeLayout "blog" }}selected{{ end }}>{{ T "periodical.blog" }}</option>
|
||
</select></label>
|
||
<label>{{ T "config.home_path" }}<input name="home_path" value="{{ .HomePath }}" placeholder="/home"></label>
|
||
<label class="wide">{{ T "home.wallpaper_path" }}<span class="config-path-control"><input id="home-wallpaper-path" name="home_wallpaper_path" value="{{ .HomeWallpaperPath }}" placeholder="/wallpapers"><button type="button" data-path-picker data-picker-target="home-wallpaper-path" data-picker-mode="image-or-folder" aria-label="{{ T "picker.open" }}" title="{{ T "picker.open" }}">⌕</button></span></label>
|
||
<label class="wide">{{ T "home.wallpaper_opacity" }}<span class="config-range-control"><input name="home_wallpaper_opacity" type="range" min="0" max="100" step="1" value="{{ .HomeWallpaperOpacity }}" data-range-output="home-wallpaper-opacity-output"><output id="home-wallpaper-opacity-output">{{ .HomeWallpaperOpacity }}%</output></span></label>
|
||
<p class="muted wide">{{ T "home.wallpaper_help" }}</p>
|
||
<label class="wide">{{ T "home.glass_transparency" }}<span class="config-range-control"><input name="home_glass_transparency" type="range" min="0" max="85" step="1" value="{{ .HomeGlassTransparency }}" data-range-output="home-glass-transparency-output"><output id="home-glass-transparency-output">{{ .HomeGlassTransparency }}%</output></span></label>
|
||
<p class="muted wide">{{ T "home.glass_help" }}</p>
|
||
{{ template "home-palette-controls" . }}
|
||
<p class="muted wide">{{ T "home.layout_help" }}</p>
|
||
<a class="wide" href="/-/sys/config?panel=bookmarks" data-config-panel="bookmarks">{{ T "config.manage_bookmarks" }} →</a>
|
||
<label class="config-toggle wide" data-label="{{ T "config.virtual_folder_pages" }}"><input name="virtual_folder_pages" value="1" type="checkbox" role="switch" aria-label="{{ T "config.virtual_folder_pages" }}" {{ if .VirtualFolderPages }}checked{{ end }}></label>
|
||
<p class="muted wide">{{ T "config.virtual_folder_help" }}</p>
|
||
</fieldset>
|
||
<fieldset><legend>{{ T "config.group_content" }}</legend>
|
||
<label>{{ T "config.zombie_grace_hours" }}<input name="zombie_grace_hours" type="number" min="0" value="{{ .ZombieGraceHours }}"></label>
|
||
</fieldset><button type="submit">{{ T "config.save" }}</button>
|
||
</form>
|
||
|
||
</section>
|
||
|
||
<section
|
||
id="panel-campuses"
|
||
class="config-section config-panel"
|
||
>
|
||
|
||
<h2>{{ T "config.campuses" }}</h2>
|
||
|
||
<p class="muted">
|
||
{{ T "config.campus_help" }}
|
||
</p>
|
||
|
||
<div class="table-scroll">
|
||
<table class="recent-table">
|
||
<thead>
|
||
<tr>
|
||
<th>{{ T "config.id" }}</th>
|
||
<th>{{ T "config.name" }}</th>
|
||
<th>{{ T "config.campus_title" }}</th>
|
||
<th>{{ T "config.default_language" }}</th>
|
||
<th>{{ T "config.authority_mode" }}</th>
|
||
<th>{{ T "config.campus_fqdn" }}</th>
|
||
<th>{{ T "config.online_status" }}</th>
|
||
<th>{{ T "config.enabled" }}</th>
|
||
<th>{{ T "config.created" }}</th>
|
||
<th>{{ T "config.actions" }}</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{{ range .Campuses }}
|
||
{{ $campus := . }}
|
||
{{ $campusManaged := eq .AuthorityMode "managed" }}
|
||
<tr>
|
||
<td class="mono">
|
||
{{ .ID }}
|
||
<form id="campus-update-{{ .ID }}" method="post" action="/-/sys/config"></form>
|
||
<form
|
||
id="campus-delete-{{ .ID }}"
|
||
method="post"
|
||
action="/-/sys/config"
|
||
onsubmit="return confirm('{{ T "config.delete_campus_confirm" }}')"
|
||
></form>
|
||
<input form="campus-update-{{ .ID }}" type="hidden" name="section" value="{{ if $campusManaged }}campus-managed-save{{ else }}campus-update{{ end }}">
|
||
<input form="campus-update-{{ .ID }}" type="hidden" name="campus_id" value="{{ .ID }}">
|
||
<input form="campus-delete-{{ .ID }}" type="hidden" name="section" value="campus-delete">
|
||
<input form="campus-delete-{{ .ID }}" type="hidden" name="campus_id" value="{{ .ID }}">
|
||
</td>
|
||
<td>
|
||
<input form="campus-update-{{ .ID }}" name="campus_name" type="text" value="{{ .Name }}" {{ if $campusManaged }}disabled{{ end }}>
|
||
</td>
|
||
<td>
|
||
<input form="campus-update-{{ .ID }}" name="campus_title" type="text" value="{{ .Title }}" {{ if $campusManaged }}disabled{{ end }}>
|
||
</td>
|
||
<td>
|
||
<input form="campus-update-{{ .ID }}" name="campus_default_lang" type="text" value="{{ .DefaultLang }}" placeholder="ja" {{ if $campusManaged }}disabled{{ end }}>
|
||
</td>
|
||
<td>
|
||
<select form="campus-update-{{ .ID }}" name="campus_authority_mode" {{ if $campusManaged }}disabled{{ end }}>
|
||
<option value="standalone" {{ if eq .AuthorityMode "standalone" }}selected{{ end }}>{{ T "config.mode_standalone" }}</option>
|
||
<option value="controller" {{ if eq .AuthorityMode "controller" }}selected{{ end }}>{{ T "config.mode_controller" }}</option>
|
||
<option value="managed" {{ if eq .AuthorityMode "managed" }}selected{{ end }}>{{ T "config.mode_managed" }}</option>
|
||
</select>
|
||
</td>
|
||
<td>
|
||
<input form="campus-update-{{ .ID }}" name="campus_fqdn" type="text" value="{{ .FQDN }}" placeholder="campus.example.test" {{ if $campusManaged }}disabled{{ end }}>
|
||
</td>
|
||
<td>
|
||
{{ if $campusManaged }}
|
||
{{ if index $.CampusOnline .UUID }}
|
||
<span class="campus-status-lamp online" title="{{ T "config.online" }}"></span>
|
||
{{ T "config.online" }}
|
||
{{ else }}
|
||
<span class="campus-status-lamp offline" title="{{ T "config.offline" }}"></span>
|
||
{{ T "config.offline" }}
|
||
{{ end }}
|
||
{{ else }}
|
||
—
|
||
{{ end }}
|
||
</td>
|
||
<td>
|
||
<label class="config-toggle" data-label="{{ T "config.enabled" }}"><input role="switch" aria-label="{{ T "config.enabled" }}" form="campus-update-{{ .ID }}" type="checkbox" name="campus_enabled" value="1" {{ if .Enabled }}checked{{ end }} {{ if $campusManaged }}disabled{{ end }}></label>
|
||
</td>
|
||
<td class="mono">{{ formatUnix .CreatedAt }}</td>
|
||
<td>
|
||
<button form="campus-update-{{ .ID }}" type="submit">{{ T "config.save" }}</button>
|
||
<button form="campus-delete-{{ .ID }}" type="submit">{{ T "config.delete" }}</button>
|
||
</td>
|
||
</tr>
|
||
{{ end }}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<h3 class="config-create-heading" data-config-dialog-title="{{ T "config.create_campus" }}"><button type="button" class="config-icon-button" data-config-open="campus-create-dialog" title="{{ T "config.create" }}" aria-label="{{ T "config.create" }}">+</button>{{ T "config.create_campus" }}</h3>
|
||
|
||
<dialog id="campus-create-dialog" class="config-form-dialog"><header><h2>{{ T "config.create_campus" }}</h2><button type="button" data-config-close aria-label="{{ T "config.close" }}">×</button></header><form method="post" action="/-/sys/config">
|
||
<input type="hidden" name="section" value="campus-create">
|
||
<div class="table-scroll">
|
||
<table class="config-form-table">
|
||
<tbody>
|
||
<tr><th><label for="new-campus-name">{{ T "config.name" }}</label></th>
|
||
<td><input id="new-campus-name" name="campus_name" type="text" placeholder="engineering"></td></tr>
|
||
<tr><th><label for="new-campus-title">{{ T "config.campus_title" }}</label></th>
|
||
<td><input id="new-campus-title" name="campus_title" type="text" placeholder="Engineering"></td></tr>
|
||
<tr><th><label for="new-campus-lang">{{ T "config.default_language" }}</label></th>
|
||
<td><input id="new-campus-lang" name="campus_default_lang" type="text" value="en" placeholder="ja"></td></tr>
|
||
<tr><th><label for="new-campus-mode">{{ T "config.authority_mode" }}</label></th>
|
||
<td><select id="new-campus-mode" name="campus_authority_mode">
|
||
<option value="standalone">{{ T "config.mode_standalone" }}</option>
|
||
<option value="controller">{{ T "config.mode_controller" }}</option>
|
||
</select></td></tr>
|
||
<tr><th><label for="new-campus-fqdn">{{ T "config.campus_fqdn" }}</label></th>
|
||
<td><input id="new-campus-fqdn" name="campus_fqdn" type="text" placeholder="campus.example.test"></td></tr>
|
||
<tr><th>{{ T "config.enabled" }}</th><td><label class="config-toggle" data-label="{{ T "config.enabled" }}"><input role="switch" aria-label="{{ T "config.enabled" }}" type="checkbox" name="campus_enabled" value="1" checked></label></td></tr>
|
||
</tbody>
|
||
<tfoot><tr><td colspan="2"><button type="submit">{{ T "config.create" }}</button></td></tr></tfoot>
|
||
</table>
|
||
</div>
|
||
</form></dialog>
|
||
|
||
<h3>{{ T "config.federation" }}</h3>
|
||
|
||
{{ range .Campuses }}
|
||
{{ if eq .AuthorityMode "controller" }}
|
||
<form method="post" action="/-/sys/config">
|
||
<input type="hidden" name="section" value="campus-token-issue">
|
||
<input type="hidden" name="campus_uuid" value="{{ .UUID }}">
|
||
<strong>{{ .Title }}</strong>
|
||
<input name="token_label" type="text" placeholder="{{ T "config.token_label" }}">
|
||
<button type="submit">{{ T "config.issue_token" }}</button>
|
||
</form>
|
||
{{ end }}
|
||
{{ end }}
|
||
|
||
<div class="table-scroll">
|
||
<table class="recent-table">
|
||
<thead>
|
||
<tr>
|
||
<th>{{ T "config.campus" }}</th>
|
||
<th>{{ T "config.token_label" }}</th>
|
||
<th>{{ T "config.created" }}</th>
|
||
<th>{{ T "config.last_used" }}</th>
|
||
<th>{{ T "config.actions" }}</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{{ range .CampusTokens }}
|
||
<tr>
|
||
<td class="mono">{{ .CampusUUID }}</td>
|
||
<td>{{ .Label }}</td>
|
||
<td>{{ formatUnix .CreatedAt }}</td>
|
||
<td>
|
||
{{ if .LastUsedAt }}{{ formatUnix .LastUsedAt }}{{ else }}—{{ end }}
|
||
<span class="token-status {{ if .Revoked }}revoked{{ else }}active{{ end }}">
|
||
{{ if .Revoked }}{{ T "config.revoked" }}{{ else }}{{ T "config.active" }}{{ end }}
|
||
</span>
|
||
</td>
|
||
<td>
|
||
{{ if not .Revoked }}
|
||
<form method="post" action="/-/sys/config">
|
||
<input type="hidden" name="section" value="campus-token-revoke">
|
||
<input type="hidden" name="token_id" value="{{ .ID }}">
|
||
<button type="submit">{{ T "config.revoke" }}</button>
|
||
</form>
|
||
{{ end }}
|
||
</td>
|
||
</tr>
|
||
{{ end }}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="table-scroll">
|
||
<table class="recent-table">
|
||
<thead>
|
||
<tr>
|
||
<th>{{ T "config.campus" }}</th>
|
||
<th>{{ T "config.instance_fqdn" }}</th>
|
||
<th>{{ T "config.fingerprint" }}</th>
|
||
<th>{{ T "config.status" }}</th>
|
||
<th>{{ T "config.actions" }}</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{{ range .FederationInstances }}
|
||
<tr>
|
||
<td class="mono">{{ .CampusUUID }}</td>
|
||
<td>{{ .FQDN }}</td>
|
||
<td class="mono"><span class="cell-clip" title="{{ .Fingerprint }}">{{ .Fingerprint }}</span></td>
|
||
<td>{{ .Status }}</td>
|
||
<td>
|
||
<form method="post" action="/-/sys/config">
|
||
<input type="hidden" name="section" value="instance-status">
|
||
<input type="hidden" name="instance_id" value="{{ .ID }}">
|
||
<button name="instance_status" value="approved" type="submit">{{ T "config.approve" }}</button>
|
||
<button name="instance_status" value="revoked" type="submit">{{ T "config.revoke" }}</button>
|
||
</form>
|
||
</td>
|
||
</tr>
|
||
{{ end }}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
</section>
|
||
|
||
<section
|
||
id="panel-domains"
|
||
class="config-section config-panel"
|
||
>
|
||
|
||
<h2>{{ T "config.domains" }}</h2>
|
||
|
||
<p class="muted">
|
||
{{ T "config.domain_help" }}
|
||
</p>
|
||
|
||
<div class="table-scroll">
|
||
<table class="recent-table">
|
||
|
||
<thead>
|
||
<tr>
|
||
<th>{{ T "config.id" }}</th>
|
||
<th>{{ T "config.campus" }}</th>
|
||
<th>{{ T "config.name" }}</th>
|
||
<th>{{ T "config.domain_title" }}</th>
|
||
<th>{{ T "config.host" }}</th>
|
||
<th>{{ T "config.placement" }}</th>
|
||
<th>{{ T "config.instance_fqdn" }}</th>
|
||
<th>{{ T "config.enabled" }}</th>
|
||
<th>{{ T "config.created" }}</th>
|
||
<th>{{ T "config.actions" }}</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
|
||
{{ range .Domains }}
|
||
{{ $domain := . }}
|
||
{{ $managed := index $.CampusManaged .CampusUUID }}
|
||
|
||
<tr>
|
||
<td class="mono">
|
||
{{ .ID }}
|
||
<form
|
||
id="domain-update-{{ .ID }}"
|
||
method="post"
|
||
action="/-/sys/config"
|
||
></form>
|
||
<form
|
||
id="domain-delete-{{ .ID }}"
|
||
method="post"
|
||
action="/-/sys/config"
|
||
onsubmit="return confirm('{{ T "config.delete_domain_confirm" }}')"
|
||
></form>
|
||
<input
|
||
form="domain-update-{{ .ID }}"
|
||
type="hidden"
|
||
name="section"
|
||
value="domain-update"
|
||
>
|
||
<input
|
||
form="domain-update-{{ .ID }}"
|
||
type="hidden"
|
||
name="domain_id"
|
||
value="{{ .ID }}"
|
||
>
|
||
<input
|
||
form="domain-delete-{{ .ID }}"
|
||
type="hidden"
|
||
name="section"
|
||
value="domain-delete"
|
||
>
|
||
<input
|
||
form="domain-delete-{{ .ID }}"
|
||
type="hidden"
|
||
name="domain_id"
|
||
value="{{ .ID }}"
|
||
>
|
||
</td>
|
||
|
||
<td>
|
||
<select form="domain-update-{{ .ID }}" name="domain_campus_uuid" {{ if $managed }}disabled{{ end }}>
|
||
{{ range $.Campuses }}
|
||
<option value="{{ .UUID }}" {{ if eq .UUID $domain.CampusUUID }}selected{{ end }}>
|
||
{{ .Title }} ({{ .Name }})
|
||
</option>
|
||
{{ end }}
|
||
</select>
|
||
</td>
|
||
|
||
<td>
|
||
<input
|
||
form="domain-update-{{ .ID }}"
|
||
name="domain_name"
|
||
type="text"
|
||
value="{{ .Name }}"
|
||
{{ if $managed }}disabled{{ end }}
|
||
>
|
||
</td>
|
||
|
||
<td>
|
||
<input
|
||
form="domain-update-{{ .ID }}"
|
||
name="domain_title"
|
||
type="text"
|
||
value="{{ .Title }}"
|
||
{{ if $managed }}disabled{{ end }}
|
||
>
|
||
</td>
|
||
|
||
<td>
|
||
<input
|
||
form="domain-update-{{ .ID }}"
|
||
name="domain_host"
|
||
type="text"
|
||
value="{{ .Domain }}"
|
||
placeholder="docs or docs.example.test"
|
||
{{ if $managed }}disabled{{ end }}
|
||
>
|
||
</td>
|
||
|
||
<td>
|
||
<select form="domain-update-{{ .ID }}" name="domain_placement" {{ if $managed }}disabled{{ end }}>
|
||
<option value="local" {{ if eq .Placement "local" }}selected{{ end }}>{{ T "config.placement_local" }}</option>
|
||
<option value="remote" {{ if eq .Placement "remote" }}selected{{ end }}>{{ T "config.placement_remote" }}</option>
|
||
</select>
|
||
</td>
|
||
|
||
<td>
|
||
<select form="domain-update-{{ .ID }}" name="domain_instance_fqdn" onchange="document.getElementById('domain-instance-fingerprint-{{ .ID }}').value=this.selectedOptions[0].dataset.fingerprint || ''" {{ if $managed }}disabled{{ end }}>
|
||
{{ if .InstanceFQDN }}
|
||
<option value="{{ .InstanceFQDN }}" data-fingerprint="{{ .InstanceFingerprint }}" title="{{ .InstanceFingerprint }}" selected>{{ .InstanceFQDN }}</option>
|
||
{{ else }}
|
||
<option value="" selected>{{ T "config.select_instance" }}</option>
|
||
{{ end }}
|
||
{{ range $.FederationInstances }}
|
||
{{ if and (eq .CampusUUID $domain.CampusUUID) (eq .Status "approved") (ne .FQDN $domain.InstanceFQDN) }}
|
||
<option value="{{ .FQDN }}" data-fingerprint="{{ .Fingerprint }}" title="{{ .Fingerprint }}">{{ .FQDN }}</option>
|
||
{{ end }}
|
||
{{ end }}
|
||
</select>
|
||
<input id="domain-instance-fingerprint-{{ .ID }}" form="domain-update-{{ .ID }}" type="hidden" name="domain_instance_fingerprint" value="{{ .InstanceFingerprint }}">
|
||
</td>
|
||
|
||
<td>
|
||
<label class="config-toggle" data-label="{{ T "config.enabled" }}"><input role="switch" aria-label="{{ T "config.enabled" }}"
|
||
form="domain-update-{{ .ID }}"
|
||
type="checkbox"
|
||
name="domain_enabled"
|
||
value="1"
|
||
{{ if .Enabled }}checked{{ end }}
|
||
{{ if $managed }}disabled{{ end }}
|
||
></label>
|
||
</td>
|
||
|
||
<td class="mono">
|
||
{{ formatUnix .CreatedAt }}
|
||
</td>
|
||
|
||
<td>
|
||
<button
|
||
form="domain-update-{{ .ID }}"
|
||
type="submit"
|
||
{{ if $managed }}disabled{{ end }}
|
||
>
|
||
{{ T "config.save" }}
|
||
</button>
|
||
<button
|
||
form="domain-delete-{{ .ID }}"
|
||
type="submit"
|
||
{{ if $managed }}disabled{{ end }}
|
||
>
|
||
{{ T "config.delete" }}
|
||
</button>
|
||
<button type="button" data-domain-entry-open="domain-entry-{{ .ID }}" title="{{ T "periodical.entry_settings" }}" aria-label="{{ T "periodical.entry_settings" }}">⚙</button>
|
||
</td>
|
||
</tr>
|
||
|
||
{{ end }}
|
||
|
||
</tbody>
|
||
|
||
</table>
|
||
</div>
|
||
|
||
<h3 class="config-create-heading" data-config-dialog-title="{{ T "config.create_domain" }}"><button type="button" class="config-icon-button" data-config-open="domain-create-dialog" title="{{ T "config.create" }}" aria-label="{{ T "config.create" }}">+</button>{{ T "config.create_domain" }}</h3>
|
||
|
||
<dialog id="domain-create-dialog" class="config-form-dialog"><header><h2>{{ T "config.create_domain" }}</h2><button type="button" data-config-close aria-label="{{ T "config.close" }}">×</button></header><form
|
||
method="post"
|
||
action="/-/sys/config"
|
||
>
|
||
|
||
<input
|
||
type="hidden"
|
||
name="section"
|
||
value="domain-create"
|
||
>
|
||
<div class="table-scroll">
|
||
<table class="config-form-table">
|
||
<tbody>
|
||
<tr><th><label for="new-domain-campus">{{ T "config.campus" }}</label></th>
|
||
<td><select id="new-domain-campus" name="domain_campus_uuid" onchange="filterNewDomainInstances()">
|
||
{{ range .Campuses }}
|
||
<option value="{{ .UUID }}" data-default-lang="{{ .DefaultLang }}">{{ .Title }} ({{ .Name }})</option>
|
||
{{ end }}
|
||
</select></td></tr>
|
||
<tr><th><label for="new-domain-name">{{ T "config.name" }}</label></th>
|
||
<td><input id="new-domain-name"
|
||
name="domain_name"
|
||
type="text"
|
||
placeholder="docs"
|
||
></td></tr>
|
||
<tr><th><label for="new-domain-title">{{ T "config.domain_title" }}</label></th>
|
||
<td><input id="new-domain-title"
|
||
name="domain_title"
|
||
type="text"
|
||
placeholder="Documentation"
|
||
></td></tr>
|
||
<tr><th><label for="new-domain-host">{{ T "config.host" }}</label></th>
|
||
<td><input id="new-domain-host"
|
||
name="domain_host"
|
||
type="text"
|
||
placeholder="docs or docs.example.test"
|
||
></td></tr>
|
||
<tr><th><label for="new-domain-placement">{{ T "config.placement" }}</label></th>
|
||
<td><select id="new-domain-placement" name="domain_placement">
|
||
<option value="local">{{ T "config.placement_local" }}</option>
|
||
<option value="remote">{{ T "config.placement_remote" }}</option>
|
||
</select></td></tr>
|
||
<tr><th><label for="new-domain-instance">{{ T "config.instance_fqdn" }}</label></th>
|
||
<td><select id="new-domain-instance" name="domain_instance_fqdn" onchange="document.getElementById('new-domain-instance-fingerprint').value=this.selectedOptions[0].dataset.fingerprint || ''">
|
||
<option value="">{{ T "config.select_instance" }}</option>
|
||
{{ range .FederationInstances }}
|
||
{{ if eq .Status "approved" }}
|
||
<option value="{{ .FQDN }}" data-campus="{{ .CampusUUID }}" data-fingerprint="{{ .Fingerprint }}" title="{{ .Fingerprint }}">{{ .FQDN }}</option>
|
||
{{ end }}
|
||
{{ end }}
|
||
</select>
|
||
<input id="new-domain-instance-fingerprint" type="hidden" name="domain_instance_fingerprint" value=""></td></tr>
|
||
<tr><th>{{ T "config.default_language" }}</th>
|
||
<td><output id="new-domain-default-lang" class="mono"></output></td></tr>
|
||
|
||
<script>
|
||
function filterNewDomainInstances() {
|
||
const campus = document.getElementById("new-domain-campus")
|
||
const instance = document.getElementById("new-domain-instance")
|
||
const fingerprint = document.getElementById("new-domain-instance-fingerprint")
|
||
const defaultLanguage = document.getElementById("new-domain-default-lang")
|
||
if (!campus || !instance || !fingerprint) return
|
||
let first = instance.options[0]
|
||
for (let index = 1; index < instance.options.length; index++) {
|
||
const option = instance.options[index]
|
||
const visible = option.dataset.campus === campus.value
|
||
option.hidden = !visible
|
||
option.disabled = !visible
|
||
if (visible && first === instance.options[0]) first = option
|
||
}
|
||
if (instance.selectedOptions[0] &&
|
||
instance.selectedOptions[0].disabled) {
|
||
first.selected = true
|
||
}
|
||
fingerprint.value =
|
||
instance.selectedOptions[0]?.dataset.fingerprint || ""
|
||
if (defaultLanguage) {
|
||
defaultLanguage.textContent =
|
||
campus.selectedOptions[0]?.dataset.defaultLang || "en"
|
||
}
|
||
}
|
||
document.addEventListener("DOMContentLoaded", filterNewDomainInstances)
|
||
</script>
|
||
|
||
<tr><th>{{ T "config.enabled" }}</th><td><label class="config-toggle" data-label="{{ T "config.enabled" }}"><input role="switch" aria-label="{{ T "config.enabled" }}"
|
||
type="checkbox"
|
||
name="domain_enabled"
|
||
value="1"
|
||
checked
|
||
></label></td></tr>
|
||
</tbody>
|
||
<tfoot><tr><td colspan="2"><button type="submit">
|
||
{{ T "config.create" }}
|
||
</button></td></tr></tfoot>
|
||
</table>
|
||
</div>
|
||
|
||
</form></dialog>
|
||
|
||
</section>
|
||
|
||
<section
|
||
id="panel-objects"
|
||
class="config-section config-panel"
|
||
>
|
||
|
||
<h2>{{ T "config.objects" }}</h2>
|
||
|
||
<form method="get" action="/-/sys/config">
|
||
<input type="hidden" name="panel" value="objects">
|
||
<label>{{ T "config.campus" }}</label>
|
||
<select id="objects-campus" name="objects_campus" onchange="filterObjectsDomains(); this.form.submit()">
|
||
{{ range .Campuses }}
|
||
<option value="{{ .UUID }}" {{ if eq .UUID $.ObjectsCampusUUID }}selected{{ end }}>{{ .Title }} ({{ .Name }})</option>
|
||
{{ end }}
|
||
</select>
|
||
|
||
<label>{{ T "config.domains" }}</label>
|
||
<select id="objects-domain" name="objects_domain" onchange="this.form.submit()">
|
||
{{ range .Domains }}
|
||
<option data-campus="{{ .CampusUUID }}" value="{{ .UUID }}" {{ if eq .UUID $.ObjectsDomainUUID }}selected{{ end }}>{{ .Title }} ({{ .Name }})</option>
|
||
{{ end }}
|
||
</select>
|
||
</form>
|
||
|
||
<script>
|
||
function filterObjectsDomains() {
|
||
const campus = document.getElementById("objects-campus")
|
||
const domain = document.getElementById("objects-domain")
|
||
if (!campus || !domain) return
|
||
let first = null
|
||
for (const option of domain.options) {
|
||
const visible = option.dataset.campus === campus.value
|
||
option.hidden = !visible
|
||
option.disabled = !visible
|
||
if (visible && !first) first = option
|
||
}
|
||
if (domain.selectedOptions.length === 0 ||
|
||
domain.selectedOptions[0].disabled) {
|
||
if (first) first.selected = true
|
||
}
|
||
}
|
||
document.addEventListener("DOMContentLoaded", filterObjectsDomains)
|
||
</script>
|
||
|
||
<div class="table-scroll">
|
||
<table class="recent-table">
|
||
|
||
<thead>
|
||
<tr>
|
||
<th>{{ T "config.primary" }}</th>
|
||
<th>{{ T "config.size" }}</th>
|
||
<th>{{ T "config.updated" }}</th>
|
||
<th>{{ T "config.object" }}</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
|
||
{{ range .Objects }}
|
||
|
||
<tr>
|
||
|
||
<td>
|
||
{{ if .Path }}
|
||
<a class="cell-clip" title="{{ .Path }}" href="//{{ $.ObjectsDomainHost }}{{ .Path }}">{{ .Path }}</a>
|
||
{{ else }}
|
||
<span class="muted">{{ T "config.unlinked" }}</span>
|
||
{{ end }}
|
||
</td>
|
||
|
||
<td class="mono">
|
||
{{ formatBytes .Size }}
|
||
</td>
|
||
|
||
<td class="mono">
|
||
{{ formatUnix .UpdatedAt }}
|
||
</td>
|
||
|
||
<td class="mono">
|
||
<a href="//{{ $.ObjectsDomainHost }}/o/uuid:{{ .UUID }}">{{ .UUID }}</a>
|
||
</td>
|
||
|
||
</tr>
|
||
|
||
{{ end }}
|
||
|
||
</tbody>
|
||
|
||
</table>
|
||
</div>
|
||
|
||
<h2>{{ T "config.zombie_objects" }}</h2>
|
||
|
||
<p class="muted">
|
||
{{ T "config.zombie_help" }}
|
||
</p>
|
||
|
||
<div class="table-scroll">
|
||
<table class="recent-table">
|
||
|
||
<thead>
|
||
<tr>
|
||
<th>UUID</th>
|
||
<th>{{ T "config.created" }}</th>
|
||
<th>{{ T "config.revisions" }}</th>
|
||
<th>{{ T "config.max_body" }}</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
|
||
{{ range .ZombieObjects }}
|
||
|
||
<tr>
|
||
<td class="mono">
|
||
<a href="/o/uuid:{{ .UUID }}">{{ .UUID }}</a>
|
||
</td>
|
||
|
||
<td class="mono">
|
||
{{ formatUnix .CreatedAt }}
|
||
</td>
|
||
|
||
<td class="mono">
|
||
{{ .RevisionCount }}
|
||
</td>
|
||
|
||
<td class="mono">
|
||
{{ formatBytes .MaxBodyLength }}
|
||
</td>
|
||
</tr>
|
||
|
||
{{ end }}
|
||
|
||
</tbody>
|
||
|
||
</table>
|
||
</div>
|
||
|
||
<form
|
||
method="post"
|
||
action="/-/sys/config"
|
||
onsubmit="return confirm('{{ T "config.purge_zombies_confirm" }}')"
|
||
>
|
||
|
||
<input
|
||
type="hidden"
|
||
name="section"
|
||
value="zombie-purge"
|
||
>
|
||
|
||
<button type="submit">
|
||
{{ T "config.purge_zombies" }}
|
||
</button>
|
||
|
||
</form>
|
||
|
||
|
||
</section>
|
||
|
||
<section
|
||
id="panel-nav-home"
|
||
class="config-section config-panel"
|
||
>
|
||
|
||
<h2>{{ T "config.nav_home" }}</h2>
|
||
|
||
<form
|
||
method="post"
|
||
action="/-/sys/config"
|
||
>
|
||
|
||
<input
|
||
type="hidden"
|
||
name="section"
|
||
value="nav-home"
|
||
>
|
||
|
||
<div class="table-scroll">
|
||
<table class="recent-table">
|
||
|
||
<thead>
|
||
<tr>
|
||
<th>{{ T "config.nav_label" }}</th>
|
||
<th>{{ T "config.nav_href" }}</th>
|
||
<th>{{ T "config.nav_order" }}</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
|
||
{{ range .HomeNavItemsConfig }}
|
||
|
||
<tr>
|
||
<td>
|
||
<input
|
||
name="nav_label"
|
||
type="text"
|
||
value="{{ .Label }}"
|
||
>
|
||
</td>
|
||
|
||
<td>
|
||
<input
|
||
name="nav_href"
|
||
type="text"
|
||
value="{{ .Href }}"
|
||
>
|
||
</td>
|
||
|
||
<td>
|
||
<button type="button" onclick="moveNavRow(this, -1)">↑</button>
|
||
<button type="button" onclick="moveNavRow(this, 1)">↓</button>
|
||
</td>
|
||
</tr>
|
||
|
||
{{ end }}
|
||
|
||
<tr>
|
||
<td>
|
||
<input
|
||
name="nav_label"
|
||
type="text"
|
||
placeholder="{{ T "config.nav_label" }}"
|
||
>
|
||
</td>
|
||
|
||
<td>
|
||
<input
|
||
name="nav_href"
|
||
type="text"
|
||
placeholder="/path"
|
||
>
|
||
</td>
|
||
|
||
<td>
|
||
<button type="button" onclick="moveNavRow(this, -1)">↑</button>
|
||
<button type="button" onclick="moveNavRow(this, 1)">↓</button>
|
||
</td>
|
||
</tr>
|
||
|
||
</tbody>
|
||
|
||
</table>
|
||
</div>
|
||
|
||
<button type="submit">
|
||
{{ T "config.nav_save" }}
|
||
</button>
|
||
|
||
</form>
|
||
|
||
</section>
|
||
|
||
<section
|
||
id="panel-nav-system"
|
||
class="config-section config-panel"
|
||
>
|
||
|
||
<h2>{{ T "config.nav_system" }}</h2>
|
||
|
||
<form
|
||
method="post"
|
||
action="/-/sys/config"
|
||
>
|
||
|
||
<input
|
||
type="hidden"
|
||
name="section"
|
||
value="nav-system"
|
||
>
|
||
|
||
<div class="table-scroll">
|
||
<table class="recent-table">
|
||
|
||
<thead>
|
||
<tr>
|
||
<th>{{ T "config.nav_label" }}</th>
|
||
<th>{{ T "config.nav_href" }}</th>
|
||
<th>{{ T "config.nav_order" }}</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
|
||
{{ range .SystemNavItemsConfig }}
|
||
|
||
<tr>
|
||
<td>
|
||
<input
|
||
name="nav_label"
|
||
type="text"
|
||
value="{{ .Label }}"
|
||
>
|
||
</td>
|
||
|
||
<td>
|
||
<input
|
||
name="nav_href"
|
||
type="text"
|
||
value="{{ .Href }}"
|
||
>
|
||
</td>
|
||
|
||
<td>
|
||
<button type="button" onclick="moveNavRow(this, -1)">↑</button>
|
||
<button type="button" onclick="moveNavRow(this, 1)">↓</button>
|
||
</td>
|
||
</tr>
|
||
|
||
{{ end }}
|
||
|
||
<tr>
|
||
<td>
|
||
<input
|
||
name="nav_label"
|
||
type="text"
|
||
placeholder="{{ T "config.nav_label" }}"
|
||
>
|
||
</td>
|
||
|
||
<td>
|
||
<input
|
||
name="nav_href"
|
||
type="text"
|
||
placeholder="/path"
|
||
>
|
||
</td>
|
||
|
||
<td>
|
||
<button type="button" onclick="moveNavRow(this, -1)">↑</button>
|
||
<button type="button" onclick="moveNavRow(this, 1)">↓</button>
|
||
</td>
|
||
</tr>
|
||
|
||
</tbody>
|
||
|
||
</table>
|
||
</div>
|
||
|
||
<button type="submit">
|
||
{{ T "config.nav_save" }}
|
||
</button>
|
||
|
||
</form>
|
||
|
||
</section>
|
||
|
||
<section
|
||
id="panel-editor"
|
||
class="config-section config-panel"
|
||
>
|
||
|
||
<h2>{{ T "config.editor" }}</h2>
|
||
|
||
<form
|
||
method="post"
|
||
action="/-/sys/config"
|
||
>
|
||
|
||
<input
|
||
type="hidden"
|
||
name="section"
|
||
value="editor"
|
||
>
|
||
|
||
<label>
|
||
{{ T "config.keymap" }}
|
||
</label>
|
||
|
||
<select name="editor_keymap">
|
||
<option value="default" {{ if eq .EditorKeymap "default" }}selected{{ end }}>
|
||
{{ T "config.keymap_default" }}
|
||
</option>
|
||
<option value="vim" {{ if eq .EditorKeymap "vim" }}selected{{ end }}>
|
||
Vim
|
||
</option>
|
||
</select>
|
||
|
||
<br>
|
||
<br>
|
||
|
||
<label>{{ T "config.editor_format" }}</label>
|
||
<select name="editor_format_default">
|
||
<option value="html" {{ if eq .EditorFormat "html" }}selected{{ end }}>{{ T "config.editor_format_html" }}</option>
|
||
<option value="markdown" {{ if eq .EditorFormat "markdown" }}selected{{ end }}>{{ T "config.editor_format_markdown" }}</option>
|
||
</select>
|
||
|
||
<br>
|
||
<br>
|
||
|
||
<label>{{ T "config.editor_preview_default" }}</label>
|
||
<select name="editor_preview_default">
|
||
<option value="visible" {{ if eq .EditorPreviewDefault "visible" }}selected{{ end }}>{{ T "config.editor_preview_visible" }}</option>
|
||
<option value="hidden" {{ if eq .EditorPreviewDefault "hidden" }}selected{{ end }}>{{ T "config.editor_preview_hidden" }}</option>
|
||
</select>
|
||
|
||
<br>
|
||
<br>
|
||
|
||
<label class="config-toggle" data-label="{{ T "config.syntax_highlight" }}"><input role="switch" aria-label="{{ T "config.syntax_highlight" }}"
|
||
type="checkbox"
|
||
name="editor_syntax_highlight"
|
||
{{ if .EditorSyntax }}checked{{ end }}
|
||
></label>
|
||
|
||
<br>
|
||
<br>
|
||
|
||
<label class="config-toggle" data-label="{{ T "config.autocomplete" }}"><input role="switch" aria-label="{{ T "config.autocomplete" }}"
|
||
type="checkbox"
|
||
name="editor_autocomplete"
|
||
{{ if .EditorAutocomplete }}checked{{ end }}
|
||
></label>
|
||
|
||
<br>
|
||
<br>
|
||
|
||
<button type="submit">
|
||
{{ T "config.save" }}
|
||
</button>
|
||
|
||
</form>
|
||
|
||
</section>
|
||
|
||
<section id="panel-adapters-builtin" class="config-section config-panel"><h1>{{ T "config.builtin_adapters" }}</h1>
|
||
<div class="table-scroll">
|
||
<table class="recent-table" id="builtin-adapters">
|
||
<thead><tr><th>ID</th><th>{{ T "config.projection" }}</th><th>{{ T "config.delivery" }}</th></tr></thead>
|
||
<tbody><tr><td colspan="3">{{ T "config.loading" }}</td></tr></tbody>
|
||
</table>
|
||
</div>
|
||
</section>
|
||
{{ template "bookmark-settings" . }}
|
||
<section id="panel-extensions" class="config-section config-panel"><h1>{{ T "extension.title" }}</h1><p class="muted">{{ T "extension.help" }}</p>
|
||
<div class="table-scroll"><table class="recent-table"><thead><tr><th>{{ T "config.name" }}</th><th>{{ T "extension.scope" }}</th><th>{{ T "extension.capabilities" }}</th><th>{{ T "config.operations" }}</th></tr></thead><tbody>
|
||
{{ range .SystemExtensions }}<tr><td><strong>{{ T .NameKey }}</strong> <small>{{ .ID }} · v{{ .Version }}</small> <span class="cell-clip cell-secondary" title="{{ T .DescriptionKey }}">{{ T .DescriptionKey }}</span></td><td>{{ if eq .Scope "instance" }}{{ T "extension.instance" }}{{ else }}{{ T "extension.domain" }}{{ end }}</td><td>{{ range .Capabilities }}<code>{{ . }}</code> {{ end }}</td><td><form method="post" action="/-/sys/config" class="inline-form"><input type="hidden" name="section" value="extension-toggle"><input type="hidden" name="extension_id" value="{{ .ID }}"><input type="hidden" name="enabled" value="{{ if .Enabled }}off{{ else }}on{{ end }}"><button type="submit" title="{{ T "config.enabled" }}">{{ if .Enabled }}{{ T "config.enabled" }}{{ else }}{{ T "config.disabled" }}{{ end }}</button></form> <a href="/-/sys/config?panel={{ .SettingsPanel }}" data-config-panel="{{ .SettingsPanel }}">{{ T "extension.settings" }}</a></td></tr>{{ end }}
|
||
</tbody></table></div></section>
|
||
<section id="panel-diary" class="config-section config-panel" data-periodical-settings="diary"><h1>{{ T "periodical.diary" }}</h1><p>{{ T "periodical.diary_help" }}</p>{{ template "periodical-settings" . }}<p><a href="/v/diary">{{ T "periodical.open" }}</a></p></section>
|
||
<section id="panel-blog" class="config-section config-panel" data-periodical-settings="blog"><h1>{{ T "periodical.blog" }}</h1><p>{{ T "periodical.blog_help" }}</p>{{ template "periodical-settings" . }}<p><a href="/v/blog">{{ T "periodical.open" }}</a></p></section>
|
||
<script src="/static/js/periodicals.js?v=8" defer></script>
|
||
{{ range .AdapterPlugins }}
|
||
<section id="panel-adapter-{{ .ID }}" class="config-section config-panel"><h1>{{ .Name }}</h1><p class="muted">{{ .ID }}</p>{{ if eq .ID "vim.wasm" }}{{ template "vim-settings" $.VimSettings }}<details><summary>{{ T "config.adapter_connection" }}</summary>{{ template "adapter-settings-fields" . }}</details>{{ else }}{{ template "adapter-settings-fields" . }}{{ end }}</section>
|
||
{{ end }}
|
||
<section id="panel-adapters" class="config-section config-panel">
|
||
<h1>{{ T "config.adapters" }}</h1>
|
||
<p class="muted">{{ T "config.adapters_help" }}</p>
|
||
<h2>{{ T "config.adapter_plugins" }}</h2>
|
||
<form id="adapter-plugin-form" class="adapter-plugin-grid">
|
||
<label>ID <input name="id" pattern="[a-z][a-z0-9._-]{1,63}" required></label>
|
||
<label>{{ T "config.name" }} <input name="name" required></label>
|
||
<label>{{ T "config.adapter_mode" }} <select name="mode">
|
||
<option value="viewer">{{ T "config.viewer" }}</option>
|
||
<option value="editor">{{ T "config.editor" }}</option>
|
||
</select></label>
|
||
<label>{{ T "config.media_types" }} <input name="media_types" placeholder="image/*, application/pdf"></label>
|
||
<label>{{ T "config.extensions" }} <input name="extensions" placeholder=".png, .pdf"></label>
|
||
<label class="adapter-template">{{ T "config.url_template" }}
|
||
<input name="url_template" placeholder="https://editor.example/open?ticket={ticket}" required>
|
||
</label>
|
||
<label class="config-toggle" data-label="{{ T "config.enabled" }}"><input role="switch" aria-label="{{ T "config.enabled" }}" type="checkbox" name="enabled" checked></label>
|
||
<button type="submit">{{ T "config.add" }}</button>
|
||
<span id="adapter-plugin-result" class="muted"></span>
|
||
</form>
|
||
<p class="muted">{{ T "config.adapter_template_help" }}</p>
|
||
<div class="table-scroll">
|
||
<table class="recent-table" id="adapter-plugins">
|
||
<thead><tr><th>ID</th><th>{{ T "config.name" }}</th><th>{{ T "config.adapter_mode" }}</th>
|
||
<th>{{ T "config.url_template" }}</th><th>{{ T "config.operations" }}</th></tr></thead>
|
||
<tbody><tr><td colspan="5">{{ T "config.loading" }}</td></tr></tbody>
|
||
</table>
|
||
</div>
|
||
</section>
|
||
|
||
<section id="panel-assets" class="config-section config-panel">
|
||
<h1>{{ T "config.assets" }}</h1>
|
||
<p class="muted">{{ T "config.assets_help" }}</p>
|
||
<form id="asset-form" class="adapter-plugin-grid">
|
||
<label>{{ T "config.asset_address" }} <input name="address" placeholder="asset:image:logo" required></label>
|
||
<label>{{ T "viewer.filename" }} <input name="filename"></label>
|
||
<label>{{ T "viewer.mime_type" }} <input name="content_type" placeholder="image/png"></label>
|
||
<label>{{ T "upload.file" }} <input type="file" name="file" required></label>
|
||
<button type="submit">{{ T "config.asset_upload" }}</button><span id="asset-result" class="muted"></span>
|
||
</form>
|
||
<div class="table-scroll"><table class="recent-table" id="asset-list"><thead><tr>
|
||
<th>{{ T "config.asset_address" }}</th><th>{{ T "viewer.filename" }}</th><th>{{ T "viewer.mime_type" }}</th><th>{{ T "viewer.size" }}</th><th>SHA-256</th><th>{{ T "config.references" }}</th><th>{{ T "config.operations" }}</th>
|
||
</tr></thead><tbody><tr><td colspan="7">{{ T "config.loading" }}</td></tr></tbody></table></div>
|
||
<dialog id="asset-detail-dialog" class="asset-detail-dialog"><button type="button" class="asset-dialog-close" data-asset-detail-close aria-label="{{ T "config.close" }}">×</button><h2 data-asset-detail-title></h2><div data-asset-detail-content>{{ T "config.loading" }}</div></dialog>
|
||
</section>
|
||
<section id="panel-external-resources" class="config-section config-panel">
|
||
<h1>{{ T "config.external_resources" }}</h1>
|
||
<p class="muted">{{ T "config.external_resources_help" }}</p>
|
||
<p class="config-warning">{{ T "config.external_script_warning" }}</p>
|
||
<div class="table-scroll"><table class="recent-table"><thead><tr><th>{{ T "config.resource_kind" }}</th><th>URL</th><th>SHA-256 SRI</th><th>{{ T "config.operations" }}</th></tr></thead><tbody>
|
||
{{ range .ExternalResources }}<tr><td>{{ T (printf "config.resource_kind_%s" .Kind) }}</td><td><code class="cell-clip" title="{{ .URL }}">{{ .URL }}</code></td><td>{{ if .Integrity }}<code class="cell-clip" title="{{ .Integrity }}">{{ .Integrity }}</code>{{ else }}—{{ end }}</td><td><form method="post" action="/-/sys/config" class="inline-form"><input type="hidden" name="section" value="external-resource-delete"><input type="hidden" name="kind" value="{{ .Kind }}"><input type="hidden" name="url" value="{{ .URL }}"><button type="submit" aria-label="{{ T "config.delete" }}" title="{{ T "config.delete" }}">🗑</button></form></td></tr>
|
||
{{ else }}<tr><td colspan="4">—</td></tr>{{ end }}
|
||
</tbody></table></div>
|
||
<h2>{{ T "config.external_resource_add" }}</h2>
|
||
<form method="post" action="/-/sys/config" class="settings-form"><input type="hidden" name="section" value="external-resource-add">
|
||
<label>{{ T "config.resource_kind" }}<select name="kind"><option value="image">{{ T "config.resource_kind_image" }}</option><option value="stylesheet">{{ T "config.resource_kind_stylesheet" }}</option><option value="script">{{ T "config.resource_kind_script" }}</option></select></label>
|
||
<label class="wide">URL<input name="url" type="url" inputmode="url" required placeholder="https://cdn.example.test/resource.js"></label>
|
||
<label class="wide">SHA-256 SRI<input name="integrity" autocomplete="off" placeholder="sha256-…"></label>
|
||
<p class="muted wide">{{ T "config.external_integrity_help" }}</p>
|
||
<label class="config-toggle wide" data-label="{{ T "config.confirm_external_script" }}"><input role="switch" aria-label="{{ T "config.confirm_external_script" }}" type="checkbox" name="confirm_script_risk" value="1"></label>
|
||
<button type="submit">{{ T "config.add" }}</button>
|
||
</form>
|
||
</section>
|
||
<section id="panel-broadcasts" class="config-section config-panel"><h1>{{ T "config.broadcasts" }}</h1><p class="muted">{{ T "config.broadcasts_help" }}</p><form method="post" action="/-/sys/config" class="broadcast-form"><input type="hidden" name="section" value="broadcast"><div class="table-scroll"><table class="config-form-table"><tbody><tr><th><label for="broadcast-title">{{ T "config.broadcast_title" }}</label></th><td><input id="broadcast-title" name="title" required maxlength="160"></td></tr><tr><th><label for="broadcast-body">{{ T "config.broadcast_body" }}</label></th><td><textarea id="broadcast-body" name="body" required maxlength="4000" rows="3"></textarea></td></tr><tr><th><label for="broadcast-severity">{{ T "config.broadcast_severity" }}</label></th><td><select id="broadcast-severity" name="severity"><option value="info">Info</option><option value="success">Success</option><option value="warning">Warning</option><option value="critical">Critical</option></select></td></tr><tr><th><label for="broadcast-start">{{ T "config.broadcast_start" }}</label></th><td><input id="broadcast-start" name="starts_at" type="datetime-local" step="60"></td></tr><tr><th><label for="broadcast-end">{{ T "config.broadcast_end" }}</label></th><td><input id="broadcast-end" name="ends_at" type="datetime-local" step="60"></td></tr><tr><th></th><td><button type="submit">{{ T "config.save" }}</button></td></tr></tbody></table></div></form><div class="table-scroll"><table class="recent-table"><thead><tr><th>{{ T "config.broadcast_title" }}</th><th>{{ T "config.broadcast_severity" }}</th><th>{{ T "config.broadcast_start" }}</th><th>{{ T "config.broadcast_end" }}</th><th></th></tr></thead><tbody>{{ range .Broadcasts }}<tr><td><strong>{{ .Title }}</strong><br><span class="muted">{{ .Body }}</span></td><td>{{ .Severity }}</td><td>{{ .StartsAtMS }}</td><td>{{ .EndsAtMS }}</td><td><form method="post" action="/-/sys/config"><input type="hidden" name="section" value="broadcast-delete"><input type="hidden" name="uuid" value="{{ .UUID }}"><button type="submit">{{ T "config.delete" }}</button></form></td></tr>{{ else }}<tr><td colspan="5">—</td></tr>{{ end }}</tbody></table></div></section>
|
||
|
||
<section id="panel-groups" class="config-section config-panel"><h1>{{ T "auth.groups" }}</h1><p class="muted">{{ T "auth.group_management_help" }}</p>
|
||
<div class="table-scroll"><table class="recent-table"><thead><tr><th>{{ T "config.name" }}</th><th>{{ T "auth.group_visibility" }}</th><th>{{ T "config.operations" }}</th></tr></thead><tbody>{{ range .Groups }}<tr><td><a href="/g/{{ .Name }}/_/edit">{{ .DisplayName }}</a><br><span class="muted">@{{ .Name }}</span></td><td>{{ T (printf "auth.group_visibility_%s" .Visibility) }}</td><td><a href="/g/{{ .Name }}/_/edit">{{ T "auth.group_edit" }}</a></td></tr>{{ else }}<tr><td colspan="3">—</td></tr>{{ end }}</tbody></table></div>
|
||
{{ if .CanCreateGroups }}<h2>{{ T "auth.group_create" }}</h2><form method="post" action="/-/sys/config" class="auth-account-form"><input type="hidden" name="section" value="groups"><label>{{ T "auth.group_name" }}<input name="name" pattern="[a-z0-9][a-z0-9_-]{1,63}" required></label><label>{{ T "auth.display_name" }}<input name="display_name"></label><label>{{ T "auth.group_description" }}<input name="description"></label><label>{{ T "auth.group_visibility" }}<select name="visibility"><option value="members">{{ T "auth.group_visibility_members" }}</option><option value="domain">{{ T "auth.group_visibility_domain" }}</option><option value="public">{{ T "auth.group_visibility_public" }}</option></select></label><button>{{ T "config.add" }}</button></form>{{ end }}</section>
|
||
|
||
<section id="panel-auth-providers" class="config-section config-panel"><h1>{{ T "config.auth_providers" }}</h1><h2>{{ T "auth.oidc" }}</h2>
|
||
<form method="post" action="/-/sys/config/auth" class="auth-account-form"><input type="hidden" name="action" value="save_oidc">
|
||
<label class="config-toggle" data-label="{{ T "config.enabled" }}"><input role="switch" aria-label="{{ T "config.enabled" }}" type="checkbox" name="enabled" {{ if .OIDCConfig.Enabled }}checked{{ end }}></label>
|
||
<label>{{ T "auth.oidc_issuer" }}<input name="issuer" type="url" value="{{ .OIDCConfig.Issuer }}" placeholder="https://id.example.com"></label>
|
||
<label>{{ T "auth.oidc_client_id" }}<input name="client_id" value="{{ .OIDCConfig.ClientID }}"></label>
|
||
<label>{{ T "auth.oidc_match_by" }}<select name="oidc_match_by"><option value="email" {{ if eq .OIDCConfig.OIDCMatchBy "email" }}selected{{ end }}>{{ T "auth.oidc_match_email" }}</option><option value="preferred_username" {{ if eq .OIDCConfig.OIDCMatchBy "preferred_username" }}selected{{ end }}>{{ T "auth.oidc_match_preferred_username" }}</option><option value="display_name" {{ if eq .OIDCConfig.OIDCMatchBy "display_name" }}selected{{ end }}>{{ T "auth.oidc_match_display_name" }}</option></select></label>
|
||
<label>{{ T "auth.oidc_client_secret" }}<input name="client_secret" type="password" placeholder="{{ T "auth.secret_unchanged" }}"></label><button>{{ T "config.save" }}</button></form>
|
||
<p class="muted">{{ T "auth.oidc_callback_help" }} {{ T "auth.oidc_match_help" }}</p>
|
||
<h2>{{ T "auth.ldap" }}</h2>
|
||
{{ if eq .LDAPTest "ok" }}<p class="config-saved">✓ {{ T "auth.ldap_test_ok" }}</p>{{ else if eq .LDAPTest "failed" }}<p class="config-warning">{{ T "auth.ldap_test_failed" }}</p>{{ end }}
|
||
<form method="post" action="/-/sys/config/auth" class="auth-account-form"><input type="hidden" name="action" value="save_ldap">
|
||
<label class="config-toggle" data-label="{{ T "config.enabled" }}"><input role="switch" aria-label="{{ T "config.enabled" }}" type="checkbox" name="enabled" {{ if .LDAPConfig.Enabled }}checked{{ end }}></label>
|
||
<label>{{ T "auth.ldap_url" }}<input name="ldap_url" value="{{ .LDAPConfig.LDAPURL }}" placeholder="ldaps://ldap.example.com:636"></label>
|
||
<label>{{ T "auth.ldap_bind_dn" }}<input name="ldap_bind_dn" value="{{ .LDAPConfig.LDAPBindDN }}" autocomplete="off"></label>
|
||
<label>{{ T "auth.ldap_bind_password" }}<input name="ldap_bind_password" type="password" placeholder="{{ T "auth.secret_unchanged" }}" autocomplete="new-password"></label>
|
||
<label class="wide">{{ T "auth.ldap_search_base" }}<input name="ldap_search_base" value="{{ .LDAPConfig.LDAPSearchBase }}" placeholder="ou=people,dc=example,dc=com"></label>
|
||
<label class="wide">{{ T "auth.ldap_search_filter" }}<input name="ldap_search_filter" value="{{ .LDAPConfig.LDAPSearchFilter }}" placeholder="(uid={{ "{{username}}" }})"></label>
|
||
<label class="config-toggle" data-label="{{ T "auth.ldap_start_tls" }}"><input role="switch" aria-label="{{ T "auth.ldap_start_tls" }}" type="checkbox" name="ldap_start_tls" {{ if .LDAPConfig.LDAPStartTLS }}checked{{ end }}></label>
|
||
<label class="config-toggle" data-label="{{ T "auth.ldap_verify_tls" }}"><input role="switch" aria-label="{{ T "auth.ldap_verify_tls" }}" type="checkbox" name="ldap_verify_tls" {{ if not .LDAPConfig.LDAPSkipTLSVerify }}checked{{ end }}></label>
|
||
<label>{{ T "auth.ldap_uid_attribute" }}<input name="ldap_uid_attribute" value="{{ .LDAPConfig.LDAPUIDAttribute }}" placeholder="uid"></label>
|
||
<label>{{ T "auth.ldap_username_attribute" }}<input name="ldap_username_attribute" value="{{ .LDAPConfig.LDAPUsernameAttribute }}" placeholder="uid"></label>
|
||
<label>{{ T "auth.ldap_email_attribute" }}<input name="ldap_email_attribute" value="{{ .LDAPConfig.LDAPEmailAttribute }}" placeholder="mail"></label>
|
||
<label>{{ T "auth.ldap_display_attribute" }}<input name="ldap_display_attribute" value="{{ .LDAPConfig.LDAPDisplayAttribute }}" placeholder="displayName"></label>
|
||
<label>{{ T "auth.ldap_match_by" }}<select name="ldap_match_by"><option value="username" {{ if eq .LDAPConfig.LDAPMatchBy "username" }}selected{{ end }}>{{ T "auth.username" }}</option><option value="email" {{ if eq .LDAPConfig.LDAPMatchBy "email" }}selected{{ end }}>{{ T "auth.email" }}</option></select></label>
|
||
<label class="config-toggle" data-label="{{ T "auth.ldap_auto_provision" }}"><input role="switch" aria-label="{{ T "auth.ldap_auto_provision" }}" type="checkbox" name="ldap_auto_provision" {{ if .LDAPConfig.LDAPAutoProvision }}checked{{ end }}></label>
|
||
<label class="wide">{{ T "auth.ldap_ca_pem" }}<textarea name="ldap_ca_pem" rows="4" placeholder="-----BEGIN CERTIFICATE-----">{{ .LDAPConfig.LDAPCAPEM }}</textarea></label>
|
||
<p class="muted wide">{{ T "auth.ldap_help" }}</p><button>{{ T "config.save" }}</button></form>
|
||
{{ if .LDAPConfig.Enabled }}<form method="post" action="/-/sys/config/auth" class="auth-account-form"><input type="hidden" name="action" value="test_ldap"><label>{{ T "auth.username" }}<input name="test_username" autocomplete="off" required></label><label>{{ T "auth.password" }}<input name="test_password" type="password" autocomplete="new-password" required></label><button>{{ T "auth.ldap_test" }}</button></form>{{ end }}
|
||
<h2>{{ T "auth.magic_link" }}</h2>
|
||
<form method="post" action="/-/sys/config/auth" class="auth-account-form"><input type="hidden" name="action" value="save_smtp">
|
||
<label class="config-toggle" data-label="{{ T "config.enabled" }}"><input role="switch" aria-label="{{ T "config.enabled" }}" type="checkbox" name="enabled" {{ if .SMTPConfig.Enabled }}checked{{ end }}></label>
|
||
<label>{{ T "auth.smtp_address" }}<input name="smtp_address" value="{{ .SMTPConfig.SMTPAddress }}" placeholder="smtp.example.com:587"></label>
|
||
<label>{{ T "auth.smtp_username" }}<input name="smtp_username" value="{{ .SMTPConfig.SMTPUsername }}"></label>
|
||
<label>{{ T "auth.smtp_password" }}<input name="smtp_password" type="password" placeholder="{{ T "auth.secret_unchanged" }}"></label>
|
||
<label>{{ T "auth.smtp_from" }}<input name="smtp_from" type="email" value="{{ .SMTPConfig.SMTPFrom }}"></label><button>{{ T "config.save" }}</button></form>
|
||
</section>
|
||
<section id="panel-auth" class="config-section config-panel">
|
||
<h1>{{ T "auth.management" }}</h1>
|
||
<p class="muted">{{ T "auth.management_help" }}</p>
|
||
<h2>{{ T "auth.accounts" }}</h2>
|
||
<form method="post" action="/-/sys/config/auth" class="auth-account-form"><input type="hidden" name="action" value="create_account">
|
||
<label>{{ T "auth.username" }}<input name="username" required></label><label>{{ T "auth.display_name" }}<input name="display_name"></label><label>{{ T "auth.email" }}<input name="email" type="email"></label><label>{{ T "auth.password" }}<input name="password" type="password" minlength="12" required></label><button>{{ T "config.add" }}</button></form>
|
||
<div class="table-scroll"><table class="recent-table"><thead><tr><th>{{ T "auth.display_name" }}</th><th>{{ T "auth.email" }}</th><th>{{ T "config.status" }}</th><th>{{ T "config.operations" }}</th></tr></thead><tbody>{{ range .AuthPrincipals }}<tr><td>{{ .DisplayName }}</td><td>{{ .Email }}</td><td>{{ T (printf "auth.state_%s" .State) }}</td><td><form method="post" action="/-/sys/config/auth"><input type="hidden" name="action" value="principal_state"><input type="hidden" name="principal_uuid" value="{{ .UUID }}"><select name="state"><option value="active" {{ if eq .State "active" }}selected{{ end }}>{{ T "auth.state_active" }}</option><option value="readonly" {{ if eq .State "readonly" }}selected{{ end }}>{{ T "auth.state_readonly" }}</option><option value="suspended" {{ if eq .State "suspended" }}selected{{ end }}>{{ T "auth.state_suspended" }}</option><option value="quarantined" {{ if eq .State "quarantined" }}selected{{ end }}>{{ T "auth.state_quarantined" }}</option></select><button>{{ T "config.save" }}</button></form></td></tr>{{ else }}<tr><td colspan="4">—</td></tr>{{ end }}</tbody></table></div>
|
||
</section>
|
||
|
||
<section id="panel-auth-sessions" class="config-section config-panel"><h1>{{ T "auth.sessions" }}</h1>
|
||
<form method="post" action="/-/sys/config/auth" class="auth-account-form"><input type="hidden" name="action" value="save_session_policy"><label>{{ T "auth.session_minutes" }}<input type="number" name="session_minutes" value="{{ .AuthSessionMinutes }}" min="5" max="43200" step="1" required aria-describedby="session-policy-help"></label><button>{{ T "config.save" }}</button></form>
|
||
<p id="session-policy-help" class="muted">{{ T "auth.session_policy_help" }}</p>
|
||
<form method="post" action="/-/sys/config/auth" class="auth-account-form"><input type="hidden" name="action" value="save_trusted_session_policy"><label>{{ T "auth.trusted_days" }}<input type="number" name="trusted_session_days" value="{{ .AuthTrustedSessionDays }}" min="0" max="30" step="1" required></label><button>{{ T "config.save" }}</button></form>
|
||
<div class="table-scroll"><table class="recent-table"><thead><tr><th>{{ T "auth.account" }}</th><th>{{ T "auth.auth_time" }}</th><th>{{ T "auth.last_seen" }}</th><th>{{ T "auth.expires" }}</th><th>MFA</th><th></th></tr></thead><tbody>{{ range .AuthSessions }}<tr><td>{{ .DisplayName }}</td><td>{{ formatUnixMS .AuthTimeMS }}</td><td>{{ formatUnixMS .LastSeenAtMS }}</td><td>{{ formatUnixMS .ExpiresAtMS }}</td><td>{{ .MFALevel }}</td><td><form method="post" action="/-/sys/config/auth"><input type="hidden" name="action" value="revoke_session"><input type="hidden" name="session_uuid" value="{{ .UUID }}"><button>{{ T "auth.revoke" }}</button></form></td></tr>{{ else }}<tr><td colspan="6">—</td></tr>{{ end }}</tbody></table></div>
|
||
</section>
|
||
<section id="panel-events" class="config-section config-panel"><h1>{{ T "config.event_definitions" }}</h1>
|
||
<form method="post" action="/-/sys/config"><input type="hidden" name="section" value="scheduler-preview"><button type="submit">{{ T "config.generate_previews" }}</button></form>
|
||
<form id="event-definition-form" class="event-definition-grid">
|
||
<label>{{ T "config.name" }} <input type="text" name="name" required></label>
|
||
<label>{{ T "config.event_type" }}
|
||
<select name="event_type"><option value="preview.sweep">preview.sweep</option></select>
|
||
</label>
|
||
<label>{{ T "config.schedule" }}
|
||
<select name="schedule_kind">
|
||
<option value="manual">{{ T "config.manual" }}</option>
|
||
<option value="interval">{{ T "config.interval" }}</option>
|
||
<option value="once">{{ T "config.once" }}</option>
|
||
</select>
|
||
</label>
|
||
<label data-schedule-field="interval">{{ T "config.interval_seconds" }} <input type="number" name="interval_seconds" min="0" value="3600"></label>
|
||
<label data-schedule-field="once">{{ T "config.next_run" }} <input type="datetime-local" name="next_run_at"></label>
|
||
<details><summary>{{ T "config.advanced" }}</summary><div><label>{{ T "config.priority" }} <input type="number" name="priority" value="0"></label>
|
||
<label>{{ T "config.max_attempts" }} <input type="number" name="max_attempts" min="1" value="3"></label>
|
||
<label>{{ T "config.event_key" }} <input type="text" name="event_key" placeholder="optional"></label>
|
||
<label class="event-payload">{{ T "config.payload_json" }} <textarea name="payload" rows="3">{}</textarea></label>
|
||
</div></details>
|
||
<label class="config-toggle" data-label="{{ T "config.enabled" }}"><input role="switch" aria-label="{{ T "config.enabled" }}" type="checkbox" name="enabled" checked></label>
|
||
<button type="submit">{{ T "config.add" }}</button>
|
||
<span id="event-definition-result" class="muted"></span>
|
||
</form>
|
||
<div class="table-scroll">
|
||
<table class="recent-table" id="event-definitions">
|
||
<thead><tr><th>{{ T "config.name" }}</th><th>{{ T "config.schedule" }}</th>
|
||
<th>{{ T "config.next_run" }}</th><th>{{ T "config.operations" }}</th></tr></thead>
|
||
<tbody><tr><td colspan="4" class="muted">{{ T "config.loading" }}</td></tr></tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<p data-panel-error="events" role="status" class="config-error"></p></section>
|
||
<section id="panel-queue" class="config-section config-panel"><h1>{{ T "config.queue_settings" }}</h1>
|
||
<form id="queue-settings-form" class="queue-settings-grid">
|
||
<label class="config-toggle" data-label="{{ T "config.queue_paused" }}"><input role="switch" aria-label="{{ T "config.queue_paused" }}" type="checkbox" name="paused"></label>
|
||
<label>{{ T "config.concurrency" }} <input type="number" name="concurrency" min="1" max="32" required></label>
|
||
<label>{{ T "config.max_depth" }} <input type="number" name="max_depth" min="1" required></label>
|
||
<label>{{ T "config.retry_delay" }} <input type="number" name="retry_base_seconds" min="1" required></label>
|
||
<label>{{ T "config.retention" }} <input type="number" name="retention_hours" min="1" required></label>
|
||
<button type="submit">{{ T "config.save" }}</button>
|
||
<span id="queue-settings-result" class="muted"></span>
|
||
</form>
|
||
|
||
<p data-panel-error="queue" role="status" class="config-error"></p></section>
|
||
<section id="panel-logs" class="config-section config-panel"><h1>{{ T "config.execution_log" }}</h1>
|
||
<div class="monitor-toolbar"><label>{{ T "config.status" }} <select id="job-history-status">
|
||
<option value="history">{{ T "config.finished_jobs" }}</option><option value="queued">{{ T "config.queued" }}</option>
|
||
<option value="failed">{{ T "config.failed" }}</option><option value="succeeded">{{ T "config.succeeded" }}</option>
|
||
<option value="skipped">{{ T "config.skipped" }}</option><option value="cancelled">{{ T "config.cancelled" }}</option>
|
||
</select></label><button type="button" id="job-history-refresh">{{ T "config.refresh" }}</button></div>
|
||
<div class="table-scroll">
|
||
<table class="recent-table job-table" id="job-history">
|
||
<thead><tr><th>{{ T "config.event" }}</th><th>{{ T "config.status" }}</th><th>{{ T "config.attempts" }}</th>
|
||
<th>{{ T "config.job_started" }}</th><th>{{ T "config.duration" }}</th><th>{{ T "config.operations" }}</th></tr></thead>
|
||
<tbody><tr><td colspan="6" class="muted">{{ T "config.loading" }}</td></tr></tbody>
|
||
</table>
|
||
</div>
|
||
<button type="button" id="job-history-more" hidden>{{ T "config.older_jobs" }}</button>
|
||
<p data-panel-error="logs" role="status" class="config-error"></p></section>
|
||
<section id="panel-scheduler" class="config-section config-panel execution-dashboard">
|
||
<header class="monitor-header"><div><h1>{{ T "config.execution_status" }}</h1><p id="resource-time-range" class="muted">—</p></div><div class="monitor-header-actions">
|
||
<button type="button" id="monitor-refresh" class="monitor-settings-icon" title="{{ T "config.refresh" }}" aria-label="{{ T "config.refresh" }}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M20 7v5h-5M20 12a8 8 0 1 0-2.3 5.7"/></svg></button>
|
||
<button type="button" id="monitor-settings-open" class="monitor-settings-icon" title="{{ T "config.monitor_settings" }}" aria-label="{{ T "config.monitor_settings" }}" aria-haspopup="dialog" aria-controls="monitor-settings-dialog" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m9 3-.5 3-2 .9L4 6l-2 4 2.5 1.8v2.4L2 16l2 4 2.5-.9 2 .9.5 3h6l.5-3 2-.9L20 20l2-4-2.5-1.8v-2.4L22 10l-2-4-2.5.9-2-.9-.5-3z"/><circle cx="12" cy="13" r="3"/></svg></button>
|
||
</div></header>
|
||
<dialog id="monitor-settings-dialog" class="monitor-settings-dialog" aria-labelledby="monitor-settings-title">
|
||
<header><h2 id="monitor-settings-title">{{ T "config.monitor_settings" }}</h2><button type="button" id="monitor-settings-close" aria-label="{{ T "bookmark.close" }}">×</button></header>
|
||
<div class="monitor-settings-body">
|
||
<div class="settings-form"><fieldset><legend>{{ T "config.monitor_display" }}</legend>
|
||
<label>{{ T "resource.history" }} <select id="resource-history-hours"><option value="1" selected>1 h</option><option value="24">24 h</option><option value="168">7 d</option></select></label>
|
||
<label class="config-toggle" data-label="{{ T "config.live_updates" }}"><input id="resource-live" type="checkbox" role="switch" aria-label="{{ T "config.live_updates" }}" checked></label>
|
||
<label>{{ T "config.stat_interval" }}<input id="resource-stat-interval" type="number" min="1" max="60" step="1" value="1"></label>
|
||
<label>{{ T "config.graph_interval" }}<input id="resource-graph-interval" type="number" min="1" max="60" step="1" value="5"></label>
|
||
</fieldset></div>
|
||
<form id="resource-monitor-form" class="settings-form"><fieldset><legend>{{ T "resource.background" }}</legend>
|
||
<label class="config-toggle" data-label="{{ T "config.enabled" }}"><input type="checkbox" role="switch" name="enabled" aria-label="{{ T "config.enabled" }}" checked></label>
|
||
<label>{{ T "resource.interval" }}<input type="number" name="interval" min="30" max="86400" value="60" required></label>
|
||
<div class="config-actions wide"><button type="submit">{{ T "config.save" }}</button><button type="button" id="resource-monitor-run">{{ T "resource.run" }}</button><output id="resource-monitor-result" role="status"></output></div>
|
||
</fieldset></form><p class="muted">{{ T "config.resource_scope" }}</p><p class="muted">{{ T "config.io_scope" }}</p>
|
||
</div></dialog>
|
||
<div id="scheduler-resources" class="resource-grid" aria-live="polite">
|
||
<div class="resource-card"><strong>CPU</strong><span data-resource="cpu">—</span></div>
|
||
<div class="resource-card"><strong>{{ T "config.memory" }}</strong><span data-resource="memory">—</span></div>
|
||
<div class="resource-card"><strong>{{ T "config.io_title" }}</strong><span data-resource="io">—</span><small>{{ T "config.storage" }}: <span data-resource="storage">—</span></small></div>
|
||
<div class="resource-card"><strong>{{ T "config.queue_load" }}</strong><span data-resource="queue">—</span></div>
|
||
</div>
|
||
|
||
<div class="resource-chart-scroll" tabindex="0" role="region" aria-label="{{ T "config.resource_status" }}">
|
||
<div class="resource-charts">
|
||
<figure><figcaption>{{ T "config.cpu_load" }}</figcaption><svg viewBox="0 0 400 140" data-resource-chart="cpu" role="img" aria-label="{{ T "config.cpu_load" }}"></svg></figure>
|
||
<figure><figcaption>{{ T "config.heap_memory" }}</figcaption><svg viewBox="0 0 400 140" data-resource-chart="memory" role="img" aria-label="{{ T "config.heap_memory" }}"></svg></figure>
|
||
<figure><figcaption>{{ T "config.io_title" }}</figcaption><svg viewBox="0 0 400 140" data-resource-chart="io" role="img" aria-label="{{ T "config.io_title" }}"></svg><div class="io-legend"><span class="io-read">{{ T "config.io_read" }}</span><span class="io-write">{{ T "config.io_write" }}</span></div></figure>
|
||
<figure><figcaption>{{ T "config.queue_load" }}</figcaption><svg viewBox="0 0 400 140" data-resource-chart="queue" role="img" aria-label="{{ T "config.queue_load" }}"></svg></figure>
|
||
</div></div><p data-panel-error="resources" role="status" class="config-error"></p>
|
||
<h2>{{ T "config.running_jobs" }}</h2><p id="scheduler-queue-state" role="status"></p>
|
||
<div class="table-scroll"><table class="recent-table job-table" id="scheduler-jobs">
|
||
<thead><tr><th>{{ T "config.event" }}</th><th>{{ T "config.status" }}</th><th>{{ T "config.attempts" }}</th>
|
||
<th>{{ T "config.job_started" }}</th><th>{{ T "config.duration" }}</th><th>{{ T "config.operations" }}</th></tr></thead>
|
||
<tbody><tr data-empty><td colspan="6" class="muted">{{ T "config.loading" }}</td></tr></tbody>
|
||
</table></div><p data-panel-error="scheduler" role="status" class="config-error"></p></section>
|
||
|
||
</section>
|
||
|
||
</div>
|
||
|
||
</main>
|
||
|
||
<dialog class="config-path-picker" data-path-picker-dialog aria-labelledby="path-picker-title" data-loading="{{ T "picker.loading" }}" data-empty="{{ T "picker.empty" }}" data-failed="{{ T "picker.failed" }}" data-truncated="{{ T "picker.truncated" }}">
|
||
<header><h2 id="path-picker-title">{{ T "picker.title" }}</h2><button type="button" data-path-picker-close aria-label="{{ T "city.close" }}">×</button></header>
|
||
<nav><button type="button" data-path-picker-up title="{{ T "picker.parent" }}" aria-label="{{ T "picker.parent" }}">↑</button><code data-path-picker-current>/</code></nav>
|
||
<p class="muted" data-path-picker-status role="status"></p>
|
||
<div class="config-path-picker-list" data-path-picker-list role="listbox" aria-label="{{ T "picker.title" }}"></div>
|
||
<footer><button type="button" data-path-picker-folder>{{ T "picker.select_folder" }}</button><button type="button" data-path-picker-select disabled>{{ T "picker.select" }}</button><button type="button" data-path-picker-close>{{ T "picker.cancel" }}</button></footer>
|
||
</dialog>
|
||
|
||
<script>
|
||
const configMessages = {
|
||
ioRead: {{ T "config.io_read" }}, ioWrite: {{ T "config.io_write" }},
|
||
emptyRunning: {{ T "config.no_running_jobs" }}, logs: {{ T "config.job_logs" }}, olderLogs: {{ T "config.older_logs" }},
|
||
cancel: {{ T "config.cancel" }}, retry: {{ T "config.retry" }}, cancelRequested: {{ T "config.cancel_requested" }}, paused: {{ T "config.queue_paused" }},
|
||
loading: {{ T "config.loading" }}, requestFailed: {{ T "config.request_failed" }},
|
||
queued: {{ T "config.queued" }}, running: {{ T "config.running" }}, succeeded: {{ T "config.succeeded" }},
|
||
skipped: {{ T "config.skipped" }}, failed: {{ T "config.failed" }}, cancelled: {{ T "config.cancelled" }},
|
||
disabled: {{ T "config.disabled" }}, manual: {{ T "config.manual" }}, interval: {{ T "config.interval" }}, once: {{ T "config.once" }},
|
||
bookmarksLimit: {{ T "config.bookmark_limit" }}
|
||
};
|
||
|
||
function formatSchedulerBytes(value) {
|
||
if (!Number.isFinite(value)) return "—"
|
||
const units = ["B", "KiB", "MiB", "GiB", "TiB"]
|
||
let number = value, index = 0
|
||
while (number >= 1024 && index < units.length - 1) {
|
||
number /= 1024
|
||
index++
|
||
}
|
||
return number.toFixed(index ? 1 : 0) + " " + units[index]
|
||
}
|
||
|
||
function schedulerEscape(value) {
|
||
const node = document.createElement("span")
|
||
node.textContent = value == null ? "" : String(value)
|
||
return node.innerHTML.replace(/"/g, """).replace(/'/g, "'")
|
||
}
|
||
|
||
async function loadSchedulerPanel(name = activeConfigPanel, signal) {
|
||
const status = value => configMessages[value] || value;
|
||
const errorBox = document.querySelector('[data-panel-error="' + name + '"]');
|
||
if (errorBox) errorBox.textContent = "";
|
||
try {
|
||
if (name === "queue") {
|
||
const settings = await configJSON("/_/api/v1/queue/settings", {signal});
|
||
const form = document.getElementById("queue-settings-form");
|
||
for (const [key,value] of Object.entries(settings)) {
|
||
const input = form.elements.namedItem(key);
|
||
if (!input) continue;
|
||
if (input.type === "checkbox") input.checked = Boolean(value); else input.value = value;
|
||
}
|
||
} else if (name === "scheduler") {
|
||
configResources.activate(activeConfigPanel === "scheduler");
|
||
} else if (name === "events") {
|
||
const data = await configJSON("/_/api/v1/event", {signal});
|
||
document.querySelector("#event-definitions tbody").innerHTML = (data.events || []).map(item =>
|
||
'<tr><td><span class="cell-clip" title="' + schedulerEscape(item.name) + '">' + schedulerEscape(item.name) + '</span> <small class="mono">' + schedulerEscape(item.event_type) +
|
||
'</small></td><td>' + schedulerEscape(status(item.schedule_kind)) + (item.enabled ? '' : ' (' + configMessages.disabled + ')') +
|
||
'</td><td>' + schedulerEscape(item.next_run_at_ms ? new Date(item.next_run_at_ms).toLocaleString() : "—") +
|
||
'</td><td><button type="button" data-event-action="run" data-event="' + schedulerEscape(item.uuid) +
|
||
'">▶</button> <button type="button" data-event-action="delete" data-event="' + schedulerEscape(item.uuid) +
|
||
'">×</button></td></tr>').join("") || '<tr><td colspan="4">—</td></tr>';
|
||
} else if (name === "logs") {
|
||
await configJobs.loadHistory("", signal);
|
||
}
|
||
} catch (error) { if (error.name !== "AbortError" && errorBox) errorBox.textContent = error.message; }
|
||
}
|
||
|
||
document.getElementById("queue-settings-form").addEventListener("submit", event => {
|
||
event.preventDefault();
|
||
const form = event.currentTarget, fields = form.elements;
|
||
configAction(event.submitter, "queue-settings-result", async () => {
|
||
await configJSON("/_/api/v1/queue/settings", {method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({
|
||
paused:fields.namedItem("paused").checked, concurrency:Number(fields.namedItem("concurrency").value),
|
||
max_depth:Number(fields.namedItem("max_depth").value),retry_base_seconds:Number(fields.namedItem("retry_base_seconds").value),
|
||
retention_hours:Number(fields.namedItem("retention_hours").value)
|
||
})});
|
||
});
|
||
});
|
||
document.getElementById("event-definition-form").addEventListener("submit", event => {
|
||
event.preventDefault();
|
||
const form = event.currentTarget, f = form.elements, value = key => f.namedItem(key).value;
|
||
configAction(event.submitter,"event-definition-result",async () => {
|
||
const kind = value("schedule_kind");
|
||
const payload = JSON.stringify(JSON.parse(value("payload") || "{}"));
|
||
await configJSON("/_/api/v1/event", {method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({
|
||
name:value("name"),event_type:value("event_type"),event_key:value("event_key") || value("name"),payload,
|
||
schedule_kind:kind,interval_seconds:kind === "interval" ? Number(value("interval_seconds")) : 0,
|
||
next_run_at_ms:kind === "once" && value("next_run_at") ? new Date(value("next_run_at")).getTime() : 0,
|
||
enabled:f.namedItem("enabled").checked,priority:Number(value("priority")),max_attempts:Number(value("max_attempts"))
|
||
})});
|
||
f.namedItem("name").value = "";
|
||
await loadSchedulerPanel("events");
|
||
});
|
||
});
|
||
document.getElementById("event-definitions").addEventListener("click", event => {
|
||
const button = event.target.closest("[data-event-action]"); if (!button) return;
|
||
configAction(button,"event-definition-result",async () => {
|
||
await configJSON("/_/api/v1/event/" + button.dataset.eventAction,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uuid:button.dataset.event})});
|
||
await loadSchedulerPanel("events");
|
||
});
|
||
});
|
||
|
||
async function loadAdapterPanel() {
|
||
try {
|
||
const data = await configJSON("/_/api/v1/adapter", {signal: configPanelController?.signal})
|
||
document.querySelector("#builtin-adapters tbody").innerHTML =
|
||
(data.builtin || []).map(item => "<tr><td class=\"mono\">" +
|
||
schedulerEscape(item.id) + "</td><td>" + schedulerEscape(item.kind) +
|
||
"</td><td>" + schedulerEscape(item.delivery) + "</td></tr>").join("")
|
||
document.querySelector("#adapter-plugins tbody").innerHTML =
|
||
(data.plugins || []).map(item => "<tr><td class=\"mono\">" +
|
||
schedulerEscape(item.id) + "</td><td>" + schedulerEscape(item.name) +
|
||
"</td><td>" + schedulerEscape(item.mode) +
|
||
(item.unsupported ? " (TODO)" : (item.enabled ? "" : " (disabled)")) +
|
||
'</td><td class="mono"><span class="cell-clip" title="' + schedulerEscape(item.url_template) + '">' + schedulerEscape(item.url_template) + '</span>' +
|
||
(item.default_editor ? ' ★' : '') +
|
||
'</td><td><a class="button-link" href="/-/sys/config/adapters?id=' +
|
||
encodeURIComponent(item.id) + '">⚙</a> <button type="button" data-adapter-delete="' +
|
||
item.id + '">×</button></td></tr>').join("") ||
|
||
'<tr><td colspan="5">—</td></tr>'
|
||
} catch (error) {
|
||
document.getElementById("adapter-plugin-result").textContent = error.message
|
||
}
|
||
}
|
||
|
||
document.getElementById("adapter-plugin-form").addEventListener("submit", event => {
|
||
event.preventDefault();
|
||
const f = event.currentTarget.elements, value = key => f.namedItem(key).value;
|
||
const list = value => value.split(",").map(x=>x.trim()).filter(Boolean);
|
||
configAction(event.submitter,"adapter-plugin-result",async () => {
|
||
await configJSON("/_/api/v1/adapter",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({
|
||
id:value("id"),name:value("name"),mode:value("mode"),url_template:value("url_template"),
|
||
media_types:list(value("media_types")),extensions:list(value("extensions")),enabled:f.namedItem("enabled").checked
|
||
})});
|
||
location.href = "/-/sys/config?panel=" + encodeURIComponent("adapter-" + value("id").trim().toLowerCase());
|
||
});
|
||
});
|
||
document.getElementById("adapter-plugins").addEventListener("click", event => {
|
||
const button = event.target.closest("[data-adapter-delete]"); if (!button) return;
|
||
configAction(button,"adapter-plugin-result",async () => {
|
||
await configJSON("/_/api/v1/adapter/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:button.dataset.adapterDelete})});
|
||
location.href = "/-/sys/config?panel=adapters";
|
||
});
|
||
});
|
||
|
||
const assetHeads = new Map()
|
||
const assetEscape = value => String(value || "").replace(/[&<>'"]/g, character => ({"&":"&","<":"<",">":">","'":"'",'"':"""}[character]))
|
||
const assetCopyLabel = {{ T "config.copy_hash" }}
|
||
const assetCopiedLabel = {{ T "config.hash_copied" }}
|
||
const assetOpenLabel = {{ T "config.open_asset_head" }}
|
||
const assetDetailsLabel = {{ T "config.asset_details" }}
|
||
const assetRestoreLabel = {{ T "config.restore" }}
|
||
|
||
async function copyAssetHash(value) {
|
||
if (navigator.clipboard && window.isSecureContext) {
|
||
await navigator.clipboard.writeText(value)
|
||
return
|
||
}
|
||
const input = document.createElement("textarea")
|
||
input.value = value
|
||
input.setAttribute("readonly", "")
|
||
input.style.position = "fixed"
|
||
input.style.opacity = "0"
|
||
document.body.appendChild(input)
|
||
input.select()
|
||
const copied = document.execCommand("copy")
|
||
input.remove()
|
||
if (!copied) throw new Error(assetCopyLabel)
|
||
}
|
||
|
||
async function loadAssetPanel() {
|
||
const body = document.querySelector("#asset-list tbody")
|
||
try {
|
||
const data = await configJSON("/_/api/v1/assets", {signal: configPanelController?.signal})
|
||
assetHeads.clear()
|
||
for (const item of data.assets || []) assetHeads.set(item.address, item.head_document_hash)
|
||
body.innerHTML = (data.assets || []).map(item => '<tr><td><code class="cell-clip" title="' + assetEscape(item.address) + '">' + assetEscape(item.address) +
|
||
'</code></td><td><span class="cell-clip" title="' + assetEscape(item.filename || '—') + '">' + assetEscape(item.filename || '—') + '</span></td><td>' + assetEscape(item.content_type) +
|
||
'</td><td>' + Number(item.size_bytes || 0) + '</td><td><code title="' + assetEscape(item.head_document_hash) + '">' +
|
||
assetEscape((item.head_document_hash || '').slice(0, 12)) + '…</code> <button type="button" data-asset-copy-hash="' + assetEscape(item.head_document_hash) + '" title="' + assetEscape(assetCopyLabel) + '" aria-label="' + assetEscape(assetCopyLabel) + '">⧉</button></td><td>' + Number(item.reference_count || 0) +
|
||
'</td><td><button type="button" data-asset-details="' + assetEscape(item.address) + '" title="' + assetEscape(assetDetailsLabel) + '">ⓘ</button> <a class="button-link" href="/v/raw/' + encodeURIComponent(item.address) + '" target="_blank" rel="noopener" title="' + assetEscape(assetOpenLabel) + '" aria-label="' + assetEscape(assetOpenLabel) + '">↗</a> <button type="button" data-asset-use="' + assetEscape(item.address) + '">↥</button> <button type="button" data-asset-delete="' + assetEscape(item.address) + '">🗑</button></td></tr>').join('') || '<tr><td colspan="7">—</td></tr>'
|
||
} catch (error) { if (error.name !== "AbortError") body.innerHTML = '<tr><td colspan="7">' + assetEscape(error.message) + '</td></tr>' }
|
||
}
|
||
|
||
document.getElementById("asset-form").addEventListener("submit", async event => {
|
||
event.preventDefault()
|
||
const form = event.currentTarget
|
||
const address = form.address.value.trim()
|
||
const headers = assetHeads.has(address) ? {"If-Match": '"sha256:' + assetHeads.get(address) + '"'} : {"If-None-Match": "*"}
|
||
const response = await fetch("/_/api/v1/assets", {method: "POST", headers, body: new FormData(form)})
|
||
document.getElementById("asset-result").textContent = response.ok ? "✓" : await response.text()
|
||
if (response.ok) { form.reset(); loadAssetPanel() }
|
||
})
|
||
|
||
document.getElementById("asset-list").addEventListener("click", async event => {
|
||
const copy = event.target.closest("[data-asset-copy-hash]")
|
||
if (copy) {
|
||
try {
|
||
await copyAssetHash(copy.dataset.assetCopyHash)
|
||
const previous = copy.textContent
|
||
copy.textContent = "✓"
|
||
copy.title = assetCopiedLabel
|
||
setTimeout(() => { copy.textContent = previous; copy.title = assetCopyLabel }, 1200)
|
||
} catch (error) { alert(error.message) }
|
||
return
|
||
}
|
||
const details = event.target.closest("[data-asset-details]")
|
||
if (details) { await showAssetDetails(details.dataset.assetDetails); return }
|
||
const use = event.target.closest("[data-asset-use]")
|
||
if (use) { document.querySelector('#asset-form [name="address"]').value = use.dataset.assetUse; document.querySelector('#asset-form [name="file"]').focus(); return }
|
||
const remove = event.target.closest("[data-asset-delete]")
|
||
if (!remove || !confirm(remove.dataset.assetDelete + "?")) return
|
||
const hash = assetHeads.get(remove.dataset.assetDelete)
|
||
const response = await fetch("/_/api/v1/assets?address=" + encodeURIComponent(remove.dataset.assetDelete), {method:"DELETE",headers:{"If-Match":'"sha256:' + hash + '"'}})
|
||
if (response.ok) loadAssetPanel(); else alert(await response.text())
|
||
})
|
||
|
||
async function showAssetDetails(address) {
|
||
const dialog = document.getElementById("asset-detail-dialog")
|
||
const content = dialog.querySelector("[data-asset-detail-content]")
|
||
dialog.querySelector("[data-asset-detail-title]").textContent = address
|
||
content.textContent = "…"
|
||
if (!dialog.open) dialog.showModal()
|
||
let data
|
||
try { data = await configJSON("/_/api/v1/assets?address=" + encodeURIComponent(address)) }
|
||
catch (error) { content.textContent = error.message; return }
|
||
assetHeads.set(address, data.asset.head_document_hash)
|
||
const history = (data.history || []).map(item => '<tr><td>' + assetEscape(item.action) + '</td><td><code title="' + assetEscape(item.document_hash) + '">' + assetEscape(item.document_hash.slice(0,12)) + '…</code></td><td>' + assetEscape(item.filename || '—') + '</td><td>' + new Date(item.created_at_ms).toLocaleString() + '</td><td>' + (item.document_hash === data.asset.head_document_hash ? 'HEAD' : '<button type="button" data-asset-restore="' + item.id + '" data-address="' + assetEscape(address) + '">' + assetEscape(assetRestoreLabel) + '</button>') + '</td></tr>').join('') || '<tr><td colspan="5">—</td></tr>'
|
||
const dependencies = (data.dependencies || []).map(item => '<tr><td><a href="' + assetEscape(item.path) + '">' + assetEscape(item.path) + '</a></td><td><a href="/r/view/' + encodeURIComponent(item.revision_uuid) + '"><code>' + assetEscape(item.revision_uuid.slice(0,12)) + '…</code></a></td><td><code>' + assetEscape(item.document_hash.slice(0,12)) + '…</code></td></tr>').join('') || '<tr><td colspan="3">—</td></tr>'
|
||
content.innerHTML = '<h3>{{ T "config.asset_history" }}</h3><div class="table-scroll"><table class="recent-table"><thead><tr><th>{{ T "config.action" }}</th><th>SHA-256</th><th>{{ T "viewer.filename" }}</th><th>{{ T "config.updated" }}</th><th></th></tr></thead><tbody>' + history + '</tbody></table></div><h3>{{ T "config.asset_dependencies" }}</h3><div class="table-scroll"><table class="recent-table"><thead><tr><th>Path</th><th>Revision</th><th>SHA-256</th></tr></thead><tbody>' + dependencies + '</tbody></table></div>'
|
||
}
|
||
|
||
document.querySelector("[data-asset-detail-close]").addEventListener("click", () => document.getElementById("asset-detail-dialog").close())
|
||
document.getElementById("asset-detail-dialog").addEventListener("click", async event => {
|
||
const restore = event.target.closest("[data-asset-restore]")
|
||
if (!restore) return
|
||
const address = restore.dataset.address
|
||
const response = await fetch("/_/api/v1/assets", {method:"POST",headers:{"Content-Type":"application/json","If-Match":'"sha256:' + assetHeads.get(address) + '"'},body:JSON.stringify({action:"restore",address,history_id:Number(restore.dataset.assetRestore)})})
|
||
if (!response.ok) { alert(await response.text()); return }
|
||
await loadAssetPanel(); await showAssetDetails(address)
|
||
})
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
function moveNavRow(button, direction) {
|
||
|
||
const row =
|
||
button.closest(
|
||
"tr"
|
||
)
|
||
|
||
const tbody =
|
||
row.parentElement
|
||
|
||
if (direction < 0) {
|
||
|
||
const prev =
|
||
row.previousElementSibling
|
||
|
||
if (prev) {
|
||
|
||
tbody.insertBefore(
|
||
row,
|
||
prev
|
||
)
|
||
}
|
||
|
||
return
|
||
}
|
||
|
||
const next =
|
||
row.nextElementSibling
|
||
|
||
if (next) {
|
||
|
||
tbody.insertBefore(
|
||
next,
|
||
row
|
||
)
|
||
}
|
||
}
|
||
|
||
</script>
|
||
|
||
|
||
|
||
{{/* Dialogs live outside tables/panels so dense-row rules and hidden panels cannot affect them. */}}
|
||
{{ range .Domains }}
|
||
{{ $domain := . }}{{ $managed := index $.CampusManaged .CampusUUID }}{{ $entry := index $.DomainEntries .UUID }}
|
||
<dialog id="domain-entry-{{ .ID }}" class="domain-entry-dialog" aria-labelledby="domain-entry-title-{{ .ID }}">
|
||
<header><h2 id="domain-entry-title-{{ .ID }}">{{ .Title }} · {{ T "periodical.entry_settings" }}</h2><button type="button" data-domain-entry-close aria-label="{{ T "city.close" }}">×</button></header>
|
||
<div class="domain-entry-body">
|
||
<form method="post" action="/-/sys/config">
|
||
<input type="hidden" name="section" value="domain-entry"><input type="hidden" name="domain_id" value="{{ .ID }}">
|
||
<fieldset {{ if $managed }}disabled{{ end }}>
|
||
<label>{{ T "home.layout" }}<select name="entry_layout">
|
||
<option value="classic" {{ if eq $entry.Layout "classic" }}selected{{ end }}>{{ T "home.layout_classic" }}</option>
|
||
<option value="search" {{ if eq $entry.Layout "search" }}selected{{ end }}>{{ T "home.layout_search" }}</option>
|
||
<option value="directory" {{ if eq $entry.Layout "directory" }}selected{{ end }}>{{ T "home.layout_directory" }}</option>
|
||
<option value="diary" {{ if eq $entry.Layout "diary" }}selected{{ end }}>{{ T "periodical.diary" }}</option>
|
||
<option value="blog" {{ if eq $entry.Layout "blog" }}selected{{ end }}>{{ T "periodical.blog" }}</option>
|
||
</select></label>
|
||
<label class="config-toggle" data-label="{{ T "periodical.diary" }}"><input type="checkbox" role="switch" aria-label="{{ T "periodical.diary" }}" name="diary_enabled" value="1" {{ if $entry.DiaryEnabled }}checked{{ end }}></label>
|
||
<label>{{ T "periodical.prefix" }}<input name="diary_prefix" required maxlength="3500" value="{{ if $entry.DiaryPrefix }}{{ $entry.DiaryPrefix }}{{ else }}/diary{{ end }}"></label>
|
||
<label class="config-toggle" data-label="{{ T "periodical.blog" }}"><input type="checkbox" role="switch" aria-label="{{ T "periodical.blog" }}" name="blog_enabled" value="1" {{ if $entry.BlogEnabled }}checked{{ end }}></label>
|
||
<label>{{ T "periodical.prefix" }}<input name="blog_prefix" required maxlength="3500" value="{{ if $entry.BlogPrefix }}{{ $entry.BlogPrefix }}{{ else }}/blog{{ end }}"></label>
|
||
<button type="submit">{{ T "config.save" }}</button>
|
||
</fieldset>
|
||
<p>{{ T "periodical.federation_help" }}</p>
|
||
{{ if gt (index $.CampusLegacyPeers .CampusUUID) 0 }}<p role="status">{{ T "periodical.capability_required" }}</p>{{ end }}
|
||
{{ if $managed }}<p>{{ T "periodical.controlled" }}</p>{{ end }}
|
||
</form>
|
||
<p>{{ T "periodical.projection_help" }}</p>
|
||
{{ range $kind := $.PeriodicalKinds }}
|
||
{{ $projection := index $.PeriodicalProjections (printf "%s|%s" $domain.UUID $kind) }}
|
||
<form method="post" action="/-/sys/config">
|
||
<input type="hidden" name="section" value="domain-projection"><input type="hidden" name="domain_id" value="{{ $domain.ID }}"><input type="hidden" name="kind" value="{{ $kind }}">
|
||
<fieldset {{ if or $managed (ne $domain.Placement "local") }}disabled{{ end }}>
|
||
<legend>{{ T (printf "periodical.%s" $kind) }}</legend>
|
||
<label>{{ T "periodical.projection" }}<select name="source_uuid">
|
||
<option value="">{{ T "periodical.projection_local" }}</option>
|
||
{{ range $.Domains }}{{ if and (eq .CampusUUID $domain.CampusUUID) (ne .UUID $domain.UUID) (eq .Placement "local") .Enabled }}<option value="{{ .UUID }}" {{ if eq .UUID $projection.Source }}selected{{ end }}>{{ .Title }} ({{ .Domain }})</option>{{ end }}{{ end }}
|
||
</select></label>
|
||
<label>Path prefix<input name="prefix" required maxlength="3500" value="{{ if $projection.Prefix }}{{ $projection.Prefix }}{{ else }}/{{ end }}"></label>
|
||
<button type="submit">{{ T "config.save" }}</button>
|
||
</fieldset></form>
|
||
{{ end }}
|
||
</div>
|
||
</dialog>
|
||
{{ end }}
|
||
</body>
|
||
<script>document.querySelector('#panel-broadcasts button[type="submit"]')?.replaceChildren(document.createTextNode('{{ T "config.send" }}'));document.querySelectorAll('#panel-broadcasts .table-scroll tbody tr td:first-child .muted').forEach(node=>node.remove());</script>
|
||
</html>
|
||
{{ end }}
|