New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow optional port for NFS remote #3131
Conversation
@@ -17,8 +17,11 @@ export const parse = string => { | |||
object.path = `/${trimStart(rest, '/')}` // the leading slash has been forgotten on client side first implementation | |||
} else if (type === 'nfs') { | |||
object.type = 'nfs' | |||
const [host, path] = rest.split(':') | |||
const [host, port, path = port] = rest.split(':') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, a regex would be safer and easier to use.
username, | ||
password, | ||
domain, | ||
}) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add tests related to these changes.
@@ -17,8 +17,9 @@ export const parse = string => { | |||
object.path = `/${trimStart(rest, '/')}` // the leading slash has been forgotten on client side first implementation | |||
} else if (type === 'nfs') { | |||
object.type = 'nfs' | |||
const [host, path] = rest.split(':') | |||
const [, host, port, path] = /^([^:]+):(\d+)?:?([^:]+)$/.exec(rest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/^([^:]+):(?:(\d+):)?([^:]+)$/
And move it in a global constant.
path: '/media/nfs', | ||
}, | ||
}, | ||
}) | ||
|
||
const NFS_WITH_PORT_DATA = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move it directly in data
.
<br /> | ||
<input | ||
className='form-control' | ||
ref='port' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase and make it controlled :)
@@ -3,6 +3,8 @@ import map from 'lodash/map' | |||
import trim from 'lodash/trim' | |||
import trimStart from 'lodash/trimStart' | |||
|
|||
const URL_RE = /^([^:]+):(?:(\d+):)?([^:]+)$/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NFS_RE
?
Fixes #2299
Screenshots
Check list
Fixes #007
)${name} v${new version}
)Process
WiP:
(Work in Progress) if not ready to be merged