mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 20:03:52 +00:00
Feat/table (#105)
* feat/table add react-table * feat/table add protected table route * feat/table upgrade dependencies * feat/table support parsing of new properties Co-authored-by: DeepSource Bot <bot@deepsource.io>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
export const NODE_PORT = 4001;
|
||||
export const EVENT_TABLE = 'event';
|
||||
export const ALIASES = 'aliases';
|
||||
export const USERFIELDS = 'userFields';
|
||||
export const EVENTS_TABLE = 'events';
|
||||
export const APP_TABLE = 'appinfo';
|
||||
export const OSC_SETTINGS = 'oscSettings';
|
||||
@@ -13,5 +14,5 @@ const calculateServer = () => {
|
||||
export const serverURL = calculateServer();
|
||||
export const eventURL = serverURL + EVENT_TABLE;
|
||||
export const eventsURL = serverURL + EVENTS_TABLE;
|
||||
export const playbackURL = serverURL + 'playback';
|
||||
export const ontimeURL = serverURL + 'ontime';
|
||||
export const playbackURL = `${serverURL}playback`;
|
||||
export const ontimeURL = `${serverURL}ontime`;
|
||||
|
||||
@@ -7,20 +7,19 @@ export const fetchAllEvents = async () => {
|
||||
};
|
||||
|
||||
export const requestPost = async (data) => {
|
||||
return await axios.post(eventsURL, data);
|
||||
await axios.post(eventsURL, data);
|
||||
};
|
||||
|
||||
export const requestPut = async (data) => {
|
||||
return await axios.put(eventsURL, data);
|
||||
await axios.put(eventsURL, data);
|
||||
};
|
||||
|
||||
export const requestPatch = async (data) => {
|
||||
return await axios.patch(eventsURL, data);
|
||||
await axios.patch(eventsURL, data);
|
||||
};
|
||||
|
||||
export const requestReorder = async (data) => {
|
||||
const action = 'reorder';
|
||||
return await axios.patch(`${eventsURL}/${action}`, data);
|
||||
await axios.patch(`${eventsURL}/reorder`, data);
|
||||
};
|
||||
|
||||
export const requestApplyDelay = async (eventId) => {
|
||||
@@ -29,9 +28,9 @@ export const requestApplyDelay = async (eventId) => {
|
||||
};
|
||||
|
||||
export const requestDelete = async (eventId) => {
|
||||
return await axios.delete(`${eventsURL}/${eventId}`);
|
||||
await axios.delete(`${eventsURL}/${eventId}`);
|
||||
};
|
||||
|
||||
export const requestDeleteAll = async () => {
|
||||
return await axios.delete(`${eventsURL}/all`);
|
||||
await axios.delete(`${eventsURL}/all`);
|
||||
};
|
||||
|
||||
@@ -21,6 +21,19 @@ export const eventPlaceholderSettings = {
|
||||
endMessage: '',
|
||||
};
|
||||
|
||||
export const userFieldsPlaceholder = {
|
||||
user0: '',
|
||||
user1: '',
|
||||
user2: '',
|
||||
user3: '',
|
||||
user4: '',
|
||||
user5: '',
|
||||
user6: '',
|
||||
user7: '',
|
||||
user8: '',
|
||||
user9: '',
|
||||
};
|
||||
|
||||
export const oscPlaceholderSettings = {
|
||||
port: '',
|
||||
portOut: '',
|
||||
@@ -92,7 +105,7 @@ export const getSettings = async () => {
|
||||
};
|
||||
|
||||
export const postSettings = async (data) => {
|
||||
return await axios.post(`${ontimeURL}/settings`, data);
|
||||
await axios.post(`${ontimeURL}/settings`, data);
|
||||
};
|
||||
|
||||
export const getInfo = async () => {
|
||||
@@ -101,7 +114,7 @@ export const getInfo = async () => {
|
||||
};
|
||||
|
||||
export const postInfo = async (data) => {
|
||||
return await axios.post(`${ontimeURL}/info`, data);
|
||||
await axios.post(`${ontimeURL}/info`, data);
|
||||
};
|
||||
|
||||
export const getAliases = async () => {
|
||||
@@ -110,7 +123,17 @@ export const getAliases = async () => {
|
||||
};
|
||||
|
||||
export const postAliases = async (data) => {
|
||||
return await axios.post(`${ontimeURL}/aliases`, data);
|
||||
await axios.post(`${ontimeURL}/aliases`, data);
|
||||
};
|
||||
|
||||
|
||||
export const getUserFields = async () => {
|
||||
const res = await axios.get(`${ontimeURL}/userfields`);
|
||||
return res.data;
|
||||
};
|
||||
|
||||
export const postUserFields = async (data) => {
|
||||
await axios.post(`${ontimeURL}/userfields`, data);
|
||||
};
|
||||
|
||||
export const getOSC = async () => {
|
||||
@@ -119,7 +142,7 @@ export const getOSC = async () => {
|
||||
};
|
||||
|
||||
export const postOSC = async (data) => {
|
||||
return await axios.post(`${ontimeURL}/osc`, data);
|
||||
await axios.post(`${ontimeURL}/osc`, data);
|
||||
};
|
||||
|
||||
export const downloadEvents = async () => {
|
||||
|
||||
Reference in New Issue
Block a user