mirror of
https://github.com/PrivateCaptcha/PrivateCaptcha.git
synced 2026-04-26 06:48:25 -05:00
164 lines
11 KiB
HTML
164 lines
11 KiB
HTML
<div>
|
|
<div class="sm:hidden">
|
|
<label for="tabs" class="sr-only">Select a tab</label>
|
|
<!-- Use an "onChange" listener to redirect the user to the selected tab URL. -->
|
|
<select id="tabs" name="tabs" class="block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-pclime-500 focus:outline-none focus:ring-pclime-500 sm:text-sm"
|
|
hx-target="#property-tabs"
|
|
hx-get="{{ partsURL $.Const.OrgEndpoint $.Params.Property.OrgID $.Const.PropertyEndpoint $.Params.Property.ID $.Const.TabEndpoint }}"
|
|
hx-on::config-request="event.detail.path += '/'+this.value"
|
|
hx-swap="innerHTML">
|
|
<option value="{{ $.Const.ReportsEndpoint }}">Reports</option>
|
|
<option value="{{ $.Const.IntegrationsEndpoint }}">Integrations</option>
|
|
<option value="{{ $.Const.SettingsEndpoint }}" selected>Settings</option>
|
|
</select>
|
|
</div>
|
|
<div class="hidden sm:block">
|
|
<div class="border-b border-gray-200">
|
|
<nav class="-mb-px flex space-x-8" aria-label="Tabs">
|
|
<!-- Current: "border-pclime-500 text-pclime-600", Default: "border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700" -->
|
|
<a href="#"
|
|
hx-get="{{ partsURL $.Const.OrgEndpoint $.Params.Property.OrgID $.Const.PropertyEndpoint $.Params.Property.ID $.Const.TabEndpoint $.Const.ReportsEndpoint }}"
|
|
hx-push-url="{{ partsURL $.Const.OrgEndpoint $.Params.Property.OrgID $.Const.PropertyEndpoint $.Params.Property.ID }}?{{ $.Const.Tab }}={{$.Const.ReportsEndpoint}}"
|
|
hx-target="#property-tabs"
|
|
hx-swap="innerHTML"
|
|
class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 whitespace-nowrap border-b-2 py-4 px-1 text-sm font-medium">Reports</a>
|
|
<a href="#"
|
|
hx-get="{{ partsURL $.Const.OrgEndpoint $.Params.Property.OrgID $.Const.PropertyEndpoint $.Params.Property.ID $.Const.TabEndpoint $.Const.IntegrationsEndpoint }}"
|
|
hx-push-url="{{ partsURL $.Const.OrgEndpoint $.Params.Property.OrgID $.Const.PropertyEndpoint $.Params.Property.ID }}?{{ $.Const.Tab }}={{$.Const.IntegrationsEndpoint}}"
|
|
hx-target="#property-tabs"
|
|
hx-swap="innerHTML"
|
|
class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 whitespace-nowrap border-b-2 py-4 px-1 text-sm font-medium">Integrations</a>
|
|
<a href="#" class="border-pclime-500 text-pclime-600 whitespace-nowrap border-b-2 py-4 px-1 text-sm font-medium" aria-current="page">Settings</a>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="divide-y divide-gray-200" x-data="{deleteOpen: false, moveOpen: false}">
|
|
<div class="relative z-10" aria-labelledby="modal-title" role="dialog" aria-modal="true"
|
|
x-show="deleteOpen"
|
|
x-transition:enter="ease-out duration-300"
|
|
x-transition:enter-start="opacity-0"
|
|
x-transition:enter-end="opacity-100"
|
|
x-transition:leave="ease-in duration-200"
|
|
x-transition:leave-start="opacity-100"
|
|
x-transition:leave-end="opacity-0"
|
|
>
|
|
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"></div>
|
|
|
|
<div class="fixed inset-0 z-10 w-screen overflow-y-auto">
|
|
<div class="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0">
|
|
<div class="relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg"
|
|
x-show="deleteOpen"
|
|
x-transition:enter="ease-out duration-300"
|
|
x-transition:enter-start="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
x-transition:enter-end="opacity-100 translate-y-0 sm:scale-100"
|
|
x-transition:leave="ease-in duration-200"
|
|
x-transition:leave-start="opacity-100 translate-y-0 sm:scale-100"
|
|
x-transition:leave-end="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95">
|
|
<div class="bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4">
|
|
<div class="sm:flex sm:items-start">
|
|
<div class="mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-pcred-100 sm:mx-0 sm:h-10 sm:w-10">
|
|
<svg class="h-6 w-6 text-red-600" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" />
|
|
</svg>
|
|
</div>
|
|
<div class="mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left">
|
|
<h3 class="text-base font-semibold leading-6 text-gray-900" id="modal-title">Delete property</h3>
|
|
<div class="mt-2">
|
|
<p class="text-sm text-gray-800">Are you sure you want to delete <strong>{{ .Params.Property.Name }}</strong>? All of your data will be permanently removed. This action cannot be undone.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="bg-gray-50 px-4 py-3 sm:flex sm:flex-row-reverse sm:px-6">
|
|
<button
|
|
hx-delete='{{ partsURL .Const.OrgEndpoint .Params.Org.ID .Const.PropertyEndpoint .Params.Property.ID .Const.DeleteEndpoint }}'
|
|
hx-indicator="#spinner"
|
|
type="button"
|
|
class="pc-internal-form-button pc-internal-form-button-danger sm:ml-3 sm:w-auto">
|
|
<svg id="spinner" class="htmx-indicator animate-spin -ml-1 mr-3 h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
</svg>
|
|
Yes, delete this property
|
|
</button>
|
|
<button type="button" class="mt-3 pc-internal-form-button pc-internal-form-button-secondary sm:mt-0 sm:w-auto" @click="deleteOpen = false">Cancel</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{ if $.Platform.Enterprise }}
|
|
<div class="relative z-10" aria-labelledby="modal-title" role="dialog" aria-modal="true"
|
|
x-show="moveOpen"
|
|
x-transition:enter="ease-out duration-300"
|
|
x-transition:enter-start="opacity-0"
|
|
x-transition:enter-end="opacity-100"
|
|
x-transition:leave="ease-in duration-200"
|
|
x-transition:leave-start="opacity-100"
|
|
x-transition:leave-end="opacity-0"
|
|
>
|
|
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"></div>
|
|
|
|
<div class="fixed inset-0 z-10 w-screen overflow-y-auto">
|
|
<div class="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"
|
|
x-show="moveOpen"
|
|
x-transition:enter="ease-out duration-300"
|
|
x-transition:enter-start="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
|
x-transition:enter-end="opacity-100 translate-y-0 sm:scale-100"
|
|
x-transition:leave="ease-in duration-200"
|
|
x-transition:leave-start="opacity-100 translate-y-0 sm:scale-100"
|
|
x-transition:leave-end="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95">
|
|
<div class="relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:w-full sm:max-w-lg sm:flex">
|
|
<form class="sm:flex-1 sm:flex sm:flex-col"
|
|
hx-disabled-elt="input, button"
|
|
hx-post="{{ partsURL .Const.OrgEndpoint .Params.Org.ID .Const.PropertyEndpoint .Params.Property.ID .Const.MoveEndpoint }}">
|
|
{{template "settings-move-form.html" .}}
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{ end }}
|
|
<div class="grid max-w-4xl grid-cols-1 gap-x-10 gap-y-10 px-4 py-12 sm:px-6 md:grid-cols-3 lg:px-8">
|
|
<div>
|
|
<h2 class="text-base font-semibold leading-7 text-gray-900">Basic settings</h2>
|
|
<p class="mt-1 text-sm leading-6 text-gray-600">Change property's difficulty configuration or property name. To change the domain, you need to create another property.</p>
|
|
<p class="mt-1">
|
|
<a href="https://docs.privatecaptcha.com/docs/reference/property-settings/" target="_blank" class="text-sm/6 font-semibold text-pclime-600 hover:text-pclime-500">Docs <span aria-hidden="true">→</span></a>
|
|
</p>
|
|
</div>
|
|
<form
|
|
hx-put='{{ partsURL .Const.OrgEndpoint .Params.Org.ID .Const.PropertyEndpoint .Params.Property.ID .Const.EditEndpoint }}'
|
|
hx-target="#property-tabs"
|
|
hx-swap="innerHTML"
|
|
hx-disabled-elt="input, button"
|
|
class="md:col-span-2 sm:max-w-lg">
|
|
{{template "settings-basic-form.html" .}}
|
|
</form>
|
|
</div>
|
|
{{ if $.Platform.Enterprise }}
|
|
<div class="grid max-w-4xl grid-cols-1 gap-x-10 gap-y-10 px-4 py-16 sm:px-6 md:grid-cols-3 lg:px-8">
|
|
<div>
|
|
<h2 class="text-base font-semibold leading-7 text-gray-900">Move property</h2>
|
|
<p class="mt-1 text-sm leading-6 text-gray-600">Property will be moved from "{{.Params.Org.Name}}" to another organization you <i>own</i>.</p>
|
|
</div>
|
|
|
|
<div class="flex items-start md:col-span-2">
|
|
<button type="submit" {{ if not .Params.CanMove }}disabled{{ end }} class="pc-internal-form-button {{ if .Params.CanMove }}pc-internal-form-button-secondary{{ else }}pc-internal-form-button-disabled{{ end }}" @click="moveOpen = true">Move</button>
|
|
</div>
|
|
</div>
|
|
{{ end }}
|
|
<div class="grid max-w-4xl grid-cols-1 gap-x-10 gap-y-10 px-4 py-16 sm:px-6 md:grid-cols-3 lg:px-8">
|
|
<div>
|
|
<h2 class="text-base font-semibold leading-7 text-gray-900">Delete property</h2>
|
|
<p class="mt-1 text-sm leading-6 text-gray-600">New verification and captcha requests for this property will be rejected. All historical data related to this property will be deleted.</p>
|
|
</div>
|
|
|
|
<div class="flex items-start md:col-span-2">
|
|
<button type="submit" {{ if not .Params.CanEdit }}disabled{{ end }} class="pc-internal-form-button {{ if .Params.CanEdit }}pc-internal-form-button-danger{{ else }}pc-internal-form-button-disabled{{ end }}" @click="deleteOpen = true">Delete</button>
|
|
</div>
|
|
</div>
|
|
</div>
|