Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Sep 21, 2024
1 parent 87d0cba commit e678af3
Show file tree
Hide file tree
Showing 27 changed files with 1,957 additions and 0 deletions.
1,543 changes: 1,543 additions & 0 deletions admin/assets/index-Bzuyxa8c.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions admin/assets/index-Bzuyxa8c.js.map

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions src-widgets/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import onlyWarn from 'eslint-plugin-only-warn';
import react from 'eslint-plugin-react';
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [...compat.extends(
'eslint:recommended',
'plugin:react/recommended',
'airbnb',
'plugin:eqeqeq-fix/recommended',
), {
plugins: {
'only-warn': onlyWarn,
react,
},

languageOptions: {
globals: {
...globals.browser,
},

ecmaVersion: 'latest',
sourceType: 'module',

parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},

rules: {
'arrow-parens': [1, 'as-needed'],
'react/jsx-indent': 'off',
'react/jsx-indent-props': 'off',
'react/no-access-state-in-setstate': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'no-plusplus': 'off',
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react/no-render-return-value': 'off',
'max-len': 'off',
'react/destructuring-assignment': 'off',
'react/prefer-stateless-function': 'off',
'react/self-closing-comp': 'off',
'react/jsx-filename-extension': 'off',
'no-nested-ternary': 'off',
'react/no-array-index-key': 'off',
'react/jsx-props-no-spreading': 'off',
'react/sort-comp': 'off',
'react/no-did-update-set-state': 'off',
'global-require': 'off',
'import/extensions': 'off',
'operator-linebreak': 'off',
'no-unused-expressions': 'off',
'prefer-destructuring': 'off',
'no-return-assign': 'off',
'no-multi-spaces': 'off',
'key-spacing': 'off',
'no-undef': 2,
'react/forbid-prop-types': 'off',
'react/require-default-props': 'off',
'import/no-extraneous-dependencies': 'off',
'react/jsx-wrap-multilines': 'off',
'react/jsx-closing-tag-location': 'off',
'no-restricted-syntax': 'off',
'guard-for-in': 'off',
'linebreak-style': ['off'],
'no-param-reassign': 'off',
'no-await-in-loop': 'off',

'no-console': ['error', {
allow: ['warn', 'error', 'log'],
}],

'no-underscore-dangle': 'off',
'no-constant-condition': 'off',
'no-loop-func': 'off',
'no-continue': 'off',
'implicit-arrow-linebreak': 'off',
radix: 'off',

indent: ['error', 4, {
SwitchCase: 1,
}],

'no-alert': 'off',
'react/function-component-definition': 'off',
},
}];
26 changes: 26 additions & 0 deletions src-widgets/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"baseUrl": "./",
"types": ["@iobroker/types", "vite/client"],
"paths": {
"@/*": ["src/*"]
}
},
"include": ["src"],
"exclude": ["node_modules", "build"]
}
2 changes: 2 additions & 0 deletions widgets/cameras/customWidgets.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions widgets/cameras/customWidgets.js.map

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions widgets/cameras/i18n/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"RTSP url": "RTSP-URL",
"RTSP Camera": "RTSP-Kamera",
"cameras_set_label": "RTSP-Kamera",
"name": "Name",
"without_card": "Ohne Rahmen",
"Cameras": "Kameras",
"Camera": "Kamera",
"Close": "Schließen",
"videoWidth": "Videobreite",
"tooltip_videoWidth": "Stellen Sie die Breite des Videos nicht zu hoch ein, um Breitband zu sparen. Es ist sowohl für kleine als auch für vollständige Videos geeignet. Wenn nicht festgelegt, wird die anfängliche Größe des Widgets verwendet.",
"Camera instance %s inactive": "Kamerainstanz %s inaktiv",
"disabled": "deaktiviert",
"pollingInterval": "Abrufintervall",
"pollingIntervalFull": "Abfrageintervall im Dialog",
"tooltip_ms": "Millisekunden",
"rotate": "Bild drehen",
"Polling Camera": "URL kamera",
"Cannot load URL": "URL kann nicht geladen werden",
"noCacheByFull": "Kein Cache im Dialog",
"camera_in_dialog": "Kamera im Dialog",
"No camera selected": "Keine Kamera ausgewählt"
}
23 changes: 23 additions & 0 deletions widgets/cameras/i18n/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"RTSP Camera": "RTSP Camera",
"without_card": "Without frame",
"name": "Name",
"RTSP url": "RTSP url",
"cameras_set_label": "RTSP Camera",
"Cameras": "Cameras",
"Camera": "Camera",
"Close": "Close",
"videoWidth": "Video width",
"tooltip_videoWidth": "Do not set width of video too hight to save broadband. It is for both: small and full videos. If not set, the initial size of widget will be taken.",
"Camera instance %s inactive": "Camera instance %s inactive",
"disabled": "disabled",
"pollingInterval": "Polling interval",
"pollingIntervalFull": "Polling interval in dialog",
"tooltip_ms": "milliseconds",
"rotate": "Rotate image",
"Polling Camera": "Polling Camera",
"Cannot load URL": "Cannot load URL",
"noCacheByFull": "No cache in dialog",
"camera_in_dialog": "Camera in Dialog",
"No camera selected": "No camera selected"
}
23 changes: 23 additions & 0 deletions widgets/cameras/i18n/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"RTSP url": "URL de RTSP",
"RTSP Camera": "Cámara RTSP",
"cameras_set_label": "Cámara RTSP",
"name": "Nombre",
"without_card": "sin marco",
"Cameras": "Cámaras",
"Camera": "Cámara",
"Close": "Cerca",
"videoWidth": "Ancho de vídeo",
"tooltip_videoWidth": "No configure el ancho del video demasiado alto para ahorrar banda ancha. Es para ambos: videos pequeños y completos. Si no se establece, se tomará el tamaño inicial del widget.",
"Camera instance %s inactive": "Instancia de cámara %s inactiva",
"disabled": "desactivado",
"pollingInterval": "Intervalo de votación",
"pollingIntervalFull": "Intervalo de sondeo en el diálogo",
"tooltip_ms": "milisegundos",
"rotate": "Girar imagen",
"Polling Camera": "Cámara de sondeo",
"Cannot load URL": "No se puede cargar la URL",
"noCacheByFull": "No hay caché en el diálogo",
"camera_in_dialog": "Cámara en diálogo",
"No camera selected": "Ninguna cámara seleccionada"
}
23 changes: 23 additions & 0 deletions widgets/cameras/i18n/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"RTSP url": "URL RTSP",
"RTSP Camera": "Caméra RTSP",
"cameras_set_label": "Caméra RTSP",
"name": "Nom",
"without_card": "Sans cadre",
"Cameras": "Appareils photo",
"Camera": "Caméra",
"Close": "Fermer",
"videoWidth": "Largeur vidéo",
"tooltip_videoWidth": "Ne définissez pas une largeur de vidéo trop élevée pour économiser le haut débit. C'est pour les deux : petites et complètes vidéos. S'il n'est pas défini, la taille initiale du widget sera prise.",
"Camera instance %s inactive": "Instance de caméra %s inactive",
"disabled": "désactivé",
"pollingInterval": "Intervalle d'interrogation",
"pollingIntervalFull": "Intervalle d'interrogation dans la boîte de dialogue",
"tooltip_ms": "millisecondes",
"rotate": "Faire pivoter l'image",
"Polling Camera": "Caméra de sondage",
"Cannot load URL": "Impossible de charger l'URL",
"noCacheByFull": "Pas de cache dans la boîte de dialogue",
"camera_in_dialog": "Caméra dans la boîte de dialogue",
"No camera selected": "Aucune caméra sélectionnée"
}
Loading

0 comments on commit e678af3

Please sign in to comment.