import React, { PureComponent } from 'react'; import intercept from 'apr-intercept'; import { Row, Col } from 'joyent-react-styled-flexboxgrid'; import { compose, graphql } from 'react-apollo'; import { connect } from 'react-redux'; import { SubmissionError, destroy } from 'redux-form'; import ReduxForm from 'declarative-redux-form'; import { set, destroy as destroyValue } from 'react-redux-values'; import { Margin, Padding } from 'styled-components-spacing'; import find from 'lodash.find'; import isBoolean from 'lodash.isboolean'; import isArray from 'lodash.isarray'; import get from 'lodash.get'; import { Card, CardOutlet, ViewContainer, StatusLoader, Message, MessageTitle, MessageDescription } from 'joyent-ui-toolkit'; import { Cns, CnsFooter as Footer, CnsAddServiceForm as AddServiceForm } from 'joyent-ui-resource-widgets'; import Description from '@components/instances/description'; import GetAccount from '@graphql/get-account.gql'; import DeleteTag from '@graphql/delete-tag.gql'; import UpdateTags from '@graphql/update-tags.gql'; import GetTags from '@graphql/list-tags.gql'; import parseError from '@state/parse-error'; import { addCnsService as validateServiceName } from '@state/validators'; const FORM_NAME = 'cns-new-service'; const CnsContainer = ({ services = [], hostnames = [], disabled = false, handleToggleCnsEnabled, handleAddService, handleRemoveService, mutating = false, loading = false, mutationError = false, loadingError = null, shouldAsyncValidate, handleAsyncValidate }) => ( Triton CNS is used to automatically update hostnames for your instances. You can serve multiple instances (with multiple IP addresses) under the same hostname by matching the CNS service names. {loading ? : null} {!loading && loadingError ? ( Ooops! An error occurred while loading your CNS services ) : null} {!loading && mutationError ? ( Ooops! {mutationError} ) : null} {!loading && !disabled ? ( handleRemoveService(name, services)) } > handleAddService(val, services)} shouldAsyncValidate={shouldAsyncValidate} asyncValidate={handleAsyncValidate} > {props => } ) : null} {!loading && !loadingError ? (