added hideControls setting

This commit is contained in:
Gani Georgiev
2022-08-18 17:10:42 +03:00
parent cfaff31d97
commit 7be389704d
9 changed files with 72 additions and 40 deletions
@@ -1,8 +1,9 @@
<script>
import ApiClient from "@/utils/ApiClient";
import CommonHelper from "@/utils/CommonHelper";
import { pageTitle, appName } from "@/stores/app";
import { pageTitle, appName, hideControls } from "@/stores/app";
import { addSuccessToast } from "@/stores/toasts";
import tooltip from "@/actions/tooltip";
import PageWrapper from "@/components/base/PageWrapper.svelte";
import Field from "@/components/base/Field.svelte";
import SettingsSidebar from "@/components/settings/SettingsSidebar.svelte";
@@ -54,6 +55,7 @@
function init(settings = {}) {
$appName = settings?.meta?.appName;
$hideControls = !!settings?.meta?.hideControls;
formSettings = {
meta: settings?.meta || {},
@@ -108,6 +110,20 @@
<input type="number" id={uniqueId} required bind:value={formSettings.logs.maxDays} />
</Field>
<Field class="form-field form-field-toggle" name="meta.hideControls" let:uniqueId>
<input type="checkbox" id={uniqueId} bind:checked={formSettings.meta.hideControls} />
<label for={uniqueId}>
<span class="txt">Hide collection create and edit controls</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: `This is useful to prevent making accidental schema changes on a production environment.`,
position: "right",
}}
/>
</label>
</Field>
<div class="col-lg-12 flex">
<div class="flex-fill" />
{#if hasChanges}