${this._renderHeader()}
${this._renderSummary()}
${this._renderConfig()}
${this._plugin.manages_own_access ? nothing : this._renderAccess()}
`;
}
_renderHeader() {
return html`
`;
}
_renderSummary() {
const p = this._plugin;
const h = pluginHealth(p);
const cls = h === 'ok' ? 'ok' : (h === 'off' ? 'off' : 'err');
return html`
${t(`plugins.health.${h}`)}
${p.description ? html`
${p.description}
` : nothing}
${hasSchema(p.user_config_schema) ? html`
${t('plugins.badge.user_config')}` : nothing}
this._save(e.target.checked)} />
`;
}
_renderConfig() {
const p = this._plugin;
const fields = schemaFields(p.config_schema);
const draft = this._draft || {};
return html`
${fields.length === 0 ? html`
${t('plugins.detail.config.empty')}
` : html`
${fields.map(f => html`
${f.type === 'boolean' ? html`
this._setDraft(f.key, e.target.checked)} />
` : html`
this._setDraft(f.key, f.type === 'number' ? Number(e.target.value) : e.target.value)} />`}
${f.description ? html`
${f.description}
` : nothing}
`)}
${this._status.err ? html`
${this._status.err}
` : nothing}
${this._status.ok ? html`
${this._status.ok}
` : nothing}
`}
`;
}
_renderAccess() {
return html`
${t('plugins.access.desc')}
${this._accessErr ? html`
${this._accessErr}
` : nothing}
${this._accessSaved ? html`
${t('plugins.saved')}
` : nothing}
${this._access === null
? html`
`
: this._access.length === 0
? html`
${t('plugins.access.empty')}
`
: html`
${this._access.map(u => html`
this._toggleAccessUser(u.user_id, e.target.checked)} />
`)}
`}
`;
}
}