Skip to content

Commit

Permalink
enh(ui): use link to docs and NcPasswordField (#345)
Browse files Browse the repository at this point in the history
1. Use link to AppAPI docs in ExApps management page
2. Use NcPasswordField for haproxy_password

---------

Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
  • Loading branch information
andrey18106 authored Aug 2, 2024
1 parent 938a820 commit 8c7be20
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
24 changes: 21 additions & 3 deletions src/components/DaemonConfig/DaemonConfigDetailsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@
<h3>{{ t('app_api', 'Deploy config') }}</h3>
<p><b>{{ t('app_api', 'Docker network') }}: </b>{{ daemon.deploy_config.net }}</p>
<p><b>{{ t('app_api', 'Nextcloud URL') }}: </b>{{ daemon.deploy_config.nextcloud_url }}</p>
<p v-if="daemon.deploy_config.haproxy_password">
<b>{{ t('app_api', 'HaProxy password') }}: </b>
{{ daemon.deploy_config?.haproxy_password }}
<p v-if="daemon.deploy_config.haproxy_password" class="external-label">
<label for="haproxy_password"><b>{{ t('app_api', 'HaProxy password') }}: </b></label>
<NcPasswordField
id="haproxy_password"
:value="daemon.deploy_config?.haproxy_password"
:disable="true"
style="width: fit-content;"
readonly
autocomplete="off" />
</p>
<p>
<b>{{ t('app_api', 'GPUs support') }}:</b> {{ daemon.deploy_config.computeDevice && daemon.deploy_config?.computeDevice?.id !== 'cpu' || false }}
Expand Down Expand Up @@ -60,6 +66,7 @@ import { showSuccess, showError } from '@nextcloud/dialogs'
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
import NcPasswordField from '@nextcloud/vue/dist/Components/NcPasswordField.js'

import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
import Connection from 'vue-material-design-icons/Connection.vue'
Expand All @@ -71,6 +78,7 @@ export default {
NcButton,
NcNoteCard,
NcLoadingIcon,
NcPasswordField,
Connection,
},
props: {
Expand Down Expand Up @@ -130,4 +138,14 @@ export default {
justify-content: space-between;
margin: 20px 0;
}

.external-label {
display: flex;
align-items: center;
width: 100%;

label {
margin-right: 5px;
}
}
</style>
7 changes: 5 additions & 2 deletions src/components/DaemonConfig/ManageDaemonConfigModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,14 @@
class="external-label"
:aria-label="t('app_api', 'HaProxy password')">
<label for="deploy-config-haproxy-password">{{ t('app_api', 'HaProxy password') }}</label>
<NcInputField
<NcPasswordField
id="deploy-config-haproxy-password"
:value.sync="deployConfig.haproxy_password"
:error="isHaProxyPasswordValid === false"
:placeholder="t('app_api', 'AppAPI Docker Socket Proxy authentication password')"
:aria-label="t('app_api', 'AppAPI Docker Socket Proxy authentication password')"
:helper-text="haProxyPasswordHelperText" />
:helper-text="haProxyPasswordHelperText"
autocomplete="off" />
</div>
<NcSelect
id="compute-device"
Expand Down Expand Up @@ -238,6 +239,7 @@ import { confirmPassword } from '@nextcloud/password-confirmation'
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
import NcInputField from '@nextcloud/vue/dist/Components/NcInputField.js'
import NcPasswordField from '@nextcloud/vue/dist/Components/NcPasswordField.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
Expand All @@ -258,6 +260,7 @@ export default {
NcLoadingIcon,
NcModal,
NcInputField,
NcPasswordField,
UnfoldLessHorizontal,
UnfoldMoreHorizontal,
NcCheckboxRadioSwitch,
Expand Down
9 changes: 3 additions & 6 deletions src/views/Apps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@

<NcAppNavigationItem
id="admin-section"
:href="linkToAdminSettings"
:name="t('app_api', 'Admin settings') + ''">
href="https://cloud-py-api.github.io/app_api/"
target="_blank"
:name="t('app_api', 'Documentation') + ''">
<template v-if="!state.daemon_config_accessible" #icon>
<Alert :size="20" />
</template>
Expand Down Expand Up @@ -162,7 +163,6 @@ import DaemonDetails from '../components/Apps/DaemonDetails.vue'
import ScopesDetails from '../components/Apps/ScopesDetails.vue'
import { APPS_SECTION_ENUM } from '../constants/AppsConstants.js'
import { generateUrl } from '@nextcloud/router'
import { loadState } from '@nextcloud/initial-state'
Vue.use(VueLocalStorage)
Expand Down Expand Up @@ -277,9 +277,6 @@ export default {
// For customers of the Nextcloud GmbH the app level will be set to `300` for apps that are supported in their subscription
return this.apps.some(app => app.level === 300)
},
linkToAdminSettings() {
return generateUrl('/settings/admin/app_api')
},
},
watch: {
Expand Down

0 comments on commit 8c7be20

Please sign in to comment.