Skip to content

Commit 8c7be20

Browse files
authored
enh(ui): use link to docs and NcPasswordField (nextcloud#345)
1. Use link to AppAPI docs in ExApps management page 2. Use NcPasswordField for haproxy_password --------- Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
1 parent 938a820 commit 8c7be20

3 files changed

Lines changed: 29 additions & 11 deletions

File tree

src/components/DaemonConfig/DaemonConfigDetailsModal.vue

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@
2020
<h3>{{ t('app_api', 'Deploy config') }}</h3>
2121
<p><b>{{ t('app_api', 'Docker network') }}: </b>{{ daemon.deploy_config.net }}</p>
2222
<p><b>{{ t('app_api', 'Nextcloud URL') }}: </b>{{ daemon.deploy_config.nextcloud_url }}</p>
23-
<p v-if="daemon.deploy_config.haproxy_password">
24-
<b>{{ t('app_api', 'HaProxy password') }}: </b>
25-
{{ daemon.deploy_config?.haproxy_password }}
23+
<p v-if="daemon.deploy_config.haproxy_password" class="external-label">
24+
<label for="haproxy_password"><b>{{ t('app_api', 'HaProxy password') }}: </b></label>
25+
<NcPasswordField
26+
id="haproxy_password"
27+
:value="daemon.deploy_config?.haproxy_password"
28+
:disable="true"
29+
style="width: fit-content;"
30+
readonly
31+
autocomplete="off" />
2632
</p>
2733
<p>
2834
<b>{{ t('app_api', 'GPUs support') }}:</b> {{ daemon.deploy_config.computeDevice && daemon.deploy_config?.computeDevice?.id !== 'cpu' || false }}
@@ -60,6 +66,7 @@ import { showSuccess, showError } from '@nextcloud/dialogs'
6066
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
6167
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
6268
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
69+
import NcPasswordField from '@nextcloud/vue/dist/Components/NcPasswordField.js'
6370
6471
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
6572
import Connection from 'vue-material-design-icons/Connection.vue'
@@ -71,6 +78,7 @@ export default {
7178
NcButton,
7279
NcNoteCard,
7380
NcLoadingIcon,
81+
NcPasswordField,
7482
Connection,
7583
},
7684
props: {
@@ -130,4 +138,14 @@ export default {
130138
justify-content: space-between;
131139
margin: 20px 0;
132140
}
141+
142+
.external-label {
143+
display: flex;
144+
align-items: center;
145+
width: 100%;
146+
147+
label {
148+
margin-right: 5px;
149+
}
150+
}
133151
</style>

src/components/DaemonConfig/ManageDaemonConfigModal.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,14 @@
109109
class="external-label"
110110
:aria-label="t('app_api', 'HaProxy password')">
111111
<label for="deploy-config-haproxy-password">{{ t('app_api', 'HaProxy password') }}</label>
112-
<NcInputField
112+
<NcPasswordField
113113
id="deploy-config-haproxy-password"
114114
:value.sync="deployConfig.haproxy_password"
115115
:error="isHaProxyPasswordValid === false"
116116
:placeholder="t('app_api', 'AppAPI Docker Socket Proxy authentication password')"
117117
:aria-label="t('app_api', 'AppAPI Docker Socket Proxy authentication password')"
118-
:helper-text="haProxyPasswordHelperText" />
118+
:helper-text="haProxyPasswordHelperText"
119+
autocomplete="off" />
119120
</div>
120121
<NcSelect
121122
id="compute-device"
@@ -238,6 +239,7 @@ import { confirmPassword } from '@nextcloud/password-confirmation'
238239
239240
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
240241
import NcInputField from '@nextcloud/vue/dist/Components/NcInputField.js'
242+
import NcPasswordField from '@nextcloud/vue/dist/Components/NcPasswordField.js'
241243
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
242244
243245
import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
@@ -258,6 +260,7 @@ export default {
258260
NcLoadingIcon,
259261
NcModal,
260262
NcInputField,
263+
NcPasswordField,
261264
UnfoldLessHorizontal,
262265
UnfoldMoreHorizontal,
263266
NcCheckboxRadioSwitch,

src/views/Apps.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@
5656

5757
<NcAppNavigationItem
5858
id="admin-section"
59-
:href="linkToAdminSettings"
60-
:name="t('app_api', 'Admin settings') + ''">
59+
href="https://cloud-py-api.github.io/app_api/"
60+
target="_blank"
61+
:name="t('app_api', 'Documentation') + ''">
6162
<template v-if="!state.daemon_config_accessible" #icon>
6263
<Alert :size="20" />
6364
</template>
@@ -162,7 +163,6 @@ import DaemonDetails from '../components/Apps/DaemonDetails.vue'
162163
import ScopesDetails from '../components/Apps/ScopesDetails.vue'
163164
164165
import { APPS_SECTION_ENUM } from '../constants/AppsConstants.js'
165-
import { generateUrl } from '@nextcloud/router'
166166
import { loadState } from '@nextcloud/initial-state'
167167
168168
Vue.use(VueLocalStorage)
@@ -277,9 +277,6 @@ export default {
277277
// For customers of the Nextcloud GmbH the app level will be set to `300` for apps that are supported in their subscription
278278
return this.apps.some(app => app.level === 300)
279279
},
280-
linkToAdminSettings() {
281-
return generateUrl('/settings/admin/app_api')
282-
},
283280
},
284281
285282
watch: {

0 commit comments

Comments
 (0)