Skip to content

Commit

Permalink
* (bluefox) preparations for remote connection
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Apr 1, 2024
1 parent 9940ac2 commit ef24665
Show file tree
Hide file tree
Showing 14 changed files with 159 additions and 135 deletions.
64 changes: 32 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,51 @@
"@alcalzone/release-script-plugin-iobroker": "^3.7.0",
"@alcalzone/release-script-plugin-lerna": "^3.7.0",
"@alcalzone/release-script-plugin-license": "^3.7.0",
"@babel/core": "^7.23.9",
"@babel/core": "^7.24.3",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.23.9",
"@babel/plugin-proposal-decorators": "^7.24.1",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-syntax-jsx": "^7.23.3",
"@babel/plugin-transform-runtime": "^7.24.0",
"@babel/preset-env": "^7.23.9",
"@babel/preset-flow": "^7.23.3",
"@babel/preset-react": "^7.23.3",
"@babel/plugin-syntax-jsx": "^7.24.1",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/preset-env": "^7.24.3",
"@babel/preset-flow": "^7.24.1",
"@babel/preset-react": "^7.24.1",
"@craco/craco": "^7.1.0",
"@dilesoft/vite-plugin-federation-dynamic": "^1.1.9",
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@fnando/sparkline": "^0.3.10",
"@honkhonk/vite-plugin-svgr": "^1.1.0",
"@iobroker/adapter-react-v5": "^4.11.2",
"@iobroker/adapter-react-v5": "^4.13.3",
"@iobroker/admin-component-easy-access": "^0.3.2",
"@iobroker/dm-utils": "^0.1.9",
"@iobroker/legacy-testing": "^1.0.9",
"@iobroker/socket-client": "^2.3.13",
"@iobroker/testing": "^4.1.0",
"@iobroker/socket-client": "^2.4.3",
"@iobroker/testing": "^4.1.1",
"@iobroker/types": "^5.0.19",
"@mui/icons-material": "^5.15.10",
"@mui/lab": "5.0.0-alpha.165",
"@mui/icons-material": "^5.15.14",
"@mui/lab": "5.0.0-alpha.169",
"@mui/material": "5.14.14",
"@mui/styles": "5.15.11",
"@mui/x-data-grid": "^6.19.5",
"@mui/x-date-pickers": "^6.19.4",
"@mui/styles": "5.14.14",
"@mui/x-data-grid": "^6.19.8",
"@mui/x-date-pickers": "^6.19.8",
"@originjs/vite-plugin-commonjs": "^1.0.3",
"@react-leaflet/core": "^2.1.0",
"@sentry/browser": "^7.102.0",
"@sentry/integrations": "^7.102.0",
"@sentry/browser": "^7.109.0",
"@sentry/integrations": "^7.109.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@testing-library/react": "^14.2.2",
"@testing-library/user-event": "^14.5.2",
"@tsconfig/node16": "^16.1.1",
"@tsconfig/node16": "^16.1.3",
"@types/crypto-js": "^4.2.2",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.19",
"@types/react": "^18.2.57",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"@types/node": "^20.12.2",
"@types/react": "^18.2.73",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"babel": "^6.23.0",
"babel-plugin-inline-json-import": "^0.3.2",
"buffer": "^6.0.3",
"chai": "^4.3.10",
"chai": "^4.4.1",
"colorette": "^2.0.20",
"copy-to-clipboard": "^3.3.3",
"craco-babel-loader": "^1.0.4",
Expand All @@ -69,7 +69,7 @@
"date-fns": "^2.30.0",
"echarts": "^5.5.0",
"echarts-for-react": "^3.0.2",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-config-react-app": "^7.0.1",
Expand All @@ -79,7 +79,7 @@
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-only-warn": "^1.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"gulp": "^4.0.2",
"gulp-clean-css": "^4.3.0",
Expand All @@ -94,14 +94,14 @@
"leaflet-geosearch": "^3.11.1",
"lerna": "^8.1.2",
"lodash": "^4.17.21",
"mocha": "^10.3.0",
"mocha": "^10.4.0",
"moment": "^2.30.1",
"ol": "^9.0.0",
"ol": "^9.1.0",
"prettier": "^3.2.5",
"prop-types": "^15.8.1",
"puppeteer": "^22.1.0",
"puppeteer": "^22.6.1",
"react": "^18.2.0",
"react-ace": "^10.1.0",
"react-ace": "^11.0.1",
"react-color": "^2.19.3",
"react-cropper": "^2.3.3",
"react-dnd": "^16.0.1",
Expand All @@ -112,7 +112,7 @@
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-icons": "^5.0.1",
"react-inlinesvg": "^4.1.1",
"react-inlinesvg": "^4.1.3",
"react-leaflet": "^4.2.1",
"react-markdown": "^9.0.1",
"react-monaco-editor": "^0.55.0",
Expand All @@ -123,7 +123,7 @@
"ts-node": "^10.9.2",
"tsc-alias": "^1.8.8",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.3.3"
"typescript": "^5.4.3"
},
"scripts": {
"build": "npm run clean && lerna run build",
Expand Down
12 changes: 6 additions & 6 deletions packages/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
"setup"
],
"dependencies": {
"@iobroker/adapter-core": "^3.0.4",
"@iobroker/socket-classes": "^1.4.6",
"@iobroker/adapter-core": "^3.0.6",
"@iobroker/socket-classes": "^1.5.0",
"@iobroker/webserver": "^1.0.3",
"@iobroker/ws-server": "^2.1.2",
"ajv": "^8.12.0",
"archiver": "^6.0.1",
"axios": "^1.6.7",
"archiver": "^7.0.1",
"axios": "^1.6.8",
"body-parser": "^1.20.2",
"compression": "^1.7.4",
"connect-flash": "^0.1.1",
"cookie-parser": "^1.4.6",
"express": "^4.18.2",
"express-fileupload": "^1.4.3",
"express": "^4.19.2",
"express-fileupload": "^1.5.0",
"express-session": "^1.18.0",
"json5": "^2.2.3",
"mime": "^3.0.0",
Expand Down
77 changes: 39 additions & 38 deletions packages/admin/src/package.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
{
"name": "src-rx",
"private": true,
"homepage": ".",
"scripts": {
"start": "set DANGEROUSLY_DISABLE_HOST_CHECK=true&& craco start",
"old-start": "react-scripts start",
"lint": "eslint --fix --ext .js,.jsx,.tsx src",
"build": "craco build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"check-ts": "tsc --noEmit --checkJS false",
"tsc": "tsc --project tsconfig.build.json"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not op_mini all"
],
"dependencies": {
"@iobroker/json-config": "file:../../jsonConfig"
},
"proxy": "http://127.0.0.1:8081",
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
"name": "src-rx",
"private": true,
"homepage": ".",
"scripts": {
"start": "set DANGEROUSLY_DISABLE_HOST_CHECK=true&& craco start",
"old-start": "react-scripts start",
"lint": "eslint --fix --ext .js,.jsx,.tsx src",
"build": "craco build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"check-ts": "tsc --noEmit --checkJS false",
"tsc": "tsc --project tsconfig.build.json"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not op_mini all"
],
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
]
]
"dependencies": {
"@iobroker/json-config": "file:../../jsonConfig"
},
"proxy": "http://127.0.0.1:8081",
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
]
],
"version": "6.16.0"
}
15 changes: 12 additions & 3 deletions packages/admin/src/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ class App extends Router {
this.adaptersWorker.registerRepositoryHandler(this.repoChangeHandler);
this.adaptersWorker.registerHandler(this.adaptersChangeHandler);
this.hostsWorker.registerHandler(this.updateHosts);
this.hostsWorker.registerNotificationHandler(notifications => this.handleNewNotifications(notifications));
this.hostsWorker.registerNotificationHandler(this.handleNewNotifications);

this.subscribeOnHostsStatus();

Expand Down Expand Up @@ -1300,11 +1300,20 @@ class App extends Router {
*
* @param {Record<string, any>} notifications
*/
async handleNewNotifications(notifications) {
handleNewNotifications = async notifications => {
// console.log(`new notifications: ${JSON.stringify(notifications)}`);
let noNotifications = 0;

// if host is offline it returns null
if (!notifications) {
this.setState({ noNotifications, notifications: { } });
return;
}

for (const hostDetails of Object.values(notifications)) {
if (!hostDetails?.result) {
continue;
}
for (const [scope, scopeDetails] of Object.entries(hostDetails.result)) {
if (scope === 'system') {
continue;
Expand All @@ -1321,7 +1330,7 @@ class App extends Router {
const instances = await this.instancesWorker.getInstances();

this.setState({ noNotifications, notifications: { notifications, instances } });
}
};

showAdaptersWarning = (notifications, socket, host) => {
if (!notifications || !notifications[host] || !notifications[host].result) {
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/src/Workers/LogsWorker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class LogsWorker {
}
}

unregisterErrorCountHandler(cb: (errors: number) => void){
unregisterErrorCountHandler(cb: (errors: number) => void) {
const pos = this.errorCountHandlers.indexOf(cb);

if (pos !== -1) {
Expand Down
2 changes: 0 additions & 2 deletions packages/admin/src/src/Workers/ObjectsWorker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class ObjectsWorker {

private readonly handlers: ((events: ObjectEvent[]) => void)[];

private readonly repositoryHandlers: (() => void)[];

private promise: Promise<void | Record<string, ioBroker.Object>> | null;

private connected: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ class BaseSettingsSystem extends Component<BaseSettingsSystemProps, BaseSettings
this.state = {
memoryLimitMB: settings.memoryLimitMB || 0,
hostname: settings.hostname || '',
statisticsInterval: settings.statisticsInterval || 15000,
checkDiskInterval: settings.checkDiskInterval || 300000,
instanceStartInterval: settings.instanceStartInterval || 2000,
statisticsInterval: settings.statisticsInterval || 15_000,
checkDiskInterval: settings.checkDiskInterval || 300_000,
instanceStartInterval: settings.instanceStartInterval || 2_000,
compact: settings.compact || false,
allowShellCommands: settings.allowShellCommands || false,
memLimitWarn: settings.memLimitWarn || 100,
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/src/components/CustomPopper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Typography,
Fade,
Paper,
IconButton
IconButton,
} from '@mui/material';

import { Edit as EditIcon } from '@mui/icons-material';
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/src/components/Drawer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ import {
Utils, I18n, Icon, withWidth, IconLogout as LogoutIcon,
} from '@iobroker/adapter-react-v5';

import { getHref } from '@/tabs/CustomTab';
import DragWrapper from './DragWrapper';
import CustomDragLayer from './CustomDragLayer';
import { ContextWrapper } from './ContextWrapper';
import CustomPopper from './CustomPopper';
import { getHref } from '@/tabs/CustomTab';
import DrawerItem from './DrawerItem';
import Adapters from '../tabs/Adapters';

Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/src/components/FileBrowser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ class FileBrowser extends Component {
onClick={() => this.setState({ expertMode: !this.state.expertMode })}
size="small"
>
<ExpertIcon fontSize="small" />
<IconExpert fontSize="small" />
</IconButton> : null}
{this.props.showViewTypeButton ? <IconButton
edge="start"
Expand Down
Loading

0 comments on commit ef24665

Please sign in to comment.