Skip to content

Commit

Permalink
Do not load vis-1 widgets if vis-2 widgets provided
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Jan 23, 2025
1 parent c8eba76 commit a7a5176
Show file tree
Hide file tree
Showing 14 changed files with 55,844 additions and 55,679 deletions.
1,359 changes: 681 additions & 678 deletions README.md

Large diffs are not rendered by default.

109,097 changes: 54,643 additions & 54,454 deletions package-lock.json

Large diffs are not rendered by default.

74 changes: 37 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
{
"name": "iobroker.vis-2",
"private": true,
"workspaces": [
"packages/*"
],
"dependencies": {
"@iobroker/types-vis-2": "file:packages/types-vis-2",
"iobroker.vis-2": "file:packages/iobroker.vis-2"
},
"devDependencies": {
"@alcalzone/release-script": "^3.8.0",
"@alcalzone/release-script-plugin-iobroker": "^3.7.2",
"@alcalzone/release-script-plugin-lerna": "^3.7.0",
"@alcalzone/release-script-plugin-license": "^3.7.0",
"@iobroker/adapter-react-v5": "^7.4.3",
"@iobroker/eslint-config": "^1.0.0",
"@iobroker/types": "^6.0.11",
"@mui/material": "^6.1.9",
"lerna": "^8.1.9",
"moment": "^2.30.1",
"react": "^18.3.1",
"typescript": "^5.7.2"
},
"scripts": {
"build": "npm run clean && lerna run build",
"clean": "lerna run clean",
"install-monorepo": "npm i -f && npm i -w packages/iobroker.vis-2 -f && npm i -w packages/types-vis-2 -f",
"npm": "npm run install-monorepo",
"update-packages": "ncu --upgrade && cd package/iobroker.vis-2 && ncu --upgrade && cd package/iobroker.vis-2/src && ncu --upgrade && cd package/types-vis-2 && ncu --upgrade",
"start": "npm run start -w packages/iobroker.vis-2",
"release": "release-script",
"release-patch": "release-script patch --yes --no-update-lockfile --publishAll",
"release-minor": "release-script minor --yes --no-update-lockfile --publishAll",
"release-major": "release-script major --yes --no-update-lockfile --publishAll"
}
}
{
"name": "iobroker.vis-2",
"private": true,
"workspaces": [
"packages/*"
],
"dependencies": {
"@iobroker/types-vis-2": "file:packages/types-vis-2",
"iobroker.vis-2": "file:packages/iobroker.vis-2"
},
"devDependencies": {
"@alcalzone/release-script": "^3.8.0",
"@alcalzone/release-script-plugin-iobroker": "^3.7.2",
"@alcalzone/release-script-plugin-lerna": "^3.7.0",
"@alcalzone/release-script-plugin-license": "^3.7.0",
"@iobroker/adapter-react-v5": "^7.4.15",
"@iobroker/eslint-config": "^1.0.0",
"@iobroker/types": "^7.0.6",
"@mui/material": "^6.4.1",
"lerna": "^8.1.9",
"moment": "^2.30.1",
"react": "^18.3.1",
"typescript": "^5.7.3"
},
"scripts": {
"build": "npm run clean && lerna run build",
"clean": "lerna run clean",
"install-monorepo": "npm i -f && npm i -w packages/iobroker.vis-2 -f && npm i -w packages/types-vis-2 -f",
"npm": "npm run install-monorepo",
"update-packages": "npx -y npm-check-updates --upgrade && cd packages/iobroker.vis-2 && npx -y npm-check-updates --upgrade && cd ./src-vis && npx -y npm-check-updates --upgrade && cd ../../types-vis-2 && npx -y npm-check-updates --upgrade",
"start": "npm run start -w packages/iobroker.vis-2",
"release": "release-script",
"release-patch": "release-script patch --yes --no-update-lockfile --publishAll",
"release-minor": "release-script minor --yes --no-update-lockfile --publishAll",
"release-major": "release-script major --yes --no-update-lockfile --publishAll"
}
}
637 changes: 314 additions & 323 deletions packages/iobroker.vis-2/io-package.json

Large diffs are not rendered by default.

242 changes: 121 additions & 121 deletions packages/iobroker.vis-2/package.json
Original file line number Diff line number Diff line change
@@ -1,123 +1,123 @@
{
"name": "iobroker.vis-2",
"description": "Next generation graphical user interface for ioBroker.",
"version": "2.11.1",
"author": {
"name": "bluefox",
"email": "[email protected]"
},
"contributors": [
"bluefox <[email protected]>",
"hobbyquaker <[email protected]>"
],
"homepage": "https://github.com/iobroker/iobroker.vis-2",
"repository": {
"type": "git",
"url": "git+https://github.com/ioBroker/ioBroker.vis-2.git"
},
"keywords": [
"iobroker",
"GUI",
"DashUI",
"web interface",
"home automation",
"SCADA",
"vis-2"
],
"dependencies": {
"@iobroker/adapter-core": "^3.2.2",
"axios": "^1.7.8",
"jsonwebtoken": "^9.0.2",
"mime": "^3.0.0"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@craco/craco": "^7.1.0",
"@devbookhq/splitter": "^1.4.2",
"@iobroker/build-tools": "^2.0.9",
"@iobroker/type-detector": "^4.0.1",
"@iobroker/vis-2-widgets-react-dev": "^4.0.4",
"@iobroker/vis-2-widgets-testing": "^1.0.5",
"@material-icons/svg": "^1.0.33",
"@mui/icons-material": "^6.1.9",
"@mui/material": "^6.1.9",
"@mui/x-date-pickers": "^7.23.0",
"@reduxjs/toolkit": "^2.4.0",
"@sentry/browser": "^8.41.0",
"@tsconfig/node18": "^18.2.4",
"@types/dom-speech-recognition": "^0.0.4",
"@types/jquery": "^3.5.32",
"@types/jsonwebtoken": "^9.0.7",
"@types/mime": "^3.0.4",
"@types/mocha": "^10.0.10",
"@types/react-beautiful-dnd": "^13.1.8",
"@types/react-color": "^3.0.12",
"@types/react-dom": "^18.3.1",
"@types/unzipper": "^0.10.10",
"@types/uuid": "^10.0.0",
"ace-builds": "^1.36.5",
"chai": "^4.5.0",
"craco-module-federation": "^1.1.0",
"dayjs": "^1.11.13",
"echarts": "^5.5.1",
"echarts-for-react": "^3.0.2",
"html-to-image": "^1.11.11",
"iobroker.web": "*",
"jquery-ui": "^1.13.3",
"mocha": "^10.8.2",
"mui-nested-menu": "^3.4.0",
"react-ace": "^13.0.0",
"react-beautiful-dnd": "^13.1.1",
"react-color": "^2.19.3",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dnd-preview": "^8.0.3",
"react-dnd-touch-backend": "^16.0.1",
"react-dom": "^18.3.1",
"react-dropzone": "^14.3.5",
"react-icons": "^5.3.0",
"redux": "^5.0.1",
"sass": "^1.81.0",
"unzipper": "^0.12.3",
"uuid": "^11.0.3"
},
"bugs": {
"url": "https://github.com/iobroker/iobroker.vis/issues"
},
"main": "build-backend/main.js",
"files": [
"admin/",
"img/",
"lib/",
"build-backend/",
"www/",
"io-package.json",
"LICENSE"
],
"scripts": {
"check-ts": "cd src-vis && tsc --project tsconfig.json && cd .. && tsc --project tsconfig.build.json",
"start": "cd src-vis && npm run start",
"test": "mocha ./test/*.engine.js --exit",
"test-gui": "mocha ./test/*.gui.js --exit",
"tsc": "tsc --project tsconfig.build.json && npm run copy-backend",
"copy-backend": "node tasks --copy-backend",
"prepublishOnly": "npm run build",
"clean": "rimraf runtime src-vis/build www",
"build": "npm run tsc && node tasks",
"runtime-0-clean": "node tasks --runtime-0-clean",
"runtime-1-copy-src": "node tasks --runtime-1-copy-src",
"runtime-2-npm": "node tasks --runtime-2-npm",
"runtime-3-build": "node tasks --runtime-3-build",
"runtime-4-copy": "node tasks --runtime-4-copy",
"runtime-5-patch": "node tasks --runtime-5-patch",
"0-clean": "node tasks --0-clean",
"1-npm": "node tasks --1-npm",
"2-svg-icons": "node tasks --2-svg-icons",
"3-build": "node tasks --3-build",
"4-copy": "node tasks --4-copy",
"5-patch": "node tasks --5-patch",
"update-packages": "ncu --upgrade && cd src-vis && ncu --upgrade && cd ..",
"npm": "npm i -f && cd src-vis && npm i -f"
},
"license": "CC-BY-NC-4.0"
"name": "iobroker.vis-2",
"description": "Next generation graphical user interface for ioBroker.",
"version": "2.11.1",
"author": {
"name": "bluefox",
"email": "[email protected]"
},
"contributors": [
"bluefox <[email protected]>",
"hobbyquaker <[email protected]>"
],
"homepage": "https://github.com/iobroker/iobroker.vis-2",
"repository": {
"type": "git",
"url": "git+https://github.com/ioBroker/ioBroker.vis-2.git"
},
"keywords": [
"iobroker",
"GUI",
"DashUI",
"web interface",
"home automation",
"SCADA",
"vis-2"
],
"dependencies": {
"@iobroker/adapter-core": "^3.2.3",
"axios": "^1.7.9",
"jsonwebtoken": "^9.0.2",
"mime": "^3.0.0"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@craco/craco": "^7.1.0",
"@devbookhq/splitter": "^1.4.2",
"@iobroker/build-tools": "^2.0.14",
"@iobroker/type-detector": "^4.1.1",
"@iobroker/vis-2-widgets-react-dev": "^4.0.4",
"@iobroker/vis-2-widgets-testing": "^1.0.5",
"@material-icons/svg": "^1.0.33",
"@mui/icons-material": "^6.4.1",
"@mui/material": "^6.4.1",
"@mui/x-date-pickers": "^7.24.0",
"@reduxjs/toolkit": "^2.5.0",
"@sentry/browser": "^8.51.0",
"@tsconfig/node18": "^18.2.4",
"@types/dom-speech-recognition": "^0.0.4",
"@types/jquery": "^3.5.32",
"@types/jsonwebtoken": "^9.0.7",
"@types/mime": "^3.0.4",
"@types/mocha": "^10.0.10",
"@types/react-beautiful-dnd": "^13.1.8",
"@types/react-color": "^3.0.13",
"@types/react-dom": "^18.3.5",
"@types/unzipper": "^0.10.10",
"@types/uuid": "^10.0.0",
"ace-builds": "^1.37.5",
"chai": "^4.5.0",
"craco-module-federation": "^1.1.0",
"dayjs": "^1.11.13",
"echarts": "^5.6.0",
"echarts-for-react": "^3.0.2",
"html-to-image": "^1.11.11",
"iobroker.web": "*",
"jquery-ui": "^1.14.1",
"mocha": "^11.1.0",
"mui-nested-menu": "^4.0.1",
"react-ace": "^13.0.0",
"react-beautiful-dnd": "^13.1.1",
"react-color": "^2.19.3",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dnd-preview": "^8.1.2",
"react-dnd-touch-backend": "^16.0.1",
"react-dom": "^18.3.1",
"react-dropzone": "^14.3.5",
"react-icons": "^5.4.0",
"redux": "^5.0.1",
"sass": "^1.83.4",
"unzipper": "^0.12.3",
"uuid": "^11.0.5"
},
"bugs": {
"url": "https://github.com/iobroker/iobroker.vis/issues"
},
"main": "build-backend/main.js",
"files": [
"admin/",
"img/",
"lib/",
"build-backend/",
"www/",
"io-package.json",
"LICENSE"
],
"scripts": {
"check-ts": "cd src-vis && tsc --project tsconfig.json && cd .. && tsc --project tsconfig.build.json",
"start": "cd src-vis && npm run start",
"test": "mocha ./test/*.engine.js --exit",
"test-gui": "mocha ./test/*.gui.js --exit",
"tsc": "tsc --project tsconfig.build.json && npm run copy-backend",
"copy-backend": "node tasks --copy-backend",
"prepublishOnly": "npm run build",
"clean": "rimraf runtime src-vis/build www",
"build": "npm run tsc && node tasks",
"runtime-0-clean": "node tasks --runtime-0-clean",
"runtime-1-copy-src": "node tasks --runtime-1-copy-src",
"runtime-2-npm": "node tasks --runtime-2-npm",
"runtime-3-build": "node tasks --runtime-3-build",
"runtime-4-copy": "node tasks --runtime-4-copy",
"runtime-5-patch": "node tasks --runtime-5-patch",
"0-clean": "node tasks --0-clean",
"1-npm": "node tasks --1-npm",
"2-svg-icons": "node tasks --2-svg-icons",
"3-build": "node tasks --3-build",
"4-copy": "node tasks --4-copy",
"5-patch": "node tasks --5-patch",
"update-packages": "ncu --upgrade && cd src-vis && ncu --upgrade && cd ..",
"npm": "npm i -f && cd src-vis && npm i -f"
},
"license": "CC-BY-NC-4.0"
}
3 changes: 2 additions & 1 deletion packages/iobroker.vis-2/src-vis/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
## Documentation CAN
https://v2.canjs.com/docs/can.view.html

https://v2.canjs.com/docs/can.view.html
39 changes: 0 additions & 39 deletions packages/iobroker.vis-2/src-vis/modulefederation.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,3 @@ module.exports = makeFederation(
},
true,
);
/*
const makeShared = pkgs => {
const result = {};
pkgs.forEach(
packageName => {
result[packageName] = {
requiredVersion: '*',
singleton: true,
eager: true,
};
},
);
return result;
};
module.exports = {
name: 'iobroker_vis',
filename: 'remoteEntry.js',
remotes: {
},
exposes: {
'./visRxWidget': './src/Vis/visRxWidget',
},
shared:
makeShared([
'react',
'react-dom',
'react-dom/client',
'clsx',
'@mui/material',
'@mui/styles',
'@mui/material/styles',
'@mui/icons-material',
'prop-types',
'@iobroker/adapter-react-v5',
'react-ace',
'@iobroker/vis-2-widgets-react-dev',
]),
};*/
2 changes: 1 addition & 1 deletion packages/iobroker.vis-2/src-vis/public/lib/js/ace/ace.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion packages/iobroker.vis-2/src-vis/src/Runtime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -868,8 +868,12 @@ class Runtime<P extends RuntimeProps = RuntimeProps, S extends RuntimeState = Ru
const userName = await this.socket.getCurrentUser(); // just name, like "admin"

const currentUser = await this.socket.getObject(`system.user.${userName || 'admin'}`);
const name =
typeof currentUser.common.name === 'object'
? currentUser.common.name[I18n.getLanguage()] || currentUser.common.name.en
: currentUser.common.name;

store.dispatch(updateActiveUser(currentUser.common.name));
store.dispatch(updateActiveUser(name));

const groups = await this.socket.getGroups();
const userGroups: Record<ioBroker.ObjectIDs.Group, ioBroker.GroupObject> = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ export default class PermissionsDialog extends React.Component<PermissionsDialog
const widgetPermissions: Record<string, PermissionsMap> = {};

const adminObj = Object.values(userView).find(obj => obj._id === 'system.user.admin');
this.adminUser = adminObj?.common.name || this.adminUser;
const name: string =
typeof adminObj?.common.name === 'object'
? !adminObj?.common.name
? ''
: adminObj.common.name[I18n.getLanguage()] || adminObj.common.name.en || ''
: adminObj?.common.name || '';
this.adminUser = name || this.adminUser;

for (const user of Object.keys(userView)) {
projectPermissions.set(user, visProject.___settings.permissions?.[user] ?? DEFAULT_PERMISSIONS);
Expand Down
Loading

0 comments on commit a7a5176

Please sign in to comment.