diff --git a/README.md b/README.md index 9f7b3a63..6a9af54a 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ To provide an easy to use, fully-featured, scalable, and portable SCADA/IIoT-I4. - MongoDB as the real-time core database, persistence layer, config store, SOE historian. - Event-based realtime async data processing with MongoDB Change Streams. - Portability and modular interoperability over Linux, Windows, Mac OSX, x86/64, ARM. -- Windows installer available in the [releases section](https://github.com/riclolsen/json-scada/releases/tag/V0.46-alpha). +- Windows installer available in the [releases section](https://github.com/riclolsen/json-scada/releases/tag/V0.47-alpha). - Unlimited tags, servers, and users. - Horizontal scalability, from a single computer to big clusters (MongoDB-sharding), Docker containers, VMs, Kubernetes, cloud, or hybrid deployments. - Modular distributed architecture. Lightweight redundant data acquisition nodes can connect securely over TLS to the database server. E.g. a Raspberry PI can be a data acquisition node. @@ -90,7 +90,7 @@ To provide an easy to use, fully-featured, scalable, and portable SCADA/IIoT-I4. ## Documentation - [Generic Install Guide](https://github.com/riclolsen/json-scada/blob/master/docs/install.md) -- [Windows Installer](https://github.com/riclolsen/json-scada/releases/tag/V0.46-alpha) +- [Windows Installer](https://github.com/riclolsen/json-scada/releases/tag/V0.47-alpha) - [RedHat/Rocky Linux Installer Script](https://github.com/riclolsen/json-scada/blob/master/docs/install.md#rhel94-and-compatible-systems-automated-installation) - [Ubuntu Linux Installer Script](https://github.com/riclolsen/json-scada/blob/master/docs/install.md#ubuntu-2404-scripted-installation) - [Generic Install Guide](https://github.com/riclolsen/json-scada/blob/master/docs/install.md) diff --git a/index.md b/index.md index 80699690..901b42ec 100644 --- a/index.md +++ b/index.md @@ -48,7 +48,7 @@ To provide an easy to use, fully-featured, scalable, and portable SCADA/IIoT-I4. - MongoDB as the real-time core database, persistence layer, config store, SOE historian. - Event-based realtime async data processing with MongoDB Change Streams. - Portability and modular interoperability over Linux, Windows, Mac OSX, x86/64, ARM. -- Windows installer available in the [releases section](https://github.com/riclolsen/json-scada/releases/tag/V0.46-alpha). +- Windows installer available in the [releases section](https://github.com/riclolsen/json-scada/releases/tag/V0.47-alpha). - Unlimited tags, servers, and users. - Horizontal scalability, from a single computer to big clusters (MongoDB-sharding), Docker containers, VMs, Kubernetes, cloud, or hybrid deployments. - Modular distributed architecture. Lightweight redundant data acquisition nodes can connect securely over TLS to the database server. E.g. a Raspberry PI can be a data acquisition node. @@ -90,7 +90,7 @@ To provide an easy to use, fully-featured, scalable, and portable SCADA/IIoT-I4. ## Documentation - [Generic Install Guide](docs/install.md) -- [Windows Installer](https://github.com/riclolsen/json-scada/releases/tag/V0.46-alpha) +- [Windows Installer](https://github.com/riclolsen/json-scada/releases/tag/V0.47-alpha) - [RedHat/Rocky Linux Installer Script](docs/install.md#rhel94-and-compatible-systems-automated-installation) - [Ubuntu Linux Installer Script](docs/install.md#ubuntu-2404-scripted-installation) - [Generic Install Guide](docs/install.md) diff --git a/platform-windows/json-scada.nsi b/platform-windows/json-scada.nsi index ccdb74d3..02700854 100644 --- a/platform-windows/json-scada.nsi +++ b/platform-windows/json-scada.nsi @@ -20,8 +20,8 @@ RequestExecutionLevel admin ;-------------------------------- -!define VERSION "v.0.46" -!define VERSION_ "0.46.0.0" +!define VERSION "v.0.47" +!define VERSION_ "0.47.0.0" Function .onInit System::Call 'keexrnel32::CreateMutexA(p0, i1, t "MutexJsonScadaInstall")?e' @@ -509,22 +509,23 @@ SetRegView 64 CreateDirectory "$DESKTOP\JSON-SCADA" ; App shortcuts - CreateShortCut "$DESKTOP\JSON-SCADA\_Start_Services.lnk" "$INSTDIR\platform-windows\start_services.bat" - CreateShortCut "$DESKTOP\JSON-SCADA\_Stop_Services.lnk" "$INSTDIR\platform-windows\stop_services.bat" - CreateShortCut "$DESKTOP\JSON-SCADA\Windows Services.lnk" "services.msc" - CreateShortCut "$DESKTOP\JSON-SCADA\_JSON SCADA WEB.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVINDEX $NAVPOSOPT" "$INSTDIR\src\htdocs\images\j-s-256.ico" - CreateShortCut "$DESKTOP\JSON-SCADA\Chromium Browser.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT $NAVPOSOPT" - CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Display.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVVISTEL $NAVPOSOPT" "$INSTDIR\src\htdocs\images\tela.ico" - CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Events.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVVISEVE $NAVPOSOPT" "$INSTDIR\src\htdocs\images\chrono.ico" - CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Historical.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVVISHEV $NAVPOSOPT" "$INSTDIR\src\htdocs\images\calendar.ico" - CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Tabular.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVVISTAB $NAVPOSOPT" "$INSTDIR\src\htdocs\images\tabular.ico" - CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Alarms.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVVISANO $NAVPOSOPT" "$INSTDIR\src\htdocs\images\firstaid.ico" - CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Grafana.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVGRAFAN $NAVPOSOPT" "$INSTDIR\src\htdocs\images\grafana.ico" - CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Metabase.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVMETABA $NAVPOSOPT" "$INSTDIR\src\htdocs\images\metabase.ico" - CreateShortCut "$DESKTOP\JSON-SCADA\Excel Config Spreadsheet.lnk" "$INSTDIR\conf\json-scada-config.xlsm" - CreateShortCut "$DESKTOP\JSON-SCADA\Compass (Mongodb GUI Client).lnk" "$INSTDIR\platform-windows\mongodb-compass-runtime\MongoDBCompass.exe" - CreateShortCut "$DESKTOP\JSON-SCADA\Inkscape SAGE (SVG Editor).lnk" "$INSTDIR\platform-windows\inkscape-runtime\bin\inkscape.exe" - CreateShortCut "$DESKTOP\JSON-SCADA\Uninstall.lnk" "$INSTDIR\bt-uninst.exe" + CreateShortCut "$DESKTOP\JSON-SCADA\_Start_Services.lnk" "$INSTDIR\platform-windows\start_services.bat" + CreateShortCut "$DESKTOP\JSON-SCADA\_Stop_Services.lnk" "$INSTDIR\platform-windows\stop_services.bat" + CreateShortCut "$DESKTOP\JSON-SCADA\Windows Services.lnk" "services.msc" + CreateShortCut "$DESKTOP\JSON-SCADA\_JSON SCADA WEB.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVINDEX $NAVPOSOPT" "$INSTDIR\src\htdocs\images\j-s-256.ico" + CreateShortCut "$DESKTOP\JSON-SCADA\Chromium Browser.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT $NAVPOSOPT" + CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Display.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVVISTEL $NAVPOSOPT" "$INSTDIR\src\htdocs\images\tela.ico" + CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Events.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVVISEVE $NAVPOSOPT" "$INSTDIR\src\htdocs\images\chrono.ico" + CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Historical.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVVISHEV $NAVPOSOPT" "$INSTDIR\src\htdocs\images\calendar.ico" + CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Tabular.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVVISTAB $NAVPOSOPT" "$INSTDIR\src\htdocs\images\tabular.ico" + CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Alarms.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVVISANO $NAVPOSOPT" "$INSTDIR\src\htdocs\images\firstaid.ico" + CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Grafana.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVGRAFAN $NAVPOSOPT" "$INSTDIR\src\htdocs\images\grafana.ico" + CreateShortCut "$DESKTOP\JSON-SCADA\Viewer - Metabase.lnk" "$INSTDIR\$NAVWINCMD" " $NAVDATDIR $NAVPREOPT --app=$HTTPSRV$NAVMETABA $NAVPOSOPT" "$INSTDIR\src\htdocs\images\metabase.ico" + CreateShortCut "$DESKTOP\JSON-SCADA\Excel Config Spreadsheet.lnk" "$INSTDIR\conf\json-scada-config.xlsm" + CreateShortCut "$DESKTOP\JSON-SCADA\Compass (Mongodb GUI Client).lnk" "$INSTDIR\platform-windows\mongodb-compass-runtime\MongoDBCompass.exe" + CreateShortCut "$DESKTOP\JSON-SCADA\pgAdmin4 (Postgres GUI Client).lnk" "$INSTDIR\platform-windows\postgresql-runtime\pgAdmin 4\runtime\pgAdmin4.exe" + CreateShortCut "$DESKTOP\JSON-SCADA\Inkscape SAGE (SVG Editor).lnk" "$INSTDIR\platform-windows\inkscape-runtime\bin\inkscape.exe" + CreateShortCut "$DESKTOP\JSON-SCADA\Uninstall.lnk" "$INSTDIR\bt-uninst.exe" ; clear chromium cache diff --git a/platform-windows/mongodb-conf/mongod.cfg b/platform-windows/mongodb-conf/mongod.cfg index cba0dde9..58b8dce2 100644 --- a/platform-windows/mongodb-conf/mongod.cfg +++ b/platform-windows/mongodb-conf/mongod.cfg @@ -1,13 +1,18 @@ net: - bindIp: 0.0.0.0 + bindIp: 127.0.0.1 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses port: 27017 + # ssl: # mode: requireSSL # PEMKeyFile: c:\json-scada\conf\mongodb.pem # CAFile: c:\json-scada\conf\rootCa.pem +# Where and how to store data. Add more memory if you have more than 4GB of RAM. storage: dbPath: c:\json-scada\platform-windows\mongodb-data + wiredTiger: + engineConfig: + cacheSizeGB: 1.5 # REPLICA IS REQUIRED FOR JSON-SCADA replication: diff --git a/platform-windows/release_notes.txt b/platform-windows/release_notes.txt index 2ca243c6..2247b123 100644 --- a/platform-windows/release_notes.txt +++ b/platform-windows/release_notes.txt @@ -135,6 +135,31 @@ Inkscape+SAGE: ------------------------------------------------------------------- +Notes for version 0.47: + +* cs_data_processor: fixes and improvements. +* PostgreSQL updated to 17.2. +* TimescaleDB updated to 2.17.2. + +To quickly run the system after installed, open the JSON-SCADA desktop folder and: + +* On the JSON-SCADA desktop folder: execute "_Start_Services". +* On the JSON-SCADA desktop folder: execute "_JSON SCADA WEB". +* Default login credentials: username=admin password=jsonscada. +* Metabase credentials: username=json@scada.com password=jsonscada123. + +Requirements and recommendations: + +* Windows 10/11 64 bits or Server >=2019, Windows PowerShell. At least 20GB of free space in the "C:" drive. +* Administrative rights. Corporate Windows policies may cause problems with the creation of services and the opening of TCP ports. +* Free TCP ports 6688, 6689, 27017, 5432, 80, 8080, 3000, 3001, 9000. Other ports may be required for optional services and protocols. +* If the server already has MongoDB, PostgreSQL, Grafana, Metabase, Nginx or another webserver, please uninstall, disable or watch out for possible conflicts. +* Do not update previously installed JSON-SCADA. Please uninstall previous JSON-SCADA versions before installing a new version. +* If using VirtualBox configure "paravirtualization interface"=KVM, otherwise Nodejs errors may occur. +* MongoDB requires AVX instructions on x86 CPU. + +------------------------------------------------------------------- + Notes for version 0.46: * NPM packages updated. diff --git a/src/AdminUI/public/config_viewers_default.js b/src/AdminUI/public/config_viewers_default.js index 364d6638..d46ca338 100644 --- a/src/AdminUI/public/config_viewers_default.js +++ b/src/AdminUI/public/config_viewers_default.js @@ -59,9 +59,9 @@ var TabularViewer_Font = 'Segoe UI,Source Sans Pro,calibri,consolas,arial,helvet var TabularViewer_GridColor = '#BBBBBB'; // table grid color -var TabularViewer_AlmTxtColor = 'rgb(37, 132, 211)'; // alarmed color +var TabularViewer_AlmTxtColor = 'rgb(164, 128, 206)'; // alarmed color var TabularViewer_FailTxtColor = '#AAAAAA'; // failed value color -var TabularViewer_AckTxtColor = 'rgb(17, 91, 151)'; // acknowledged alarm color +var TabularViewer_AckTxtColor = 'rgb(40, 130, 136)'; // acknowledged alarm color var TabularViewer_RefreshTime = 3; // refresh time (seconds) diff --git a/src/AdminUI/public/i18n/messages_i18n-en_us.js b/src/AdminUI/public/i18n/messages_i18n-en_us.js index 017f5b8d..2286169d 100644 --- a/src/AdminUI/public/i18n/messages_i18n-en_us.js +++ b/src/AdminUI/public/i18n/messages_i18n-en_us.js @@ -4,7 +4,7 @@ var Msg = { NomeProduto: '{json:scada}', -VersaoProduto: '0.46', +VersaoProduto: '0.47', NomeVisorTelas: 'Display Viewer', NomeVisorEventos: 'Events Viewer', diff --git a/src/AdminUI/public/i18n/messages_i18n-pt_br.js b/src/AdminUI/public/i18n/messages_i18n-pt_br.js index 937a4faa..93859e8f 100644 --- a/src/AdminUI/public/i18n/messages_i18n-pt_br.js +++ b/src/AdminUI/public/i18n/messages_i18n-pt_br.js @@ -4,7 +4,7 @@ var Msg = { NomeProduto: '{json:scada}', -VersaoProduto: '0.46', +VersaoProduto: '0.47', NomeVisorTelas: 'Visor de Telas', NomeVisorEventos: 'Visor de Eventos', diff --git a/src/AdminUI/public/i18n/messages_i18n-uk_ua.js b/src/AdminUI/public/i18n/messages_i18n-uk_ua.js index bb78d826..2e67f795 100644 --- a/src/AdminUI/public/i18n/messages_i18n-uk_ua.js +++ b/src/AdminUI/public/i18n/messages_i18n-uk_ua.js @@ -4,7 +4,7 @@ var Msg = { NomeProduto: '{json:scada}', -VersaoProduto: '0.46', +VersaoProduto: '0.47', NomeVisorTelas: 'Перегляд ', NomeVisorEventos: 'Події', diff --git a/src/AdminUI/public/i18n/messages_i18n.js b/src/AdminUI/public/i18n/messages_i18n.js index 017f5b8d..2286169d 100644 --- a/src/AdminUI/public/i18n/messages_i18n.js +++ b/src/AdminUI/public/i18n/messages_i18n.js @@ -4,7 +4,7 @@ var Msg = { NomeProduto: '{json:scada}', -VersaoProduto: '0.46', +VersaoProduto: '0.47', NomeVisorTelas: 'Display Viewer', NomeVisorEventos: 'Events Viewer', diff --git a/src/AdminUI/public/release_notes.txt b/src/AdminUI/public/release_notes.txt index 2ca243c6..2247b123 100644 --- a/src/AdminUI/public/release_notes.txt +++ b/src/AdminUI/public/release_notes.txt @@ -135,6 +135,31 @@ Inkscape+SAGE: ------------------------------------------------------------------- +Notes for version 0.47: + +* cs_data_processor: fixes and improvements. +* PostgreSQL updated to 17.2. +* TimescaleDB updated to 2.17.2. + +To quickly run the system after installed, open the JSON-SCADA desktop folder and: + +* On the JSON-SCADA desktop folder: execute "_Start_Services". +* On the JSON-SCADA desktop folder: execute "_JSON SCADA WEB". +* Default login credentials: username=admin password=jsonscada. +* Metabase credentials: username=json@scada.com password=jsonscada123. + +Requirements and recommendations: + +* Windows 10/11 64 bits or Server >=2019, Windows PowerShell. At least 20GB of free space in the "C:" drive. +* Administrative rights. Corporate Windows policies may cause problems with the creation of services and the opening of TCP ports. +* Free TCP ports 6688, 6689, 27017, 5432, 80, 8080, 3000, 3001, 9000. Other ports may be required for optional services and protocols. +* If the server already has MongoDB, PostgreSQL, Grafana, Metabase, Nginx or another webserver, please uninstall, disable or watch out for possible conflicts. +* Do not update previously installed JSON-SCADA. Please uninstall previous JSON-SCADA versions before installing a new version. +* If using VirtualBox configure "paravirtualization interface"=KVM, otherwise Nodejs errors may occur. +* MongoDB requires AVX instructions on x86 CPU. + +------------------------------------------------------------------- + Notes for version 0.46: * NPM packages updated. diff --git a/src/AdminUI/src/App.vue b/src/AdminUI/src/App.vue index 9d47433f..6386ae12 100644 --- a/src/AdminUI/src/App.vue +++ b/src/AdminUI/src/App.vue @@ -119,7 +119,7 @@ import { useRouter } from 'vue-router' import { STORAGE_KEY } from './i18n' - const version = ref('v0.46-alpha') + const version = ref('v0.47-alpha') const router = useRouter() const theme = ref('dark') const vuetifyTheme = useTheme() diff --git a/src/cs_data_processor/cs_data_processor.js b/src/cs_data_processor/cs_data_processor.js index 599d3eb5..c86a8506 100644 --- a/src/cs_data_processor/cs_data_processor.js +++ b/src/cs_data_processor/cs_data_processor.js @@ -1094,6 +1094,21 @@ const pipeline = [ b2 = '0', // reserved b1 = '0', // reserved b0 = '0' // reserved + let vj = + valueJson === '' + ? '""' + : valueJson.trim().replaceAll("'", "''") + let trimS = '' + if (vj.length > 0) { + if (vj.charAt(0) === '{' || vj.charAt(0) === '[') + trimS = '"' + else if (isNaN(vj) && vj.charAt(0) !== '"') + vj = '"' + vj + '"' + } + const vs = + valueString === '' + ? '' + : valueString.replaceAll("'", "''") sqlHistQueue.enqueue({ sql: "'" + @@ -1103,14 +1118,7 @@ const pipeline = [ change.updateDescription.updatedFields.sourceDataUpdate.timeTag.toISOString() + "'," + value + - ',to_json(' + - "'{" + - '"v": ' + - JSON.stringify(valueJson).replaceAll("'", "''") + - ',' + - '"s": "' + - valueString.replaceAll("'", "''") + - '"}\'::text),' + + `,('{"v":'||trim('${trimS}' FROM to_json('${vj}'::text)::jsonb #>> '{}')||',"s":'||to_json('${vs}'::text)||'}'::text)::jsonb,` + (update.timeTagAtSource !== null ? "'" + change.updateDescription.updatedFields.sourceDataUpdate.timeTagAtSource.toISOString() +