Compare commits
No commits in common. "5cc1830e2b446094eefd21759cd94b4a103f7c4a" and "96605a692382008e01a75a8c1adeb676c3a36d56" have entirely different histories.
5cc1830e2b
...
96605a6923
@ -25,4 +25,3 @@ npm run build
|
|||||||
|
|
||||||
The development server will start on `http://localhost:3000`
|
The development server will start on `http://localhost:3000`
|
||||||
|
|
||||||
Get css docs here https://materializecss.com/
|
|
||||||
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="stylesheet" href="main.css">
|
|
||||||
<link rel="icon"
|
<link rel="icon"
|
||||||
href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.14/svgs/solid/book.svg" />
|
href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.14/svgs/solid/book.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|||||||
@ -1,16 +0,0 @@
|
|||||||
a.white-link:link {
|
|
||||||
color: azure;
|
|
||||||
font-size: large;
|
|
||||||
}
|
|
||||||
a.white-link:hover {
|
|
||||||
color: azure;
|
|
||||||
font-size: large;
|
|
||||||
}
|
|
||||||
a.white-link:visited {
|
|
||||||
color: azure;
|
|
||||||
font-size: large;
|
|
||||||
}
|
|
||||||
a.white-link:active {
|
|
||||||
color: azure;
|
|
||||||
font-size: large;
|
|
||||||
}
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
// // Generic Msgbox
|
|
||||||
|
|
||||||
function Msgbox(props) {
|
|
||||||
return <div>
|
|
||||||
<div className="card-panel grey darken-1">
|
|
||||||
<div className="card-content white-link">
|
|
||||||
<center>
|
|
||||||
<span className="card-title">
|
|
||||||
{ props.error ? <span> { "Unable to update: " + props.error } </span> : null }
|
|
||||||
{ props.msg ? <span className="white-text">{ "Updated migration details for: " + props.msg }</span> : null }
|
|
||||||
{ props.linkid ? <a href={ "https://devui.benjamyn.love/migrations/" + props.linkid } className="white-link">{"https://devui.benjamyn.love/migrations/" + props.linkid }</a> : null }
|
|
||||||
</span>
|
|
||||||
</center>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Msgbox;
|
|
||||||
@ -22,7 +22,7 @@ export class Home extends Component {
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
callAPI
|
callAPI
|
||||||
.get("/")
|
.get('/')
|
||||||
.then((request) => {
|
.then((request) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
migs: request.data,
|
migs: request.data,
|
||||||
@ -37,6 +37,7 @@ export class Home extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
|
<div className="container">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="divider"></div>
|
<div className="divider"></div>
|
||||||
|
|
||||||
@ -57,6 +58,7 @@ export class Home extends Component {
|
|||||||
<div className="divider"></div>
|
<div className="divider"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,20 @@ class Historical extends Component {
|
|||||||
error: false,
|
error: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
componentDidMount() {
|
||||||
|
callAPI
|
||||||
|
.get("/all")
|
||||||
|
.then((request) => {
|
||||||
|
this.setState({
|
||||||
|
migs: request.data,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
this.setState({
|
||||||
|
error: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
renderItems() {
|
renderItems() {
|
||||||
if (!this.props.error) {
|
if (!this.props.error) {
|
||||||
return <HistoricalSingle data={this.state.sidemigs} />;
|
return <HistoricalSingle data={this.state.sidemigs} />;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from "react";
|
import React from "react";
|
||||||
import "bootstrap/dist/css/bootstrap.min.css";
|
import "bootstrap/dist/css/bootstrap.min.css";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { Col, FormGroup, Row, Container, Label } from "reactstrap";
|
import { Col, FormGroup, Row, Container, Label } from "reactstrap";
|
||||||
@ -6,7 +6,6 @@ import { Formik, Form, Field } from "formik";
|
|||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
import { Input, Submit } from "formstrap";
|
import { Input, Submit } from "formstrap";
|
||||||
import { callAPI } from "../../../actions/API";
|
import { callAPI } from "../../../actions/API";
|
||||||
import Msgbox from "../../../actions/Msgbox";
|
|
||||||
// import FormikFieldDateTimePicker from "./FormikFieldDateTimePicker";
|
// import FormikFieldDateTimePicker from "./FormikFieldDateTimePicker";
|
||||||
|
|
||||||
// Main form and POST Request to add migrations
|
// Main form and POST Request to add migrations
|
||||||
@ -24,8 +23,6 @@ const timezoneList = {
|
|||||||
};
|
};
|
||||||
const timezone = timezoneList.melbourne;
|
const timezone = timezoneList.melbourne;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const InputValidation = Yup.object().shape({
|
const InputValidation = Yup.object().shape({
|
||||||
domain: Yup.string()
|
domain: Yup.string()
|
||||||
.matches(
|
.matches(
|
||||||
@ -49,9 +46,6 @@ const InputValidation = Yup.object().shape({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const CPanelBooking = () => {
|
export const CPanelBooking = () => {
|
||||||
const [respID, setRespID] = useState(0)
|
|
||||||
const [error, setError] = useState(0)
|
|
||||||
|
|
||||||
const initialValues = {
|
const initialValues = {
|
||||||
submit_time: moment().format("YYYY-MM-DD"),
|
submit_time: moment().format("YYYY-MM-DD"),
|
||||||
dateTime: "2019-03-11T12:00:00.000Z",
|
dateTime: "2019-03-11T12:00:00.000Z",
|
||||||
@ -63,11 +57,9 @@ export const CPanelBooking = () => {
|
|||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
console.log(response.data.id);
|
console.log(response.data.id);
|
||||||
// add function here
|
// add function here
|
||||||
setRespID(response.data.id)
|
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
setError(error)
|
|
||||||
});
|
});
|
||||||
setSubmitting(false);
|
setSubmitting(false);
|
||||||
resetForm({ values: "" });
|
resetForm({ values: "" });
|
||||||
@ -235,8 +227,6 @@ export const CPanelBooking = () => {
|
|||||||
</FormGroup>
|
</FormGroup>
|
||||||
<Submit withSpinner>Submit</Submit>
|
<Submit withSpinner>Submit</Submit>
|
||||||
</Container>
|
</Container>
|
||||||
{ respID ? <Msgbox linkid={respID}></Msgbox> : null }
|
|
||||||
{ error ? <Msgbox error={error}></Msgbox> : null }
|
|
||||||
</Form>
|
</Form>
|
||||||
)}
|
)}
|
||||||
</Formik>
|
</Formik>
|
||||||
|
|||||||
@ -1,20 +1,15 @@
|
|||||||
import React, { useState } from "react";
|
import React from "react";
|
||||||
import "bootstrap/dist/css/bootstrap.min.css";
|
import "bootstrap/dist/css/bootstrap.min.css";
|
||||||
import { Col, FormGroup, Row, Container, Label } from "reactstrap";
|
import { Col, FormGroup, Row, Container, Label } from "reactstrap";
|
||||||
import { Formik, Form } from "formik";
|
import { Formik, Form } from "formik";
|
||||||
import { Input, Submit } from "formstrap";
|
import { Input, Submit } from "formstrap";
|
||||||
import { callAPI } from "../../../actions/API";
|
import { callAPI } from "../../../actions/API";
|
||||||
import Msgbox from "../../../actions/Msgbox";
|
|
||||||
|
|
||||||
// Main form element for the UUID linking Migrations page,
|
// Main form element for the UUID linking Migrations page,
|
||||||
// Contians the PUT request to modify data from the API
|
// Contians the PUT request to modify data from the API
|
||||||
|
|
||||||
const ReportSingleMigration = ({ item }) => {
|
const ReportSingleMigration = ({ item }) => {
|
||||||
const [respID, setRespID] = useState(0);
|
|
||||||
const [error, setError] = useState(0);
|
|
||||||
|
|
||||||
const initialValues = {
|
const initialValues = {
|
||||||
migration_status: item.migration_status,
|
|
||||||
submit_time: item.submit_time,
|
submit_time: item.submit_time,
|
||||||
domain: item.domain,
|
domain: item.domain,
|
||||||
booked_date: item.booked_date,
|
booked_date: item.booked_date,
|
||||||
@ -36,11 +31,9 @@ const ReportSingleMigration = ({ item }) => {
|
|||||||
.put(`/${item.id}/`, values)
|
.put(`/${item.id}/`, values)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
console.log(JSON.stringify(response.values));
|
console.log(JSON.stringify(response.values));
|
||||||
setRespID(response.data.ticket_id);
|
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
setError(error);
|
|
||||||
});
|
});
|
||||||
setSubmitting(false);
|
setSubmitting(false);
|
||||||
};
|
};
|
||||||
@ -51,21 +44,16 @@ const ReportSingleMigration = ({ item }) => {
|
|||||||
<Row>
|
<Row>
|
||||||
<Col>
|
<Col>
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<Label for={item.migration_status}>Status</Label>
|
<Label for={item.booked_date}>Date</Label>
|
||||||
<Input
|
<Input
|
||||||
type="select"
|
type="date"
|
||||||
name="migration_status"
|
name="booked_date"
|
||||||
id="migration_status"
|
id="booked_date"
|
||||||
>
|
placeholder="date placeholder"
|
||||||
<option>Status</option>
|
mindate={Date()}
|
||||||
<option>Booked</option>
|
/>
|
||||||
<option>Waiting Termination</option>
|
|
||||||
<option>Complete</option>
|
|
||||||
<option>Cancelled</option>
|
|
||||||
</Input>
|
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
<Col>
|
<Col>
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<Label for="bookedTime">Timeslot</Label>
|
<Label for="bookedTime">Timeslot</Label>
|
||||||
@ -217,8 +205,6 @@ const ReportSingleMigration = ({ item }) => {
|
|||||||
</FormGroup>
|
</FormGroup>
|
||||||
<Submit withSpinner>Update</Submit>
|
<Submit withSpinner>Update</Submit>
|
||||||
</Container>
|
</Container>
|
||||||
{respID ? <Msgbox msg={respID}></Msgbox> : null}
|
|
||||||
{error ? <Msgbox error={error}></Msgbox> : null}
|
|
||||||
</Form>
|
</Form>
|
||||||
</Formik>
|
</Formik>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import ToolkitProvider, {
|
|||||||
const HistoricalSingle = () => {
|
const HistoricalSingle = () => {
|
||||||
const [list, setList] = useState([]);
|
const [list, setList] = useState([]);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [ticURl, setURL] = useState(null)
|
|
||||||
const { SearchBar } = Search;
|
const { SearchBar } = Search;
|
||||||
const { ExportCSVButton } = CSVExport;
|
const { ExportCSVButton } = CSVExport;
|
||||||
const sizePerPageRenderer = ({
|
const sizePerPageRenderer = ({
|
||||||
@ -46,11 +45,6 @@ const HistoricalSingle = () => {
|
|||||||
console.log(data);
|
console.log(data);
|
||||||
setList(data.data);
|
setList(data.data);
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
// Determine brand and set URL based on brand
|
|
||||||
console.log(data.data.brand)
|
|
||||||
if (data.data.brand === "VentraIP" ) {
|
|
||||||
console.log("memes")
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
@ -84,7 +78,6 @@ const HistoricalSingle = () => {
|
|||||||
],
|
],
|
||||||
sizePerPageRenderer, // A numeric array is also available. the purpose of above example is custom the text
|
sizePerPageRenderer, // A numeric array is also available. the purpose of above example is custom the text
|
||||||
};
|
};
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ dataField: "id", text: "ID", hidden: true },
|
{ dataField: "id", text: "ID", hidden: true },
|
||||||
{ dataField: "brand", text: "Brand", sort: true },
|
{ dataField: "brand", text: "Brand", sort: true },
|
||||||
@ -96,9 +89,8 @@ const HistoricalSingle = () => {
|
|||||||
formatter: (cell, row) => (
|
formatter: (cell, row) => (
|
||||||
<a
|
<a
|
||||||
href={
|
href={
|
||||||
row.brand === "VentraIP" ? "https://helpdesk.ventraip.com.au/profiles/ticket/" + row.ticket_id : null
|
"https://helpdesk.ventraip.com.au/profiles/ticket/" + row.ticket_id
|
||||||
}
|
}
|
||||||
target="_blank"
|
|
||||||
>
|
>
|
||||||
{" "}
|
{" "}
|
||||||
{cell}{" "}
|
{cell}{" "}
|
||||||
@ -106,7 +98,7 @@ const HistoricalSingle = () => {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
{ dataField: "booked_date", text: "Booked Date", sort: true },
|
{ dataField: "booked_date", text: "Booked Date", sort: true },
|
||||||
// { dataField: "booked_time", text: "Booked Time", sort: true },
|
{ dataField: "booked_time", text: "Booked Time", sort: true },
|
||||||
{ dataField: "agent_booked", text: "Agent initials", sort: true },
|
{ dataField: "agent_booked", text: "Agent initials", sort: true },
|
||||||
{
|
{
|
||||||
dataField: "domain",
|
dataField: "domain",
|
||||||
@ -120,9 +112,14 @@ const HistoricalSingle = () => {
|
|||||||
{ dataField: "original_server", text: "Original Server", sort: true },
|
{ dataField: "original_server", text: "Original Server", sort: true },
|
||||||
{ dataField: "new_server", text: "New Server", sort: true },
|
{ dataField: "new_server", text: "New Server", sort: true },
|
||||||
{ dataField: "migration_status", text: "Status", sort: true },
|
{ dataField: "migration_status", text: "Status", sort: true },
|
||||||
// { dataField: "term_date", text: "Termination Date", sort: true },
|
{ dataField: "term_date", text: "Termination Date", sort: true },
|
||||||
{ dataField: "notes", text: "Notes", sort: true },
|
{ dataField: "notes", text: "Notes", sort: true },
|
||||||
// { dataField: "submit_time", text: "Submit Time", sort: true },
|
{ dataField: "submit_time", text: "Submit Time", sort: true },
|
||||||
|
{
|
||||||
|
dataField: "report",
|
||||||
|
text: "Show Detailed Report",
|
||||||
|
formatter: (cell, row) => <a href={cell + row.id}> {cell} </a>,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user