feat(xo-web/settings/remotes): warning when creating a local remote (#3142)

Fixes #3105
This commit is contained in:
Julien Fontanet 2018-07-05 10:24:12 +02:00 committed by GitHub
commit 46100729b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -6,6 +6,7 @@
- [Backup NG form] Add a link to the remotes' settings [#2711](https://github.com/vatesfr/xen-orchestra/issues/2711) [#3106](https://github.com/vatesfr/xen-orchestra/issues/3106) [#2299](https://github.com/vatesfr/xen-orchestra/issues/2299) (PR [#3128](https://github.com/vatesfr/xen-orchestra/pull/3128))
- [Backup NG logs] Make copy to clipboard and report buttons always available [#3130](https://github.com/vatesfr/xen-orchestra/issues/3130) (PR [#3133](https://github.com/vatesfr/xen-orchestra/pull/3133))
- Warning message when creating a local remote [#3105](https://github.com/vatesfr/xen-orchestra/issues/3105) (PR [3142](https://github.com/vatesfr/xen-orchestra/pull/3142))
### Bug fixes

View File

@ -11,7 +11,7 @@ import SortedTable from 'sorted-table'
import StateButton from 'state-button'
import Tooltip from 'tooltip'
import { addSubscriptions } from 'utils'
import { alert } from 'modal'
import { alert, confirm } from 'modal'
import { error } from 'notification'
import { format, parse } from 'xo-remote-parser'
import { Password, Text } from 'editable'
@ -305,6 +305,13 @@ export default class Remotes extends Component {
password && (urlParams.password = password)
domain && (urlParams.domain = domain)
if (type === 'file') {
await confirm({
title: _('localRemoteWarningTitle'),
body: _('localRemoteWarningMessage'),
})
}
const url = format(urlParams)
return createRemote(name, url).then(
() => {