mirror of
https://github.com/OpenNebula/one.git
synced 2026-12-02 13:16:48 +09:00
F OpenNebula/one#6876: Redirect when delete entities (#3649)
Co-authored-by: Tino Vázquez <cvazquez@opennebula.io>
This commit is contained in:
1 parent
0642d83e7d
commit
6263dab4bf
47 files changed
+379
-280
No files matched your search
@@ -13,13 +13,13 @@
|
||||
* See the License for the specific language governing permissions and *
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { Box, useTheme, useMediaQuery } from '@mui/material'
|
||||
import { SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { useAuth, useGeneral, useGeneralApi } from '@FeaturesModule'
|
||||
import SplitPane from '@modules/components/SplitPane'
|
||||
import { GlobalActions } from '@modules/components/Tables/Enhanced/Utils'
|
||||
import Pagination from '@modules/components/Tables/Enhanced/pagination'
|
||||
import EnhancedTableStyles from '@modules/components/Tables/Enhanced/styles'
|
||||
import { SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { useAuth, useGeneral, useGeneralApi } from '@FeaturesModule'
|
||||
import { Box, useMediaQuery, useTheme } from '@mui/material'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, useCallback, useEffect, useMemo, useState } from 'react'
|
||||
|
||||
@@ -206,7 +206,7 @@ const ResourcesBackButton = memo(
|
||||
condition={moreThanOneSelected}
|
||||
valid={
|
||||
<Pagination
|
||||
className={styles.pagination}
|
||||
styles={styles.pagination}
|
||||
handleChangePage={(index) => setPageIndex(index)}
|
||||
count={countSelectedRows}
|
||||
showPageCount={true}
|
||||
|
||||
@@ -14,20 +14,20 @@
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { Typography } from '@mui/material'
|
||||
import { Plus, DesignPencil, Trash } from 'iconoir-react'
|
||||
import { DesignPencil, Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import { useViews, AclAPI } from '@FeaturesModule'
|
||||
import { AclAPI, useViews } from '@FeaturesModule'
|
||||
|
||||
import {
|
||||
createActions,
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { ACL_ACTIONS, RESOURCE_NAMES, STYLE_BUTTONS, T } from '@ConstantsModule'
|
||||
import { Tr, Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components/path'
|
||||
import { Translate, Tr } from '@modules/components/HOC'
|
||||
import { RESOURCE_NAMES, T, ACL_ACTIONS, STYLE_BUTTONS } from '@ConstantsModule'
|
||||
|
||||
import { translateACL } from '@ModelsModule'
|
||||
|
||||
@@ -62,9 +62,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on ACL table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [remove] = AclAPI.useRemoveAclMutation()
|
||||
@@ -114,6 +117,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -17,9 +17,9 @@ import { Typography } from '@mui/material'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import { BackupJobAPI, useViews } from '@FeaturesModule'
|
||||
import { ChangeGroupForm, ChangeUserForm } from '@modules/components/Forms/Vm'
|
||||
import { useViews, BackupJobAPI } from '@FeaturesModule'
|
||||
import { Plus, Group, Lock, PlayOutline, Trash } from 'iconoir-react'
|
||||
import { Group, Lock, PlayOutline, Plus, Trash } from 'iconoir-react'
|
||||
|
||||
import { PATH } from '@modules/components/path'
|
||||
import {
|
||||
@@ -27,14 +27,14 @@ import {
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import {
|
||||
BACKUPJOB_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
T,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
} from '@ConstantsModule'
|
||||
import { isVmAvailableAction } from '@ModelsModule'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
|
||||
const isDisabled = (action) => (rows) =>
|
||||
!isVmAvailableAction(
|
||||
@@ -73,9 +73,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on Backup Jobs Template table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [changeOwnership] = BackupJobAPI.useChangeBackupJobOwnershipMutation()
|
||||
@@ -251,6 +254,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => deleteBackupJob({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -17,7 +17,7 @@ import { Typography } from '@mui/material'
|
||||
import { Group, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
|
||||
import { useViews, ImageAPI } from '@FeaturesModule'
|
||||
import { ImageAPI, useViews } from '@FeaturesModule'
|
||||
|
||||
import { RestoreForm } from '@modules/components/Forms/Backup'
|
||||
import { ChangeGroupForm, ChangeUserForm } from '@modules/components/Forms/Vm'
|
||||
@@ -26,14 +26,14 @@ import {
|
||||
createActions,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import {
|
||||
IMAGE_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
T,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
} from '@ConstantsModule'
|
||||
import { isVmAvailableAction } from '@ModelsModule'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
|
||||
const isDisabled = (action) => (rows) =>
|
||||
!isVmAvailableAction(
|
||||
@@ -69,9 +69,12 @@ const MessageToConfirmAction = (rows) => (
|
||||
/**
|
||||
* Generates the actions to operate resources on Backup table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const { view, getResourceView } = useViews()
|
||||
const [changeOwnership] = ImageAPI.useChangeImageOwnershipMutation()
|
||||
const [restoreBackup] = ImageAPI.useRestoreBackupMutation()
|
||||
@@ -217,6 +220,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => deleteImage({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -18,21 +18,21 @@ import { Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import { useViews, ClusterAPI } from '@FeaturesModule'
|
||||
import { ClusterAPI, useViews } from '@FeaturesModule'
|
||||
|
||||
import {
|
||||
createActions,
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { PATH } from '@modules/components/path'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import {
|
||||
RESOURCE_NAMES,
|
||||
T,
|
||||
CLUSTER_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
} from '@ConstantsModule'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components/path'
|
||||
|
||||
const ListClusterNames = ({ rows = [] }) =>
|
||||
rows?.map?.(({ id, original }) => {
|
||||
@@ -63,9 +63,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on Clusters table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [remove] = ClusterAPI.useRemoveClusterMutation()
|
||||
@@ -120,6 +123,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and *
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { ClusterAPI, DatastoreAPI, useViews } from '@FeaturesModule'
|
||||
import { ChangeClusterForm } from '@modules/components/Forms/Cluster'
|
||||
import { ChangeGroupForm, ChangeUserForm } from '@modules/components/Forms/Vm'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
@@ -20,18 +21,17 @@ import {
|
||||
GlobalAction,
|
||||
createActions,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
import { useViews, ClusterAPI, DatastoreAPI } from '@FeaturesModule'
|
||||
import { Plus, Group, MoreVert, Trash } from 'iconoir-react'
|
||||
import { Group, MoreVert, Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import { PATH } from '@modules/components/path'
|
||||
import {
|
||||
DATASTORE_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
T,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
} from '@ConstantsModule'
|
||||
import { PATH } from '@modules/components/path'
|
||||
|
||||
const MessageToConfirmAction = (rows) => {
|
||||
const names = rows?.map?.(({ original }) => original?.NAME)
|
||||
@@ -54,9 +54,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on Datastore table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [enable] = DatastoreAPI.useEnableDatastoreMutation()
|
||||
@@ -231,6 +234,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -13,28 +13,28 @@
|
||||
* See the License for the specific language governing permissions and *
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { Typography } from '@mui/material'
|
||||
import { Group, MoreVert, Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { Typography } from '@mui/material'
|
||||
import { MoreVert, Plus, Group, Trash } from 'iconoir-react'
|
||||
|
||||
import { useViews, ImageAPI } from '@FeaturesModule'
|
||||
import { ImageAPI, useViews } from '@FeaturesModule'
|
||||
|
||||
import { ChangeUserForm, ChangeGroupForm } from '@modules/components/Forms/Vm'
|
||||
import { ChangeGroupForm, ChangeUserForm } from '@modules/components/Forms/Vm'
|
||||
import {
|
||||
createActions,
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components'
|
||||
import { isVmAvailableAction } from '@ModelsModule'
|
||||
import {
|
||||
T,
|
||||
IMAGE_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
} from '@ConstantsModule'
|
||||
import { isVmAvailableAction } from '@ModelsModule'
|
||||
import { PATH } from '@modules/components'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
|
||||
const isDisabled = (action) => (rows) =>
|
||||
!isVmAvailableAction(
|
||||
@@ -70,9 +70,12 @@ const MessageToConfirmAction = (rows) => (
|
||||
/**
|
||||
* Generates the actions to operate resources on Image table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [enable] = ImageAPI.useEnableImageMutation()
|
||||
@@ -205,6 +208,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => deleteImage({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -18,21 +18,21 @@ import { Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import { useViews, GroupAPI } from '@FeaturesModule'
|
||||
import { GroupAPI, useViews } from '@FeaturesModule'
|
||||
|
||||
import {
|
||||
createActions,
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { PATH } from '@modules/components/path'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import {
|
||||
RESOURCE_NAMES,
|
||||
T,
|
||||
GROUP_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
} from '@ConstantsModule'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components/path'
|
||||
|
||||
const ListGroupNames = ({ rows = [] }) =>
|
||||
rows?.map?.(({ id, original }) => {
|
||||
@@ -63,9 +63,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on Groups table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [remove] = GroupAPI.useRemoveGroupMutation()
|
||||
@@ -120,6 +123,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -22,8 +22,8 @@ import {
|
||||
HOST_STATES,
|
||||
RESOURCE_NAMES,
|
||||
STATES,
|
||||
T,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
} from '@ConstantsModule'
|
||||
import {
|
||||
ClusterAPI,
|
||||
@@ -68,9 +68,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on Host table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const dispatch = useDispatch()
|
||||
const { enqueueError, enqueueInfo } = useGeneralApi()
|
||||
const history = useHistory()
|
||||
@@ -216,6 +219,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { Typography } from '@mui/material'
|
||||
import { Plus, Cart, Group, Lock, MoreVert, Trash } from 'iconoir-react'
|
||||
import { Cart, Group, Lock, MoreVert, Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import { useViews, ImageAPI } from '@FeaturesModule'
|
||||
import { ImageAPI, useViews } from '@FeaturesModule'
|
||||
|
||||
import { CloneForm } from '@modules/components/Forms/Image'
|
||||
import { ChangeGroupForm, ChangeUserForm } from '@modules/components/Forms/Vm'
|
||||
@@ -27,16 +27,16 @@ import {
|
||||
createActions,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { PATH } from '@modules/components/path'
|
||||
import { Tr, Translate } from '@modules/components/HOC'
|
||||
import {
|
||||
IMAGE_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
VM_ACTIONS,
|
||||
STYLE_BUTTONS,
|
||||
} from '@ConstantsModule'
|
||||
import { isVmAvailableAction } from '@ModelsModule'
|
||||
import { Tr, Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components/path'
|
||||
|
||||
const isDisabled = (action) => (rows) =>
|
||||
!isVmAvailableAction(
|
||||
@@ -72,9 +72,12 @@ const MessageToConfirmAction = (rows) => (
|
||||
/**
|
||||
* Generates the actions to operate resources on Image table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [clone] = ImageAPI.useCloneImageMutation()
|
||||
@@ -347,6 +350,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => deleteImage({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -13,20 +13,20 @@
|
||||
* See the License for the specific language governing permissions and *
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import {
|
||||
Plus,
|
||||
CloudDownload,
|
||||
DownloadCircledOutline,
|
||||
Group,
|
||||
Lock,
|
||||
MoreVert,
|
||||
Group,
|
||||
Plus,
|
||||
Trash,
|
||||
} from 'iconoir-react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import { useViews, useGeneralApi, MarketplaceAppAPI } from '@FeaturesModule'
|
||||
import { MarketplaceAppAPI, useGeneralApi, useViews } from '@FeaturesModule'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
|
||||
import { ExportForm } from '@modules/components/Forms/MarketplaceApp'
|
||||
@@ -35,14 +35,14 @@ import {
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { PATH } from '@modules/components/path'
|
||||
import {
|
||||
T,
|
||||
RESOURCE_NAMES,
|
||||
MARKETPLACE_APP_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
} from '@ConstantsModule'
|
||||
import { ChangeGroupForm, ChangeUserForm } from '@modules/components/Forms/Vm'
|
||||
import { PATH } from '@modules/components/path'
|
||||
import { Typography } from '@mui/material'
|
||||
|
||||
const ListAppNames = ({ rows = [] }) => {
|
||||
@@ -79,9 +79,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on Host table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const { enqueueSuccess } = useGeneralApi()
|
||||
@@ -296,6 +299,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => deleteApp({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -14,26 +14,26 @@
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { Typography } from '@mui/material'
|
||||
import { Plus, Trash, MoreVert, Group } from 'iconoir-react'
|
||||
import { Group, MoreVert, Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import { useViews, MarketplaceAPI } from '@FeaturesModule'
|
||||
import { MarketplaceAPI, useViews } from '@FeaturesModule'
|
||||
|
||||
import {
|
||||
createActions,
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { PATH } from '@modules/components/path'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import {
|
||||
RESOURCE_NAMES,
|
||||
T,
|
||||
MARKETPLACE_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
} from '@ConstantsModule'
|
||||
import { ChangeGroupForm, ChangeUserForm } from '@modules/components/Forms/Vm'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components/path'
|
||||
|
||||
const ListMarketplaceNames = ({ rows = [] }) =>
|
||||
rows?.map?.(({ id, original }) => {
|
||||
@@ -66,9 +66,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on Groups table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [remove] = MarketplaceAPI.useRemoveMarketplaceMutation()
|
||||
@@ -209,6 +212,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -14,25 +14,25 @@
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { Typography } from '@mui/material'
|
||||
import { Plus, Group, Trash } from 'iconoir-react'
|
||||
import { Group, Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import { PATH, Form } from '@modules/components'
|
||||
import { useViews, SecurityGroupAPI } from '@FeaturesModule'
|
||||
import { SecurityGroupAPI, useViews } from '@FeaturesModule'
|
||||
import { Form, PATH } from '@modules/components'
|
||||
|
||||
import {
|
||||
GlobalAction,
|
||||
createActions,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { Tr, Translate } from '@modules/components/HOC'
|
||||
import {
|
||||
RESOURCE_NAMES,
|
||||
SEC_GROUP_ACTIONS,
|
||||
T,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
} from '@ConstantsModule'
|
||||
import { Tr, Translate } from '@modules/components/HOC'
|
||||
const { SecurityGroup, Vm } = Form
|
||||
|
||||
const ListSecGroupNames = ({ rows = [] }) =>
|
||||
@@ -68,9 +68,12 @@ const MessageToConfirmAction = (rows, message) => (
|
||||
/**
|
||||
* Generates the actions to operate resources on Security Groups table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [clone] = SecurityGroupAPI.useCloneSegGroupMutation()
|
||||
@@ -250,6 +253,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => deleteSecGroup({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -13,27 +13,27 @@
|
||||
* See the License for the specific language governing permissions and *
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { Box, Typography } from '@mui/material'
|
||||
import { Group, PlayOutline, Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { Box, Typography } from '@mui/material'
|
||||
import { Plus, Trash, PlayOutline, Group } from 'iconoir-react'
|
||||
|
||||
import { useViews, ServiceTemplateAPI } from '@FeaturesModule'
|
||||
import { ServiceTemplateAPI, useViews } from '@FeaturesModule'
|
||||
|
||||
import { ChangeUserForm, ChangeGroupForm } from '@modules/components/Forms/Vm'
|
||||
import { ChangeGroupForm, ChangeUserForm } from '@modules/components/Forms/Vm'
|
||||
import {
|
||||
createActions,
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import {
|
||||
RESOURCE_NAMES,
|
||||
SERVICE_TEMPLATE_ACTIONS,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
} from '@ConstantsModule'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components/path'
|
||||
import {
|
||||
T,
|
||||
SERVICE_TEMPLATE_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
} from '@ConstantsModule'
|
||||
|
||||
const ListServiceTemplateNames = ({ rows = [] }) =>
|
||||
rows?.map?.(({ id, original }) => {
|
||||
@@ -66,9 +66,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on VM Template table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
|
||||
@@ -232,6 +235,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -13,29 +13,29 @@
|
||||
* See the License for the specific language governing permissions and *
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { useMemo } from 'react'
|
||||
import { useTheme, Box, Typography } from '@mui/material'
|
||||
import { css } from '@emotion/css'
|
||||
import { Box, Typography, useTheme } from '@mui/material'
|
||||
import { Group, Plus, RefreshCircular, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { Plus, Trash, Group, RefreshCircular } from 'iconoir-react'
|
||||
|
||||
import { useViews, ServiceAPI } from '@FeaturesModule'
|
||||
import { ServiceAPI, useViews } from '@FeaturesModule'
|
||||
|
||||
import { ChangeUserForm, ChangeGroupForm } from '@modules/components/Forms/Vm'
|
||||
import { ChangeGroupForm, ChangeUserForm } from '@modules/components/Forms/Vm'
|
||||
import {
|
||||
createActions,
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import ServiceTemplatesTable from '@modules/components/Tables/ServiceTemplates'
|
||||
import {
|
||||
RESOURCE_NAMES,
|
||||
SERVICE_TEMPLATE_ACTIONS,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
} from '@ConstantsModule'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components/path'
|
||||
import {
|
||||
T,
|
||||
SERVICE_TEMPLATE_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
} from '@ConstantsModule'
|
||||
import ServiceTemplatesTable from '@modules/components/Tables/ServiceTemplates'
|
||||
|
||||
const useTableStyles = () => ({
|
||||
body: css({ gridTemplateColumns: 'repeat(auto-fill, minmax(400px, 1fr))' }),
|
||||
@@ -72,9 +72,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on VM Template table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
|
||||
@@ -228,6 +231,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -18,21 +18,21 @@ import { Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import { useViews, UserAPI } from '@FeaturesModule'
|
||||
import { UserAPI, useViews } from '@FeaturesModule'
|
||||
|
||||
import {
|
||||
createActions,
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { PATH } from '@modules/components/path'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import {
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
USER_ACTIONS,
|
||||
STYLE_BUTTONS,
|
||||
} from '@ConstantsModule'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components/path'
|
||||
const { useDisableUserMutation, useEnableUserMutation, useRemoveUserMutation } =
|
||||
UserAPI
|
||||
|
||||
@@ -65,9 +65,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on User table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [enable] = useEnableUserMutation()
|
||||
@@ -137,6 +140,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -25,9 +25,9 @@ import {
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { PATH } from '@modules/components/path'
|
||||
import { RESOURCE_NAMES, STYLE_BUTTONS, T, VDC_ACTIONS } from '@ConstantsModule'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import { RESOURCE_NAMES, T, VDC_ACTIONS, STYLE_BUTTONS } from '@ConstantsModule'
|
||||
import { PATH } from '@modules/components/path'
|
||||
|
||||
const ListVDCNames = ({ rows = [] }) =>
|
||||
rows?.map?.(({ id, original }) => {
|
||||
@@ -58,9 +58,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on VM Template table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [remove] = VdcAPI.useRemoveVDCMutation()
|
||||
@@ -115,6 +118,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -25,14 +25,14 @@ import {
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { PATH } from '@modules/components/path'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import {
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
VMGROUP_ACTIONS,
|
||||
STYLE_BUTTONS,
|
||||
} from '@ConstantsModule'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components/path'
|
||||
|
||||
const ListVmGroupNames = ({ rows = [] }) =>
|
||||
rows?.map?.(({ id, original }) => {
|
||||
@@ -63,9 +63,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on VmGroup table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [enable] = VmGroupAPI.useUnlockVMGroupMutation()
|
||||
@@ -151,6 +154,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
* See the License for the specific language governing permissions and *
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { Typography } from '@mui/material'
|
||||
import { Cart, Group, Lock, PlayOutline, Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { Typography } from '@mui/material'
|
||||
import { Trash, PlayOutline, Lock, Group, Cart, Plus } from 'iconoir-react'
|
||||
|
||||
import { useViews, VmTemplateAPI } from '@FeaturesModule'
|
||||
|
||||
@@ -25,14 +25,14 @@ import {
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { Tr, Translate } from '@modules/components/HOC'
|
||||
import { PATH, Form } from '@modules/components'
|
||||
import {
|
||||
T,
|
||||
VM_TEMPLATE_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
VM_TEMPLATE_ACTIONS,
|
||||
} from '@ConstantsModule'
|
||||
import { Form, PATH } from '@modules/components'
|
||||
import { Tr, Translate } from '@modules/components/HOC'
|
||||
const { Vm, VmTemplate } = Form
|
||||
|
||||
const ListVmTemplateNames = ({ rows = [] }) =>
|
||||
@@ -66,9 +66,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on VM Template table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
|
||||
@@ -335,6 +338,7 @@ const Actions = () => {
|
||||
const { image } = formData ?? {}
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id, image })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -13,23 +13,23 @@
|
||||
* See the License for the specific language governing permissions and *
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { Typography, useTheme } from '@mui/material'
|
||||
import { css } from '@emotion/css'
|
||||
import { Typography, useTheme } from '@mui/material'
|
||||
import {
|
||||
Plus,
|
||||
Cart,
|
||||
Group,
|
||||
Lock,
|
||||
PlayOutline,
|
||||
Plus,
|
||||
SaveFloppyDisk,
|
||||
Settings,
|
||||
TransitionRight,
|
||||
Trash,
|
||||
Settings,
|
||||
} from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import { useViews, useGeneralApi, DatastoreAPI, VmAPI } from '@FeaturesModule'
|
||||
import { DatastoreAPI, VmAPI, useGeneralApi, useViews } from '@FeaturesModule'
|
||||
|
||||
import {
|
||||
GlobalAction,
|
||||
@@ -37,10 +37,10 @@ import {
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
import VmTemplatesTable from '@modules/components/Tables/Vms/VmTemplateTable'
|
||||
|
||||
import { PATH, Form } from '@modules/components'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import { RESOURCE_NAMES, T, VM_ACTIONS, STYLE_BUTTONS } from '@ConstantsModule'
|
||||
import { RESOURCE_NAMES, STYLE_BUTTONS, T, VM_ACTIONS } from '@ConstantsModule'
|
||||
import { getLastHistory, isVmAvailableAction } from '@ModelsModule'
|
||||
import { Form, PATH } from '@modules/components'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
const { Vm, Backup } = Form
|
||||
|
||||
const useTableStyles = () => ({
|
||||
@@ -93,9 +93,12 @@ const MessageToConfirmAction = (rows) => (
|
||||
/**
|
||||
* Generates the actions to operate resources on VM table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const { enqueueSuccess } = useGeneralApi()
|
||||
@@ -686,6 +689,7 @@ const Actions = () => {
|
||||
await Promise.all(
|
||||
ids.map((id) => actionVm({ id, action: 'terminate' }))
|
||||
)
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -703,6 +707,7 @@ const Actions = () => {
|
||||
await Promise.all(
|
||||
ids.map((id) => actionVm({ id, action: 'terminate-hard' }))
|
||||
)
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -14,27 +14,27 @@
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { Typography } from '@mui/material'
|
||||
import { Plus, Group, Lock, PlayOutline, Trash } from 'iconoir-react'
|
||||
import { Group, Lock, PlayOutline, Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import { useViews, VnTemplateAPI, ClusterAPI } from '@FeaturesModule'
|
||||
import { ClusterAPI, useViews, VnTemplateAPI } from '@FeaturesModule'
|
||||
|
||||
import { ChangeClusterForm } from '@modules/components/Forms/Cluster'
|
||||
import { ChangeGroupForm, ChangeUserForm } from '@modules/components/Forms/Vm'
|
||||
import { Translate } from '@modules/components/HOC'
|
||||
import {
|
||||
GlobalAction,
|
||||
createActions,
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { PATH } from '@modules/components/path'
|
||||
import {
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
VN_TEMPLATE_ACTIONS,
|
||||
STYLE_BUTTONS,
|
||||
} from '@ConstantsModule'
|
||||
import { PATH } from '@modules/components/path'
|
||||
|
||||
const ListNames = ({ rows = [] }) =>
|
||||
rows?.map?.(({ id, original }) => {
|
||||
@@ -75,9 +75,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on Virtual networks table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [changeCluster] = ClusterAPI.useAddNetworkToClusterMutation()
|
||||
@@ -263,6 +266,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { Typography, useTheme } from '@mui/material'
|
||||
import { Plus, Group, Lock, Trash } from 'iconoir-react'
|
||||
import { Group, Lock, Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import { useViews, ClusterAPI, VnAPI } from '@FeaturesModule'
|
||||
import { ClusterAPI, VnAPI, useViews } from '@FeaturesModule'
|
||||
import { isVnAvailableAction } from '@ModelsModule'
|
||||
|
||||
import { ChangeClusterForm } from '@modules/components/Forms/Cluster'
|
||||
@@ -31,9 +31,9 @@ import {
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
import VnTemplatesTable from '@modules/components/Tables/VnTemplates'
|
||||
|
||||
import { PATH } from '@modules/components/path'
|
||||
import { RESOURCE_NAMES, T, VN_ACTIONS, STYLE_BUTTONS } from '@ConstantsModule'
|
||||
import { RESOURCE_NAMES, STYLE_BUTTONS, T, VN_ACTIONS } from '@ConstantsModule'
|
||||
import { css } from '@emotion/css'
|
||||
import { PATH } from '@modules/components/path'
|
||||
|
||||
const isDisabled = (action) => (rows) =>
|
||||
!isVnAvailableAction(
|
||||
@@ -84,9 +84,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on Virtual networks table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
const [changeCluster] = ClusterAPI.useAddNetworkToClusterMutation()
|
||||
@@ -370,6 +373,7 @@ const Actions = () => {
|
||||
onSubmit: (rows) => async () => {
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -13,28 +13,28 @@
|
||||
* See the License for the specific language governing permissions and *
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { Typography } from '@mui/material'
|
||||
import { Group, Lock, PlayOutline, Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { Typography } from '@mui/material'
|
||||
import { Plus, Trash, PlayOutline, Lock, Group } from 'iconoir-react'
|
||||
|
||||
import { useViews, VmTemplateAPI, VrTemplateAPI } from '@FeaturesModule'
|
||||
|
||||
import { ChangeUserForm, ChangeGroupForm } from '@modules/components/Forms/Vm'
|
||||
import { ChangeGroupForm, ChangeUserForm } from '@modules/components/Forms/Vm'
|
||||
import { CloneForm, DeleteForm } from '@modules/components/Forms/VmTemplate'
|
||||
import {
|
||||
createActions,
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { Tr, Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components/path'
|
||||
import {
|
||||
T,
|
||||
VROUTER_TEMPLATE_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
VROUTER_TEMPLATE_ACTIONS,
|
||||
} from '@ConstantsModule'
|
||||
import { Tr, Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components/path'
|
||||
|
||||
const ListVrTemplateNames = ({ rows = [] }) =>
|
||||
rows?.map?.(({ id, original }) => {
|
||||
@@ -67,10 +67,13 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on VM Template table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const history = useHistory()
|
||||
const { setSelectedRows } = props
|
||||
const { view, getResourceView } = useViews()
|
||||
|
||||
const [fetchVrs] = VrTemplateAPI.useLazyGetVrTemplatesQuery()
|
||||
@@ -327,6 +330,7 @@ const Actions = () => {
|
||||
const { image } = formData ?? {}
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id, image })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -13,27 +13,27 @@
|
||||
* See the License for the specific language governing permissions and *
|
||||
* limitations under the License. *
|
||||
* ------------------------------------------------------------------------- */
|
||||
import { Typography } from '@mui/material'
|
||||
import { Group, Lock, Plus, Trash } from 'iconoir-react'
|
||||
import { useMemo } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { Typography } from '@mui/material'
|
||||
import { Plus, Trash, Lock, Group } from 'iconoir-react'
|
||||
|
||||
import { useViews, VmTemplateAPI, VrAPI } from '@FeaturesModule'
|
||||
|
||||
import { ChangeUserForm, ChangeGroupForm } from '@modules/components/Forms/Vm'
|
||||
import { ChangeGroupForm, ChangeUserForm } from '@modules/components/Forms/Vm'
|
||||
import {
|
||||
createActions,
|
||||
GlobalAction,
|
||||
} from '@modules/components/Tables/Enhanced/Utils'
|
||||
|
||||
import { Tr, Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components/path'
|
||||
import {
|
||||
T,
|
||||
VROUTER_ACTIONS,
|
||||
RESOURCE_NAMES,
|
||||
STYLE_BUTTONS,
|
||||
T,
|
||||
VROUTER_ACTIONS,
|
||||
} from '@ConstantsModule'
|
||||
import { Tr, Translate } from '@modules/components/HOC'
|
||||
import { PATH } from '@modules/components/path'
|
||||
|
||||
const ListVmTemplateNames = ({ rows = [] }) =>
|
||||
rows?.map?.(({ id, original }) => {
|
||||
@@ -66,9 +66,12 @@ MessageToConfirmAction.displayName = 'MessageToConfirmAction'
|
||||
/**
|
||||
* Generates the actions to operate resources on VM Template table.
|
||||
*
|
||||
* @param {object} props - datatable props
|
||||
* @param {Function} props.setSelectedRows - set selected rows
|
||||
* @returns {GlobalAction} - Actions
|
||||
*/
|
||||
const Actions = () => {
|
||||
const Actions = (props = {}) => {
|
||||
const { setSelectedRows } = props
|
||||
const history = useHistory()
|
||||
const { view, getResourceView } = useViews()
|
||||
|
||||
@@ -243,6 +246,7 @@ const Actions = () => {
|
||||
const { image } = formData ?? {}
|
||||
const ids = rows?.map?.(({ original }) => original?.ID)
|
||||
await Promise.all(ids.map((id) => remove({ id, image })))
|
||||
setSelectedRows && setSelectedRows([])
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -34,7 +34,7 @@ import { ReactElement, useState } from 'react'
|
||||
export function ACLs() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const { zone } = useGeneral()
|
||||
const actions = ACLsTable.Actions()
|
||||
const actions = ACLsTable.Actions({ selectedRows, setSelectedRows })
|
||||
|
||||
return (
|
||||
<TranslateProvider>
|
||||
|
||||
@@ -26,21 +26,21 @@ import {
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
import { ReactElement, memo, useEffect, useState } from 'react'
|
||||
|
||||
import { T, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { SERVER_CONFIG, T } from '@ConstantsModule'
|
||||
import {
|
||||
BackupJobAPI,
|
||||
useAuth,
|
||||
useGeneral,
|
||||
useGeneralApi,
|
||||
useAuth,
|
||||
} from '@FeaturesModule'
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,7 @@ import {
|
||||
*/
|
||||
export function BackupJobs() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = BackupJobsTable.Actions()
|
||||
const actions = BackupJobsTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,19 +23,19 @@ import {
|
||||
Tr,
|
||||
TranslateProvider,
|
||||
} from '@ComponentsModule'
|
||||
import { Image, T, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { ImageAPI, useGeneral, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
import { Image, SERVER_CONFIG, T } from '@ConstantsModule'
|
||||
import { ImageAPI, useAuth, useGeneral, useGeneralApi } from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
import { memo, ReactElement, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of Backups with a split pane between the list and selected row(s).
|
||||
@@ -44,7 +44,7 @@ import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function Backups() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = BackupsTable.Actions(selectedRows)
|
||||
const actions = BackupsTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
const { refetch, isFetching } = ImageAPI.useGetBackupsQuery()
|
||||
|
||||
|
||||
@@ -23,19 +23,19 @@ import {
|
||||
Tr,
|
||||
TranslateProvider,
|
||||
} from '@ComponentsModule'
|
||||
import { Cluster, T, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { ClusterAPI, useGeneral, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
import { Cluster, SERVER_CONFIG, T } from '@ConstantsModule'
|
||||
import { ClusterAPI, useAuth, useGeneral, useGeneralApi } from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
import { memo, ReactElement, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of Clusters with a split pane between the list and selected row(s).
|
||||
@@ -45,7 +45,7 @@ import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
export function Clusters() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
|
||||
const actions = ClustersTable.Actions()
|
||||
const actions = ClustersTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,24 +23,24 @@ import {
|
||||
Tr,
|
||||
TranslateProvider,
|
||||
} from '@ComponentsModule'
|
||||
import { Datastore, T, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { Datastore, SERVER_CONFIG, T } from '@ConstantsModule'
|
||||
import {
|
||||
DatastoreAPI,
|
||||
useAuth,
|
||||
useGeneral,
|
||||
useGeneralApi,
|
||||
useAuth,
|
||||
} from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
import { memo, ReactElement, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of Datastores with a split pane between the list and selected row(s).
|
||||
@@ -49,7 +49,7 @@ import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function Datastores() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = DatastoresTable.Actions()
|
||||
const actions = DatastoresTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
import { memo, ReactElement, useEffect, useState } from 'react'
|
||||
|
||||
import {
|
||||
FilesTable,
|
||||
@@ -35,8 +35,8 @@ import {
|
||||
Tr,
|
||||
TranslateProvider,
|
||||
} from '@ComponentsModule'
|
||||
import { Image, T, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { ImageAPI, useGeneral, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
import { Image, SERVER_CONFIG, T } from '@ConstantsModule'
|
||||
import { ImageAPI, useAuth, useGeneral, useGeneralApi } from '@FeaturesModule'
|
||||
|
||||
/**
|
||||
* Displays a list of Files with a split pane between the list and selected row(s).
|
||||
@@ -45,7 +45,7 @@ import { ImageAPI, useGeneral, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
*/
|
||||
export function Files() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = FilesTable.Actions()
|
||||
const actions = FilesTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,19 +23,19 @@ import {
|
||||
Tr,
|
||||
TranslateProvider,
|
||||
} from '@ComponentsModule'
|
||||
import { Group, T, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { GroupAPI, useGeneral, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
import { Group, SERVER_CONFIG, T } from '@ConstantsModule'
|
||||
import { GroupAPI, useAuth, useGeneral, useGeneralApi } from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
import { memo, ReactElement, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of Groups with a split pane between the list and selected row(s).
|
||||
@@ -44,7 +44,7 @@ import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function Groups() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = GroupsTable.Actions()
|
||||
const actions = GroupsTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,20 +23,20 @@ import {
|
||||
Tr,
|
||||
TranslateProvider,
|
||||
} from '@ComponentsModule'
|
||||
import { Host, T, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { HostAPI, useGeneral, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
import { Host, SERVER_CONFIG, T } from '@ConstantsModule'
|
||||
import { HostAPI, useAuth, useGeneral, useGeneralApi } from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import { MuiProvider, SunstoneTheme } from '@ProvidersModule'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
import { memo, ReactElement, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of Hosts with a split pane between the list and selected row(s).
|
||||
@@ -45,7 +45,7 @@ import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function Hosts() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = HostsTable.Actions()
|
||||
const actions = HostsTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,19 +23,19 @@ import {
|
||||
Tr,
|
||||
TranslateProvider,
|
||||
} from '@ComponentsModule'
|
||||
import { Image, T, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { ImageAPI, useGeneral, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
import { Image, SERVER_CONFIG, T } from '@ConstantsModule'
|
||||
import { ImageAPI, useAuth, useGeneral, useGeneralApi } from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
import { memo, ReactElement, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of Images with a split pane between the list and selected row(s).
|
||||
@@ -44,7 +44,7 @@ import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function Images() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = ImagesTable.Actions()
|
||||
const actions = ImagesTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,24 +23,24 @@ import {
|
||||
Tr,
|
||||
TranslateProvider,
|
||||
} from '@ComponentsModule'
|
||||
import { MarketplaceApp, T, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { MarketplaceApp, SERVER_CONFIG, T } from '@ConstantsModule'
|
||||
import {
|
||||
MarketplaceAppAPI,
|
||||
useAuth,
|
||||
useGeneral,
|
||||
useGeneralApi,
|
||||
useAuth,
|
||||
} from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
import { ReactElement, memo, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of Marketplace Apps with a split pane between the list and selected row(s).
|
||||
@@ -49,7 +49,10 @@ import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function MarketplaceApps() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = MarketplaceAppsTable.Actions()
|
||||
const actions = MarketplaceAppsTable.Actions({
|
||||
selectedRows,
|
||||
setSelectedRows,
|
||||
})
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,24 +23,24 @@ import {
|
||||
Tr,
|
||||
TranslateProvider,
|
||||
} from '@ComponentsModule'
|
||||
import { Marketplace, T, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { Marketplace, SERVER_CONFIG, T } from '@ConstantsModule'
|
||||
import {
|
||||
MarketplaceAPI,
|
||||
useAuth,
|
||||
useGeneral,
|
||||
useGeneralApi,
|
||||
useAuth,
|
||||
} from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
import { memo, ReactElement, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of Marketplaces with a split pane between the list and selected row(s).
|
||||
@@ -49,7 +49,7 @@ import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function Marketplaces() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = MarketplacesTable.Actions()
|
||||
const actions = MarketplacesTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,24 +23,24 @@ import {
|
||||
Tr,
|
||||
TranslateProvider,
|
||||
} from '@ComponentsModule'
|
||||
import { Image, T, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { Image, SERVER_CONFIG, T } from '@ConstantsModule'
|
||||
import {
|
||||
SecurityGroupAPI,
|
||||
useAuth,
|
||||
useGeneral,
|
||||
useGeneralApi,
|
||||
useAuth,
|
||||
} from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
import { memo, ReactElement, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of Security Groups with a split pane between the list and selected row(s).
|
||||
@@ -49,7 +49,7 @@ import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function SecurityGroups() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = SecurityGroupsTable.Actions()
|
||||
const actions = SecurityGroupsTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
import { memo, ReactElement, useEffect, useState } from 'react'
|
||||
|
||||
import {
|
||||
MultipleTags,
|
||||
@@ -35,12 +35,12 @@ import {
|
||||
Tr,
|
||||
TranslateProvider,
|
||||
} from '@ComponentsModule'
|
||||
import { T, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { SERVER_CONFIG, T } from '@ConstantsModule'
|
||||
import {
|
||||
ServiceTemplateAPI,
|
||||
useAuth,
|
||||
useGeneral,
|
||||
useGeneralApi,
|
||||
useAuth,
|
||||
} from '@FeaturesModule'
|
||||
|
||||
/**
|
||||
@@ -51,7 +51,10 @@ import {
|
||||
*/
|
||||
export function ServiceTemplates() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = ServiceTemplatesTable.Actions()
|
||||
const actions = ServiceTemplatesTable.Actions({
|
||||
selectedRows,
|
||||
setSelectedRows,
|
||||
})
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
import { memo, ReactElement, useEffect, useState } from 'react'
|
||||
|
||||
import {
|
||||
MultipleTags,
|
||||
@@ -35,8 +35,8 @@ import {
|
||||
Tr,
|
||||
TranslateProvider,
|
||||
} from '@ComponentsModule'
|
||||
import { T, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { ServiceAPI, useGeneral, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
import { SERVER_CONFIG, T } from '@ConstantsModule'
|
||||
import { ServiceAPI, useAuth, useGeneral, useGeneralApi } from '@FeaturesModule'
|
||||
|
||||
/**
|
||||
* Displays a list of Service with a split pane between
|
||||
@@ -46,7 +46,7 @@ import { ServiceAPI, useGeneral, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
*/
|
||||
export function Services() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = ServicesTable.Actions()
|
||||
const actions = ServicesTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,19 +23,19 @@ import {
|
||||
UserTabs,
|
||||
UsersTable,
|
||||
} from '@ComponentsModule'
|
||||
import { T, User, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { UserAPI, useGeneral, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
import { SERVER_CONFIG, T, User } from '@ConstantsModule'
|
||||
import { UserAPI, useAuth, useGeneral, useGeneralApi } from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
import { ReactElement, memo, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of Users with a split pane between the list and selected row(s).
|
||||
@@ -44,7 +44,7 @@ import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function Users() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = UsersTable.Actions()
|
||||
const actions = UsersTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,19 +23,19 @@ import {
|
||||
VDCsTable,
|
||||
VDCTabs,
|
||||
} from '@ComponentsModule'
|
||||
import { T, VmTemplate as VdcTemplate, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { useGeneral, VdcAPI, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
import { SERVER_CONFIG, T, VmTemplate as VdcTemplate } from '@ConstantsModule'
|
||||
import { useAuth, useGeneral, useGeneralApi, VdcAPI } from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
import { memo, ReactElement, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of VDCs with a split pane between the list and selected row(s).
|
||||
@@ -44,7 +44,7 @@ import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function VDCs() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = VDCsTable.Actions()
|
||||
const actions = VDCsTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -54,7 +54,7 @@ export function VirtualMachines() {
|
||||
const [dismissError] = VmAPI.useUpdateUserTemplateMutation()
|
||||
const dispatch = useDispatch()
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = VmsTable.Actions(selectedRows)
|
||||
const actions = VmsTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -23,19 +23,19 @@ import {
|
||||
VnTabs,
|
||||
VnsTable,
|
||||
} from '@ComponentsModule'
|
||||
import { T, VirtualNetwork, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { VnAPI, useGeneral, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
import { SERVER_CONFIG, T, VirtualNetwork } from '@ConstantsModule'
|
||||
import { VnAPI, useAuth, useGeneral, useGeneralApi } from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
import { ReactElement, memo, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of Virtual Networks with a split pane between the list and selected row(s).
|
||||
@@ -44,7 +44,7 @@ import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function VirtualNetworks() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = VnsTable.Actions()
|
||||
const actions = VnsTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
+6
-6
@@ -23,24 +23,24 @@ import {
|
||||
VmTemplateTabs,
|
||||
VrTemplatesTable,
|
||||
} from '@ComponentsModule'
|
||||
import { T, VmTemplate, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { SERVER_CONFIG, T, VmTemplate } from '@ConstantsModule'
|
||||
import {
|
||||
VrTemplateAPI,
|
||||
useAuth,
|
||||
useGeneral,
|
||||
useGeneralApi,
|
||||
useAuth,
|
||||
} from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
import { ReactElement, memo, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of VM Templates with a split pane between the list and selected row(s).
|
||||
@@ -49,7 +49,7 @@ import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function VrTemplates() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = VrTemplatesTable.Actions()
|
||||
const actions = VrTemplatesTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,19 +23,19 @@ import {
|
||||
VrsTable,
|
||||
VrTabs,
|
||||
} from '@ComponentsModule'
|
||||
import { T, VmTemplate, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { useGeneral, VrAPI, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
import { SERVER_CONFIG, T, VmTemplate } from '@ConstantsModule'
|
||||
import { useAuth, useGeneral, useGeneralApi, VrAPI } from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
import { memo, ReactElement, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of VM Templates with a split pane between the list and selected row(s).
|
||||
@@ -44,7 +44,7 @@ import { memo, ReactElement, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function VirtualRouters() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = VrsTable.Actions()
|
||||
const actions = VrsTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,19 +23,19 @@ import {
|
||||
VmGroupTabs,
|
||||
VmGroupsTable,
|
||||
} from '@ComponentsModule'
|
||||
import { T, VmGroup, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { VmGroupAPI, useGeneral, useGeneralApi, useAuth } from '@FeaturesModule'
|
||||
import { SERVER_CONFIG, T, VmGroup } from '@ConstantsModule'
|
||||
import { VmGroupAPI, useAuth, useGeneral, useGeneralApi } from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
import { ReactElement, memo, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of VmGroups with a split pane between the list and selected row(s).
|
||||
@@ -44,7 +44,7 @@ import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function VmGroups() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = VmGroupsTable.Actions()
|
||||
const actions = VmGroupsTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,24 +23,24 @@ import {
|
||||
VmTemplateTabs,
|
||||
VmTemplatesTable,
|
||||
} from '@ComponentsModule'
|
||||
import { T, VmTemplate, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { SERVER_CONFIG, T, VmTemplate } from '@ConstantsModule'
|
||||
import {
|
||||
VmTemplateAPI,
|
||||
useAuth,
|
||||
useGeneral,
|
||||
useGeneralApi,
|
||||
useAuth,
|
||||
} from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
import { ReactElement, memo, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of VM Templates with a split pane between the list and selected row(s).
|
||||
@@ -49,7 +49,7 @@ import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function VmTemplates() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = VmTemplatesTable.Actions()
|
||||
const actions = VmTemplatesTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,24 +23,24 @@ import {
|
||||
VnTemplateTabs,
|
||||
VnTemplatesTable,
|
||||
} from '@ComponentsModule'
|
||||
import { T, VNetworkTemplate, SERVER_CONFIG } from '@ConstantsModule'
|
||||
import { SERVER_CONFIG, T, VNetworkTemplate } from '@ConstantsModule'
|
||||
import {
|
||||
VnTemplateAPI,
|
||||
useAuth,
|
||||
useGeneral,
|
||||
useGeneralApi,
|
||||
useAuth,
|
||||
} from '@FeaturesModule'
|
||||
import { Chip, Stack } from '@mui/material'
|
||||
import {
|
||||
Cancel,
|
||||
RefreshDouble,
|
||||
Expand,
|
||||
Collapse,
|
||||
Expand,
|
||||
NavArrowLeft,
|
||||
RefreshDouble,
|
||||
} from 'iconoir-react'
|
||||
import { Row } from 'opennebula-react-table'
|
||||
import PropTypes from 'prop-types'
|
||||
import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
import { ReactElement, memo, useEffect, useState } from 'react'
|
||||
|
||||
/**
|
||||
* Displays a list of VNet Templates with a split pane between the list and selected row(s).
|
||||
@@ -49,7 +49,7 @@ import { ReactElement, memo, useState, useEffect } from 'react'
|
||||
*/
|
||||
export function VnTemplates() {
|
||||
const [selectedRows, setSelectedRows] = useState(() => [])
|
||||
const actions = VnTemplatesTable.Actions()
|
||||
const actions = VnTemplatesTable.Actions({ selectedRows, setSelectedRows })
|
||||
const { zone } = useGeneral()
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user