mirror of
https://github.com/OpenNebula/one.git
synced 2026-12-06 07:04:45 +09:00
1 parent
d832272224
commit
bd9561a7eb
48 files changed
+354
-228
No files matched your search
@@ -11,9 +11,9 @@ import {
|
||||
} from '@material-ui/core'
|
||||
import FileIcon from '@material-ui/icons/Description'
|
||||
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { APPLICATION_STATES } from 'client/constants/flow'
|
||||
import SelectCard from 'client/components/Cards/SelectCard'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T, APPLICATION_STATES } from 'client/constants'
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
content: {
|
||||
@@ -48,12 +48,12 @@ const ApplicationCard = memo(
|
||||
<CardActions>
|
||||
{handleShow && (
|
||||
<Button variant="contained" size="small" onClick={handleShow} disableElevation>
|
||||
{Tr('Info')}
|
||||
{Tr(T.Info)}
|
||||
</Button>
|
||||
)}
|
||||
{handleRemove && (
|
||||
<Button size="small" onClick={handleRemove} disableElevation>
|
||||
{Tr('Remove')}
|
||||
{Tr(T.Remove)}
|
||||
</Button>
|
||||
)}
|
||||
</CardActions>
|
||||
|
||||
@@ -3,8 +3,9 @@ import PropTypes from 'prop-types'
|
||||
|
||||
import { Button, CardActions } from '@material-ui/core'
|
||||
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import SelectCard from 'client/components/Cards/SelectCard'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const ApplicationNetworkCard = memo(({
|
||||
value,
|
||||
@@ -32,7 +33,7 @@ const ApplicationNetworkCard = memo(({
|
||||
onClick={handleEdit}
|
||||
disableElevation
|
||||
>
|
||||
{Tr('Edit')}
|
||||
{Tr(T.Edit)}
|
||||
</Button>
|
||||
)}
|
||||
{handleClone && (
|
||||
@@ -42,12 +43,12 @@ const ApplicationNetworkCard = memo(({
|
||||
onClick={handleClone}
|
||||
disableElevation
|
||||
>
|
||||
{Tr('Clone')}
|
||||
{Tr(T.Clone)}
|
||||
</Button>
|
||||
)}
|
||||
{handleRemove && (
|
||||
<Button size="small" onClick={handleRemove} disableElevation>
|
||||
{Tr('Remove')}
|
||||
{Tr(T.Remove)}
|
||||
</Button>
|
||||
)}
|
||||
</CardActions>
|
||||
|
||||
@@ -13,8 +13,9 @@ import FileIcon from '@material-ui/icons/Description'
|
||||
import VideogameAssetIcon from '@material-ui/icons/VideogameAsset'
|
||||
import AccountTreeIcon from '@material-ui/icons/AccountTree'
|
||||
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import SelectCard from 'client/components/Cards/SelectCard'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
badgesWrapper: {
|
||||
@@ -44,7 +45,7 @@ const ApplicationTemplateCard = memo(
|
||||
<Box className={classes.badgesWrapper}>
|
||||
<Badge
|
||||
showZero
|
||||
title={Tr('Tiers')}
|
||||
title={Tr(T.Tiers)}
|
||||
classes={{ badge: 'badge' }}
|
||||
color="primary"
|
||||
badgeContent={numberOfTiers}
|
||||
@@ -54,7 +55,7 @@ const ApplicationTemplateCard = memo(
|
||||
</Badge>
|
||||
<Badge
|
||||
showZero
|
||||
title={Tr('Networks')}
|
||||
title={Tr(T.Networks)}
|
||||
classes={{ badge: 'badge' }}
|
||||
color="primary"
|
||||
badgeContent={numberOfNetworks}
|
||||
@@ -72,7 +73,7 @@ const ApplicationTemplateCard = memo(
|
||||
onClick={handleEdit}
|
||||
disableElevation
|
||||
>
|
||||
{Tr('Edit')}
|
||||
{Tr(T.Edit)}
|
||||
</Button>
|
||||
)}
|
||||
{handleDeploy && (
|
||||
@@ -82,7 +83,7 @@ const ApplicationTemplateCard = memo(
|
||||
onClick={handleDeploy}
|
||||
disableElevation
|
||||
>
|
||||
{Tr('Deploy')}
|
||||
{Tr(T.Deploy)}
|
||||
</Button>
|
||||
)}
|
||||
{handleShow && (
|
||||
@@ -92,12 +93,12 @@ const ApplicationTemplateCard = memo(
|
||||
onClick={handleShow}
|
||||
disableElevation
|
||||
>
|
||||
{Tr('Info')}
|
||||
{Tr(T.Info)}
|
||||
</Button>
|
||||
)}
|
||||
{handleRemove && (
|
||||
<Button size="small" onClick={handleRemove} disableElevation>
|
||||
{Tr('Remove')}
|
||||
{Tr(T.Remove)}
|
||||
</Button>
|
||||
)}
|
||||
</CardActions>
|
||||
|
||||
@@ -9,8 +9,9 @@ import {
|
||||
FolderOpen as DatastoreIcon
|
||||
} from '@material-ui/icons'
|
||||
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import SelectCard from 'client/components/Cards/SelectCard'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
badgesWrapper: {
|
||||
@@ -41,7 +42,7 @@ const ClusterCard = memo(
|
||||
<Box className={classes.badgesWrapper}>
|
||||
<Badge
|
||||
showZero
|
||||
title={Tr('Hosts')}
|
||||
title={Tr(T.Hosts)}
|
||||
classes={{ badge: 'badge' }}
|
||||
color="primary"
|
||||
badgeContent={hosts.length}
|
||||
@@ -51,7 +52,7 @@ const ClusterCard = memo(
|
||||
</Badge>
|
||||
<Badge
|
||||
showZero
|
||||
title={Tr('Virtual networks')}
|
||||
title={Tr(T.VirtualsNetworks)}
|
||||
classes={{ badge: 'badge' }}
|
||||
color="primary"
|
||||
badgeContent={vnets.length}
|
||||
@@ -61,7 +62,7 @@ const ClusterCard = memo(
|
||||
</Badge>
|
||||
<Badge
|
||||
showZero
|
||||
title={Tr('Datastores')}
|
||||
title={Tr(T.Datastores)}
|
||||
classes={{ badge: 'badge' }}
|
||||
color="primary"
|
||||
badgeContent={datastores.length}
|
||||
|
||||
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
|
||||
|
||||
import { Card, CardHeader, Fade, makeStyles } from '@material-ui/core'
|
||||
import { Tr } from 'client/components/HOC/Translate'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
root: {
|
||||
@@ -23,7 +24,7 @@ const EmptyCard = memo(({ title }) => {
|
||||
<Fade in unmountOnExit>
|
||||
<Card className={classes.root} variant="outlined">
|
||||
<CardHeader
|
||||
subheader={title ?? Tr('empty')}
|
||||
subheader={title ?? Tr(T.Empty)}
|
||||
className={classes.content}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
@@ -5,6 +5,7 @@ import { makeStyles, Card, CardContent, Button, CardActions } from '@material-ui
|
||||
|
||||
import FormWithSchema from 'client/components/Forms/FormWithSchema'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const useStyles = makeStyles(() => ({
|
||||
root: {
|
||||
@@ -30,7 +31,7 @@ const PolicyCard = memo(
|
||||
<CardActions>
|
||||
{handleRemove && (
|
||||
<Button variant="contained" size="small" onClick={handleRemove} disableElevation>
|
||||
{Tr('Remove')}
|
||||
{Tr(T.Remove)}
|
||||
</Button>
|
||||
)}
|
||||
</CardActions>
|
||||
|
||||
@@ -4,8 +4,9 @@ import PropTypes from 'prop-types'
|
||||
import { Button, CardActions, Badge } from '@material-ui/core'
|
||||
import DesktopWindowsIcon from '@material-ui/icons/DesktopWindows'
|
||||
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import SelectCard from 'client/components/Cards/SelectCard'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const TierCard = memo(
|
||||
({ value, handleEdit, handleRemove, cardProps }) => {
|
||||
@@ -32,12 +33,12 @@ const TierCard = memo(
|
||||
<CardActions>
|
||||
{handleEdit && (
|
||||
<Button variant="contained" size="small" onClick={handleEdit} disableElevation>
|
||||
{Tr('Edit')}
|
||||
{Tr(T.Edit)}
|
||||
</Button>
|
||||
)}
|
||||
{handleRemove && (
|
||||
<Button size="small" onClick={handleRemove} disableElevation>
|
||||
{Tr('Remove')}
|
||||
{Tr(T.Remove)}
|
||||
</Button>
|
||||
)}
|
||||
</CardActions>
|
||||
|
||||
@@ -11,8 +11,8 @@ import {
|
||||
} from '@material-ui/core'
|
||||
|
||||
import ButtonSubmit from 'client/components/FormControl/SubmitButton'
|
||||
import { Cancel, Accept } from 'client/constants/translates'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const DialogConfirmation = memo(
|
||||
({
|
||||
@@ -56,14 +56,14 @@ const DialogConfirmation = memo(
|
||||
color="primary"
|
||||
{...cancelButtonProps}
|
||||
>
|
||||
{Tr(Cancel)}
|
||||
{Tr(T.Cancel)}
|
||||
</Button>
|
||||
)}
|
||||
{handleAccept && (
|
||||
<ButtonSubmit
|
||||
data-cy="dg-accept-button"
|
||||
onClick={handleAccept}
|
||||
label={Tr(Accept)}
|
||||
label={Tr(T.Accept)}
|
||||
{...acceptButtonProps}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -13,8 +13,8 @@ import { useForm, FormProvider } from 'react-hook-form'
|
||||
import { yupResolver } from '@hookform/resolvers'
|
||||
|
||||
import ButtonSubmit from 'client/components/FormControl/SubmitButton'
|
||||
import { Cancel, Save } from 'client/constants/translates'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const DialogForm = memo(
|
||||
({
|
||||
@@ -49,7 +49,7 @@ const DialogForm = memo(
|
||||
}
|
||||
}}
|
||||
>
|
||||
<DialogTitle>{Tr(title)}</DialogTitle>
|
||||
<DialogTitle>{title}</DialogTitle>
|
||||
<DialogContent dividers>
|
||||
<FormProvider {...methods}>{children}</FormProvider>
|
||||
</DialogContent>
|
||||
@@ -57,7 +57,7 @@ const DialogForm = memo(
|
||||
<DialogActions>
|
||||
{onCancel && (
|
||||
<Button onClick={onCancel} color="primary">
|
||||
{Tr(Cancel)}
|
||||
{Tr(T.Cancel)}
|
||||
</Button>
|
||||
)}
|
||||
{onSubmit && (
|
||||
@@ -65,7 +65,7 @@ const DialogForm = memo(
|
||||
data-cy="dg-form-submit-button"
|
||||
isSubmitting={methods.formState.isSubmitting}
|
||||
onClick={methods.handleSubmit(onSubmit)}
|
||||
label={Tr(Save)}
|
||||
label={Tr(T.Save)}
|
||||
{...submitButtonProps}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -2,9 +2,8 @@ import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
import { makeStyles, CircularProgress, Button, Fab } from '@material-ui/core'
|
||||
|
||||
import { Submit } from 'client/constants/translates'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const useStyles = makeStyles(() => ({
|
||||
root: {
|
||||
@@ -38,7 +37,7 @@ const SubmitButton = ({ isSubmitting, label, fab, ...props }) => {
|
||||
{...props}
|
||||
>
|
||||
{isSubmitting && <CircularProgress size={24} />}
|
||||
{!isSubmitting && (label ?? Tr(Submit))}
|
||||
{!isSubmitting && (label ?? Tr(T.Submit))}
|
||||
</ButtonComponent>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import { KeyboardArrowLeft, KeyboardArrowRight } from '@material-ui/icons'
|
||||
import { makeStyles, fade } from '@material-ui/core/styles'
|
||||
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
root: {
|
||||
@@ -62,12 +63,12 @@ const CustomMobileStepper = ({
|
||||
onClick={handleBack}
|
||||
disabled={disabledBack}
|
||||
>
|
||||
<KeyboardArrowLeft /> {Tr('Back')}
|
||||
<KeyboardArrowLeft /> {Tr(T.Back)}
|
||||
</Button>
|
||||
}
|
||||
nextButton={
|
||||
<Button className={classes.button} size="small" onClick={handleNext}>
|
||||
{activeStep === lastStep ? Tr('Finish') : Tr('Next')}
|
||||
{activeStep === lastStep ? Tr(T.Finish) : Tr(T.Next)}
|
||||
<KeyboardArrowRight />
|
||||
</Button>
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
import { makeStyles, fade } from '@material-ui/core/styles'
|
||||
|
||||
import ButtonSubmit from 'client/components/FormControl/SubmitButton'
|
||||
import { Finish, Back, Next } from 'client/constants/translates'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
root: {
|
||||
@@ -55,13 +55,13 @@ const CustomStepper = ({
|
||||
</Stepper>
|
||||
<Box marginY={2}>
|
||||
<Button onClick={handleBack} disabled={disabledBack}>
|
||||
{Tr(Back)}
|
||||
{Tr(T.Back)}
|
||||
</Button>
|
||||
<ButtonSubmit
|
||||
data-cy="stepper-next-button"
|
||||
onClick={handleNext}
|
||||
isSubmitting={isSubmitting}
|
||||
label={activeStep === lastStep ? Tr(Finish) : Tr(Next)}
|
||||
label={activeStep === lastStep ? Tr(T.Finish) : Tr(T.Next)}
|
||||
/>
|
||||
</Box>
|
||||
</>
|
||||
|
||||
@@ -5,8 +5,8 @@ import AccountCircleIcon from '@material-ui/icons/AccountCircle'
|
||||
|
||||
import useAuth from 'client/hooks/useAuth'
|
||||
import { Tr, SelectTranslate } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
import { SignOut } from 'client/constants/translates'
|
||||
import HeaderPopover from 'client/components/Header/Popover'
|
||||
import { DevTypography } from 'client/components/Typography'
|
||||
import { defaultApps, defaultAppName } from 'server/utils/constants/defaults'
|
||||
@@ -33,7 +33,7 @@ const User = React.memo(() => {
|
||||
</MenuItem>
|
||||
<Divider />
|
||||
<MenuItem onClick={handleLogout} data-cy="header-logout-button">
|
||||
{Tr(SignOut)}
|
||||
{Tr(T.SignOut)}
|
||||
</MenuItem>
|
||||
{process?.env?.NODE_ENV === 'development' &&
|
||||
Object.keys(defaultApps)?.map(appName => (
|
||||
|
||||
@@ -5,7 +5,7 @@ import LanguageIcon from '@material-ui/icons/Language'
|
||||
|
||||
import HeaderPopover from 'client/components/Header/Popover'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { ZoneLabel } from 'client/constants/translates'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const Zone = memo(() => (
|
||||
<HeaderPopover
|
||||
@@ -17,7 +17,7 @@ const Zone = memo(() => (
|
||||
{({ handleClose }) => (
|
||||
<MenuList>
|
||||
<MenuItem onClick={handleClose}>
|
||||
{Tr(ZoneLabel)}
|
||||
{Tr(T.Zone)}
|
||||
</MenuItem>
|
||||
</MenuList>
|
||||
)}
|
||||
|
||||
@@ -57,7 +57,7 @@ const Header = ({ title }) => {
|
||||
className={classes.title}
|
||||
data-cy="header-title"
|
||||
>
|
||||
{title}
|
||||
{'OneProvision'}
|
||||
</Typography>
|
||||
)}
|
||||
<Box flexGrow={isMobile ? 1 : 0} textAlign="end">
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
import React, { memo } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
import { makeStyles, Box, Typography, Divider } from '@material-ui/core'
|
||||
import RefreshIcon from '@material-ui/icons/Autorenew'
|
||||
|
||||
import SubmitButton from 'client/components/FormControl/SubmitButton'
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
title: { marginLeft: theme.spacing(1) }
|
||||
}))
|
||||
|
||||
const ListHeader = memo(({
|
||||
title,
|
||||
hasReloadButton,
|
||||
reloadButtonProps
|
||||
}) => {
|
||||
const classes = useStyles()
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box p={3} display="flex" alignItems="center">
|
||||
{hasReloadButton && (
|
||||
<SubmitButton fab label={<RefreshIcon />} {...reloadButtonProps} />
|
||||
)}
|
||||
{title && (
|
||||
<Typography variant="h5" className={classes.title}>
|
||||
{title}
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
<Divider />
|
||||
</>
|
||||
)
|
||||
})
|
||||
|
||||
ListHeader.propTypes = {
|
||||
title: PropTypes.string,
|
||||
hasReloadButton: PropTypes.bool,
|
||||
reloadButtonProps: PropTypes.shape({
|
||||
onClick: PropTypes.func,
|
||||
isSubmitting: PropTypes.bool
|
||||
})
|
||||
}
|
||||
|
||||
ListHeader.defaultProps = {
|
||||
title: undefined,
|
||||
hasReloadButton: false,
|
||||
reloadButtonProps: {
|
||||
onClick: undefined,
|
||||
isSubmitting: false
|
||||
}
|
||||
}
|
||||
|
||||
ListHeader.displayName = 'ListHeader'
|
||||
|
||||
export default ListHeader
|
||||
@@ -0,0 +1,9 @@
|
||||
import ListHeader from 'client/components/List/ListHeader'
|
||||
import ListCards from 'client/components/List/ListCards'
|
||||
import ListInfiniteScroll from 'client/components/List/ListInfiniteScroll'
|
||||
|
||||
export {
|
||||
ListHeader,
|
||||
ListCards,
|
||||
ListInfiniteScroll
|
||||
}
|
||||
@@ -14,10 +14,15 @@ module.exports = {
|
||||
Submit: 'Submit',
|
||||
Show: 'Show',
|
||||
ShowAll: 'Show all',
|
||||
SelectGroup: 'Select a group',
|
||||
Remove: 'Remove',
|
||||
Delete: 'Delete',
|
||||
Edit: 'Edit',
|
||||
Info: 'Info',
|
||||
Clone: 'Clone',
|
||||
Configuration: 'Configuration',
|
||||
Select: 'Select',
|
||||
SelectGroup: 'Select a group',
|
||||
SelectRequest: 'Select request',
|
||||
|
||||
/* login */
|
||||
Username: 'Username',
|
||||
@@ -29,18 +34,79 @@ module.exports = {
|
||||
CannotConnectOneFlow: 'Cannot connect to OneFlow server',
|
||||
CannotConnectOneProvision: 'Cannot connect to OneProvision server',
|
||||
NotFound: 'Not found',
|
||||
None: 'None',
|
||||
Empty: 'Empty',
|
||||
|
||||
/* steps form */
|
||||
/* steps form - flow */
|
||||
ApplicationOverview: 'Application Overview',
|
||||
WhereWillItRun: 'Where will it run?',
|
||||
ConfigureNetworking: 'Configure Networking',
|
||||
TierDefinition: 'Tier Definition',
|
||||
ConfigureTiers: 'Configure Tiers',
|
||||
ConfigurePolicies: 'Configure policies',
|
||||
ConfigureTemplate: 'Configure template',
|
||||
/* steps form - provision */
|
||||
ConfigureConnection: 'Configure connection',
|
||||
Location: 'Location',
|
||||
ProviderTemplate: 'Provider template',
|
||||
ProvisionTemplate: 'Provision template',
|
||||
ConfigureInputs: 'Configure inputs',
|
||||
|
||||
/* sections */
|
||||
Dashboard: 'Dashboard',
|
||||
Settings: 'Settings',
|
||||
ZoneLabel: 'Zone',
|
||||
/* sections - system */
|
||||
User: 'User',
|
||||
Users: 'Users',
|
||||
Group: 'Group',
|
||||
Groups: 'Groups',
|
||||
VDC: 'VDC',
|
||||
VDCs: 'VDCs',
|
||||
ACL: 'ACL',
|
||||
ACLs: 'ACLs',
|
||||
/* sections - infrastructure */
|
||||
Zone: 'Zone',
|
||||
Zones: 'Zones',
|
||||
Cluster: 'Cluster',
|
||||
Clusters: 'Clusters',
|
||||
Host: 'Host',
|
||||
Hosts: 'Hosts',
|
||||
/* sections - network */
|
||||
Network: 'Network',
|
||||
Networks: 'Networks',
|
||||
VirtualNetwork: 'Virtual network',
|
||||
VirtualsNetworks: 'Virtuals networks',
|
||||
NetworkTopology: 'Network topology',
|
||||
NetworksTopologies: 'Networks topologies',
|
||||
/* sections - storage */
|
||||
Datastore: 'Datastore',
|
||||
Datastores: 'Datastores',
|
||||
Image: 'Image',
|
||||
Images: 'Images',
|
||||
File: 'File',
|
||||
Files: 'Files',
|
||||
Marketplace: 'Marketplace',
|
||||
Marketplaces: 'Marketplaces',
|
||||
App: 'App',
|
||||
Apps: 'Apps',
|
||||
/* sections - templates & instances */
|
||||
VM: 'VM',
|
||||
VMs: 'VMs',
|
||||
VirtualRouter: 'VirtualRouter',
|
||||
VirtualRouters: 'VirtualRouters',
|
||||
VMGroup: 'VMGroup',
|
||||
VMGroups: 'VMGroups',
|
||||
/* sections - flow */
|
||||
ApplicationsTemplates: 'Applications templates',
|
||||
ApplicationsInstances: 'Applications instances',
|
||||
ProviderLabel: 'Provider',
|
||||
ProvidersLabel: 'Providers',
|
||||
ProvisionLabel: 'Provision',
|
||||
ProvisionsLabel: 'Provisions',
|
||||
ClustersLabel: 'Clusters',
|
||||
Tier: 'Tier',
|
||||
Tiers: 'Tiers',
|
||||
/* sections - provision */
|
||||
Provider: 'Provider',
|
||||
Providers: 'Providers',
|
||||
Provision: 'Provision',
|
||||
Provisions: 'Provisions',
|
||||
|
||||
/* tabs */
|
||||
Information: 'Information',
|
||||
@@ -52,6 +118,11 @@ module.exports = {
|
||||
RegistrationTime: 'Registration time',
|
||||
StartTime: 'Start time',
|
||||
|
||||
/* flow schema */
|
||||
Strategy: 'Strategy',
|
||||
ShutdownAction: 'Shutdown action',
|
||||
ReadyStatusGate: 'Ready status gate',
|
||||
|
||||
/* permissions */
|
||||
Permissions: 'Permissions',
|
||||
Use: 'Use',
|
||||
@@ -61,7 +132,6 @@ module.exports = {
|
||||
/* ownership */
|
||||
Ownership: 'Ownership',
|
||||
Owner: 'Owner',
|
||||
Group: 'Group',
|
||||
Other: 'Other',
|
||||
|
||||
Language: 'Language',
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
} from '@material-ui/core'
|
||||
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const CustomDialog = ({ title, handleClose, children }) => {
|
||||
const isMobile = useMediaQuery(theme => theme.breakpoints.only('xs'))
|
||||
@@ -42,7 +43,7 @@ const CustomDialog = ({ title, handleClose, children }) => {
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={handleClose} color="primary">
|
||||
{Tr('Cancel')}
|
||||
{Tr(T.Cancel)}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
@@ -8,6 +8,7 @@ import clsx from 'clsx'
|
||||
import useStyles from 'client/containers/ApplicationsInstances/DialogInfo/styles'
|
||||
import { APPLICATION_STATES } from 'client/constants/flow'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const InfoTab = memo(({ info }) => {
|
||||
const classes = useStyles()
|
||||
@@ -31,27 +32,27 @@ const InfoTab = memo(({ info }) => {
|
||||
<Paper variant="outlined">
|
||||
<List className={clsx(classes.list, 'w-50')}>
|
||||
<ListItem className={classes.title}>
|
||||
<Typography>{Tr('Information')}</Typography>
|
||||
<Typography>{Tr(T.Information)}</Typography>
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem>
|
||||
<Typography>{Tr('ID')}</Typography>
|
||||
<Typography>{'ID'}</Typography>
|
||||
<Typography>{ID}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr('Name')}</Typography>
|
||||
<Typography>{Tr(T.Name)}</Typography>
|
||||
<Typography>{name}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr('Strategy')}</Typography>
|
||||
<Typography>{Tr(T.Strategy)}</Typography>
|
||||
<Typography>{deployment}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr('Shutdown action')}</Typography>
|
||||
<Typography>{Tr(T.ShutdownAction)}</Typography>
|
||||
<Typography>{shutdown ?? '-'}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr('State')}</Typography>
|
||||
<Typography>{Tr(T.State)}</Typography>
|
||||
<Chip
|
||||
size="small"
|
||||
label={stateInfo?.name}
|
||||
@@ -59,7 +60,7 @@ const InfoTab = memo(({ info }) => {
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr('Ready status gate')}</Typography>
|
||||
<Typography>{Tr(T.ReadyStatusGate)}</Typography>
|
||||
<Typography>{gate ? 'yes' : 'no'}</Typography>
|
||||
</ListItem>
|
||||
</List>
|
||||
@@ -69,26 +70,26 @@ const InfoTab = memo(({ info }) => {
|
||||
<Paper variant="outlined" className={classes.permissions}>
|
||||
<List className={clsx(classes.list, 'w-25')}>
|
||||
<ListItem className={classes.title}>
|
||||
<Typography>{Tr('Permissions')}</Typography>
|
||||
<Typography>{Tr('Use')}</Typography>
|
||||
<Typography>{Tr('Manage')}</Typography>
|
||||
<Typography>{Tr('Admin')}</Typography>
|
||||
<Typography>{Tr(T.Permissions)}</Typography>
|
||||
<Typography>{Tr(T.Use)}</Typography>
|
||||
<Typography>{Tr(T.Manage)}</Typography>
|
||||
<Typography>{Tr(T.Admin)}</Typography>
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem>
|
||||
<Typography>{Tr('Owner')}</Typography>
|
||||
<Typography>{Tr(T.Owner)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.OWNER_U)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.OWNER_M)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.OWNER_A)}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr('Group')}</Typography>
|
||||
<Typography>{Tr(T.Group)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.GROUP_U)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.GROUP_M)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.GROUP_A)}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr('Other')}</Typography>
|
||||
<Typography>{Tr(T.Other)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.OTHER_U)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.OTHER_M)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.OTHER_A)}</Typography>
|
||||
@@ -98,15 +99,15 @@ const InfoTab = memo(({ info }) => {
|
||||
<Paper variant="outlined">
|
||||
<List className={clsx(classes.list, 'w-50')}>
|
||||
<ListItem className={classes.title}>
|
||||
<Typography>{Tr('Ownership')}</Typography>
|
||||
<Typography>{Tr(T.Ownership)}</Typography>
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem>
|
||||
<Typography>{Tr('Owner')}</Typography>
|
||||
<Typography>{Tr(T.Owner)}</Typography>
|
||||
<Typography>{UNAME}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr('Group')}</Typography>
|
||||
<Typography>{Tr(T.Group)}</Typography>
|
||||
<Typography>{GNAME}</Typography>
|
||||
</ListItem>
|
||||
</List>
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
import React, { useEffect, useMemo, useState } from 'react'
|
||||
|
||||
import { Container, Box, Typography, Divider } from '@material-ui/core'
|
||||
import RefreshIcon from '@material-ui/icons/Autorenew'
|
||||
import { Container, Box } from '@material-ui/core'
|
||||
|
||||
import useApplication from 'client/hooks/useApplication'
|
||||
import useFetch from 'client/hooks/useFetch'
|
||||
|
||||
import DialogInfo from 'client/containers/ApplicationsInstances/DialogInfo'
|
||||
import SubmitButton from 'client/components/FormControl/SubmitButton'
|
||||
import ListCards from 'client/components/List/ListCards'
|
||||
import { ListHeader, ListCards } from 'client/components/List'
|
||||
import AlertError from 'client/components/Alerts/Error'
|
||||
import { ApplicationCard, EmptyCard } from 'client/components/Cards'
|
||||
|
||||
import { DONE } from 'client/constants/states'
|
||||
import { APPLICATION_STATES } from 'client/constants/flow'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import {
|
||||
ApplicationsInstances as ApplicationsInstancesLabel,
|
||||
CannotConnectOneFlow
|
||||
} from 'client/constants/translates'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
function ApplicationsInstances () {
|
||||
const { applications, getApplications } = useApplication()
|
||||
@@ -37,22 +32,18 @@ function ApplicationsInstances () {
|
||||
|
||||
return (
|
||||
<Container disableGutters>
|
||||
<Box p={3} display="flex" alignItems="center">
|
||||
<SubmitButton
|
||||
fab
|
||||
onClick={() => fetchRequest(undefined, { reload: true, delay: 500 })}
|
||||
isSubmitting={loading || reloading}
|
||||
label={<RefreshIcon />}
|
||||
/>
|
||||
<Typography variant="h5" style={{ marginLeft: 8 }}>
|
||||
{Tr(ApplicationsInstancesLabel)}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Divider />
|
||||
<ListHeader
|
||||
title={Tr(T.ApplicationsInstancesLabel)}
|
||||
hasReloadButton
|
||||
reloadButtonProps={{
|
||||
onClick: () => fetchRequest(undefined, { reload: true, delay: 500 }),
|
||||
isSubmitting: Boolean(loading || reloading)
|
||||
}}
|
||||
/>
|
||||
<Box p={3}>
|
||||
{error ? (
|
||||
<AlertError>
|
||||
{Tr(CannotConnectOneFlow)}
|
||||
{Tr(T.CannotConnectOneFlow)}
|
||||
</AlertError>
|
||||
) : (
|
||||
<ListCards
|
||||
|
||||
+3
-1
@@ -3,12 +3,14 @@ import React, { useCallback } from 'react'
|
||||
import FormWithSchema from 'client/components/Forms/FormWithSchema'
|
||||
|
||||
import { FORM_FIELDS, STEP_FORM_SCHEMA } from './schema'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
export const STEP_ID = 'application'
|
||||
|
||||
const BasicConfiguration = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Application Overview',
|
||||
label: Tr(T.ApplicationOverview),
|
||||
resolver: STEP_FORM_SCHEMA,
|
||||
optionsValidate: { abortEarly: false },
|
||||
content: useCallback(
|
||||
|
||||
+3
-1
@@ -8,12 +8,14 @@ import ListCards from 'client/components/List/ListCards'
|
||||
import { ClusterCard, EmptyCard } from 'client/components/Cards'
|
||||
|
||||
import { STEP_FORM_SCHEMA } from './schema'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
export const STEP_ID = 'clusters'
|
||||
|
||||
const Clusters = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Where will it run?',
|
||||
label: Tr(T.WhereWillItRun),
|
||||
resolver: STEP_FORM_SCHEMA,
|
||||
content: useCallback(({ data, setFormData }) => {
|
||||
const { clusters, getClusters } = useOpennebula()
|
||||
|
||||
+4
-2
@@ -11,12 +11,14 @@ import { ApplicationNetworkCard } from 'client/components/Cards'
|
||||
|
||||
import { STEP_ID as TIERS_ID } from 'client/containers/ApplicationsTemplates/Form/Create/Steps/Tiers'
|
||||
import { FORM_FIELDS, NETWORK_FORM_SCHEMA, STEP_FORM_SCHEMA } from './schema'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
export const STEP_ID = 'networking'
|
||||
|
||||
const Networks = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Configure Networking',
|
||||
label: Tr(T.ConfigureNetworking),
|
||||
resolver: STEP_FORM_SCHEMA,
|
||||
content: useCallback(({ data, setFormData }) => {
|
||||
const form = useWatch({})
|
||||
@@ -66,7 +68,7 @@ const Networks = () => ({
|
||||
/>
|
||||
{showDialog && (
|
||||
<DialogForm
|
||||
title={'Network form'}
|
||||
title={`${Tr(T.Networks)} form`}
|
||||
resolver={() => NETWORK_FORM_SCHEMA}
|
||||
open={showDialog}
|
||||
values={editingData}
|
||||
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
import React, { useCallback } from 'react'
|
||||
|
||||
import FormWithSchema from 'client/components/Forms/FormWithSchema'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
import { FORM_FIELDS, STEP_FORM_SCHEMA } from './schema'
|
||||
|
||||
@@ -8,7 +10,7 @@ export const STEP_ID = 'tier'
|
||||
|
||||
const BasicConfiguration = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Configuration',
|
||||
label: Tr(T.Configuration),
|
||||
resolver: STEP_FORM_SCHEMA,
|
||||
optionsValidate: { abortEarly: false },
|
||||
content: useCallback(
|
||||
|
||||
+4
-1
@@ -6,13 +6,16 @@ import { ApplicationNetworkCard } from 'client/components/Cards'
|
||||
|
||||
import { STEP_ID as NETWORKING } from 'client/containers/ApplicationsTemplates/Form/Create/Steps/Networking'
|
||||
import { Context } from 'client/containers/ApplicationsTemplates/Form/Create/Steps/Tiers'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
import { STEP_FORM_SCHEMA } from './schema'
|
||||
|
||||
export const STEP_ID = 'networks'
|
||||
|
||||
const Networks = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Networks',
|
||||
label: Tr(T.Networks),
|
||||
resolver: STEP_FORM_SCHEMA,
|
||||
content: useCallback(({ data, setFormData }) => {
|
||||
const { nestedForm: list } = useContext(Context)
|
||||
|
||||
+3
-1
@@ -10,6 +10,8 @@ import { PolicyCard } from 'client/components/Cards'
|
||||
import ListCards from 'client/components/List/ListCards'
|
||||
import useListForm from 'client/hooks/useListForm'
|
||||
import { set } from 'client/utils/helpers'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
import {
|
||||
TAB_ID as ELASTICITY_ID,
|
||||
@@ -42,7 +44,7 @@ const TABS = {
|
||||
|
||||
const Policies = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Policies',
|
||||
label: Tr(T.ConfigurePolicies),
|
||||
resolver: POLICIES_SCHEMA,
|
||||
optionsValidate: { abortEarly: false },
|
||||
content: useCallback(
|
||||
|
||||
+3
-1
@@ -8,6 +8,8 @@ import {
|
||||
import { makeStyles, IconButton, Button, Fade } from '@material-ui/core'
|
||||
import DockerLogo from 'client/icons/docker'
|
||||
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
import ListTemplates from './List/Templates'
|
||||
import ListMarketApps from './List/MarketApps'
|
||||
import DockerFile from './List/Docker'
|
||||
@@ -49,7 +51,7 @@ const useStyles = makeStyles(() => ({
|
||||
|
||||
const Template = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Template',
|
||||
label: Tr(T.ConfigureTemplate),
|
||||
resolver: STEP_FORM_SCHEMA,
|
||||
content: useCallback(({ data = {}, setFormData }) => {
|
||||
const classes = useStyles()
|
||||
|
||||
+4
-2
@@ -17,6 +17,8 @@ import FormStepper from 'client/components/FormStepper'
|
||||
import { DialogForm } from 'client/components/Dialogs'
|
||||
import { STEP_ID as NETWORKING_ID } from 'client/containers/ApplicationsTemplates/Form/Create/Steps/Networking'
|
||||
import { STEP_ID as NETWORKS_ID } from 'client/containers/ApplicationsTemplates/Form/Create/Steps/Tiers/Steps/Networks'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
import Steps from './Steps'
|
||||
import Flow from './Flow'
|
||||
@@ -29,7 +31,7 @@ const Tiers = () => {
|
||||
|
||||
return {
|
||||
id: STEP_ID,
|
||||
label: 'Tier Definition',
|
||||
label: Tr(T.TierDefinition),
|
||||
resolver: yup
|
||||
.array(resolvers())
|
||||
.min(1, 'Should be at least one tier')
|
||||
@@ -85,7 +87,7 @@ const Tiers = () => {
|
||||
<Context.Provider value={{ nestedForm }}>
|
||||
<DialogForm
|
||||
open={showDialog}
|
||||
title={'Tier form'}
|
||||
title={`${Tr(T.Tiers)} form`}
|
||||
resolver={resolvers}
|
||||
values={editingData}
|
||||
onCancel={() => setShowDialog(false)}
|
||||
|
||||
+3
-1
@@ -3,12 +3,14 @@ import React, { useCallback } from 'react'
|
||||
import FormWithSchema from 'client/components/Forms/FormWithSchema'
|
||||
|
||||
import { FORM_FIELDS, STEP_FORM_SCHEMA } from './schema'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
export const STEP_ID = 'application'
|
||||
|
||||
const BasicConfiguration = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Application Overview',
|
||||
label: Tr(T.ApplicationOverview),
|
||||
resolver: STEP_FORM_SCHEMA,
|
||||
optionsValidate: { abortEarly: false },
|
||||
content: useCallback(
|
||||
|
||||
+3
-1
@@ -4,6 +4,8 @@ import { Divider, Paper, Typography } from '@material-ui/core'
|
||||
|
||||
import useOpennebula from 'client/hooks/useOpennebula'
|
||||
import FormWithSchema from 'client/components/Forms/FormWithSchema'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
import { FORM_FIELDS, STEP_FORM_SCHEMA } from './schema'
|
||||
|
||||
@@ -11,7 +13,7 @@ export const STEP_ID = 'networking'
|
||||
|
||||
const Networks = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Configure Networking',
|
||||
label: Tr(T.ConfigureNetworking),
|
||||
resolver: STEP_FORM_SCHEMA,
|
||||
optionsValidate: { abortEarly: false },
|
||||
content: useCallback(({ data }) => {
|
||||
|
||||
+4
-1
@@ -5,6 +5,9 @@ import { AppBar, Tabs, Tab } from '@material-ui/core'
|
||||
import { Warning as WarningIcon } from '@material-ui/icons'
|
||||
|
||||
import FormWithSchema from 'client/components/Forms/FormWithSchema'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
import { ID, FORM_FIELDS, STEP_FORM_SCHEMA } from './schema'
|
||||
|
||||
export const STEP_ID = 'tiers'
|
||||
@@ -18,7 +21,7 @@ const Tiers = ({ tiers, vmTemplates }) => {
|
||||
|
||||
return {
|
||||
id: STEP_ID,
|
||||
label: 'Configure Tiers',
|
||||
label: Tr(T.ConfigureTiers),
|
||||
resolver: STEP_FORM_SCHEMA({ tiers, vmTemplates }),
|
||||
optionsValidate: { abortEarly: false },
|
||||
content: useCallback(() => {
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { Container, Box, Typography, Divider } from '@material-ui/core'
|
||||
import RefreshIcon from '@material-ui/icons/Autorenew'
|
||||
import { Container, Box } from '@material-ui/core'
|
||||
|
||||
import { PATH } from 'client/router/flow'
|
||||
import useApplication from 'client/hooks/useApplication'
|
||||
import useFetch from 'client/hooks/useFetch'
|
||||
|
||||
import DeployForm from 'client/containers/ApplicationsTemplates/Form/Deploy'
|
||||
import SubmitButton from 'client/components/FormControl/SubmitButton'
|
||||
import ListCards from 'client/components/List/ListCards'
|
||||
import { ListHeader, ListCards } from 'client/components/List'
|
||||
import AlertError from 'client/components/Alerts/Error'
|
||||
import { ApplicationTemplateCard } from 'client/components/Cards'
|
||||
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import {
|
||||
ApplicationsTemplates as ApplicationsTemplatesLabel,
|
||||
CannotConnectOneFlow
|
||||
} from 'client/constants/translates'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
function ApplicationsTemplates () {
|
||||
const history = useHistory()
|
||||
@@ -35,22 +30,18 @@ function ApplicationsTemplates () {
|
||||
|
||||
return (
|
||||
<Container disableGutters>
|
||||
<Box p={3} display="flex" alignItems="center">
|
||||
<SubmitButton
|
||||
fab
|
||||
onClick={() => fetchRequest(undefined, { reload: true, delay: 500 })}
|
||||
isSubmitting={loading || reloading}
|
||||
label={<RefreshIcon />}
|
||||
/>
|
||||
<Typography variant="h5" style={{ marginLeft: 8 }}>
|
||||
{Tr(ApplicationsTemplatesLabel)}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Divider />
|
||||
<ListHeader
|
||||
title={Tr(T.ApplicationsTemplatesLabel)}
|
||||
hasReloadButton
|
||||
reloadButtonProps={{
|
||||
onClick: () => fetchRequest(undefined, { reload: true, delay: 500 }),
|
||||
isSubmitting: Boolean(loading || reloading)
|
||||
}}
|
||||
/>
|
||||
<Box p={3}>
|
||||
{error ? (
|
||||
<AlertError>
|
||||
{Tr(CannotConnectOneFlow)}
|
||||
{Tr(T.CannotConnectOneFlow)}
|
||||
</AlertError>
|
||||
) : (
|
||||
<ListCards
|
||||
|
||||
@@ -19,7 +19,7 @@ import { Box, Typography } from '@material-ui/core'
|
||||
|
||||
import dashboardStyles from 'client/containers/Dashboard/styles'
|
||||
import { Tr } from 'client/components/HOC/Translate'
|
||||
import { Dashboard as Title } from 'client/constants/translates'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
function Dashboard () {
|
||||
const classes = dashboardStyles()
|
||||
@@ -31,7 +31,7 @@ function Dashboard () {
|
||||
className={classes.title}
|
||||
data-cy="dashboard-title"
|
||||
>
|
||||
{Tr(Title)}
|
||||
{Tr(T.Dashboard)}
|
||||
</Typography>
|
||||
</Box>
|
||||
)
|
||||
|
||||
@@ -6,12 +6,12 @@ import { Box, Button, Slide } from '@material-ui/core'
|
||||
import { useForm, FormProvider } from 'react-hook-form'
|
||||
import { yupResolver } from '@hookform/resolvers'
|
||||
|
||||
import { SignIn, Back, Next } from 'client/constants/translates'
|
||||
import loginStyles from 'client/containers/Login/styles'
|
||||
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import ButtonSubmit from 'client/components/FormControl/SubmitButton'
|
||||
import FormWithSchema from 'client/components/Forms/FormWithSchema'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const Form = ({ onBack, onSubmit, resolver, fields, error, isLoading, transitionProps }) => {
|
||||
const defaultValues = resolver.default()
|
||||
@@ -45,13 +45,13 @@ const Form = ({ onBack, onSubmit, resolver, fields, error, isLoading, transition
|
||||
<Box>
|
||||
{onBack && (
|
||||
<Button onClick={onBack} color="primary" disabled={isLoading}>
|
||||
{Tr(Back)}
|
||||
{Tr(T.Back)}
|
||||
</Button>
|
||||
)}
|
||||
<ButtonSubmit
|
||||
data-cy="login-button"
|
||||
isSubmitting={isLoading}
|
||||
label={onBack ? Tr(Next) : Tr(SignIn)}
|
||||
label={onBack ? Tr(T.Next) : Tr(T.SignIn)}
|
||||
className={classes.submit}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
@@ -5,20 +5,12 @@ import * as yup from 'yup'
|
||||
|
||||
import useAuth from 'client/hooks/useAuth'
|
||||
import useOpennebula from 'client/hooks/useOpennebula'
|
||||
import { INPUT_TYPES, FILTER_POOL } from 'client/constants'
|
||||
import { T, INPUT_TYPES, FILTER_POOL } from 'client/constants'
|
||||
import { getValidationFromFields } from 'client/utils/helpers'
|
||||
import {
|
||||
Username,
|
||||
Password,
|
||||
KeepLoggedIn,
|
||||
Token2FA,
|
||||
SelectGroup,
|
||||
ShowAll
|
||||
} from 'client/constants/translates'
|
||||
|
||||
export const USERNAME = {
|
||||
name: 'user',
|
||||
label: Username,
|
||||
label: T.Username,
|
||||
type: INPUT_TYPES.TEXT,
|
||||
validation: yup
|
||||
.string()
|
||||
@@ -36,7 +28,7 @@ export const USERNAME = {
|
||||
|
||||
export const PASSWORD = {
|
||||
name: 'token',
|
||||
label: Password,
|
||||
label: T.Password,
|
||||
type: INPUT_TYPES.TEXT,
|
||||
htmlType: 'password',
|
||||
validation: yup
|
||||
@@ -54,7 +46,7 @@ export const PASSWORD = {
|
||||
|
||||
export const REMEMBER = {
|
||||
name: 'remember',
|
||||
label: KeepLoggedIn,
|
||||
label: T.KeepLoggedIn,
|
||||
type: INPUT_TYPES.CHECKBOX,
|
||||
validation: yup
|
||||
.boolean()
|
||||
@@ -64,7 +56,7 @@ export const REMEMBER = {
|
||||
|
||||
export const TOKEN = {
|
||||
name: 'token2fa',
|
||||
label: Token2FA,
|
||||
label: T.Token2FA,
|
||||
type: INPUT_TYPES.TEXT,
|
||||
validation: yup
|
||||
.string()
|
||||
@@ -81,7 +73,7 @@ export const TOKEN = {
|
||||
|
||||
export const GROUP = {
|
||||
name: 'group',
|
||||
label: SelectGroup,
|
||||
label: T.SelectGroup,
|
||||
type: INPUT_TYPES.SELECT,
|
||||
values: () => {
|
||||
const { authUser } = useAuth()
|
||||
|
||||
@@ -5,6 +5,8 @@ import { useFormContext } from 'react-hook-form'
|
||||
import useProvision from 'client/hooks/useProvision'
|
||||
import FormWithSchema from 'client/components/Forms/FormWithSchema'
|
||||
import { EmptyCard } from 'client/components/Cards'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
import {
|
||||
STEP_ID as PROVIDER_ID
|
||||
@@ -17,7 +19,7 @@ let connection = {}
|
||||
|
||||
const Connection = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Connection configuration',
|
||||
label: Tr(T.ConfigureConnection),
|
||||
resolver: () => STEP_FORM_SCHEMA(connection),
|
||||
optionsValidate: { abortEarly: false },
|
||||
content: useCallback(() => {
|
||||
|
||||
@@ -7,6 +7,8 @@ import useListForm from 'client/hooks/useListForm'
|
||||
|
||||
import ListCards from 'client/components/List/ListCards'
|
||||
import { EmptyCard, LocationCard } from 'client/components/Cards'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
import { STEP_ID as PROVIDER_ID } from 'client/containers/Providers/Form/Create/Steps/Provider'
|
||||
import { STEP_FORM_SCHEMA } from './schema'
|
||||
@@ -15,7 +17,7 @@ export const STEP_ID = 'location'
|
||||
|
||||
const Locations = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Location',
|
||||
label: Tr(T.Location),
|
||||
resolver: () => STEP_FORM_SCHEMA,
|
||||
content: useCallback(({ data, setFormData }) => {
|
||||
const [locationsList, setLocationsList] = useState([])
|
||||
|
||||
@@ -8,6 +8,8 @@ import useListForm from 'client/hooks/useListForm'
|
||||
import ListCards from 'client/components/List/ListCards'
|
||||
import { EmptyCard, ProvisionTemplateCard } from 'client/components/Cards'
|
||||
import { PATH } from 'client/router/provision'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
import { STEP_ID as CONNECTION_ID } from 'client/containers/Providers/Form/Create/Steps/Connection'
|
||||
import { STEP_ID as LOCATION_ID } from 'client/containers/Providers/Form/Create/Steps/Locations'
|
||||
@@ -17,7 +19,7 @@ export const STEP_ID = 'provider'
|
||||
|
||||
const Provider = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Provider Template',
|
||||
label: Tr(T.ProviderTemplate),
|
||||
resolver: () => STEP_FORM_SCHEMA,
|
||||
content: useCallback(({ data, setFormData }) => {
|
||||
const { getProvidersTemplates } = useProvision()
|
||||
|
||||
@@ -7,20 +7,7 @@ import clsx from 'clsx'
|
||||
|
||||
import useStyles from 'client/containers/Providers/Sections/styles'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import {
|
||||
Information,
|
||||
Name,
|
||||
ProviderLabel,
|
||||
RegistrationTime,
|
||||
Permissions,
|
||||
Use,
|
||||
Manage,
|
||||
Admin,
|
||||
Ownership,
|
||||
Owner,
|
||||
Group,
|
||||
Other
|
||||
} from 'client/constants/translates'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const Info = memo(({ data }) => {
|
||||
const classes = useStyles()
|
||||
@@ -40,7 +27,7 @@ const Info = memo(({ data }) => {
|
||||
<Paper variant="outlined">
|
||||
<List className={clsx(classes.list, 'w-50')}>
|
||||
<ListItem className={classes.title}>
|
||||
<Typography>{Tr(Information)}</Typography>
|
||||
<Typography>{Tr(T.Information)}</Typography>
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem>
|
||||
@@ -48,15 +35,15 @@ const Info = memo(({ data }) => {
|
||||
<Typography>{ID}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr(Name)}</Typography>
|
||||
<Typography>{Tr(T.Name)}</Typography>
|
||||
<Typography>{NAME}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr(ProviderLabel)}</Typography>
|
||||
<Typography>{Tr(T.Provider)}</Typography>
|
||||
<Typography>{providerName}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr(RegistrationTime)}</Typography>
|
||||
<Typography>{Tr(T.RegistrationTime)}</Typography>
|
||||
<Typography>
|
||||
{new Date(time * 1000).toLocaleString()}
|
||||
</Typography>
|
||||
@@ -75,26 +62,26 @@ const Info = memo(({ data }) => {
|
||||
<Paper variant="outlined" className={classes.permissions}>
|
||||
<List className={clsx(classes.list, 'w-25')}>
|
||||
<ListItem className={classes.title}>
|
||||
<Typography>{Tr(Permissions)}</Typography>
|
||||
<Typography>{Tr(Use)}</Typography>
|
||||
<Typography>{Tr(Manage)}</Typography>
|
||||
<Typography>{Tr(Admin)}</Typography>
|
||||
<Typography>{Tr(T.Permissions)}</Typography>
|
||||
<Typography>{Tr(T.Use)}</Typography>
|
||||
<Typography>{Tr(T.Manage)}</Typography>
|
||||
<Typography>{Tr(T.Admin)}</Typography>
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem>
|
||||
<Typography>{Tr(Owner)}</Typography>
|
||||
<Typography>{Tr(T.Owner)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.OWNER_U)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.OWNER_M)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.OWNER_A)}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr(Group)}</Typography>
|
||||
<Typography>{Tr(T.Group)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.GROUP_U)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.GROUP_M)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.GROUP_A)}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr(Other)}</Typography>
|
||||
<Typography>{Tr(T.Other)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.OTHER_U)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.OTHER_M)}</Typography>
|
||||
<Typography>{isChecked(PERMISSIONS.OTHER_A)}</Typography>
|
||||
@@ -104,15 +91,15 @@ const Info = memo(({ data }) => {
|
||||
<Paper variant="outlined">
|
||||
<List className={clsx(classes.list, 'w-50')}>
|
||||
<ListItem className={classes.title}>
|
||||
<Typography>{Tr(Ownership)}</Typography>
|
||||
<Typography>{Tr(T.Ownership)}</Typography>
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem>
|
||||
<Typography>{Tr(Owner)}</Typography>
|
||||
<Typography>{Tr(T.Owner)}</Typography>
|
||||
<Typography>{UNAME}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr(Group)}</Typography>
|
||||
<Typography>{Tr(T.Group)}</Typography>
|
||||
<Typography>{GNAME}</Typography>
|
||||
</ListItem>
|
||||
</List>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import React, { useState, useEffect } from 'react'
|
||||
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { Container, Box, Typography, Divider } from '@material-ui/core'
|
||||
import RefreshIcon from '@material-ui/icons/Autorenew'
|
||||
import { Container, Box } from '@material-ui/core'
|
||||
import EditIcon from '@material-ui/icons/Settings'
|
||||
import DeleteIcon from '@material-ui/icons/Delete'
|
||||
|
||||
@@ -10,16 +9,15 @@ import { PATH } from 'client/router/provision'
|
||||
import useProvision from 'client/hooks/useProvision'
|
||||
import useFetch from 'client/hooks/useFetch'
|
||||
|
||||
import SubmitButton from 'client/components/FormControl/SubmitButton'
|
||||
import ListCards from 'client/components/List/ListCards'
|
||||
import { ListHeader, ListCards } from 'client/components/List'
|
||||
import AlertError from 'client/components/Alerts/Error'
|
||||
import { ProvisionCard } from 'client/components/Cards'
|
||||
|
||||
import { DialogRequest } from 'client/components/Dialogs'
|
||||
import Information from 'client/containers/Providers/Sections/info'
|
||||
|
||||
import { ProvidersLabel, CannotConnectOneProvision } from 'client/constants/translates'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
function Providers () {
|
||||
const history = useHistory()
|
||||
@@ -36,21 +34,17 @@ function Providers () {
|
||||
|
||||
return (
|
||||
<Container disableGutters>
|
||||
<Box p={3} display="flex" alignItems="center">
|
||||
<SubmitButton
|
||||
fab
|
||||
onClick={() => fetchRequest(undefined, { reload: true })}
|
||||
isSubmitting={loading || reloading}
|
||||
label={<RefreshIcon />}
|
||||
/>
|
||||
<Typography variant="h5" style={{ marginLeft: 8 }}>
|
||||
{Tr(ProvidersLabel)}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Divider />
|
||||
<ListHeader
|
||||
title={Tr(T.Providers)}
|
||||
hasReloadButton
|
||||
reloadButtonProps={{
|
||||
onClick: () => fetchRequest(undefined, { reload: true }),
|
||||
isSubmitting: Boolean(loading || reloading)
|
||||
}}
|
||||
/>
|
||||
<Box p={3}>
|
||||
{error ? (
|
||||
<AlertError>{Tr(CannotConnectOneProvision)}</AlertError>
|
||||
<AlertError>{Tr(T.CannotConnectOneProvision)}</AlertError>
|
||||
) : (
|
||||
<ListCards
|
||||
list={providers}
|
||||
|
||||
@@ -49,11 +49,11 @@ const Info = memo(({ data }) => {
|
||||
<Typography>{description}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr(T.ProviderLabel)}</Typography>
|
||||
<Typography>{Tr(T.Provider)}</Typography>
|
||||
<Typography>{providerName}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<Typography>{Tr(T.ClustersLabel)}</Typography>
|
||||
<Typography>{Tr(T.Cluster)}</Typography>
|
||||
<Typography>{`${clusterId} - ${clusterName}`}</Typography>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
|
||||
@@ -5,6 +5,8 @@ import { useFormContext } from 'react-hook-form'
|
||||
import useProvision from 'client/hooks/useProvision'
|
||||
import FormWithSchema from 'client/components/Forms/FormWithSchema'
|
||||
import { EmptyCard } from 'client/components/Cards'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
import {
|
||||
STEP_ID as PROVISION_TEMPLATE_ID
|
||||
@@ -17,7 +19,7 @@ let inputs = []
|
||||
|
||||
const Inputs = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Inputs configuration',
|
||||
label: Tr(T.ConfigureInputs),
|
||||
resolver: () => STEP_FORM_SCHEMA(inputs),
|
||||
optionsValidate: { abortEarly: false },
|
||||
content: useCallback(() => {
|
||||
|
||||
@@ -8,6 +8,8 @@ import useListForm from 'client/hooks/useListForm'
|
||||
import ListCards from 'client/components/List/ListCards'
|
||||
import { EmptyCard, ProvisionCard } from 'client/components/Cards'
|
||||
import { PATH } from 'client/router/provision'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
import { STEP_FORM_SCHEMA } from './schema'
|
||||
|
||||
@@ -15,7 +17,7 @@ export const STEP_ID = 'provider'
|
||||
|
||||
const Provider = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Provider',
|
||||
label: Tr(T.Provider),
|
||||
resolver: () => STEP_FORM_SCHEMA,
|
||||
content: useCallback(({ data, setFormData }) => {
|
||||
const { getProviders } = useProvision()
|
||||
|
||||
@@ -8,6 +8,8 @@ import useListForm from 'client/hooks/useListForm'
|
||||
import ListCards from 'client/components/List/ListCards'
|
||||
import { EmptyCard, ProvisionTemplateCard } from 'client/components/Cards'
|
||||
import { PATH } from 'client/router/provision'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
import { STEP_ID as INPUTS_ID } from 'client/containers/Provisions/Form/Create/Steps/Inputs'
|
||||
import { STEP_ID as PROVIDER_ID } from 'client/containers/Provisions/Form/Create/Steps/Provider'
|
||||
@@ -17,7 +19,7 @@ export const STEP_ID = 'provision'
|
||||
|
||||
const Provision = () => ({
|
||||
id: STEP_ID,
|
||||
label: 'Provision template',
|
||||
label: Tr(T.ProvisionTemplate),
|
||||
resolver: () => STEP_FORM_SCHEMA,
|
||||
content: useCallback(({ data, setFormData }) => {
|
||||
const { getProvisionsTemplates } = useProvision()
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
import React, { useState, useEffect, createElement } from 'react'
|
||||
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { Container, Box, Typography, Divider } from '@material-ui/core'
|
||||
import RefreshIcon from '@material-ui/icons/Autorenew'
|
||||
import { Container, Box } from '@material-ui/core'
|
||||
import DeleteIcon from '@material-ui/icons/Delete'
|
||||
|
||||
import { PATH } from 'client/router/provision'
|
||||
import useProvision from 'client/hooks/useProvision'
|
||||
import useFetch from 'client/hooks/useFetch'
|
||||
|
||||
import SubmitButton from 'client/components/FormControl/SubmitButton'
|
||||
import ListCards from 'client/components/List/ListCards'
|
||||
import { ListHeader, ListCards } from 'client/components/List'
|
||||
import AlertError from 'client/components/Alerts/Error'
|
||||
import { ProvisionCard } from 'client/components/Cards'
|
||||
|
||||
import { DialogRequest } from 'client/components/Dialogs'
|
||||
import DialogInfo from 'client/containers/Provisions/DialogInfo'
|
||||
|
||||
import { ProvisionsLabel, CannotConnectOneProvision } from 'client/constants/translates'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
function Provisions () {
|
||||
const history = useHistory()
|
||||
@@ -37,21 +34,17 @@ function Provisions () {
|
||||
|
||||
return (
|
||||
<Container disableGutters>
|
||||
<Box p={3} display="flex" alignItems="center">
|
||||
<SubmitButton
|
||||
fab
|
||||
onClick={() => fetchRequest(undefined, { reload: true })}
|
||||
isSubmitting={loading || reloading}
|
||||
label={<RefreshIcon />}
|
||||
/>
|
||||
<Typography variant="h5" style={{ marginLeft: 8 }}>
|
||||
{Tr(ProvisionsLabel)}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Divider />
|
||||
<ListHeader
|
||||
title={Tr(T.Provisions)}
|
||||
hasReloadButton
|
||||
reloadButtonProps={{
|
||||
onClick: () => fetchRequest(undefined, { reload: true }),
|
||||
isSubmitting: Boolean(loading || reloading)
|
||||
}}
|
||||
/>
|
||||
<Box p={3}>
|
||||
{error ? (
|
||||
<AlertError>{Tr(CannotConnectOneProvision)}</AlertError>
|
||||
<AlertError>{Tr(T.CannotConnectOneProvision)}</AlertError>
|
||||
) : (
|
||||
<ListCards
|
||||
list={provisions}
|
||||
|
||||
@@ -14,13 +14,11 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
import React from 'react'
|
||||
import { Translate } from 'client/components/HOC'
|
||||
import TRANSLATES from 'client/constants/translates'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const Settings = () => (
|
||||
<div>
|
||||
<Translate word={TRANSLATES.Settings} />
|
||||
</div>
|
||||
<div>{Tr(T.Settings)}</div>
|
||||
)
|
||||
|
||||
export default Settings
|
||||
@@ -17,10 +17,12 @@ import React, { useState, useMemo } from 'react'
|
||||
import { Container, TextField, Grid, MenuItem } from '@material-ui/core'
|
||||
|
||||
import Commands from 'server/utils/constants/commands'
|
||||
import { Translate, Tr } from 'client/components/HOC'
|
||||
import InputCode from 'client/components/FormControl/InputCode'
|
||||
import ResponseForm from 'client/containers/TestApi/ResponseForm'
|
||||
|
||||
import testapiStyles from 'client/containers/TestApi/styles'
|
||||
import { Tr } from 'client/components/HOC'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const TestApi = () => {
|
||||
const classes = testapiStyles()
|
||||
@@ -40,13 +42,11 @@ const TestApi = () => {
|
||||
fullWidth
|
||||
select
|
||||
variant="outlined"
|
||||
label={Tr('Select request')}
|
||||
label={Tr(T.SelectRequest)}
|
||||
value={name}
|
||||
onChange={handleChangeCommand}
|
||||
>
|
||||
<MenuItem value="">
|
||||
<Translate word="none" />
|
||||
</MenuItem>
|
||||
<MenuItem value="">{Tr(T.None)}</MenuItem>
|
||||
{useMemo(() =>
|
||||
Object.keys(Commands)?.map(
|
||||
commandName => (
|
||||
|
||||
Reference in new issue
Block a user