Skip to content

Commit

Permalink
fix(ui): add warning for http nextcloud url in https daemon (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey18106 authored Jul 1, 2024
1 parent c26ca32 commit 23f027b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [2.7.0 - 2024-07-0x]

### Fixed

- Nextcloud URL state warning in the Register daemon form for HTTPS configuration. #312

## [2.6.0 - 2024-05-10]

### Added
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ to join us in shaping a more versatile, stable, and secure app landscape.
*Your insights, suggestions, and contributions are invaluable to us.*
]]></description>
<version>2.6.0</version>
<version>2.7.0</version>
<licence>agpl</licence>
<author mail="andrey18106x@gmail.com" homepage="https://github.com/andrey18106">Andrey Borysenko</author>
<author mail="bigcat88@icloud.com" homepage="https://github.com/bigcat88">Alexander Piskun</author>
Expand Down
21 changes: 21 additions & 0 deletions src/components/DaemonConfig/RegisterDaemonConfigModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@
<label for="nextcloud-url">{{ t('app_api', 'Nextcloud URL') }}</label>
<NcInputField
id="nextcloud-url"
:helper-text="isNextcloudUrlSafeHelpText"
:input-class="!isNextcloudUrlSafe ? 'text-warning' : ''"
:value.sync="nextcloud_url"
style="max-width: 70%;"
:placeholder="t('app_api', 'Nextcloud URL')"
:aria-label="t('app_api', 'Nextcloud URL')" />
</div>
Expand Down Expand Up @@ -356,6 +359,15 @@ export default {
isAdditionalOptionValid() {
return this.additionalOption.key.trim() !== '' && this.additionalOption.value.trim() !== ''
},
isNextcloudUrlSafe() {
if (this.httpsEnabled) {
return this.nextcloud_url.startsWith('https://')
}
return this.nextcloud_url.startsWith('http://') || this.nextcloud_url.startsWith('https://')
},
isNextcloudUrlSafeHelpText() {
return this.isNextcloudUrlSafe ? '' : t('app_api', 'For HTTPS daemon, Nextcloud URL should be HTTPS')
},
},
watch: {
configurationTab(newConfigurationTab) {
Expand Down Expand Up @@ -542,3 +554,12 @@ export default {
}
}
</style>
<style lang="scss">
.register-daemon-config-body {
.input-field__input.text-warning {
border-color: var(--color-warning-text) !important;
color: var(--color-warning-text) !important;
}
}
</style>

0 comments on commit 23f027b

Please sign in to comment.