refractor + style tweaks

- bugfix on lower
- delay between 0-60 minutes
- action buttons in dropdown
- added button for toggling element visibility
- several css and code cleanups
- renamed settingsAPI
This commit is contained in:
cv
2021-04-24 10:32:19 +02:00
parent 11fca1ab6d
commit ea92fc7de7
44 changed files with 835 additions and 572 deletions
+21
View File
@@ -0,0 +1,21 @@
import axios from 'axios';
import { NODE_PORT } from './apiConstants';
// get origin from URL
const serverURL = window.location.origin.replace(
window.location.port,
`${NODE_PORT}/`
);
export const eventNamespace = 'event';
export const eventURL = serverURL + eventNamespace;
export const fetchEvent = async () => {
const res = await axios.get(eventURL);
return res.data;
};
export const postEvent = async (data) => {
const res = await axios.post(eventURL, data);
return res;
};
-23
View File
@@ -1,23 +0,0 @@
import axios from 'axios';
import { NODE_PORT } from '../api/apiConstants';
// get origin from URL
const serverURL = window.location.origin.replace(
window.location.port,
`${NODE_PORT}/`
);
export const settingsNamespace = 'settings';
export const settingsURL = serverURL + settingsNamespace;
export const fetchSettings = async () => {
const res = await axios.get(settingsURL);
return res.data;
};
export const postSettings = async (data) => {
console.log('debug sending', data)
console.log('debug await', await axios.post(settingsURL, data))
const res = await axios.post(settingsURL, data);
return res;
};