Fix custom domain setting + fix maxFileSize preview
This commit is contained in:
@@ -117,6 +117,7 @@ export default {
|
||||
const workingFormStore = useWorkingFormStore()
|
||||
return {
|
||||
workingFormStore,
|
||||
currentWorkspace: computed(() => useWorkspacesStore().getCurrent),
|
||||
selectedFieldIndex: computed(() => workingFormStore.selectedFieldIndex),
|
||||
showEditFieldSidebar: computed(() => workingFormStore.showEditFieldSidebar)
|
||||
}
|
||||
@@ -299,7 +300,7 @@ export default {
|
||||
}
|
||||
} else if (field.type === 'files' || (field.type === 'url' && field.file_upload)) {
|
||||
inputProperties.multiple = (field.multiple !== undefined && field.multiple)
|
||||
inputProperties.mbLimit = this.form.max_file_size
|
||||
inputProperties.mbLimit = this.currentWorkspace.max_file_size ?? this.form.max_file_size
|
||||
inputProperties.accept = (this.form.is_pro && field.allowed_file_types) ? field.allowed_file_types : ''
|
||||
} else if (field.type === 'number' && field.is_rating) {
|
||||
inputProperties.numberOfStars = parseInt(field.rating_max_value)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</div>
|
||||
|
||||
<template v-if="customDomainsEnabled">
|
||||
<text-area-input v-model="customDomains" name="custom_domain" class="mt-4" :required="false"
|
||||
<text-area-input :form="customDomainsForm" name="custom_domains" class="mt-4" :required="false"
|
||||
:disabled="!workspace.is_pro"
|
||||
label="Workspace Custom Domains" wrapper-class="" placeholder="yourdomain.com - 1 per line"
|
||||
/>
|
||||
@@ -135,7 +135,9 @@ let form = useForm({
|
||||
emoji: ''
|
||||
})
|
||||
let workspaceModal = ref(false)
|
||||
let customDomains = ''
|
||||
let customDomainsForm = useForm({
|
||||
custom_domain: ''
|
||||
})
|
||||
let customDomainsLoading = ref(false)
|
||||
|
||||
let workspace = computed(() => workspacesStore.getCurrent)
|
||||
@@ -153,12 +155,14 @@ onMounted(() => {
|
||||
const saveChanges = () => {
|
||||
if (customDomainsLoading.value) return
|
||||
customDomainsLoading.value = true
|
||||
|
||||
// Update the workspace custom domain
|
||||
opnFetch('/open/workspaces/' + workspace.value.id + '/custom-domains', {
|
||||
method: 'PUT',
|
||||
custom_domains: customDomains.split('\n')
|
||||
.map(domain => domain ? domain.trim() : null)
|
||||
.filter(domain => domain && domain.length > 0)
|
||||
customDomainsForm.put('/open/workspaces/' + workspace.value.id + '/custom-domains', {
|
||||
data: {
|
||||
custom_domains: customDomainsForm.custom_domains.split('\n')
|
||||
.map(domain => domain ? domain.trim() : null)
|
||||
.filter(domain => domain && domain.length > 0)
|
||||
}
|
||||
}).then((data) => {
|
||||
workspacesStore.save(data)
|
||||
useAlert().success('Custom domains saved.')
|
||||
@@ -171,7 +175,7 @@ const saveChanges = () => {
|
||||
|
||||
const initCustomDomains = () => {
|
||||
if (!workspace || !workspace.value.custom_domains) return
|
||||
customDomains = workspace.value.custom_domains.join('\n')
|
||||
customDomainsForm.custom_domains = workspace.value.custom_domains.join('\n')
|
||||
}
|
||||
|
||||
const deleteWorkspace = (workspaceId) => {
|
||||
|
||||
Reference in New Issue
Block a user