Basic MultiJobs
This commit is contained in:
parent
91027e79af
commit
8ad5b7876c
25 changed files with 539 additions and 142 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
# The command that is executed when the run button is clicked.
|
||||||
|
run = ["echo", "run"]
|
||||||
|
|
||||||
entrypoint = "index.js"
|
entrypoint = "index.js"
|
||||||
|
|
||||||
[nix]
|
[nix]
|
|
@ -1,5 +1,5 @@
|
||||||
FROM node:16
|
FROM node:16
|
||||||
WORKDIR /dunemask/net/cairo
|
WORKDIR /dunemask/net/qualiteer
|
||||||
# Copy dependencies
|
# Copy dependencies
|
||||||
COPY package.json .
|
COPY package.json .
|
||||||
COPY package-lock.json .
|
COPY package-lock.json .
|
||||||
|
@ -8,6 +8,7 @@ RUN npm i
|
||||||
COPY public public
|
COPY public public
|
||||||
COPY src src
|
COPY src src
|
||||||
COPY lib lib
|
COPY lib lib
|
||||||
|
COPY index.html .
|
||||||
RUN npm run build:react
|
RUN npm run build:react
|
||||||
# Copy bin over
|
# Copy bin over
|
||||||
COPY bin bin
|
COPY bin bin
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
"build:react": "vite build",
|
"build:react": "vite build",
|
||||||
"start": "node dist/app.js",
|
"start": "node dist/app.js",
|
||||||
"start:dev": "nodemon dist/app.js",
|
"start:dev": "nodemon dist/app.js",
|
||||||
"start:dev:replit": "npm run start:dev & npm run start:react:replit",
|
"start:dev:replit": "npm run start:react:replit & (sleep 5 && npm run start:dev)",
|
||||||
"start:react": "vite preview",
|
"start:react": "vite preview",
|
||||||
"start:react:replit": "vite --host",
|
"start:react:replit": "vite --host",
|
||||||
"test": "node tests/index.js",
|
"test": "node tests/index.js",
|
||||||
|
|
|
@ -8,13 +8,14 @@ import Views from "./views/Views.jsx";
|
||||||
export default function Dashboard() {
|
export default function Dashboard() {
|
||||||
return (
|
return (
|
||||||
<div className="qualiteer">
|
<div className="qualiteer">
|
||||||
<JobProvider>
|
|
||||||
<StoreProvider>
|
<StoreProvider>
|
||||||
|
<JobProvider>
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<Views />
|
<Views />
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</StoreProvider>
|
|
||||||
</JobProvider>
|
</JobProvider>
|
||||||
|
</StoreProvider>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { useReducer, createContext, useMemo } from "react";
|
import React, { useReducer, createContext, useMemo } from "react";
|
||||||
|
import Initiator from "../../lib/sockets/clients/Initiator.js";
|
||||||
const JobContext = createContext();
|
const JobContext = createContext();
|
||||||
|
|
||||||
export const jobStatus = {
|
export const jobStatus = {
|
||||||
|
@ -15,32 +16,20 @@ const ACTIONS = {
|
||||||
UPDATE: "u",
|
UPDATE: "u",
|
||||||
DELETE: "d",
|
DELETE: "d",
|
||||||
};
|
};
|
||||||
/**/
|
|
||||||
const jobMock = Object.values(jobStatus).map((v, i) => ({
|
const url = "https://qualiteer.elijahparker3.repl.co/";
|
||||||
name: `Job${i + 1}`,
|
|
||||||
test: `someTestName${i + 1}`,
|
|
||||||
status: v,
|
|
||||||
exitcode: 0,
|
|
||||||
}));
|
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
jobs: jobMock,
|
jobs: [],
|
||||||
|
pipelines: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
pipelines: [{tracks:[
|
||||||
{
|
{
|
||||||
name: "Job1",
|
|
||||||
test: "someTestName",
|
|
||||||
status: JOB_STATUS.SUCCESS,
|
|
||||||
exitcode: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
OR
|
|
||||||
{
|
|
||||||
compound: true,
|
|
||||||
name: "Compound Job",
|
|
||||||
pipeline: [{}]
|
|
||||||
}
|
}
|
||||||
|
]}]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const reducer = (state, action) => {
|
const reducer = (state, action) => {
|
||||||
|
@ -55,7 +44,7 @@ const reducer = (state, action) => {
|
||||||
|
|
||||||
case ACTIONS.UPDATE:
|
case ACTIONS.UPDATE:
|
||||||
jobIndex = jobs.find((j) => j.id === (action.job.id ?? action.jobId));
|
jobIndex = jobs.find((j) => j.id === (action.job.id ?? action.jobId));
|
||||||
jobs[jobIndex] = action.job;
|
jobs[jobIndex] = { ...jobs[jobIndex], ...action.job };
|
||||||
return { ...state, jobs };
|
return { ...state, jobs };
|
||||||
|
|
||||||
case ACTIONS.DELETE:
|
case ACTIONS.DELETE:
|
||||||
|
@ -82,31 +71,68 @@ export const JobProvider = ({ children }) => {
|
||||||
console.log("Would retry all failing tests!");
|
console.log("Would retry all failing tests!");
|
||||||
}
|
}
|
||||||
|
|
||||||
function activeJobStates() {
|
|
||||||
const jobs = { state };
|
|
||||||
console.log("Would return all active job states");
|
|
||||||
}
|
|
||||||
|
|
||||||
function mockRun() {
|
|
||||||
dispatch({
|
|
||||||
job: {
|
|
||||||
name: "Job1",
|
|
||||||
test: "someTestName",
|
|
||||||
log: [],
|
|
||||||
status: jobStatus.OK,
|
|
||||||
exitcode: 0,
|
|
||||||
},
|
|
||||||
action: ACTIONS.CREATE,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function jobBuilder(tests) {
|
function jobBuilder(tests) {
|
||||||
if (!Array.isArray(tests)) throw Error("Error from within JobContext.jsx");
|
if (!Array.isArray(tests)) throw Error("Error from within JobContext.jsx");
|
||||||
console.log("Would run tests", tests);
|
console.log("Would run tests", tests);
|
||||||
|
return jobFactory({ testNames: ["single"] });
|
||||||
|
}
|
||||||
|
|
||||||
|
function pipelineFactory(builderCache) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function jobFactory(builderCache) {
|
||||||
|
// Find test
|
||||||
|
const i = new Initiator(url);
|
||||||
|
const jobId = `j${Date.now()}`;
|
||||||
|
const job = {
|
||||||
|
name: jobId,
|
||||||
|
status: jobStatus.PENDING,
|
||||||
|
jobId,
|
||||||
|
isPipeline: false,
|
||||||
|
builderCache,
|
||||||
|
};
|
||||||
|
|
||||||
|
const request = {
|
||||||
|
testName: builderCache.testNames[0],
|
||||||
|
image: "node",
|
||||||
|
type: "single",
|
||||||
|
name: jobId,
|
||||||
|
};
|
||||||
|
|
||||||
|
jobCreate(job);
|
||||||
|
|
||||||
|
const onLog = (d) => {
|
||||||
|
const job = state.jobs.find((j) => j.jobId === jobId);
|
||||||
|
job.log.push(d);
|
||||||
|
job.status = jobStatus.ACTIVE;
|
||||||
|
jobUpdate({ ...job }, jobId);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onClose = (c) => {
|
||||||
|
const job = state.jobs.find((j) => j.jobId === jobId);
|
||||||
|
job.exitcode = c;
|
||||||
|
job.status = c === 0 ? jobStatus.OK : jobStatus.ERROR;
|
||||||
|
jobUpdate({ ...job }, jobId);
|
||||||
|
};
|
||||||
|
|
||||||
|
const started = i.newJob(request, onLog, onClose);
|
||||||
|
started.then(() => jobUpdate({ status: jobStatus.ACTIVE }, jobId));
|
||||||
|
|
||||||
|
/*const job = {
|
||||||
|
type: "compound",
|
||||||
|
testName: "primary",
|
||||||
|
pipelineTriggers: "secondary",
|
||||||
|
name: "testing",
|
||||||
|
image: "node",
|
||||||
|
};*/
|
||||||
|
return jobId;
|
||||||
}
|
}
|
||||||
|
|
||||||
function retrySingle(test) {
|
function retrySingle(test) {
|
||||||
console.log("Would retry test", test);
|
console.log("Would retry test", test);
|
||||||
|
return jobFactory({ testNames: ["single"] });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const context = {
|
const context = {
|
||||||
|
@ -118,7 +144,7 @@ export const JobProvider = ({ children }) => {
|
||||||
retryAll,
|
retryAll,
|
||||||
retrySingle,
|
retrySingle,
|
||||||
jobBuilder,
|
jobBuilder,
|
||||||
activeJobStates,
|
jobFactory,
|
||||||
};
|
};
|
||||||
const contextValue = useMemo(() => context, [state, dispatch]);
|
const contextValue = useMemo(() => context, [state, dispatch]);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import React, { useReducer, createContext, useMemo } from "react";
|
import React, { useReducer, createContext, useMemo } from "react";
|
||||||
import { jobStatus } from "./JobContext.jsx";
|
|
||||||
|
|
||||||
const StoreContext = createContext();
|
const StoreContext = createContext();
|
||||||
|
|
||||||
|
@ -7,6 +6,11 @@ const ACTIONS = {
|
||||||
UPDATE: "u",
|
UPDATE: "u",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const pipelineMappingsMock = [["primary", "secondary1","tertiary1"],
|
||||||
|
["primary", "secondary1", "tertiary2"],
|
||||||
|
["primary", "secondary2", "tertiary3"]];
|
||||||
|
|
||||||
const silencedMock = new Array(10).fill(0).map((v, i) => ({
|
const silencedMock = new Array(10).fill(0).map((v, i) => ({
|
||||||
name: `Test${i + 1}`,
|
name: `Test${i + 1}`,
|
||||||
class: `SomeTestClass${i % 2 ? i - 1 : i / 2}`,
|
class: `SomeTestClass${i % 2 ? i - 1 : i / 2}`,
|
||||||
|
@ -39,36 +43,58 @@ const failingMock = new Array(12).fill(0).map((v, i) => ({
|
||||||
jobStatus: (() => {
|
jobStatus: (() => {
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 1:
|
case 1:
|
||||||
return jobStatus.OK;
|
return "o";
|
||||||
case 3:
|
case 3:
|
||||||
return jobStatus.ERROR;
|
return "e";
|
||||||
case 4:
|
case 4:
|
||||||
return jobStatus.PENDING;
|
return "p";
|
||||||
case 5:
|
case 5:
|
||||||
return jobStatus.ACTIVE;
|
return "a";
|
||||||
case 6:
|
case 6:
|
||||||
return jobStatus.CANCELED;
|
return "c";
|
||||||
case 8:
|
case 8:
|
||||||
return jobStatus.QUEUED;
|
return "q";
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
})(),
|
})(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const localStorage = {setItem: ()=>{}, getItem: ()=>{}};
|
||||||
|
|
||||||
|
const localSettings = localStorage.getItem("settings");
|
||||||
|
const defaultSettings = {
|
||||||
|
focusJob: true,
|
||||||
|
simplifiedControls: true,
|
||||||
|
logAppDetails: true,
|
||||||
|
defaultRegion: "us",
|
||||||
|
defaultPage: "failing",
|
||||||
|
};
|
||||||
|
|
||||||
|
const settings = localSettings ? JSON.parse(localSettings) : defaultSettings;
|
||||||
|
const settingsKeys = Object.keys(defaultSettings);
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
pages: ["failing", "alerting", "jobs", "catalog", "settings", "about"],
|
pages: ["failing", "alerting", "jobs", "catalog", "settings", "about"],
|
||||||
intervals: [],
|
intervals: [],
|
||||||
catalog: catalogMock,
|
catalog: catalogMock,
|
||||||
failing: failingMock,
|
failing: failingMock,
|
||||||
silenced: silencedMock,
|
silenced: silencedMock,
|
||||||
|
pipelineMappings: pipelineMappingsMock,
|
||||||
regions: [],
|
regions: [],
|
||||||
catalogSearch: "",
|
catalogSearch: "",
|
||||||
focusJob: false,
|
...settings,
|
||||||
simplifiedControls: true,
|
};
|
||||||
logAppDetails: true,
|
|
||||||
defaultRegion: "us", // Local Store
|
const settingsUpdater = (oldState, storeUpdate) => {
|
||||||
defaultPage: "failing", // Local Store
|
const settingsToUpdate = {};
|
||||||
|
for (var k of settingsKeys) {
|
||||||
|
settingsToUpdate[k] = oldState[k];
|
||||||
|
if (storeUpdate[k] === undefined) continue;
|
||||||
|
settingsToUpdate[k] = storeUpdate[k];
|
||||||
|
}
|
||||||
|
|
||||||
|
localStorage.setItem("settings", JSON.stringify(settingsToUpdate));
|
||||||
};
|
};
|
||||||
|
|
||||||
const reducer = (state, action) => {
|
const reducer = (state, action) => {
|
||||||
|
@ -76,6 +102,7 @@ const reducer = (state, action) => {
|
||||||
// Actions
|
// Actions
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case ACTIONS.UPDATE:
|
case ACTIONS.UPDATE:
|
||||||
|
settingsUpdater(state, store);
|
||||||
return { ...state, ...store };
|
return { ...state, ...store };
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
|
|
|
@ -29,7 +29,6 @@ const drawerWidth = 250;
|
||||||
export default function Navbar(props) {
|
export default function Navbar(props) {
|
||||||
const { state: jobState } = useContext(JobContext);
|
const { state: jobState } = useContext(JobContext);
|
||||||
const { state: store } = useContext(StoreContext);
|
const { state: store } = useContext(StoreContext);
|
||||||
const { inModal } = props;
|
|
||||||
const pages = store.pages;
|
const pages = store.pages;
|
||||||
const icons = [
|
const icons = [
|
||||||
<Badge badgeContent={store.failing.length} color="error">
|
<Badge badgeContent={store.failing.length} color="error">
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
|
import { useContext } from "react";
|
||||||
import { Routes, Route, Navigate } from "react-router-dom";
|
import { Routes, Route, Navigate } from "react-router-dom";
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
import Toolbar from "@mui/material/Toolbar";
|
import Toolbar from "@mui/material/Toolbar";
|
||||||
|
import StoreContext from "../ctx/StoreContext.jsx";
|
||||||
// Import Navbar
|
// Import Navbar
|
||||||
import Navbar from "./Navbar.jsx";
|
import Navbar from "./Navbar.jsx";
|
||||||
// Import Pages
|
// Import Pages
|
||||||
|
@ -14,6 +15,7 @@ import About from "./about/About.jsx";
|
||||||
import NotFound from "./NotFound.jsx";
|
import NotFound from "./NotFound.jsx";
|
||||||
|
|
||||||
export default function Views() {
|
export default function Views() {
|
||||||
|
const { state: store } = useContext(StoreContext);
|
||||||
return (
|
return (
|
||||||
<div className="view">
|
<div className="view">
|
||||||
<Navbar />
|
<Navbar />
|
||||||
|
@ -24,7 +26,9 @@ export default function Views() {
|
||||||
<Route
|
<Route
|
||||||
exact
|
exact
|
||||||
path="/qualiteer/"
|
path="/qualiteer/"
|
||||||
element={<Navigate to="/qualiteer/failing" replace />}
|
element={
|
||||||
|
<Navigate to={`/qualiteer/${store.defaultPage}`} replace />
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
exact
|
exact
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { useState, useContext } from "react";
|
import React, { useState, useContext } from "react";
|
||||||
|
import {useNavigate} from "react-router-dom";
|
||||||
import StoreContext from "../../ctx/StoreContext.jsx";
|
import StoreContext from "../../ctx/StoreContext.jsx";
|
||||||
import JobContext from "../../ctx/JobContext.jsx";
|
import JobContext from "../../ctx/JobContext.jsx";
|
||||||
|
|
||||||
|
@ -24,6 +25,8 @@ export default function CatalogBox(props) {
|
||||||
type: testType,
|
type: testType,
|
||||||
} = catalogTest;
|
} = catalogTest;
|
||||||
|
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const { state: store, updateStore } = useContext(StoreContext);
|
const { state: store, updateStore } = useContext(StoreContext);
|
||||||
|
|
||||||
const { state: jobState, jobBuilder } = useContext(JobContext);
|
const { state: jobState, jobBuilder } = useContext(JobContext);
|
||||||
|
@ -35,7 +38,8 @@ export default function CatalogBox(props) {
|
||||||
const runTest = (e) => {
|
const runTest = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
jobBuilder([catalogTest]);
|
const jobId = jobBuilder([catalogTest]);
|
||||||
|
if(store.focusJob) navigate(`/qualiteer/jobs#${jobId}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
function Actions() {
|
function Actions() {
|
||||||
|
|
|
@ -18,7 +18,7 @@ import DialogTitle from "@mui/material/DialogTitle";
|
||||||
import ReplayIcon from "@mui/icons-material/Replay";
|
import ReplayIcon from "@mui/icons-material/Replay";
|
||||||
|
|
||||||
export default function Failing() {
|
export default function Failing() {
|
||||||
const { state: jobState, retryAll, activeJobStates } = useContext(JobContext);
|
const { state: jobState, retryAll } = useContext(JobContext);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
state: store,
|
state: store,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { useState, useContext } from "react";
|
import React, { useState, useContext } from "react";
|
||||||
|
import {useNavigate} from "react-router-dom";
|
||||||
import StoreContext from "../../ctx/StoreContext.jsx";
|
import StoreContext from "../../ctx/StoreContext.jsx";
|
||||||
import JobContext, { jobStatus } from "../../ctx/JobContext.jsx";
|
import JobContext, { jobStatus } from "../../ctx/JobContext.jsx";
|
||||||
|
|
||||||
|
@ -35,7 +36,6 @@ const stopPropagation = (e) => e.stopPropagation() && e.preventDefault();
|
||||||
|
|
||||||
export default function FailingBox(props) {
|
export default function FailingBox(props) {
|
||||||
const { failingTest, silenceClick } = props;
|
const { failingTest, silenceClick } = props;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
class: testClass,
|
class: testClass,
|
||||||
name: testName,
|
name: testName,
|
||||||
|
@ -50,6 +50,8 @@ export default function FailingBox(props) {
|
||||||
jobStatus: testJobStatus,
|
jobStatus: testJobStatus,
|
||||||
} = failingTest;
|
} = failingTest;
|
||||||
|
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const { state: jobState, retrySingle } = useContext(JobContext);
|
const { state: jobState, retrySingle } = useContext(JobContext);
|
||||||
|
|
||||||
const { state: store, updateStore, removeFailure } = useContext(StoreContext);
|
const { state: store, updateStore, removeFailure } = useContext(StoreContext);
|
||||||
|
@ -74,7 +76,10 @@ export default function FailingBox(props) {
|
||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
|
|
||||||
const retryTest = () => retrySingle(failingTest);
|
const retryTest = () => {
|
||||||
|
const jobId = retrySingle(failingTest);
|
||||||
|
if(store.focusJob) navigate(`/qualiteer/jobs#${jobId}`);
|
||||||
|
}
|
||||||
|
|
||||||
const jobOnClick = () => {
|
const jobOnClick = () => {
|
||||||
switch (testJobStatus) {
|
switch (testJobStatus) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { useContext, useState, useEffect } from "react";
|
import React from "react";
|
||||||
import JobContext from "../../ctx/JobContext.jsx";
|
import { jobStatus } from "../../ctx/JobContext.jsx";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
|
@ -7,7 +7,7 @@ import Skeleton from "@mui/material/Skeleton";
|
||||||
import Stack from "@mui/material/Stack";
|
import Stack from "@mui/material/Stack";
|
||||||
|
|
||||||
export default function JobLogView(props) {
|
export default function JobLogView(props) {
|
||||||
const { log } = props;
|
const { log, status } = props;
|
||||||
|
|
||||||
const LoadingDot = () => (
|
const LoadingDot = () => (
|
||||||
<Skeleton
|
<Skeleton
|
||||||
|
@ -58,9 +58,22 @@ export default function JobLogView(props) {
|
||||||
</Box>
|
</Box>
|
||||||
))}
|
))}
|
||||||
<Stack direction="row" spacing={1} sx={{ mt: ".5rem", ml: "0.75rem" }}>
|
<Stack direction="row" spacing={1} sx={{ mt: ".5rem", ml: "0.75rem" }}>
|
||||||
|
{status === jobStatus.PENDING && (
|
||||||
|
<Typography
|
||||||
|
variant="body2"
|
||||||
|
component="div"
|
||||||
|
sx={{ display: "flex", overflowWrap: "anywhere" }}
|
||||||
|
>
|
||||||
|
Waiting for Executor...
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
|
{(status === jobStatus.ACTIVE || status === jobStatus.PENDING) && (
|
||||||
|
<React.Fragment>
|
||||||
<LoadingDot />
|
<LoadingDot />
|
||||||
<LoadingDot />
|
<LoadingDot />
|
||||||
<LoadingDot />
|
<LoadingDot />
|
||||||
|
</React.Fragment>
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,34 +1,67 @@
|
||||||
import React, { useContext, useState, useEffect } from "react";
|
import React, { useContext, useState, useEffect } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import JobContext from "../../ctx/JobContext.jsx";
|
import JobContext, { jobStatus } from "../../ctx/JobContext.jsx";
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
import AppBar from "@mui/material/AppBar";
|
import AppBar from "@mui/material/AppBar";
|
||||||
import Toolbar from "@mui/material/Toolbar";
|
import Toolbar from "@mui/material/Toolbar";
|
||||||
import Button from "@mui/material/Button";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
|
import Menu from "@mui/material/Menu";
|
||||||
|
import MenuItem from "@mui/material/MenuItem";
|
||||||
|
|
||||||
import JobLogView from "./JobLogView.jsx";
|
import JobLogView from "./JobLogView.jsx";
|
||||||
|
import ListItemText from "@mui/material/ListItemText";
|
||||||
|
import ListItemIcon from "@mui/material/ListItemIcon";
|
||||||
|
import MoreVertIcon from "@mui/icons-material/MoreVert";
|
||||||
|
import DownloadIcon from "@mui/icons-material/Download";
|
||||||
|
import ReplayIcon from "@mui/icons-material/Replay";
|
||||||
|
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
|
||||||
|
|
||||||
export default function JobView(props) {
|
export default function JobView(props) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { state: jobState } = useContext(JobContext);
|
const { job } = props;
|
||||||
const { job: initJob } = props;
|
const { jobFactory } = useContext(JobContext);
|
||||||
const [job, setJob] = useState({ log: [initJob.name] });
|
|
||||||
|
|
||||||
function retryJob() {}
|
const [anchorEl, setAnchorEl] = React.useState(null);
|
||||||
|
const open = Boolean(anchorEl);
|
||||||
|
const handleClick = (event) => {
|
||||||
|
setAnchorEl(event.currentTarget);
|
||||||
|
};
|
||||||
|
const handleClose = () => {
|
||||||
|
setAnchorEl(null);
|
||||||
|
};
|
||||||
|
|
||||||
function downloadLog() {}
|
function download(filename, text) {
|
||||||
|
var element = document.createElement("a");
|
||||||
|
element.setAttribute(
|
||||||
|
"href",
|
||||||
|
"data:text/plain;charset=utf-8," + encodeURIComponent(text)
|
||||||
|
);
|
||||||
|
element.setAttribute("download", filename);
|
||||||
|
element.style.display = "none";
|
||||||
|
document.body.appendChild(element);
|
||||||
|
element.click();
|
||||||
|
document.body.removeChild(element);
|
||||||
|
}
|
||||||
|
|
||||||
|
function retryJob() {
|
||||||
|
jobFactory(job.builderCache);
|
||||||
|
}
|
||||||
|
|
||||||
|
function downloadLog() {
|
||||||
|
if (job.status === jobStatus.PENDING) return;
|
||||||
|
download(`${job.jobId}.txt`, job.log.join("\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
const menuSelect = (cb) => () => {
|
||||||
|
handleClose();
|
||||||
|
cb();
|
||||||
|
};
|
||||||
|
|
||||||
function navigateToJobs() {
|
function navigateToJobs() {
|
||||||
navigate("/qualiteer/jobs");
|
navigate("/qualiteer/jobs");
|
||||||
}
|
}
|
||||||
|
|
||||||
function onLog(d) {
|
|
||||||
const j = { ...job };
|
|
||||||
j.log.push(d);
|
|
||||||
setJob(j);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<AppBar
|
<AppBar
|
||||||
|
@ -42,28 +75,34 @@ export default function JobView(props) {
|
||||||
<Toolbar disableGutters />
|
<Toolbar disableGutters />
|
||||||
<Box sx={{ flexGrow: 1, margin: "0 10px" }}>
|
<Box sx={{ flexGrow: 1, margin: "0 10px" }}>
|
||||||
<Toolbar disableGutters>
|
<Toolbar disableGutters>
|
||||||
<Button onClick={navigateToJobs}>Back</Button>
|
<IconButton onClick={navigateToJobs}>
|
||||||
|
<ArrowBackIcon />
|
||||||
|
</IconButton>
|
||||||
<Typography variant="h6" sx={{ ml: "auto", mr: "auto" }}>
|
<Typography variant="h6" sx={{ ml: "auto", mr: "auto" }}>
|
||||||
{initJob.name}
|
{job.name}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button onClick={downloadLog}>Log</Button>
|
<IconButton onClick={handleClick}>
|
||||||
<Button onClick={retryJob}>Retry</Button>
|
<MoreVertIcon />
|
||||||
|
</IconButton>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
</Box>
|
</Box>
|
||||||
</AppBar>
|
</AppBar>
|
||||||
<Toolbar disableGutters />
|
<Toolbar disableGutters />
|
||||||
<button
|
<JobLogView log={job.log} status={job.status} />
|
||||||
onClick={() => {
|
<Menu anchorEl={anchorEl} open={open} onClose={handleClose}>
|
||||||
const itvrl = setInterval(() => {
|
<MenuItem onClick={menuSelect(retryJob)}>
|
||||||
onLog(Date.now());
|
<ListItemIcon>
|
||||||
}, 100);
|
<ReplayIcon fontSize="small" />
|
||||||
setTimeout(() => clearInterval(itvrl), 5000);
|
</ListItemIcon>
|
||||||
}}
|
<ListItemText>Retry</ListItemText>
|
||||||
>
|
</MenuItem>
|
||||||
Hello{" "}
|
<MenuItem onClick={menuSelect(downloadLog)}>
|
||||||
</button>
|
<ListItemIcon>
|
||||||
|
<DownloadIcon fontSize="small" />
|
||||||
<JobLogView log={job.log} />
|
</ListItemIcon>
|
||||||
|
<ListItemText>Download Log</ListItemText>
|
||||||
|
</MenuItem>
|
||||||
|
</Menu>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,21 @@
|
||||||
import { useState, useContext, useEffect } from "react";
|
import { useState, useContext, useEffect } from "react";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
import JobContext from "../../ctx/JobContext.jsx";
|
import JobContext from "../../ctx/JobContext.jsx";
|
||||||
import JobBox from "./JobBox.jsx";
|
import JobBox from "./JobBox.jsx";
|
||||||
import JobTestSelector from "./JobTestSelector.jsx";
|
|
||||||
import JobView from "./JobView.jsx";
|
import JobView from "./JobView.jsx";
|
||||||
import JobBuilder from "./builder/JobBuilder.jsx";
|
import JobBuilder from "./builder/JobBuilder.jsx";
|
||||||
|
|
||||||
export default function Jobs() {
|
export default function Jobs() {
|
||||||
const {
|
const { state: jobState } = useContext(JobContext);
|
||||||
state: jobState,
|
|
||||||
dispatch: jobDispatch,
|
|
||||||
jobBuilder,
|
|
||||||
} = useContext(JobContext);
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const jobName = location.hash.slice(1);
|
||||||
|
if (!jobName || jobState.jobs.find((job) => job.name === jobName)) return;
|
||||||
|
navigate("/qualiteer/jobs");
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="jobs">
|
<div className="jobs">
|
||||||
|
|
25
src/views/jobs/builder/GroupConfirm.jsx
Normal file
25
src/views/jobs/builder/GroupConfirm.jsx
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import React from "react";
|
||||||
|
import Button from "@mui/material/Button";
|
||||||
|
import DialogActions from "@mui/material/DialogActions";
|
||||||
|
import DialogContent from "@mui/material/DialogContent";
|
||||||
|
|
||||||
|
function GroupConfirm(props) {
|
||||||
|
const { cache, setCache, back, start } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
<DialogContent>
|
||||||
|
<h3>Confirm group?</h3>
|
||||||
|
{JSON.stringify(cache)}
|
||||||
|
</DialogContent>
|
||||||
|
<DialogActions>
|
||||||
|
<Button onClick={back}>Back</Button>
|
||||||
|
<Button onClick={start} autoFocus>
|
||||||
|
Start
|
||||||
|
</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default GroupConfirm;
|
30
src/views/jobs/builder/GroupSelector.jsx
Normal file
30
src/views/jobs/builder/GroupSelector.jsx
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
import React from "react";
|
||||||
|
import Button from "@mui/material/Button";
|
||||||
|
import DialogActions from "@mui/material/DialogActions";
|
||||||
|
import DialogContent from "@mui/material/DialogContent";
|
||||||
|
|
||||||
|
function GroupSelector(props) {
|
||||||
|
const { cache, setCache, cancel, next } = props;
|
||||||
|
function makeReq() {
|
||||||
|
setCache({
|
||||||
|
testNames: ["single"],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
<DialogContent>
|
||||||
|
{JSON.stringify(cache)}
|
||||||
|
<button onClick={makeReq}>Clickme</button>
|
||||||
|
</DialogContent>
|
||||||
|
<DialogActions>
|
||||||
|
<Button onClick={cancel}>Cancel</Button>
|
||||||
|
<Button onClick={next} autoFocus>
|
||||||
|
Next
|
||||||
|
</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default GroupSelector;
|
25
src/views/jobs/builder/IndividualConfirm.jsx
Normal file
25
src/views/jobs/builder/IndividualConfirm.jsx
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import React from "react";
|
||||||
|
import Button from "@mui/material/Button";
|
||||||
|
import DialogActions from "@mui/material/DialogActions";
|
||||||
|
import DialogContent from "@mui/material/DialogContent";
|
||||||
|
|
||||||
|
function IndividualConfirm(props) {
|
||||||
|
const { cache, setCache, back, start } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
<DialogContent>
|
||||||
|
<h3>Individual Confirm?</h3>
|
||||||
|
{JSON.stringify(cache)}
|
||||||
|
</DialogContent>
|
||||||
|
<DialogActions>
|
||||||
|
<Button onClick={back}>Back</Button>
|
||||||
|
<Button onClick={start} autoFocus>
|
||||||
|
Start
|
||||||
|
</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default IndividualConfirm;
|
31
src/views/jobs/builder/IndividualSelector.jsx
Normal file
31
src/views/jobs/builder/IndividualSelector.jsx
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
import React from "react";
|
||||||
|
import Button from "@mui/material/Button";
|
||||||
|
import DialogActions from "@mui/material/DialogActions";
|
||||||
|
import DialogContent from "@mui/material/DialogContent";
|
||||||
|
|
||||||
|
function IndividualSelector(props) {
|
||||||
|
const { cache, setCache, cancel, next } = props;
|
||||||
|
function makeReq() {
|
||||||
|
setCache({
|
||||||
|
testNames: ["failing"],
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
<DialogContent>
|
||||||
|
{JSON.stringify(cache)}
|
||||||
|
<button onClick={makeReq}>Clickme</button>
|
||||||
|
</DialogContent>
|
||||||
|
<DialogActions>
|
||||||
|
<Button onClick={cancel}>Cancel</Button>
|
||||||
|
<Button onClick={next} autoFocus>
|
||||||
|
Next
|
||||||
|
</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default IndividualSelector;
|
|
@ -1,11 +1,9 @@
|
||||||
import React, { useContext, useState, useEffect } from "react";
|
import React, { useContext, useState, useEffect } from "react";
|
||||||
|
import {useNavigate} from "react-router-dom";
|
||||||
import StoreContext from "../../../ctx/StoreContext.jsx";
|
import StoreContext from "../../../ctx/StoreContext.jsx";
|
||||||
|
import JobContext from "../../../ctx/JobContext.jsx";
|
||||||
|
|
||||||
import Button from "@mui/material/Button";
|
|
||||||
import Dialog from "@mui/material/Dialog";
|
import Dialog from "@mui/material/Dialog";
|
||||||
import DialogActions from "@mui/material/DialogActions";
|
|
||||||
import DialogContent from "@mui/material/DialogContent";
|
|
||||||
import Toolbar from "@mui/material/Toolbar";
|
import Toolbar from "@mui/material/Toolbar";
|
||||||
import DialogTitle from "@mui/material/DialogTitle";
|
import DialogTitle from "@mui/material/DialogTitle";
|
||||||
|
|
||||||
|
@ -18,9 +16,22 @@ import PageviewIcon from "@mui/icons-material/Pageview";
|
||||||
import ViewColumnIcon from "@mui/icons-material/ViewColumn";
|
import ViewColumnIcon from "@mui/icons-material/ViewColumn";
|
||||||
import ViewCarouselIcon from "@mui/icons-material/ViewCarousel";
|
import ViewCarouselIcon from "@mui/icons-material/ViewCarousel";
|
||||||
|
|
||||||
export default function JobBuilder(props) {
|
import IndividualSelector from "./IndividualSelector.jsx";
|
||||||
const { state: store, updateStore } = useContext(StoreContext);
|
import IndividualConfirm from "./IndividualConfirm.jsx";
|
||||||
|
|
||||||
|
import GroupSelector from "./GroupSelector.jsx";
|
||||||
|
import GroupConfirm from "./GroupConfirm.jsx";
|
||||||
|
|
||||||
|
import PipelineSelector from "./PipelineSelector.jsx";
|
||||||
|
import PipelineTrackSelector from "./PipelineTrackSelector.jsx";
|
||||||
|
import PipelineConfirm from "./PipelineConfirm.jsx";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export default function JobBuilder() {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const { state: store } = useContext(StoreContext);
|
||||||
|
const { jobFactory } = useContext(JobContext);
|
||||||
const [quickOpen, setQuickOpen] = useState(false);
|
const [quickOpen, setQuickOpen] = useState(false);
|
||||||
const [jobDialogOpen, setJobDialogOpen] = useState(false);
|
const [jobDialogOpen, setJobDialogOpen] = useState(false);
|
||||||
|
|
||||||
|
@ -28,39 +39,51 @@ export default function JobBuilder(props) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if (!store.simplifiedControls) return setQuickOpen(!quickOpen);
|
if (!store.simplifiedControls) return setQuickOpen(!quickOpen);
|
||||||
|
setBuilderPage("individualSelect");
|
||||||
setJobDialogOpen(true);
|
setJobDialogOpen(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const quickOpenClose = () => setQuickOpen(false);
|
const quickOpenClose = () => setQuickOpen(false);
|
||||||
const handleClickOpen = () => setJobDialogOpen(true);
|
const handleClickOpen = (page)=> () =>{
|
||||||
|
setBuilderPage(page);
|
||||||
|
setJobDialogOpen(true);
|
||||||
|
}
|
||||||
|
const [builderPage, setBuilderPage] = useState();
|
||||||
const [cache, setCache] = useState({});
|
const [cache, setCache] = useState({});
|
||||||
|
|
||||||
const handleClose = (confirmed) => () => {
|
const handleClose = (confirmed) => () => {
|
||||||
setJobDialogOpen(false);
|
setJobDialogOpen(false);
|
||||||
if (!confirmed) return;
|
if (!confirmed) return;
|
||||||
jobBuilder(cache);
|
const jobId = jobFactory(cache);
|
||||||
|
if(store.focusJob)
|
||||||
|
navigate(`/qualiteer/jobs#${jobId}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Pull info from url if possible?
|
// Pull info from url if possible?
|
||||||
const actions = [
|
const actions = [
|
||||||
{ name: "Suite", icon: <ViewCarouselIcon /> },
|
{ name: "Suite", icon: <ViewCarouselIcon />, page: "groupSelect" },
|
||||||
{ name: "Compound", icon: <ViewColumnIcon /> },
|
{ name: "Compound", icon: <ViewColumnIcon />, page: "pipelineSelect" },
|
||||||
{ name: "Manual", icon: <PageviewIcon /> },
|
{ name: "Manual", icon: <PageviewIcon />, page: "individualSelect" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const changePage = (page) => () => setBuilderPage(page);
|
||||||
|
|
||||||
|
const pages = {
|
||||||
|
individualSelect: <IndividualSelector cache={cache} setCache={setCache} cancel={handleClose()} next={changePage("individualConfirm")}/>,
|
||||||
|
individualConfirm: <IndividualConfirm cache={cache} setCache={setCache} back={changePage("individualSelect")} start={handleClose(true)}/>,
|
||||||
|
groupSelect: <GroupSelector cache={cache} setCache={setCache} cancel={handleClose()} next={changePage("groupConfirm")}/>,
|
||||||
|
groupConfirm: <GroupConfirm cache={cache} setCache={setCache} back={changePage("groupSelect")} start={handleClose(true)}/>,
|
||||||
|
pipelineSelect: <PipelineSelector cache={cache} setCache={setCache} cancel={handleClose()} next={changePage("pipelineTrackSelect")}/>,
|
||||||
|
pipelineTrackSelect: <PipelineTrackSelector cache={cache} setCache={setCache} back={changePage("pipelineSelect")} next={changePage("pipelineConfirm")}/>,
|
||||||
|
pipelineConfirm: <PipelineConfirm cache={cache} back={changePage("pipelineTrackSelect")} next={handleClose(true)}/>
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Dialog open={jobDialogOpen} onClose={handleClose()} fullScreen>
|
<Dialog open={jobDialogOpen} onClose={handleClose()} fullScreen>
|
||||||
<Toolbar />
|
<Toolbar />
|
||||||
<DialogTitle>New Job</DialogTitle>
|
<DialogTitle>New Job</DialogTitle>
|
||||||
<DialogContent></DialogContent>
|
{pages[builderPage]}
|
||||||
<DialogActions>
|
|
||||||
<Button onClick={handleClose()}>Cancel</Button>
|
|
||||||
<Button onClick={handleClose(true)} autoFocus>
|
|
||||||
Start
|
|
||||||
</Button>
|
|
||||||
</DialogActions>
|
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
<ClickAwayListener onClickAway={quickOpenClose}>
|
<ClickAwayListener onClickAway={quickOpenClose}>
|
||||||
|
@ -76,7 +99,7 @@ export default function JobBuilder(props) {
|
||||||
key={action.name}
|
key={action.name}
|
||||||
icon={action.icon}
|
icon={action.icon}
|
||||||
tooltipTitle={action.name}
|
tooltipTitle={action.name}
|
||||||
onClick={handleClickOpen}
|
onClick={handleClickOpen(action.page)}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</SpeedDial>
|
</SpeedDial>
|
||||||
|
|
26
src/views/jobs/builder/PipelineConfirm.jsx
Normal file
26
src/views/jobs/builder/PipelineConfirm.jsx
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
import React from "react";
|
||||||
|
import Button from "@mui/material/Button";
|
||||||
|
import DialogActions from "@mui/material/DialogActions";
|
||||||
|
import DialogContent from "@mui/material/DialogContent";
|
||||||
|
|
||||||
|
function PipelineConfirm(props) {
|
||||||
|
const { cache, back, start } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
<DialogContent>
|
||||||
|
<h3>Pipeline Confirm</h3>
|
||||||
|
{JSON.stringify(cache)}
|
||||||
|
|
||||||
|
</DialogContent>
|
||||||
|
<DialogActions>
|
||||||
|
<Button onClick={back}>Back</Button>
|
||||||
|
<Button onClick={start} autoFocus>
|
||||||
|
Start
|
||||||
|
</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PipelineConfirm;
|
91
src/views/jobs/builder/PipelineSelector.jsx
Normal file
91
src/views/jobs/builder/PipelineSelector.jsx
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
import React, {useContext} from "react";
|
||||||
|
import StoreContext from "../../../ctx/StoreContext.jsx";
|
||||||
|
|
||||||
|
import Button from "@mui/material/Button";
|
||||||
|
import DialogActions from "@mui/material/DialogActions";
|
||||||
|
import DialogContent from "@mui/material/DialogContent";
|
||||||
|
|
||||||
|
import Accordion from "@mui/material/Accordion";
|
||||||
|
import AccordionDetails from "@mui/material/AccordionDetails";
|
||||||
|
import AccordionSummary from "@mui/material/AccordionSummary";
|
||||||
|
import Typography from "@mui/material/Typography";
|
||||||
|
import Stack from "@mui/material/Stack";
|
||||||
|
|
||||||
|
function PipelineSelector(props){
|
||||||
|
const {cache, setCache, cancel, next} = props;
|
||||||
|
const {state: store} = useContext(StoreContext);
|
||||||
|
const { pipelineMappings } = store;
|
||||||
|
const primaryMappings = {};
|
||||||
|
for(var pm of pipelineMappings){
|
||||||
|
if(!(pm[0] in primaryMappings)) primaryMappings[pm[0]] = [];
|
||||||
|
primaryMappings[pm[0]].push(pm);
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectPrimary = (primarySelectedMappings) => ()=>{
|
||||||
|
setCache({primarySelectedMappings});
|
||||||
|
};
|
||||||
|
|
||||||
|
return( <React.Fragment>
|
||||||
|
<DialogContent>
|
||||||
|
{Object.keys(primaryMappings).map((k, i)=>( <Accordion expanded={false} disableGutters={true} square key={i} onClick={selectPrimary(primaryMappings[k])}>
|
||||||
|
<AccordionSummary
|
||||||
|
style={{
|
||||||
|
backgroundColor: "rgba(0, 0, 0, .03)",
|
||||||
|
flexWrap: "wrap",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
component={"span"}
|
||||||
|
style={{ wordBreak: "break-word", margin: "auto 0" }}
|
||||||
|
>
|
||||||
|
{k}
|
||||||
|
</Typography>
|
||||||
|
<Stack sx={{ ml: "auto" }}>
|
||||||
|
{primaryMappings[k].length}
|
||||||
|
</Stack>
|
||||||
|
</AccordionSummary>
|
||||||
|
</Accordion>))}
|
||||||
|
</DialogContent>
|
||||||
|
<DialogActions>
|
||||||
|
<Button onClick={cancel}>Cancel</Button>
|
||||||
|
<Button onClick={next} autoFocus>
|
||||||
|
Next
|
||||||
|
</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</React.Fragment>)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
export default PipelineSelector;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Server -> pipeMappings
|
||||||
|
[["primary", "secondary1", "tertiary1"], ["primary", "secondary2", "tertiary3"]]
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
const primaryMappings = pipeMappings.filter((m)=>m[0] === "primary"); // Select Page
|
||||||
|
|
||||||
|
const displayTracks = [];
|
||||||
|
// Track Select Page
|
||||||
|
for(var pm of primaryMappings){
|
||||||
|
for(var i=0;i<pm.length;i++){
|
||||||
|
if(!displayTracks[i]) displayTracks[i] = [];
|
||||||
|
if(!displayTracks[i].includes(pm[i])) continue;
|
||||||
|
|
||||||
|
displayTracks[i].push(pm[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
primaryMappings.forEach((pm)=>{
|
||||||
|
|
||||||
|
})
|
||||||
|
*/
|
||||||
|
/* Cache:
|
||||||
|
{
|
||||||
|
testTree: [["primary"],["secondary1", "secondary2"], ["tertiary1", "tertiary3"]]
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
tracks: [["primary", "secondary1", "tertiary1"], ["primary", "secondary2", "tertiary3"]]
|
||||||
|
*/
|
||||||
|
/**/
|
25
src/views/jobs/builder/PipelineTrackSelector.jsx
Normal file
25
src/views/jobs/builder/PipelineTrackSelector.jsx
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import React from "react";
|
||||||
|
import Button from "@mui/material/Button";
|
||||||
|
import DialogActions from "@mui/material/DialogActions";
|
||||||
|
import DialogContent from "@mui/material/DialogContent";
|
||||||
|
|
||||||
|
function PipelineTrackSelector(props) {
|
||||||
|
const { cache, setCache, back, next } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
<DialogContent>
|
||||||
|
<h3>Select Track</h3>
|
||||||
|
{JSON.stringify(cache)}
|
||||||
|
</DialogContent>
|
||||||
|
<DialogActions>
|
||||||
|
<Button onClick={back}>Back</Button>
|
||||||
|
<Button onClick={next} autoFocus>
|
||||||
|
Next
|
||||||
|
</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PipelineTrackSelector;
|
|
@ -107,29 +107,17 @@ export default function Settings(props) {
|
||||||
|
|
||||||
<ListItem button divider onClick={handleToggle("simplifiedControls")}>
|
<ListItem button divider onClick={handleToggle("simplifiedControls")}>
|
||||||
<ListItemText primary="Simplified Controls" />
|
<ListItemText primary="Simplified Controls" />
|
||||||
<Switch
|
<Switch edge="end" checked={store.simplifiedControls} />
|
||||||
edge="end"
|
|
||||||
onChange={handleToggle("simplifiedControls")}
|
|
||||||
checked={store.simplifiedControls}
|
|
||||||
/>
|
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
|
||||||
<ListItem button divider onClick={handleToggle("focusJob")}>
|
<ListItem button divider onClick={handleToggle("focusJob")}>
|
||||||
<ListItemText primary="Focus New Jobs" />
|
<ListItemText primary="Focus New Jobs" />
|
||||||
<Switch
|
<Switch edge="end" checked={store.focusJob} />
|
||||||
edge="end"
|
|
||||||
onChange={handleToggle("focusJob")}
|
|
||||||
checked={store.focusJob}
|
|
||||||
/>
|
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
|
||||||
<ListItem button divider onClick={handleToggle("logAppDetails")}>
|
<ListItem button divider onClick={handleToggle("logAppDetails")}>
|
||||||
<ListItemText primary="Log App Details" />
|
<ListItemText primary="Log App Details" />
|
||||||
<Switch
|
<Switch edge="end" checked={store.logAppDetails} />
|
||||||
edge="end"
|
|
||||||
onChange={handleToggle("logAppDetails")}
|
|
||||||
checked={store.logAppDetails}
|
|
||||||
/>
|
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
|
||||||
<MultiOptionDialog
|
<MultiOptionDialog
|
||||||
|
|
|
@ -54,5 +54,7 @@ setTimeout(() => {
|
||||||
};
|
};
|
||||||
axios.post(reportingUrl, { testResult }).catch((e) => {
|
axios.post(reportingUrl, { testResult }).catch((e) => {
|
||||||
console.log(e.response.status);
|
console.log(e.response.status);
|
||||||
|
}).then(()=>{
|
||||||
|
if(status.status === 1) process.exit(1);
|
||||||
});
|
});
|
||||||
}, endLiveCount * 1000);
|
}, endLiveCount * 1000);
|
||||||
|
|
|
@ -9,6 +9,13 @@ export default () => {
|
||||||
hmr: {
|
hmr: {
|
||||||
port: 443,
|
port: 443,
|
||||||
},
|
},
|
||||||
|
proxy: {
|
||||||
|
'/api': 'http://localhost:52000',
|
||||||
|
'/socket.io': {
|
||||||
|
target: 'ws://localhost:52000',
|
||||||
|
ws: true
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
outDir: "./build",
|
outDir: "./build",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue