Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/nanoid-3.3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
palagdan authored Dec 29, 2024
2 parents da186cf + f741a03 commit ed9bb88
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 84 deletions.
15 changes: 6 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"cytoscape-expand-collapse": "^4.1.1",
"cytoscape-navigator": "^2.0.2",
"cytoscape-popper": "^4.0.0",
"dayjs": "^1.11.13",
"js-cookie": "^2.2.1",
"lodash": "^4.17.20",
"moment": "^2.29.4",
"prop-types": "^15.7.2",
"react": "^18.2.0",
"react-bootstrap": "^2.10.5",
Expand Down
1 change: 1 addition & 0 deletions src/constants/vocabulary.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const MODULE_INPUT_PATH = `${S_PIPES}/has-module-input-path`;
export const MODULE_OUTPUT_PATH = `${S_PIPES}/has-module-output-path`;
export const PARAMETER = `${S_PIPES}/has-parameter`;
export const FUNCTION_LOCAL_NAME = `${S_PIPES}/has-function-local-name`;
export const RDF4j_TRANSFORMATION_ID = `${S_PIPES}/rdf4j-transformation-id`;

export const X = `${S_PIPES_VIEW}/has-x-coordinate`;
export const Y = `${S_PIPES_VIEW}/has-y-coordinate`;
Expand Down
146 changes: 72 additions & 74 deletions src/pages/ExecutionsPage.jsx
Original file line number Diff line number Diff line change
@@ -1,89 +1,87 @@
import React from "react";
import { ABSOLUTE_PATH, DISPLAY_NAME, EXECUTION_DURATION, TRANSFORMATION } from "../constants/vocabulary.js";
import React, { useEffect, useState } from "react";
import {
ABSOLUTE_PATH,
DISPLAY_NAME,
EXECUTION_DURATION,
MODULE_EXECUTION_FINISH_DATE,
MODULE_EXECUTION_START_DATE,
RDF4j_TRANSFORMATION_ID,
TRANSFORMATION,
} from "../constants/vocabulary.js";
import Rest from "../rest/Rest.jsx";
import { Col, Container, Row, Table } from "react-bootstrap";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faMugHot, faEdit, faQuestion } from "@fortawesome/free-solid-svg-icons";
import { Link } from "react-router-dom";
import dayjs from "dayjs";
import Spinner from "../components/spinner/Spinner.jsx";

class ExecutionsPage extends React.Component {
constructor(props) {
super(props);
this.state = {
data: [],
};
}
const ExecutionsPage = () => {
const [data, setData] = useState([]);
const [loading, setLoading] = useState(true);

componentDidMount() {
useEffect(() => {
Rest.getExecutions().then((response) => {
console.log(response);
this.setState({ data: response });
setData(response);
setLoading(false);
});
}, []);

if (loading) {
return <Spinner />;
}

render() {
if (this.state.data === []) {
return <h3>Loading</h3>;
} else {
return (
<>
<h3>Executions</h3>
<Table striped bordered hover>
<thead>
<tr>
<th>Status</th>
<th>Name</th>
<th>Started</th>
<th>Finished</th>
<th>Duration</th>
<th style={{ textAlign: "center" }}>Action</th>
return (
<>
<h3 className="mt-3">Executions</h3>
<Table striped bordered hover>
<thead>
<tr>
<th>Status</th>
<th>Name</th>
<th>Started</th>
<th>Finished</th>
<th>Duration</th>
<th style={{ textAlign: "center" }}>Action</th>
</tr>
</thead>
<tbody>
{data
.filter((v) => v !== null)
.map((data, key) => (
<tr key={key}>
<td align={"center"}>
<FontAwesomeIcon icon={faMugHot} />
</td>
<td>{data[DISPLAY_NAME]}</td>
<td>{dayjs(data[MODULE_EXECUTION_START_DATE]).format("HH:mm:ss")}</td>
<td>{dayjs(data[MODULE_EXECUTION_FINISH_DATE]).format("HH:mm:ss")}</td>
<td>{data[EXECUTION_DURATION]}ms</td>
<td>
<Container>
<Row>
<Col>
<Link to={`/script?file=${data[ABSOLUTE_PATH]}&transformation=${data[TRANSFORMATION]}`}>
<FontAwesomeIcon icon={faEdit} />
</Link>
</Col>
<Col
onClick={() => {
window.open(data[RDF4j_TRANSFORMATION_ID], "_blank");
}}
>
<FontAwesomeIcon icon={faQuestion} />
</Col>
</Row>
</Container>
</td>
</tr>
</thead>
<tbody>
{this.state.data
.filter((v) => {
return v !== null;
})
.map((data, key) => {
return (
<tr key={key}>
<td align={"center"}>
<FontAwesomeIcon icon={faMugHot} />
</td>
<td>{data[DISPLAY_NAME]}</td>
<td>{data[EXECUTION_DURATION]}ms</td>
<td>
<Container>
<Row>
<Col>
<Link to={`/script?file=${data[ABSOLUTE_PATH]}&transformation=${data[TRANSFORMATION]}`}>
<FontAwesomeIcon icon={faEdit} />
</Link>
</Col>
<Col
onClick={() => {
window.open(
data["http://onto.fel.cvut.cz/ontologies/s-pipes/rdf4j-transformation-id"],
"_blank",
);
}}
>
<FontAwesomeIcon icon={faQuestion} />
</Col>
{/*<Col><FontAwesomeIcon icon={faPlayCircle} /></Col>*/}
{/*<Col><FontAwesomeIcon icon={faTrash} /></Col>*/}
</Row>
</Container>
</td>
</tr>
);
})}
</tbody>
</Table>
</>
);
}
}
}
))}
</tbody>
</Table>
</>
);
};

export default ExecutionsPage;

0 comments on commit ed9bb88

Please sign in to comment.