aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDesmond Kyeremeh <elDekyfin@gmail.com>2021-07-12 03:30:34 +0000
committerDesmond Kyeremeh <elDekyfin@gmail.com>2021-07-12 03:30:34 +0000
commitf60983a4131862db0125844a651b994d2212022d (patch)
treec44ef60f3c37dbfc286ff3f4111f10a08b7d7b4f
parenta7e1b5f5fd772d37f9777fec097f28411f13562f (diff)
downloadetbsa-traccar-web-f60983a4131862db0125844a651b994d2212022d.tar.gz
etbsa-traccar-web-f60983a4131862db0125844a651b994d2212022d.tar.bz2
etbsa-traccar-web-f60983a4131862db0125844a651b994d2212022d.zip
Restored styling
-rw-r--r--modern/src/MainToolbar.js12
-rw-r--r--modern/src/admin/StatisticsPage.js33
-rw-r--r--modern/src/admin/UsersPage.js6
-rw-r--r--modern/src/attributes/EditAttributesView.js3
-rw-r--r--modern/src/settings/ComputedAttributesPage.js8
5 files changed, 15 insertions, 47 deletions
diff --git a/modern/src/MainToolbar.js b/modern/src/MainToolbar.js
index 8b6c22c..59c2eca 100644
--- a/modern/src/MainToolbar.js
+++ b/modern/src/MainToolbar.js
@@ -44,12 +44,8 @@ const MainToolbar = () => {
const history = useHistory();
const userId = useSelector(selectors.getUserId);
- const openDrawer = () => {
- setDrawer(true);
- };
- const closeDrawer = () => {
- setDrawer(false);
- };
+ const openDrawer = () => { setDrawer(true); };
+ const closeDrawer = () => { setDrawer(false); };
const handleLogout = async () => {
const response = await fetch('/api/session', { method: 'DELETE' });
@@ -73,9 +69,7 @@ const MainToolbar = () => {
<Typography variant="h6" color="inherit" className={classes.flex}>
Traccar
</Typography>
- <Button color="inherit" onClick={handleLogout}>
- {t('loginLogout')}
- </Button>
+ <Button color="inherit" onClick={handleLogout}>{t('loginLogout')}</Button>
</Toolbar>
</AppBar>
<Drawer open={drawer} onClose={closeDrawer}>
diff --git a/modern/src/admin/StatisticsPage.js b/modern/src/admin/StatisticsPage.js
index 20974f4..1f32c3d 100644
--- a/modern/src/admin/StatisticsPage.js
+++ b/modern/src/admin/StatisticsPage.js
@@ -21,36 +21,24 @@ const Filter = ({ setItems }) => {
selectedTo = moment().endOf('day');
break;
case 'yesterday':
- selectedFrom = moment()
- .subtract(1, 'day')
- .startOf('day');
- selectedTo = moment()
- .subtract(1, 'day')
- .endOf('day');
+ selectedFrom = moment().subtract(1, 'day').startOf('day');
+ selectedTo = moment().subtract(1, 'day').endOf('day');
break;
case 'thisWeek':
selectedFrom = moment().startOf('week');
selectedTo = moment().endOf('week');
break;
case 'previousWeek':
- selectedFrom = moment()
- .subtract(1, 'week')
- .startOf('week');
- selectedTo = moment()
- .subtract(1, 'week')
- .endOf('week');
+ selectedFrom = moment().subtract(1, 'week').startOf('week');
+ selectedTo = moment().subtract(1, 'week').endOf('week');
break;
case 'thisMonth':
selectedFrom = moment().startOf('month');
selectedTo = moment().endOf('month');
break;
case 'previousMonth':
- selectedFrom = moment()
- .subtract(1, 'month')
- .startOf('month');
- selectedTo = moment()
- .subtract(1, 'month')
- .endOf('month');
+ selectedFrom = moment().subtract(1, 'month').startOf('month');
+ selectedTo = moment().subtract(1, 'month').endOf('month');
break;
default:
selectedFrom = from;
@@ -58,13 +46,8 @@ const Filter = ({ setItems }) => {
break;
}
- const query = new URLSearchParams({
- from: selectedFrom.toISOString(),
- to: selectedTo.toISOString(),
- });
- const response = await fetch(`/api/statistics?${query.toString()}`, {
- Accept: 'application/json',
- });
+ const query = new URLSearchParams({ from: selectedFrom.toISOString(), to: selectedTo.toISOString() });
+ const response = await fetch(`/api/statistics?${query.toString()}`, { Accept: 'application/json' });
if (response.ok) {
setItems(await response.json());
}
diff --git a/modern/src/admin/UsersPage.js b/modern/src/admin/UsersPage.js
index 9b51cdd..a8b3c84 100644
--- a/modern/src/admin/UsersPage.js
+++ b/modern/src/admin/UsersPage.js
@@ -62,11 +62,7 @@ const UsersView = ({ updateTimestamp, onMenuClick }) => {
const UsersPage = () => (
<OptionsLayout>
- <EditCollectionView
- content={UsersView}
- editPath="/user"
- endpoint="users"
- />
+ <EditCollectionView content={UsersView} editPath="/user" endpoint="users" />
</OptionsLayout>
);
diff --git a/modern/src/attributes/EditAttributesView.js b/modern/src/attributes/EditAttributesView.js
index e8d427b..e38c02a 100644
--- a/modern/src/attributes/EditAttributesView.js
+++ b/modern/src/attributes/EditAttributesView.js
@@ -43,8 +43,7 @@ const EditAttributesView = ({ attributes, setAttributes, definitions }) => {
const getAttributeType = (value) => {
if (typeof value === 'number') {
return 'number';
- }
- if (typeof value === 'boolean') {
+ } if (typeof value === 'boolean') {
return 'boolean';
}
return 'string';
diff --git a/modern/src/settings/ComputedAttributesPage.js b/modern/src/settings/ComputedAttributesPage.js
index d376f23..9f131d3 100644
--- a/modern/src/settings/ComputedAttributesPage.js
+++ b/modern/src/settings/ComputedAttributesPage.js
@@ -20,9 +20,7 @@ const ComputedAttributeView = ({ updateTimestamp, onMenuClick }) => {
const classes = useStyles();
const [items, setItems] = useState([]);
- const adminEnabled = useSelector(
- (state) => state.session.user && state.session.user.administrator,
- );
+ const adminEnabled = useSelector((state) => state.session.user && state.session.user.administrator);
useEffectAsync(async () => {
const response = await fetch('/api/attributes/computed');
@@ -49,9 +47,7 @@ const ComputedAttributeView = ({ updateTimestamp, onMenuClick }) => {
{adminEnabled
&& (
<TableCell className={classes.columnAction} padding="none">
- <IconButton
- onClick={(event) => onMenuClick(event.currentTarget, item.id)}
- >
+ <IconButton onClick={(event) => onMenuClick(event.currentTarget, item.id)}>
<MoreVertIcon />
</IconButton>
</TableCell>