machine actions

master
Tudor Stanciu 2021-04-17 02:39:05 +03:00
parent 93fdc26886
commit b7bd9b6206
2 changed files with 49 additions and 7 deletions

View File

@ -1,11 +1,21 @@
import React from "react"; import React from "react";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { TableCell, TableRow, IconButton } from "@material-ui/core"; import {
import Collapse from "@material-ui/core/Collapse"; TableCell,
import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown"; TableRow,
import KeyboardArrowUpIcon from "@material-ui/icons/KeyboardArrowUp"; IconButton,
Collapse,
Tooltip
} from "@material-ui/core";
import {
KeyboardArrowDown,
KeyboardArrowUp,
PowerSettingsNew,
LastPage
} from "@material-ui/icons";
import { makeStyles } from "@material-ui/core/styles"; import { makeStyles } from "@material-ui/core/styles";
import MachineLog from "./MachineLog"; import MachineLog from "./MachineLog";
import { useTranslation } from "react-i18next";
const useRowStyles = makeStyles({ const useRowStyles = makeStyles({
root: { root: {
@ -18,6 +28,11 @@ const useRowStyles = makeStyles({
const MachineItem = ({ machine }) => { const MachineItem = ({ machine }) => {
const [open, setOpen] = React.useState(false); const [open, setOpen] = React.useState(false);
const classes = useRowStyles(); const classes = useRowStyles();
const { t } = useTranslation();
const handleClick = event => {
alert("asdasd");
};
return ( return (
<React.Fragment> <React.Fragment>
@ -28,7 +43,7 @@ const MachineItem = ({ machine }) => {
size="small" size="small"
onClick={() => setOpen(!open)} onClick={() => setOpen(!open)}
> >
{open ? <KeyboardArrowUpIcon /> : <KeyboardArrowDownIcon />} {open ? <KeyboardArrowUp /> : <KeyboardArrowDown />}
</IconButton> </IconButton>
</TableCell> </TableCell>
<TableCell component="th" scope="row"> <TableCell component="th" scope="row">
@ -36,7 +51,34 @@ const MachineItem = ({ machine }) => {
</TableCell> </TableCell>
<TableCell>{machine.machineName}</TableCell> <TableCell>{machine.machineName}</TableCell>
<TableCell>{machine.iPv4Address}</TableCell> <TableCell>{machine.iPv4Address}</TableCell>
<TableCell align="right">{"buttons"}</TableCell> <TableCell align="right">
<>
<Tooltip title={t("General.Actions")}>
<span>
<IconButton
id={`machine-item-${machine.machineId}-wake`}
size={"small"}
disabled={false}
onClick={handleClick}
>
<PowerSettingsNew />
</IconButton>
</span>
</Tooltip>
<Tooltip title={t("General.Actions")}>
<span>
<IconButton
id={`machine-item-${machine.machineId}-ping`}
size={"small"}
disabled={false}
onClick={handleClick}
>
<LastPage />
</IconButton>
</span>
</Tooltip>
</>
</TableCell>
</TableRow> </TableRow>
<TableRow> <TableRow>
<TableCell style={{ paddingBottom: 0, paddingTop: 0 }} colSpan={6}> <TableCell style={{ paddingBottom: 0, paddingTop: 0 }} colSpan={6}>

View File

@ -21,7 +21,7 @@ const MachinesList = ({ dense, machines }) => {
<TableCell>Full machine name</TableCell> <TableCell>Full machine name</TableCell>
<TableCell>Machine name</TableCell> <TableCell>Machine name</TableCell>
<TableCell>IP</TableCell> <TableCell>IP</TableCell>
<TableCell align="right">Actions</TableCell> <TableCell align="right" />
</TableRow> </TableRow>
</TableHead> </TableHead>
<TableBody> <TableBody>