24 lines
5.5 KiB
HTML
24 lines
5.5 KiB
HTML
<section class="site-admin" x-show="view==='site'" x-cloak>
|
|||
|
|
<div class="page-heading"><div><div class="eyebrow" x-text="t('site_scope')"></div><h1 x-text="t('site_title')"></h1><p class="muted" x-text="t('site_scope_hint')"></p></div><button type="button" @click="loadSite()" :disabled="siteLoading||busy" x-text="t('site_refresh')"></button></div>
|
||
|
|
<p class="info-note" x-show="!siteAdmin" x-text="t('site_denied')"></p>
|
||
|
|
<template x-if="siteAdmin && siteData"><div class="site-layout">
|
||
|
|
<nav class="site-tabs" :aria-label="t('site_sections')"><template x-for="section in siteSections()" :key="section.id"><button type="button" :class="{active:siteSection===section.id}" :aria-current="siteSection===section.id?'page':null" @click="siteTab(section.id)" x-text="section.label"></button></template></nav>
|
||
|
|
<div class="site-body">
|
||
|
|
<label x-show="['users','workspaces'].includes(siteSection)"><span x-text="t('site_search')"></span><input x-model="siteSearch" type="search"></label>
|
||
|
|
<section x-show="siteSection==='users'"><h2 x-text="t('site_users')"></h2><div class="site-list"><template x-for="row in siteUsers()" :key="row.user.id"><article class="site-row"><div><strong x-text="row.user.display_name"></strong><div class="muted" x-text="row.user.username"></div><div class="muted" x-text="row.user.email"></div><span class="badge" x-show="row.access.administrator" x-text="t('site_administrator')"></span><span class="badge" x-show="row.access.disabled" x-text="t('site_disabled')"></span></div><button @click="editSiteUser(row)" x-text="t('site_edit')"></button></article></template></div></section>
|
||
|
|
<section x-show="siteSection==='workspaces'"><h2 x-text="t('site_workspaces')"></h2><div class="site-list"><template x-for="row in siteWorkspaces()" :key="row.id"><article class="site-row"><div><strong x-text="row.name"></strong><div class="muted"><span x-text="t('site_owners')"></span>: <span x-text="row.owners.map(id=>siteUserName(id)).join(', ')"></span></div></div><button @click="editSiteWorkspace(row)" x-text="t('site_edit')"></button></article></template></div></section>
|
||
|
|
<form class="site-editor" x-show="siteEdit" @submit.prevent="saveSiteEdit()"><h3 x-text="t('site_edit')"></h3>
|
||
|
|
<template x-if="siteEdit?.kind==='user'"><div><label><span x-text="t('display_name_c7874a')"></span><input x-model="siteEdit.display_name" required maxlength="120"></label><label class="check"><input type="checkbox" x-model="siteEdit.administrator"><span x-text="t('site_administrator')"></span></label><label class="check"><input type="checkbox" x-model="siteEdit.disabled"><span x-text="t('site_disabled')"></span></label><p class="muted" x-text="t('site_suspend_hint')"></p></div></template>
|
||
|
|
<template x-if="siteEdit?.kind==='workspace'"><div><label><span x-text="t('site_name')"></span><input x-model="siteEdit.name" required maxlength="120"></label><label><span x-text="t('site_add_owner')"></span><select x-model="siteEdit.owner_id" :aria-label="t('site_add_owner')" required><template x-for="row in siteData.users.filter(x=>!x.access.disabled)" :key="row.user.id"><option :value="row.user.id" x-text="row.user.username"></option></template></select></label><p class="muted" x-text="t('site_owner_hint')"></p></div></template>
|
||
|
|
<div class="actions"><button type="button" @click="siteEdit=null" x-text="t('site_cancel')"></button><button class="primary" :disabled="busy" x-text="t('site_save')"></button></div>
|
||
|
|
</form>
|
||
|
|
<section x-show="siteSection==='authentication'"><h2 x-text="t('site_authentication')"></h2><p class="info-note" x-text="t('site_auth_draft')"></p>
|
||
|
|
<form @submit.prevent="saveSiteAuth()" class="site-settings-form"><fieldset><legend x-text="t('site_login_methods')"></legend><label class="check"><input type="checkbox" x-model="siteAuth.password_enabled"><span x-text="t('site_password_enabled')"></span></label><label class="check"><input type="checkbox" x-model="siteAuth.oidc_enabled"><span x-text="t('site_oidc_enabled')"></span></label></fieldset>
|
||
|
|
<fieldset><legend x-text="t('site_oidc_provider')"></legend><label><span x-text="t('site_issuer')"></span><input type="url" x-model="siteAuth.issuer" :required="siteAuth.oidc_enabled" maxlength="2048"></label><p class="muted" x-text="t('site_issuer_hint')"></p><label><span x-text="t('site_client_id')"></span><input x-model="siteAuth.client_id" :required="siteAuth.oidc_enabled" maxlength="500"></label><label><span x-text="t('site_secret_env')"></span><input x-model="siteAuth.client_secret_env" required pattern="MEGURI_OIDC_[A-Z0-9_]+"></label><p class="muted" x-text="t('site_secret_hint')"></p></fieldset>
|
||
|
|
<fieldset><legend x-text="t('site_login_experience')"></legend><label><span x-text="t('site_button_label')"></span><input x-model="siteAuth.button_label" :required="siteAuth.oidc_enabled" maxlength="80"></label><label class="check"><input type="checkbox" x-model="siteAuth.allow_new_users"><span x-text="t('site_new_accounts')"></span></label><p class="muted" x-text="t('site_new_accounts_hint')"></p></fieldset><button class="primary" :disabled="busy" x-text="t('site_save_draft')"></button>
|
||
|
|
</form>
|
||
|
|
</section>
|
||
|
|
<section x-show="siteSection==='audit'"><h2 x-text="t('site_audit')"></h2><template x-for="event in siteData.audit" :key="event.id"><article class="site-audit-row"><strong x-text="t('site_action_'+event.action.split('.').at(-1))"></strong><span x-text="event.actor_id?siteUserName(event.actor_id):t('site_deployment')"></span><time x-text="formatTime(event.created_at)"></time><pre x-text="JSON.stringify(event.details,null,2)"></pre></article></template></section>
|
||
|
|
</div>
|
||
|
|
</div></template>
|
||
|
|
</section>
|