2474 fix typing problems
* commit 'bc9be8d9eebdc8ab19607b8547d81736b32ba58c': Update type definition Fix some typing problems
This commit is contained in:
commit
ab1cefca4b
|
@ -190,7 +190,12 @@ export const getIpList = (interfaces) => Object.values(interfaces)
|
||||||
.reduce((acc, curr) => acc.concat(curr.ip_addresses), [])
|
.reduce((acc, curr) => acc.concat(curr.ip_addresses), [])
|
||||||
.sort();
|
.sort();
|
||||||
|
|
||||||
export const getDnsAddress = (ip, port = '') => {
|
/**
|
||||||
|
* @param {string} ip
|
||||||
|
* @param {number} [port]
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
export const getDnsAddress = (ip, port = 0) => {
|
||||||
const isStandardDnsPort = port === STANDARD_DNS_PORT;
|
const isStandardDnsPort = port === STANDARD_DNS_PORT;
|
||||||
let address = ip;
|
let address = ip;
|
||||||
|
|
||||||
|
@ -205,7 +210,12 @@ export const getDnsAddress = (ip, port = '') => {
|
||||||
return address;
|
return address;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getWebAddress = (ip, port = '') => {
|
/**
|
||||||
|
* @param {string} ip
|
||||||
|
* @param {number} [port]
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
export const getWebAddress = (ip, port = 0) => {
|
||||||
const isStandardWebPort = port === STANDARD_WEB_PORT;
|
const isStandardWebPort = port === STANDARD_WEB_PORT;
|
||||||
let address = `http://${ip}`;
|
let address = `http://${ip}`;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { getLastIpv4Octet, isValidAbsolutePath } from './form';
|
||||||
// https://redux-form.com/8.3.0/examples/fieldlevelvalidation/
|
// https://redux-form.com/8.3.0/examples/fieldlevelvalidation/
|
||||||
// If the value is valid, the validation function should return undefined.
|
// If the value is valid, the validation function should return undefined.
|
||||||
/**
|
/**
|
||||||
* @param value {string}
|
* @param value {string|number}
|
||||||
* @returns {undefined|string}
|
* @returns {undefined|string}
|
||||||
*/
|
*/
|
||||||
export const validateRequiredValue = (value) => {
|
export const validateRequiredValue = (value) => {
|
||||||
|
|
|
@ -41,16 +41,13 @@ const AddressList = ({
|
||||||
AddressList.propTypes = {
|
AddressList.propTypes = {
|
||||||
interfaces: PropTypes.object.isRequired,
|
interfaces: PropTypes.object.isRequired,
|
||||||
address: PropTypes.string.isRequired,
|
address: PropTypes.string.isRequired,
|
||||||
port: PropTypes.oneOfType([
|
port: PropTypes.number.isRequired,
|
||||||
PropTypes.string,
|
|
||||||
PropTypes.number,
|
|
||||||
]),
|
|
||||||
isDns: PropTypes.bool,
|
isDns: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
renderItem.propTypes = {
|
renderItem.propTypes = {
|
||||||
ip: PropTypes.string.isRequired,
|
ip: PropTypes.string.isRequired,
|
||||||
port: PropTypes.string.isRequired,
|
port: PropTypes.number.isRequired,
|
||||||
isDns: PropTypes.bool.isRequired,
|
isDns: PropTypes.bool.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue