mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 17:33:55 +00:00
Compare commits
2 Commits
v4.8.0
...
fix-storage
| Author | SHA1 | Date | |
|---|---|---|---|
| e2c9ee31ad | |||
| bfd85855d4 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@getontime/cli",
|
"name": "@getontime/cli",
|
||||||
"version": "3.16.0",
|
"version": "3.16.1",
|
||||||
"author": "Carlos Valente",
|
"author": "Carlos Valente",
|
||||||
"description": "Time keeping for live events",
|
"description": "Time keeping for live events",
|
||||||
"repository": "https://github.com/cpvalente/ontime",
|
"repository": "https://github.com/cpvalente/ontime",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ontime-ui",
|
"name": "ontime-ui",
|
||||||
"version": "3.16.0",
|
"version": "3.16.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { IoChevronDown } from 'react-icons/io5';
|
import { IoChevronDown } from 'react-icons/io5';
|
||||||
import { useLocalStorage } from '@mantine/hooks';
|
import { useLocalStorage } from '@mantine/hooks';
|
||||||
|
|
||||||
|
import { baseURI } from '../../../externals';
|
||||||
import { cx } from '../../utils/styleUtils';
|
import { cx } from '../../utils/styleUtils';
|
||||||
|
|
||||||
import ParamInput from './ParamInput';
|
import ParamInput from './ParamInput';
|
||||||
@@ -17,7 +18,7 @@ interface ViewParamsSectionProps {
|
|||||||
export default function ViewParamsSection(props: ViewParamsSectionProps) {
|
export default function ViewParamsSection(props: ViewParamsSectionProps) {
|
||||||
const { title, collapsible, options } = props;
|
const { title, collapsible, options } = props;
|
||||||
|
|
||||||
const [collapsed, setCollapsed] = useLocalStorage({ key: `params-${title}`, defaultValue: false });
|
const [collapsed, setCollapsed] = useLocalStorage({ key: `${baseURI}params-${title}`, defaultValue: false });
|
||||||
|
|
||||||
const handleCollapse = () => {
|
const handleCollapse = () => {
|
||||||
if (collapsible) {
|
if (collapsible) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { createContext, PropsWithChildren, useCallback, useEffect, useState } from 'react';
|
import { createContext, PropsWithChildren, useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
import { baseURI } from '../../externals';
|
||||||
import useSettings from '../hooks-query/useSettings';
|
import useSettings from '../hooks-query/useSettings';
|
||||||
|
|
||||||
interface AppContextType {
|
interface AppContextType {
|
||||||
@@ -26,7 +27,7 @@ export const AppContextProvider = ({ children }: PropsWithChildren) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (status === 'pending') return;
|
if (status === 'pending') return;
|
||||||
const previousEditor = sessionStorage.getItem(storageKeys.editor);
|
const previousEditor = sessionStorage.getItem(`${baseURI}${storageKeys.editor}`);
|
||||||
|
|
||||||
if (previousEditor && previousEditor === data.editorKey) {
|
if (previousEditor && previousEditor === data.editorKey) {
|
||||||
setEditorAuth(true);
|
setEditorAuth(true);
|
||||||
@@ -34,7 +35,7 @@ export const AppContextProvider = ({ children }: PropsWithChildren) => {
|
|||||||
setEditorAuth(data.editorKey == null || data.editorKey === '');
|
setEditorAuth(data.editorKey == null || data.editorKey === '');
|
||||||
}
|
}
|
||||||
|
|
||||||
const previousOperator = sessionStorage.getItem(storageKeys.operator);
|
const previousOperator = sessionStorage.getItem(`${baseURI}${storageKeys.operator}`);
|
||||||
if (previousOperator && previousOperator === data.operatorKey) {
|
if (previousOperator && previousOperator === data.operatorKey) {
|
||||||
setOperatorAuth(true);
|
setOperatorAuth(true);
|
||||||
} else {
|
} else {
|
||||||
@@ -55,14 +56,14 @@ export const AppContextProvider = ({ children }: PropsWithChildren) => {
|
|||||||
if (permission === 'editor') {
|
if (permission === 'editor') {
|
||||||
const correct = isValid(pin, data.editorKey);
|
const correct = isValid(pin, data.editorKey);
|
||||||
if (correct) {
|
if (correct) {
|
||||||
sessionStorage.setItem(storageKeys.editor, pin);
|
sessionStorage.setItem(`${baseURI}${storageKeys.editor}`, pin);
|
||||||
}
|
}
|
||||||
setEditorAuth(correct);
|
setEditorAuth(correct);
|
||||||
return correct;
|
return correct;
|
||||||
} else if (permission === 'operator') {
|
} else if (permission === 'operator') {
|
||||||
const correct = isValid(pin, data.operatorKey);
|
const correct = isValid(pin, data.operatorKey);
|
||||||
if (correct) {
|
if (correct) {
|
||||||
sessionStorage.setItem(storageKeys.operator, pin);
|
sessionStorage.setItem(`${baseURI}${storageKeys.operator}`, pin);
|
||||||
}
|
}
|
||||||
setOperatorAuth(correct);
|
setOperatorAuth(correct);
|
||||||
return correct;
|
return correct;
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import { create } from 'zustand';
|
import { create } from 'zustand';
|
||||||
|
|
||||||
|
import { baseURI } from '../../externals';
|
||||||
|
|
||||||
export enum AppMode {
|
export enum AppMode {
|
||||||
Run = 'run',
|
Run = 'run',
|
||||||
Edit = 'edit',
|
Edit = 'edit',
|
||||||
Freeze = 'freeze',
|
Freeze = 'freeze',
|
||||||
}
|
}
|
||||||
|
|
||||||
const appModeKey = 'ontime-app-mode';
|
const appModeKey = `${baseURI}ontime-app-mode`;
|
||||||
|
|
||||||
function getModeFromSession() {
|
function getModeFromSession() {
|
||||||
return sessionStorage.getItem(appModeKey) === AppMode.Run ? AppMode.Run : AppMode.Edit;
|
return sessionStorage.getItem(appModeKey) === AppMode.Run ? AppMode.Run : AppMode.Edit;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { ClientList } from 'ontime-types';
|
import { ClientList } from 'ontime-types';
|
||||||
import { create } from 'zustand';
|
import { create } from 'zustand';
|
||||||
|
|
||||||
|
import { baseURI } from '../../externals';
|
||||||
|
|
||||||
interface ClientStore {
|
interface ClientStore {
|
||||||
name?: string;
|
name?: string;
|
||||||
setName: (newValue: string) => void;
|
setName: (newValue: string) => void;
|
||||||
@@ -15,7 +17,7 @@ interface ClientStore {
|
|||||||
setClients: (clients: ClientList) => void;
|
setClients: (clients: ClientList) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const clientNameKey = 'ontime-client-name';
|
const clientNameKey = `${baseURI}ontime-client-name`;
|
||||||
|
|
||||||
function persistNameInStorage(newValue: string) {
|
function persistNameInStorage(newValue: string) {
|
||||||
localStorage.setItem(clientNameKey, newValue);
|
localStorage.setItem(clientNameKey, newValue);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
// eslint-disable-next-line simple-import-sort/imports
|
||||||
import { create } from 'zustand';
|
import { create } from 'zustand';
|
||||||
|
|
||||||
import { booleanFromLocalStorage } from '../utils/localStorage';
|
import { booleanFromLocalStorage } from '../utils/localStorage';
|
||||||
|
import { baseURI } from '../../externals';
|
||||||
|
|
||||||
enum LocalEventKeys {
|
enum LocalEventKeys {
|
||||||
Mirror = 'ontime-view-mirror',
|
Mirror = 'ontime-view-mirror',
|
||||||
@@ -12,11 +14,11 @@ type ViewOptionsStore = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const useViewOptionsStore = create<ViewOptionsStore>()((set) => ({
|
export const useViewOptionsStore = create<ViewOptionsStore>()((set) => ({
|
||||||
mirror: booleanFromLocalStorage(LocalEventKeys.Mirror, false),
|
mirror: booleanFromLocalStorage(`${baseURI}${LocalEventKeys.Mirror}`, false),
|
||||||
toggleMirror: (newValue?: boolean) =>
|
toggleMirror: (newValue?: boolean) =>
|
||||||
set((state) => {
|
set((state) => {
|
||||||
const val = typeof newValue === 'undefined' ? !state.mirror : newValue;
|
const val = typeof newValue === 'undefined' ? !state.mirror : newValue;
|
||||||
localStorage.setItem(LocalEventKeys.Mirror, String(val));
|
localStorage.setItem(`${baseURI}${LocalEventKeys.Mirror}`, String(val));
|
||||||
return { mirror: val };
|
return { mirror: val };
|
||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
|
|||||||
+4
-2
@@ -1,5 +1,7 @@
|
|||||||
import { ImportCustom, ImportMap } from 'ontime-utils';
|
import { ImportCustom, ImportMap } from 'ontime-utils';
|
||||||
|
|
||||||
|
import { baseURI } from '../../../../../externals';
|
||||||
|
|
||||||
export type NamedImportMap = typeof namedImportMap;
|
export type NamedImportMap = typeof namedImportMap;
|
||||||
|
|
||||||
// Record of label and import name
|
// Record of label and import name
|
||||||
@@ -64,11 +66,11 @@ export function convertToImportMap(namedImportMap: NamedImportMap): ImportMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function persistImportMap(options: NamedImportMap) {
|
export function persistImportMap(options: NamedImportMap) {
|
||||||
localStorage.setItem('ontime-import-options', JSON.stringify(options));
|
localStorage.setItem(`${baseURI}ontime-import-options`, JSON.stringify(options));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPersistImportMap(): unknown {
|
function getPersistImportMap(): unknown {
|
||||||
const options = localStorage.getItem('ontime-import-options');
|
const options = localStorage.getItem(`${baseURI}ontime-import-options`);
|
||||||
if (!options) {
|
if (!options) {
|
||||||
throw new Error('no import options found');
|
throw new Error('no import options found');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { MILLIS_PER_HOUR, MILLIS_PER_SECOND, parseUserTime } from 'ontime-utils'
|
|||||||
|
|
||||||
import TimeInput from '../../../../common/components/input/time-input/TimeInput';
|
import TimeInput from '../../../../common/components/input/time-input/TimeInput';
|
||||||
import { setPlayback } from '../../../../common/hooks/useSocket';
|
import { setPlayback } from '../../../../common/hooks/useSocket';
|
||||||
|
import { baseURI } from '../../../../externals';
|
||||||
import { tooltipDelayMid } from '../../../../ontimeConfig';
|
import { tooltipDelayMid } from '../../../../ontimeConfig';
|
||||||
import TapButton from '../tap-button/TapButton';
|
import TapButton from '../tap-button/TapButton';
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ interface AddTimeProps {
|
|||||||
|
|
||||||
export default function AddTime(props: AddTimeProps) {
|
export default function AddTime(props: AddTimeProps) {
|
||||||
const { playback } = props;
|
const { playback } = props;
|
||||||
const [time, setTime] = useLocalStorage({ key: 'add-time', defaultValue: 300_000 }); // 5 minutes
|
const [time, setTime] = useLocalStorage({ key: `${baseURI}add-time`, defaultValue: 300_000 }); // 5 minutes
|
||||||
|
|
||||||
const handleTimeChange = (_field: string, value: string) => {
|
const handleTimeChange = (_field: string, value: string) => {
|
||||||
const newTime = parseUserTime(value);
|
const newTime = parseUserTime(value);
|
||||||
|
|||||||
@@ -3,13 +3,18 @@ import { useLocalStorage } from '@mantine/hooks';
|
|||||||
import { ColumnDef } from '@tanstack/react-table';
|
import { ColumnDef } from '@tanstack/react-table';
|
||||||
import { OntimeRundownEntry } from 'ontime-types';
|
import { OntimeRundownEntry } from 'ontime-types';
|
||||||
|
|
||||||
|
import { baseURI } from '../../../externals';
|
||||||
|
|
||||||
export default function useColumnManager(columns: ColumnDef<OntimeRundownEntry>[]) {
|
export default function useColumnManager(columns: ColumnDef<OntimeRundownEntry>[]) {
|
||||||
const [columnVisibility, setColumnVisibility] = useLocalStorage({ key: 'table-hidden', defaultValue: {} });
|
const [columnVisibility, setColumnVisibility] = useLocalStorage({ key: `${baseURI}table-hidden`, defaultValue: {} });
|
||||||
const [columnOrder, saveColumnOrder] = useLocalStorage<string[]>({
|
const [columnOrder, saveColumnOrder] = useLocalStorage<string[]>({
|
||||||
key: 'table-order',
|
key: `${baseURI}table-order`,
|
||||||
defaultValue: columns.map((col) => col.id as string),
|
defaultValue: columns.map((col) => col.id as string),
|
||||||
});
|
});
|
||||||
const [columnSizing, setColumnSizing] = useLocalStorage({ key: 'table-sizes', defaultValue: {} });
|
const [columnSizing, setColumnSizing] = useLocalStorage({
|
||||||
|
key: `${baseURI}table-sizes`,
|
||||||
|
defaultValue: {},
|
||||||
|
});
|
||||||
|
|
||||||
// if the columns change, we update the dataset
|
// if the columns change, we update the dataset
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ontime-electron",
|
"name": "ontime-electron",
|
||||||
"version": "3.16.0",
|
"version": "3.16.1",
|
||||||
"author": "Carlos Valente",
|
"author": "Carlos Valente",
|
||||||
"description": "Time keeping for live events",
|
"description": "Time keeping for live events",
|
||||||
"repository": "https://github.com/cpvalente/ontime",
|
"repository": "https://github.com/cpvalente/ontime",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "ontime-server",
|
"name": "ontime-server",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"version": "3.16.0",
|
"version": "3.16.1",
|
||||||
"exports": "./src/index.js",
|
"exports": "./src/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@googleapis/sheets": "^5.0.5",
|
"@googleapis/sheets": "^5.0.5",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ontime",
|
"name": "ontime",
|
||||||
"version": "3.16.0",
|
"version": "3.16.1",
|
||||||
"description": "Time keeping for live events",
|
"description": "Time keeping for live events",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ontime",
|
"ontime",
|
||||||
|
|||||||
Reference in New Issue
Block a user