diff --git a/apps/settings/src/components/AppStoreSidebar/AppDeployOptionsModal.vue b/apps/settings/src/components/AppStoreSidebar/AppDeployOptionsModal.vue
index 6d95216879a83..6494ad8b79cb9 100644
--- a/apps/settings/src/components/AppStoreSidebar/AppDeployOptionsModal.vue
+++ b/apps/settings/src/components/AppStoreSidebar/AppDeployOptionsModal.vue
@@ -10,156 +10,127 @@
- {{ t('settings', 'Edit ExApp deploy options before installation') }}
+ {{ configuredDeployOptions === null ? t('settings', 'Edit ExApp deploy options before installation') : t('settings', 'Configured ExApp deploy options. Can be set only during installation') }}.
+ Learn more
-
{{ t('settings', 'Environment variables') }}
-
-
-
{{ envVar.description }}
-
-
+
+ {{ t('settings', 'Environment variables') }}
+
+
+
+
+
{{ envVar.description }}
+
+
+
+ {{ t('settings', 'ExApp container environment variables (ExApp-reserved envs are excluded)') }}
+
+
+
+ {{ t('settings', 'No environment variables defined') }}
+
{{ t('settings', 'Mounts') }}
-
{{ t('settings', 'Define host folder mounts to bind to ExApp container') }}
-
{{ t('settings', 'Must exist prior to installing the ExApp') }}
-
-
-
-
-
- {{ t('settings', 'Read-only') }}
-
-
-
-
-
-
-
-
-
-
{{ t('settings', 'New mount') }}
-
-
-
-
+
+ {{ t('settings', 'Define host folder mounts to bind to ExApp container') }}
+ {{ t('settings', 'Must exist on Deploy daemon host prior to installing the ExApp') }}
+
+
+
+
{{ t('settings', 'Read-only') }}
-
-
+ :aria-label="t('settings', 'Remove mount')"
+ style="margin-top: 6px;"
+ @click="removeMount(mount)">
-
+
- {{ t('settings', 'Confirm') }}
-
-
-
-
-
- {{ t('settings', 'Cancel') }}
-
-
addingMount = true">
-
-
-
- {{ t('settings', 'Add mount') }}
-
-
-
-
{{ t('settings', 'Port bindings') }}
-
{{ t('settings', 'Define ports to expose from ExApp container') }}
-
-
-
-
-
+
+
{{ t('settings', 'New mount') }}
+
+
+
+
+ {{ t('settings', 'Read-only') }}
+
+
+
+
+
+
+
+ {{ t('settings', 'Confirm') }}
+
+
+
+
+
+ {{ t('settings', 'Cancel') }}
+
+
+
+ v-if="!addingMount"
+ :aria-label="t('settings', 'Add mount')"
+ style="margin-top: 5px;"
+ @click="() => {
+ addingMount = true
+ $nextTick(() => {
+ this.$refs.newMountHostPath.focus()
+ })
+ }">
-
+
+ {{ t('settings', 'Add mount') }}
-
-
-
-
{{ t('settings', 'New port binding') }}
-
-
-
-
-
-
-
-
-
-
- {{ t('settings', 'Confirm') }}
-
-
-
-
-
- {{ t('settings', 'Cancel') }}
-
+
+
+ {{ t('settings', 'ExApp container mounts') }}
+
+
+
+
+ {{ t('settings', 'Read-only') }}
+
-
-
addingPortBinding = true">
-
-
-
- {{ t('settings', 'Add port binding') }}
-
-
+
+
+ {{ t('settings', 'No mounts defined') }}
+
-
import { computed, ref } from 'vue'
+import axios from '@nextcloud/axios'
+import { generateUrl } from '@nextcloud/router'
+
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
@@ -229,7 +203,6 @@ export default {
return acc
}, {}),
mounts: [],
- ports: [],
})
return {
@@ -243,6 +216,15 @@ export default {
mdiDelete,
}
},
+ watch: {
+ show(newShow) {
+ if (newShow) {
+ this.fetchExAppDeployOptions()
+ } else {
+ this.configuredDeployOptions = null
+ }
+ },
+ },
data() {
return {
addingMount: false,
@@ -252,11 +234,7 @@ export default {
readonly: false,
},
addingPortBinding: false,
- newPortBinding: {
- hostPort: '',
- hostIp: '',
- containerPort: '',
- },
+ configuredDeployOptions: null,
}
},
methods: {
@@ -280,25 +258,14 @@ export default {
removeMount(mountToRemove) {
this.deployOptions.mounts = this.deployOptions.mounts.filter(mount => mount !== mountToRemove)
},
- addPortBinding() {
- this.deployOptions.ports.push(this.newPortBinding)
- this.newPortBinding = {
- hostPort: '',
- hostIp: '',
- containerPort: '',
- }
- this.addingPortBinding = false
- },
- cancelAddPortBinding() {
- this.newPortBinding = {
- hostPort: '',
- hostIp: '',
- containerPort: '',
- }
- this.addingPortBinding = false
- },
- removePortBinding(portToRemove) {
- this.deployOptions.ports = this.deployOptions.ports.filter(port => port !== portToRemove)
+ async fetchExAppDeployOptions() {
+ return axios.get(generateUrl(`/apps/app_api/apps/deploy-options/${this.app.id}`))
+ .then(response => {
+ this.configuredDeployOptions = response.data
+ })
+ .catch(() => {
+ this.configuredDeployOptions = null
+ })
},
},
}
@@ -320,6 +287,17 @@ export default {
align-items: flex-start;
}
+.envs {
+ width: 100%;
+ overflow: auto;
+ height: 100%;
+ max-height: 300px;
+
+ li {
+ margin: 10px 0;
+ }
+}
+
.description {
margin-top: 4px;
font-size: 0.8em;
diff --git a/apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue b/apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue
index 83847e2e4527f..5878244339c95 100644
--- a/apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue
+++ b/apps/settings/src/components/AppStoreSidebar/AppDetailsTab.vue
@@ -78,6 +78,7 @@
:disabled="installing || isLoading"
@click="forceEnable(app.id)">
+ {{ t('settings', 'Deploy options') }}