-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
656 additions
and
12 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// in posts.js | ||
import * as React from "react"; | ||
import { List, Datagrid, TextField, EditButton, NumberField, ReferenceField} from 'react-admin'; | ||
import KeyActions from "./KeyActions"; | ||
|
||
export const BuildingList = (props) => ( | ||
<List | ||
actions={<KeyActions/>} | ||
{...props} | ||
> | ||
<Datagrid rowClick="show"> | ||
<TextField source="name"/> | ||
<EditButton/> | ||
</Datagrid> | ||
</List> | ||
); | ||
|
||
|
||
|
||
|
||
|
||
export default BuildingList |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import * as React from 'react'; | ||
import { cloneElement } from 'react'; | ||
import { | ||
useListContext, | ||
TopToolbar, | ||
CreateButton, | ||
ExportButton, | ||
sanitizeListRestProps, | ||
} from 'react-admin'; | ||
|
||
const KeyActions = (props) => { | ||
const { | ||
className, | ||
exporter, | ||
filters, | ||
maxResults, | ||
...rest | ||
} = props; | ||
const { | ||
currentSort, | ||
resource, | ||
displayedFilters, | ||
filterValues, | ||
basePath, | ||
showFilter, | ||
total, | ||
} = useListContext(); | ||
|
||
|
||
return ( | ||
<TopToolbar className={className} {...sanitizeListRestProps(rest)}> | ||
{filters && cloneElement(filters, { | ||
resource, | ||
showFilter, | ||
displayedFilters, | ||
filterValues, | ||
context: 'button', | ||
})} | ||
<CreateButton basePath={basePath} /> | ||
<ExportButton | ||
disabled={total === 0} | ||
resource={resource} | ||
sort={currentSort} | ||
filterValues={filterValues} | ||
maxResults={maxResults} | ||
/> | ||
|
||
</TopToolbar> | ||
); | ||
}; | ||
|
||
export default KeyActions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// in posts.js | ||
import * as React from "react"; | ||
import { Create, SimpleForm, TextInput, BooleanInput, DateTimeInput, ReferenceInput, SelectInput } from 'react-admin'; | ||
|
||
|
||
|
||
|
||
|
||
const KeyCreate = (props) => ( | ||
<Create title="Create a Post" {...props} > | ||
<SimpleForm> | ||
<TextInput source="name" /> | ||
<TextInput source="uid" /> | ||
<DateTimeInput source="validUntil" showTime locales="de" /> | ||
<BooleanInput source="isOneTimeCode" /> | ||
<ReferenceInput reference="newkey" source="newkey_id" allowEmpty {...props}> | ||
<SelectInput optionText="uid" /> | ||
</ReferenceInput> | ||
</SimpleForm> | ||
</Create> | ||
); | ||
|
||
export default KeyCreate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
import {Edit, SimpleForm, TextInput, DateInput, BooleanInput} from 'react-admin' | ||
|
||
const KeyEdit = (props) => ( | ||
<Edit {...props}> | ||
<SimpleForm> | ||
<TextInput disabled source="id" /> | ||
<TextInput source="uid" disabled /> | ||
<TextInput source="name" /> | ||
<DateInput label="valid until" source="validUntil" showTime locales="de" /> | ||
<BooleanInput source="isOneTimeCode" /> | ||
</SimpleForm> | ||
</Edit> | ||
); | ||
|
||
export default KeyEdit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react' | ||
import {Datagrid, Show, SimpleShowLayout, ArrayField, BooleanField, NumberField, DateField, TextField} from 'react-admin'; | ||
|
||
|
||
|
||
|
||
|
||
const LockShow = (props) => { | ||
return ( | ||
<Show title=" " {...props}> | ||
<SimpleShowLayout {...props}> | ||
<TextField source="name"/> | ||
<TextField source="uid" /> | ||
<NumberField source="acctype" /> | ||
<NumberField source="acctype2" /> | ||
<NumberField source="acctype3" /> | ||
<NumberField source="acctype4" /> | ||
<DateField source="validUntil" showTime locales="de"/> | ||
<BooleanField source="isOneTimeCode" /> | ||
|
||
<ArrayField label="KEY IS ON THESE READERS" source="readerKeys" > | ||
<Datagrid> | ||
<TextField label="name" source="reader.readerName" /> | ||
<TextField label="local ip" source="reader.ip" /> | ||
<DateField label="last ping" source="reader.lastPing" showTime locales="de"/> | ||
</Datagrid> | ||
</ArrayField> | ||
</SimpleShowLayout> | ||
</Show> | ||
) | ||
} | ||
|
||
export default LockShow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import * as React from 'react'; | ||
import { cloneElement } from 'react'; | ||
import { | ||
useListContext, | ||
TopToolbar, | ||
CreateButton, | ||
ExportButton, | ||
sanitizeListRestProps, | ||
} from 'react-admin'; | ||
|
||
const KeyActions = (props) => { | ||
const { | ||
className, | ||
exporter, | ||
filters, | ||
maxResults, | ||
...rest | ||
} = props; | ||
const { | ||
currentSort, | ||
resource, | ||
displayedFilters, | ||
filterValues, | ||
basePath, | ||
showFilter, | ||
total, | ||
} = useListContext(); | ||
|
||
|
||
return ( | ||
<TopToolbar className={className} {...sanitizeListRestProps(rest)}> | ||
{filters && cloneElement(filters, { | ||
resource, | ||
showFilter, | ||
displayedFilters, | ||
filterValues, | ||
context: 'button', | ||
})} | ||
<CreateButton basePath={basePath} /> | ||
<ExportButton | ||
disabled={total === 0} | ||
resource={resource} | ||
sort={currentSort} | ||
filterValues={filterValues} | ||
maxResults={maxResults} | ||
/> | ||
|
||
</TopToolbar> | ||
); | ||
}; | ||
|
||
export default KeyActions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// in posts.js | ||
import * as React from "react"; | ||
import { Create, SimpleForm, TextInput, BooleanInput, DateTimeInput, ReferenceInput, SelectInput } from 'react-admin'; | ||
|
||
|
||
|
||
|
||
|
||
const KeyCreate = (props) => ( | ||
<Create title="Create a Post" {...props} > | ||
<SimpleForm> | ||
<TextInput source="name" /> | ||
<TextInput source="uid" /> | ||
<DateTimeInput source="validUntil" showTime locales="de" /> | ||
<BooleanInput source="isOneTimeCode" /> | ||
<ReferenceInput reference="newkey" source="newkey_id" allowEmpty {...props}> | ||
<SelectInput optionText="uid" /> | ||
</ReferenceInput> | ||
</SimpleForm> | ||
</Create> | ||
); | ||
|
||
export default KeyCreate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
import {Edit, SimpleForm, TextInput, DateInput, BooleanInput} from 'react-admin' | ||
|
||
const KeyEdit = (props) => ( | ||
<Edit {...props}> | ||
<SimpleForm> | ||
<TextInput disabled source="id" /> | ||
<TextInput source="uid" disabled /> | ||
<TextInput source="name" /> | ||
<DateInput label="valid until" source="validUntil" showTime locales="de" /> | ||
<BooleanInput source="isOneTimeCode" /> | ||
</SimpleForm> | ||
</Edit> | ||
); | ||
|
||
export default KeyEdit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// in posts.js | ||
import * as React from "react"; | ||
import { List, Datagrid, TextField, EditButton, NumberField, ReferenceField} from 'react-admin'; | ||
import KeyActions from "./KeyActions"; | ||
|
||
export const LockList = (props) => ( | ||
<List | ||
actions={<KeyActions/>} | ||
{...props} | ||
> | ||
<Datagrid rowClick="show"> | ||
<TextField source="name"/> | ||
<TextField source="type" /> | ||
<NumberField source="slot"/> | ||
<ReferenceField label="Building" reference="building" source="building.id" link="show"> | ||
<TextField source="name"/> | ||
</ReferenceField> | ||
<ReferenceField label="Reader" reference="reader" source="reader.id" link="show"> | ||
<TextField source="readerName"/> | ||
</ReferenceField> | ||
<EditButton/> | ||
</Datagrid> | ||
</List> | ||
); | ||
|
||
|
||
|
||
|
||
|
||
export default LockList |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react' | ||
import {Datagrid, Show, SimpleShowLayout, ArrayField, BooleanField, NumberField, DateField, TextField} from 'react-admin'; | ||
|
||
|
||
|
||
|
||
|
||
const LockShow = (props) => { | ||
return ( | ||
<Show title=" " {...props}> | ||
<SimpleShowLayout {...props}> | ||
<TextField source="name"/> | ||
<TextField source="uid" /> | ||
<NumberField source="acctype" /> | ||
<NumberField source="acctype2" /> | ||
<NumberField source="acctype3" /> | ||
<NumberField source="acctype4" /> | ||
<DateField source="validUntil" showTime locales="de"/> | ||
<BooleanField source="isOneTimeCode" /> | ||
|
||
<ArrayField label="KEY IS ON THESE READERS" source="readerKeys" > | ||
<Datagrid> | ||
<TextField label="name" source="reader.readerName" /> | ||
<TextField label="local ip" source="reader.ip" /> | ||
<DateField label="last ping" source="reader.lastPing" showTime locales="de"/> | ||
</Datagrid> | ||
</ArrayField> | ||
</SimpleShowLayout> | ||
</Show> | ||
) | ||
} | ||
|
||
export default LockShow |
Oops, something went wrong.