Compare commits
No commits in common. "c233be5d80d0c55b263dc0caacda9f40364b6ae5" and "7606afcf1105cf484a493413d052012bf2b97f71" have entirely different histories.
c233be5d80
...
7606afcf11
@ -3,7 +3,7 @@ import { isAuthenticated } from '../../keycloak.js';
|
|||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
const listAllowedFilters = ['state', 'gcodeFile._id', 'quantity', '_id', '_reference'];
|
const listAllowedFilters = ['state', 'gcodeFile._id', 'quantity'];
|
||||||
const propertiesAllowedFilters = ['state'];
|
const propertiesAllowedFilters = ['state'];
|
||||||
import {
|
import {
|
||||||
listJobsRouteHandler,
|
listJobsRouteHandler,
|
||||||
@ -16,14 +16,15 @@ import {
|
|||||||
getJobHistoryRouteHandler,
|
getJobHistoryRouteHandler,
|
||||||
searchJobsRouteHandler,
|
searchJobsRouteHandler,
|
||||||
getJobPropertyValuesRouteHandler,
|
getJobPropertyValuesRouteHandler,
|
||||||
getJobNeighborsRouteHandler,
|
|
||||||
|
getJobNeighborsRouteHandler
|
||||||
} from '../../services/production/jobs.js';
|
} from '../../services/production/jobs.js';
|
||||||
import { convertPropertiesString, getFilter } from '../../utils.js';
|
import { convertPropertiesString, getFilter } from '../../utils.js';
|
||||||
|
|
||||||
// list of jobs
|
// list of jobs
|
||||||
router.get('/', isAuthenticated, (req, res) => {
|
router.get('/', isAuthenticated, (req, res) => {
|
||||||
const { page, limit, property, search, sort, order } = req.query;
|
const { page, limit, property, search, sort, order } = req.query;
|
||||||
const filter = getFilter(req.query, listAllowedFilters);
|
const filter = getFilter(req.query, listAllowedFilters);
|
||||||
listJobsRouteHandler(req, res, page, limit, property, filter, search, sort, order);
|
listJobsRouteHandler(req, res, page, limit, property, filter, search, sort, order);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -46,6 +47,7 @@ router.get('/search', isAuthenticated, (req, res) => {
|
|||||||
searchJobsRouteHandler(req, res, search);
|
searchJobsRouteHandler(req, res, search);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
router.post('/', isAuthenticated, (req, res) => {
|
router.post('/', isAuthenticated, (req, res) => {
|
||||||
newJobRouteHandler(req, res);
|
newJobRouteHandler(req, res);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -16,16 +16,7 @@ import {
|
|||||||
} from '../../services/production/printers.js';
|
} from '../../services/production/printers.js';
|
||||||
import { convertPropertiesString, getFilter } from '../../utils.js';
|
import { convertPropertiesString, getFilter } from '../../utils.js';
|
||||||
|
|
||||||
const listAllowedFilters = [
|
const listAllowedFilters = ['tags', 'host._id', 'active', 'online', 'name', '_id', '_reference'];
|
||||||
'tags',
|
|
||||||
'host._id',
|
|
||||||
'active',
|
|
||||||
'online',
|
|
||||||
'name',
|
|
||||||
'_id',
|
|
||||||
'_reference',
|
|
||||||
'state',
|
|
||||||
];
|
|
||||||
const propertiesAllowedFilters = ['tags'];
|
const propertiesAllowedFilters = ['tags'];
|
||||||
// list of printers
|
// list of printers
|
||||||
router.get('/', isAuthenticated, (req, res) => {
|
router.get('/', isAuthenticated, (req, res) => {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { isAuthenticated } from '../../keycloak.js';
|
|||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
const listAllowedFilters = ['_id', 'job._id', 'printer._id', '_reference', 'state'];
|
const listAllowedFilters = ['_id', 'job._id', 'printer._id'];
|
||||||
const propertiesAllowedFilters = ['job'];
|
const propertiesAllowedFilters = ['job'];
|
||||||
import {
|
import {
|
||||||
listSubJobsRouteHandler,
|
listSubJobsRouteHandler,
|
||||||
@ -13,14 +13,15 @@ import {
|
|||||||
getSubJobHistoryRouteHandler,
|
getSubJobHistoryRouteHandler,
|
||||||
searchSubJobsRouteHandler,
|
searchSubJobsRouteHandler,
|
||||||
getSubJobPropertyValuesRouteHandler,
|
getSubJobPropertyValuesRouteHandler,
|
||||||
getSubJobNeighborsRouteHandler,
|
|
||||||
|
getSubJobNeighborsRouteHandler
|
||||||
} from '../../services/production/subjobs.js';
|
} from '../../services/production/subjobs.js';
|
||||||
import { getFilter, convertPropertiesString } from '../../utils.js';
|
import { getFilter, convertPropertiesString } from '../../utils.js';
|
||||||
|
|
||||||
// list of sub jobs
|
// list of sub jobs
|
||||||
router.get('/', isAuthenticated, (req, res) => {
|
router.get('/', isAuthenticated, (req, res) => {
|
||||||
const { page, limit, property, search, sort, order } = req.query;
|
const { page, limit, property, search, sort, order } = req.query;
|
||||||
const filter = getFilter(req.query, listAllowedFilters);
|
const filter = getFilter(req.query, listAllowedFilters);
|
||||||
listSubJobsRouteHandler(req, res, page, limit, property, filter, search, sort, order);
|
listSubJobsRouteHandler(req, res, page, limit, property, filter, search, sort, order);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -43,6 +44,7 @@ router.get('/search', isAuthenticated, (req, res) => {
|
|||||||
searchSubJobsRouteHandler(req, res, search);
|
searchSubJobsRouteHandler(req, res, search);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// get sub job stats
|
// get sub job stats
|
||||||
router.get('/stats', isAuthenticated, (req, res) => {
|
router.get('/stats', isAuthenticated, (req, res) => {
|
||||||
getSubJobStatsRouteHandler(req, res);
|
getSubJobStatsRouteHandler(req, res);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user