Skip to content

Commit

Permalink
### __WORK IN PROGRESS__
Browse files Browse the repository at this point in the history
* (bluefox) Corrected some GUI errors
  • Loading branch information
GermanBluefox committed Jul 9, 2021
1 parent b16cfe6 commit 9c8f31e
Show file tree
Hide file tree
Showing 27 changed files with 221 additions and 63 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ The icons may not be reused in other projects without the proper flaticon licens
-->

## Changelog
### __WORK IN PROGRESS__
* (bluefox) Corrected some GUI errors

### 5.1.9 (2021-06-09)
* (bluefox) Corrected some GUI errors

Expand Down
7 changes: 6 additions & 1 deletion admin/i18n/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@
"sec": "Sek",
"Use background image": "Hintergrundbild verwenden",
"Upload image": "Bild hochladen",
"Undo": "Rückgängig machen"
"Undo": "Rückgängig machen",
"End date": "Enddatum",
"End time": "Endzeit",
"Insert entry": "Eintrag einfügen",
"No data in history for selected period": "Keine Daten im Verlauf für den ausgewählten Zeitraum",
"1 minute": "1 Minute"
}
7 changes: 6 additions & 1 deletion admin/i18n/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@
"sec": "sec",
"Use background image": "Use background image",
"Upload image": "Upload image",
"Undo": "Undo"
"Undo": "Undo",
"End date": "End date",
"End time": "End time",
"Insert entry": "Insert entry",
"No data in history for selected period": "No data in history for selected period",
"1 minute": "1 minute"
}
7 changes: 6 additions & 1 deletion admin/i18n/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@
"sec": "segundo",
"Use background image": "Usar imagen de fondo",
"Upload image": "Cargar imagen",
"Undo": "Deshacer"
"Undo": "Deshacer",
"End date": "Fecha final",
"End time": "Hora de finalización",
"Insert entry": "Insertar entrada",
"No data in history for selected period": "No hay datos en el historial para el período seleccionado",
"1 minute": "1 minuto"
}
7 changes: 6 additions & 1 deletion admin/i18n/fr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@
"sec": "seconde",
"Use background image": "Utiliser l'image d'arrière-plan",
"Upload image": "Télécharger une image",
"Undo": "annuler"
"Undo": "annuler",
"End date": "Date de fin",
"End time": "Heure de fin",
"Insert entry": "Insérer une entrée",
"No data in history for selected period": "Aucune donnée dans l'historique pour la période sélectionnée",
"1 minute": "1 minute"
}
7 changes: 6 additions & 1 deletion admin/i18n/it/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@
"sec": "secondo",
"Use background image": "Usa immagine di sfondo",
"Upload image": "Carica immagine",
"Undo": "Disfare"
"Undo": "Disfare",
"End date": "Data di fine",
"End time": "Tempo scaduto",
"Insert entry": "Inserisci voce",
"No data in history for selected period": "Nessun dato nella cronologia per il periodo selezionato",
"1 minute": "1 minuto"
}
7 changes: 6 additions & 1 deletion admin/i18n/nl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@
"sec": "sec",
"Use background image": "Achtergrondafbeelding gebruiken",
"Upload image": "Afbeelding uploaden",
"Undo": "ongedaan maken"
"Undo": "ongedaan maken",
"End date": "Einddatum",
"End time": "Eindtijd",
"Insert entry": "Invoer invoegen",
"No data in history for selected period": "Geen gegevens in geschiedenis voor geselecteerde periode",
"1 minute": "1 minuut"
}
7 changes: 6 additions & 1 deletion admin/i18n/pl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@
"sec": "sek",
"Use background image": "Użyj obrazu tła",
"Upload image": "Załaduj obrazek",
"Undo": "Cofnij"
"Undo": "Cofnij",
"End date": "Data końcowa",
"End time": "Koniec czasu",
"Insert entry": "Wstaw wpis",
"No data in history for selected period": "Brak danych w historii dla wybranego okresu",
"1 minute": "1 minuta"
}
7 changes: 6 additions & 1 deletion admin/i18n/pt/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@
"sec": "s",
"Use background image": "Use imagem de fundo",
"Upload image": "Enviar Imagem",
"Undo": "Desfazer"
"Undo": "Desfazer",
"End date": "Data final",
"End time": "Fim do tempo",
"Insert entry": "Inserir entrada",
"No data in history for selected period": "Nenhum dado no histórico para o período selecionado",
"1 minute": "1 minuto"
}
7 changes: 6 additions & 1 deletion admin/i18n/ru/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@
"sec": "сек",
"Use background image": "Использовать фоновое изображение",
"Upload image": "Загрузить изображение",
"Undo": "Отменить"
"Undo": "Отменить",
"End date": "До",
"End time": "Время до",
"Insert entry": "Вставить запись",
"No data in history for selected period": "Нет данных в истории за выбранный период",
"1 minute": "1 минута"
}
7 changes: 6 additions & 1 deletion admin/i18n/zh-cn/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@
"sec": "",
"Use background image": "使用背景图片",
"Upload image": "上传图片",
"Undo": "撤消"
"Undo": "撤消",
"End date": "结束日期",
"End time": "时间结束",
"Insert entry": "插入条目",
"No data in history for selected period": "所选期间的历史记录中没有数据",
"1 minute": "1分钟"
}
4 changes: 2 additions & 2 deletions src-rx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@date-io/core": "^1.3.13",
"@date-io/date-fns": "^1.3.13",
"@fnando/sparkline": "^0.3.10",
"@iobroker/adapter-react": "^1.6.29",
"@iobroker/adapter-react": "^1.6.30",
"@material-ui/core": "^4.11.4",
"@material-ui/data-grid": "^4.0.0-alpha.30",
"@material-ui/icons": "^4.11.2",
Expand Down Expand Up @@ -67,4 +67,4 @@
"not dead",
"not op_mini all"
]
}
}
3 changes: 1 addition & 2 deletions src-rx/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const styles = theme => ({
animation: '0.2s linear infinite alternate $myEffect2',
},
performed: {
color: '#388e3c',
color: theme.palette.type === 'light' ? '#3bfd44' : '#388e3c',
animation: '0.2s linear infinite alternate $myEffect2',
},
wrapperButtons: {
Expand Down Expand Up @@ -1280,7 +1280,6 @@ class App extends Router {
}

showAlert(message, type) {

if (type !== 'error' && type !== 'warning' && type !== 'info' && type !== 'success') {
type = 'info';
}
Expand Down
1 change: 1 addition & 0 deletions src-rx/src/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Marked with "!" must be in release candidate
## Adapters
- Install command: during installation the close button in upper right corner is not disabled
- Show icons for autocomplete in github dialog
- Make close button black and not red

## Wizard
- Replace map with leaflet
Expand Down
12 changes: 9 additions & 3 deletions src-rx/src/components/Adapters/AdapterRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ const styles = theme => ({
filter: 'invert(0%) sepia(90%) saturate(1267%) hue-rotate(-260deg) brightness(99%) contrast(97%)'
},
rating: {
cursor: 'pointer'
cursor: 'pointer',
height: 18
},
nameCell: {
paddingTop: '0 !important',
paddingBottom: '0 !important',
}
});

Expand Down Expand Up @@ -253,7 +258,8 @@ class AdapterRow extends Component {
/>
</Grid>
{/* <Grid item>{name}</Grid> */}
<Grid item><div>{name}</div>
<Grid item className={classes.nameCell}>
<div>{name}</div>
{!versionDate ? <div
onClick={onSetRating ? () => onSetRating() : undefined}
className={clsx(classes.rating, onSetRating && classes.ratingSet)}
Expand All @@ -270,7 +276,7 @@ class AdapterRow extends Component {
</Grid>
</Grid>
</TableCell>
{!descHidden && <TableCell>{this.props.description}</TableCell>}
{!descHidden && <TableCell title={this.props.description}>{this.props.description}</TableCell>}
<TableCell>
<div className={classes.flex}>
{connectionType === 'cloud' ?
Expand Down
2 changes: 1 addition & 1 deletion src-rx/src/components/Enums/EnumsMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ class EnumsList extends Component {
ids.sort(sort(container.children, this.getName));
}

let name = this.getName(container.data.common?.name);
let name = this.getName(container.data?.common?.name);
let idText = container.id;
if (this.state.search) {
const search = this.state.search;
Expand Down
32 changes: 28 additions & 4 deletions src-rx/src/components/Instances/InstanceRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,24 @@ const styles = theme => ({
opacity: '.3 !important',
background: 'repeating-linear-gradient(135deg, #333, #333 10px, #888 10px, #888 20px)',
}
},
desktopRow: {
minHeight: 0
},
desktopIcon: {
height: 32,
width: 32,
marginTop: 4
},
desktopRowContent: {
marginTop: 2,
marginBottom: 2,
},
desktopButton: {
paddingRight: 12,
paddingTop: 4,
paddingBottom: 4,
paddingLeft: 4,
}
});

Expand Down Expand Up @@ -665,6 +683,7 @@ const InstanceRow = ({
const [hostValue, setHostValue] = useState(host);

const [visibleEdit, handlerEdit] = useState(false);
const desktop = window.innerWidth > 1000;

let showModal = false;
let title;
Expand Down Expand Up @@ -874,14 +893,19 @@ const InstanceRow = ({
}}>
{linksDialog}
<AccordionSummary
classes={{ root: classes.row }}
classes={{
root: classes.row,
content: desktop ? classes.desktopRowContent : undefined,
expandIcon: desktop ? classes.desktopButton : undefined,
}}
className={clsx(
(!running || instance.mode !== 'daemon') && (idx % 2 === 0 ? classes.instanceStateNotEnabled1 : classes.instanceStateNotEnabled2),
running && instance.mode === 'daemon' && (!connectedToHost || !alive) && (idx % 2 === 0 ? classes.instanceStateNotAlive1 : classes.instanceStateNotAlive2),
running && connectedToHost && alive && connected === false && (idx % 2 === 0 ? classes.instanceStateAliveNotConnected1 : classes.instanceStateAliveNotConnected2),
running && connectedToHost && alive && connected !== false && (idx % 2 === 0 ? classes.instanceStateAliveAndConnected1 : classes.instanceStateAliveAndConnected1)
running && connectedToHost && alive && connected !== false && (idx % 2 === 0 ? classes.instanceStateAliveAndConnected1 : classes.instanceStateAliveAndConnected1),
desktop && classes.desktopRow
)}
expandIcon={<ExpandMoreIcon />}>
expandIcon={<ExpandMoreIcon/>}>
{customModal}
{stopAdminDialog}
{(openDialogCron || openDialogSchedule) && <ComplexCron
Expand Down Expand Up @@ -924,7 +948,7 @@ const InstanceRow = ({
variant="square"
alt={instance.id}
src={instance.image}
className={classes.instanceIcon}
className={clsx(classes.instanceIcon, desktop && classes.desktopIcon)}
/>
<div className={classes.instanceId}>{instance.id}</div>
</div>
Expand Down
16 changes: 16 additions & 0 deletions src-rx/src/components/JsonConfigComponent/ConfigGeneric.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class ConfigGeneric extends Component {
confirmData: null,
};

this.isError = {};

if (this.props.custom) {
this.defaultValue = this.props.schema.defaultFunc ? this.executeCustom(this.props.schema.defaultFunc, this.props.schema.default, this.props.data, this.props.instanceObj) : this.props.schema.default;
} else {
Expand Down Expand Up @@ -332,6 +334,12 @@ class ConfigGeneric extends Component {
}

onError(attr, error) {
if (!error) {
delete this.isError[attr];
} else {
this.isError[attr] = error;
}

this.props.onError && this.props.onError(attr, error);
}

Expand Down Expand Up @@ -389,6 +397,14 @@ class ConfigGeneric extends Component {
const schema = this.props.schema;

if (hidden) {
// Remove all errors if element is hidden
if (Object.keys(this.isError)) {
setTimeout(isError =>
Object.keys(isError).forEach(attr => this.props.onError(attr)),
100, JSON.parse(JSON.stringify(this.isError)));
this.isError = {};
}

if (schema.hideOnlyControl) {
const item = <Grid
item
Expand Down
9 changes: 8 additions & 1 deletion src-rx/src/components/Object/ObjectChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Toolbar from '@material-ui/core/Toolbar';
import Fab from '@material-ui/core/Fab';

import ReactEchartsCore from 'echarts-for-react/lib/core';

import * as echarts from 'echarts/core';
import { LineChart } from 'echarts/charts';
import {
Expand Down Expand Up @@ -85,6 +86,7 @@ const styles = theme => ({
maxHeight: '100%',
maxWidth: '100%',
overflow: 'hidden',
width: '100%'
},
chart: {
width: '100%',
Expand Down Expand Up @@ -179,7 +181,7 @@ class ObjectChart extends Component {

this.state = {
loaded: false,
historyInstance: '',
historyInstance: this.props.historyInstance || '',
historyInstances: null,
defaultHistory: '',
chartHeight: 300,
Expand Down Expand Up @@ -315,6 +317,11 @@ class ObjectChart extends Component {
getHistoryInstances() {
const list = [];
const ids = [];

if (this.props.historyInstance) {
return Promise.resolve(list);
}

this.props.customsInstances.forEach(instance => {
const instObj = this.props.objects['system.adapter.' + instance];
if (instObj && instObj.common && instObj.common.getHistory) {
Expand Down
2 changes: 1 addition & 1 deletion src-rx/src/components/Users/GroupBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function GroupBlock(props) {
key={i}
variant="outlined"
className={props.classes.userGroupMember}
style={{ color: _textColor, borderColor: _textColor + '80', background: user.common?.color || 'inherit' }}
style={{ color: _textColor, borderColor: _textColor + '40', background: user.common?.color || 'inherit' }}
>
{user.common.icon ?
<Icon
Expand Down
Loading

0 comments on commit 9c8f31e

Please sign in to comment.