mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 10:53:51 +00:00
Docker (#146)
* docker: initial config * docker: add entrypoint for headless run * docker: resolve path from env variable * docker: initial config * docker: rename preloaded data directories * docker: update README * docker: prevent issue with port mappings * docker: update README.md * docker: add docker-compose * docker: cleanup logs * docker: add CI * docker: cleanup unused * docker: use static port in development * refactor: isolate tasks * docker: add demo db * fix: download db resolves according to OS * docker: config build * fix: ensure db path exists * fix: add object type to block * docker: config build * docker: config build * docker: env is production * docker: preload db * fix: remove test dir * docker: graceful shutdown node app * docker: env is production * docker: add docker-compose * docker: remove unused mappings * docker: version bump
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export const NODE_PORT = 4001;
|
||||
export const STATIC_PORT = 4001;
|
||||
export const EVENT_TABLE = 'event';
|
||||
export const ALIASES = 'aliases';
|
||||
export const USERFIELDS = 'userFields';
|
||||
@@ -8,15 +8,18 @@ export const OSC_SETTINGS = 'oscSettings';
|
||||
export const APP_SETTINGS = 'appSettings';
|
||||
|
||||
/**
|
||||
* @description finds server path given the current location
|
||||
* @description finds server path given the current location, it
|
||||
* @return {*}
|
||||
*/
|
||||
const calculateServer = () => {
|
||||
return window.location.origin.replace(window.location.port, `${NODE_PORT}/`);
|
||||
if (process.env?.NODE_ENV === 'development') {
|
||||
return `http://localhost:${STATIC_PORT}`;
|
||||
}
|
||||
return window.location.origin;
|
||||
};
|
||||
|
||||
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 eventURL = `${serverURL}/${EVENT_TABLE}`;
|
||||
export const eventsURL = `${serverURL}/${EVENTS_TABLE}`;
|
||||
export const playbackURL = `${serverURL}/playback`;
|
||||
export const ontimeURL = `${serverURL}/ontime`;
|
||||
|
||||
@@ -222,7 +222,9 @@ export const downloadEvents = async () => {
|
||||
filename = headerLine.substring(startFileNameIndex, endFileNameIndex);
|
||||
}
|
||||
|
||||
const url = window.URL.createObjectURL(new Blob([response.data]));
|
||||
const url = window.URL.createObjectURL(
|
||||
new Blob([response.data], { type: 'application/json' })
|
||||
);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', filename);
|
||||
|
||||
@@ -154,15 +154,16 @@ const withSocket = (Component) => {
|
||||
// Filter events only to pass down
|
||||
useEffect(() => {
|
||||
if (eventsData == null) return;
|
||||
|
||||
// filter just events with title
|
||||
const pe = eventsData.filter(
|
||||
(d) => d.type === 'event' && d.title !== '' && d.isPublic === true
|
||||
);
|
||||
setPublicEvents(pe);
|
||||
if (Array.isArray(eventsData)) {
|
||||
const pe = eventsData.filter(
|
||||
(d) => d.type === 'event' && d.title !== '' && d.isPublic
|
||||
);
|
||||
setPublicEvents(pe);
|
||||
|
||||
// everything goes backstage
|
||||
setBackstageEvents(eventsData);
|
||||
// everything goes backstage
|
||||
setBackstageEvents(eventsData);
|
||||
}
|
||||
}, [eventsData]);
|
||||
|
||||
// Set general data
|
||||
@@ -178,13 +179,11 @@ const withSocket = (Component) => {
|
||||
/********************************************/
|
||||
// is there a now field?
|
||||
let showNow = true;
|
||||
if (!titles.titleNow && !titles.subtitleNow && !titles.presenterNow)
|
||||
showNow = false;
|
||||
if (!titles.titleNow && !titles.subtitleNow && !titles.presenterNow) showNow = false;
|
||||
|
||||
// is there a next field?
|
||||
let showNext = true;
|
||||
if (!titles.titleNext && !titles.subtitleNext && !titles.presenterNext)
|
||||
showNext = false;
|
||||
if (!titles.titleNext && !titles.subtitleNext && !titles.presenterNext) showNext = false;
|
||||
|
||||
const titleManager = { ...titles, showNow: showNow, showNext: showNext };
|
||||
|
||||
@@ -195,20 +194,12 @@ const withSocket = (Component) => {
|
||||
/********************************************/
|
||||
// is there a now field?
|
||||
let showPublicNow = true;
|
||||
if (
|
||||
!publicTitles.titleNow &&
|
||||
!publicTitles.subtitleNow &&
|
||||
!publicTitles.presenterNow
|
||||
)
|
||||
if (!publicTitles.titleNow && !publicTitles.subtitleNow && !publicTitles.presenterNow)
|
||||
showPublicNow = false;
|
||||
|
||||
// is there a next field?
|
||||
let showPublicNext = true;
|
||||
if (
|
||||
!publicTitles.titleNext &&
|
||||
!publicTitles.subtitleNext &&
|
||||
!publicTitles.presenterNext
|
||||
)
|
||||
if (!publicTitles.titleNext && !publicTitles.subtitleNext && !publicTitles.presenterNext)
|
||||
showPublicNext = false;
|
||||
|
||||
const publicTitleManager = {
|
||||
|
||||
Reference in New Issue
Block a user