change name and other small things
This commit is contained in:
parent
f8c9b93dad
commit
35ff9e643d
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "signage",
|
"name": "Artemio",
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -5,11 +5,11 @@
|
|||||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="theme-color" content="#000000" />
|
||||||
<meta name="description" content="Signage" />
|
<meta name="description" content="Artemio" />
|
||||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||||
<meta name="darkreader" content="disable" />
|
<meta name="darkreader" content="disable" />
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||||
<title>Signage</title>
|
<title>Artemio</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"short_name": "signage",
|
"short_name": "artemio",
|
||||||
"name": "signage",
|
"name": "artemio",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "favicon.ico",
|
"src": "favicon.ico",
|
||||||
|
@ -70,7 +70,7 @@ const HeaderSearch = () => {
|
|||||||
<Group>
|
<Group>
|
||||||
<Avatar src={Logo} size={30} />
|
<Avatar src={Logo} size={30} />
|
||||||
<UnstyledButton onClick={() => navigate('/')} className={classes.link}>
|
<UnstyledButton onClick={() => navigate('/')} className={classes.link}>
|
||||||
<Title order={1}>Signage</Title>
|
<Title order={1}>Artemio</Title>
|
||||||
</UnstyledButton>
|
</UnstyledButton>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ const Authentication = ({ redirect }) => {
|
|||||||
align="center"
|
align="center"
|
||||||
sx={(theme) => ({ fontFamily: `Greycliff CF, ${theme.fontFamily}`, fontWeight: 900 })}
|
sx={(theme) => ({ fontFamily: `Greycliff CF, ${theme.fontFamily}`, fontWeight: 900 })}
|
||||||
>
|
>
|
||||||
Connect to signage
|
Connect to Artemio
|
||||||
</Title>
|
</Title>
|
||||||
|
|
||||||
<Paper withBorder shadow="md" p={30} mt={30} radius="md">
|
<Paper withBorder shadow="md" p={30} mt={30} radius="md">
|
||||||
|
@ -161,9 +161,6 @@ const Content = ({ form, playlistId, playlist }) => {
|
|||||||
form.getInputProps(`files.${index}.seconds`).errors && 'This field is required'
|
form.getInputProps(`files.${index}.seconds`).errors && 'This field is required'
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Text>
|
|
||||||
Display time: {parseTime(form.getInputProps(`files.${index}.seconds`).value)}
|
|
||||||
</Text>
|
|
||||||
<ActionIcon color="red" variant="light" size="lg" onClick={() => handleDelete(index)}>
|
<ActionIcon color="red" variant="light" size="lg" onClick={() => handleDelete(index)}>
|
||||||
<IconTrash size="1rem" />
|
<IconTrash size="1rem" />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
|
@ -22,7 +22,7 @@ const Playlist = (item) => {
|
|||||||
|
|
||||||
const toggleActivate = () => {
|
const toggleActivate = () => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
(isActive ? API.disactivate : API.activate)(id)
|
(isActive ? API.playlists.disactivate : API.playlists.activate)(id)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
setIsActive(!isActive);
|
setIsActive(!isActive);
|
||||||
|
@ -3,7 +3,7 @@ import PlaylistViewEditor from './playlist-view-editor';
|
|||||||
import API from '../../services/api';
|
import API from '../../services/api';
|
||||||
|
|
||||||
const ModalCreatePlaylist = ({ opened, handler, addPlaylist }) => {
|
const ModalCreatePlaylist = ({ opened, handler, addPlaylist }) => {
|
||||||
const validated = (item) => {
|
const validate = (item) => {
|
||||||
if (item) {
|
if (item) {
|
||||||
addPlaylist(item);
|
addPlaylist(item);
|
||||||
}
|
}
|
||||||
@ -26,7 +26,7 @@ const ModalCreatePlaylist = ({ opened, handler, addPlaylist }) => {
|
|||||||
<PlaylistViewEditor
|
<PlaylistViewEditor
|
||||||
buttonText="Create"
|
buttonText="Create"
|
||||||
APICall={API.playlists.create}
|
APICall={API.playlists.create}
|
||||||
handler={(item) => validated(item)}
|
handler={(item) => validate(item)}
|
||||||
/>
|
/>
|
||||||
</Modal.Body>
|
</Modal.Body>
|
||||||
</Modal.Content>
|
</Modal.Content>
|
||||||
|
@ -1,64 +0,0 @@
|
|||||||
import { MultiSelect } from '@mantine/core';
|
|
||||||
import { useEffect, useState } from 'react';
|
|
||||||
import setNotification from '../errors/error-notification';
|
|
||||||
import API from '../../services/api';
|
|
||||||
|
|
||||||
const RoleSelector = ({ defaultRoles, label, value, setValue }) => {
|
|
||||||
const [data, setData] = useState([]);
|
|
||||||
const [search, setSearch] = useState();
|
|
||||||
|
|
||||||
const addRoles = (roles) => {
|
|
||||||
if (!roles) return;
|
|
||||||
for (let i = 0; i < roles.length; i++) {
|
|
||||||
const role = roles[i];
|
|
||||||
if (!data.find((r) => r.id === role.id)) {
|
|
||||||
role.label = role.name;
|
|
||||||
role.value = role.id.toString();
|
|
||||||
setData((prev) => [...prev, role]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
API.roles
|
|
||||||
.search(search)
|
|
||||||
.then((res) => {
|
|
||||||
if (res.status === 200) {
|
|
||||||
addRoles(res.data);
|
|
||||||
} else {
|
|
||||||
setNotification(true, res);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
setNotification(true, err);
|
|
||||||
});
|
|
||||||
// eslint-disable-next-line
|
|
||||||
}, [search]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
addRoles(defaultRoles);
|
|
||||||
// eslint-disable-next-line
|
|
||||||
}, [defaultRoles]);
|
|
||||||
|
|
||||||
// creatable
|
|
||||||
// getCreateLabel={(query) => `+ Create ${query}`}
|
|
||||||
// onCreate={(query) => {
|
|
||||||
// const item = { value: query, label: query };
|
|
||||||
// setData((current) => [...current, item]);
|
|
||||||
// return item;
|
|
||||||
// }}
|
|
||||||
return (
|
|
||||||
<MultiSelect
|
|
||||||
label={label}
|
|
||||||
data={data}
|
|
||||||
searchable
|
|
||||||
searchValue={search}
|
|
||||||
onSearchChange={setSearch}
|
|
||||||
value={value}
|
|
||||||
onChange={setValue}
|
|
||||||
maxDropdownHeight={160}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default RoleSelector;
|
|
@ -3,8 +3,10 @@ import API from '../../services/api';
|
|||||||
import PlaylistViewEditor from './playlist-view-editor';
|
import PlaylistViewEditor from './playlist-view-editor';
|
||||||
|
|
||||||
const ModalUpdatePlaylist = ({ item, opened, handler, updatePlaylist }) => {
|
const ModalUpdatePlaylist = ({ item, opened, handler, updatePlaylist }) => {
|
||||||
const validated = (playlist) => {
|
const validate = (playlist) => {
|
||||||
|
if (playlist) {
|
||||||
updatePlaylist(playlist);
|
updatePlaylist(playlist);
|
||||||
|
}
|
||||||
handler();
|
handler();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -25,7 +27,7 @@ const ModalUpdatePlaylist = ({ item, opened, handler, updatePlaylist }) => {
|
|||||||
item={item}
|
item={item}
|
||||||
buttonText="Update"
|
buttonText="Update"
|
||||||
APICall={API.playlists.update}
|
APICall={API.playlists.update}
|
||||||
handler={(playlist) => validated(playlist)}
|
handler={(playlist) => validate(playlist)}
|
||||||
/>
|
/>
|
||||||
</Modal.Body>
|
</Modal.Body>
|
||||||
</Modal.Content>
|
</Modal.Content>
|
||||||
|
@ -64,10 +64,10 @@ const API = {
|
|||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
upload(data) {
|
upload(data) {
|
||||||
return caller().post('/file', data);
|
return caller().post('/files', data);
|
||||||
},
|
},
|
||||||
list() {
|
list() {
|
||||||
return caller().get('/file');
|
return caller().get('/files');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
profile() {
|
profile() {
|
||||||
|
@ -4,7 +4,7 @@ module.exports = function(app) {
|
|||||||
app.use(
|
app.use(
|
||||||
'/api',
|
'/api',
|
||||||
createProxyMiddleware({
|
createProxyMiddleware({
|
||||||
target: 'http://192.168.2.183:5500',
|
target: 'http://127.0.0.1:5500',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user