Skip to content

Commit 176c978

Browse files
committed
Config Grafana on project IDX platform.
1 parent daf5a51 commit 176c978

File tree

4 files changed

+1681
-130
lines changed

4 files changed

+1681
-130
lines changed

.idx/dev.nix

+10-4
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,15 @@
9797
initdb -D ~/postgres &&
9898
cp ~/json-scada/platform-nix-idx/postgresql.conf ~/postgres/postgresql.conf &&
9999
cp ~/json-scada/platform-nix-idx/pg_hba.conf ~/postgres/pg_hba.conf &&
100-
/usr/bin/pg_ctl -D /home/user/postgres start &&
101-
/usr/bin/createuser -h localhost -s postgres &&
100+
/usr/bin/pg_ctl -D /home/user/postgres start >/dev/null 2>&1 &&
101+
/usr/bin/createuser -h localhost -s postgres ;
102102
psql -U postgres -w -h localhost -f ~/json-scada/sql/create_tables.sql template1 &&
103103
psql -U postgres -w -h localhost -f ~/json-scada/sql/metabaseappdb.sql metabaseappdb &&
104-
psql -U postgres -w -h localhost -f ~/json-scada/sql/grafanaappdb.sql grafanaappdb
104+
psql -U postgres -w -h localhost -f ~/json-scada/sql/grafanaappdb.sql grafanaappdb &&
105+
mkdir -p ~/json-scada/grafana/data &&
106+
mkdir -p ~/json-scada/grafana/logs &&
107+
mkdir -p ~/json-scada/grafana/plugins &&
108+
grafana server target --config ~/json-scada/platform-nix-idx/grafana.ini --homepath /nix/store/454jp6ww3nr2k7jxfp4il4a3l9kq0l3h-grafana-10.2.8/share/grafana/
105109
";
106110
build-jsonscada = "
107111
cd ~/json-scada/platform-linux &&
@@ -110,7 +114,9 @@
110114
rm -rf /home/user/json-scada/src/custom-developments/basic_bargraph/node_modules &&
111115
rm -rf /home/user/json-scada/src/custom-developments/advanced_dashboard/node_modules &&
112116
rm -rf /home/user/json-scada/src/custom-developments/transformer_with_commands/node_modules &&
113-
rm -rf /home/user/json-scada/src/log-io &&
117+
rm -rf /home/user/json-scada/src/log-io/inputs/file/node_modules &&
118+
rm -rf /home/user/json-scada/src/log-io/ui/node_modules &&
119+
rm -rf /home/user/json-scada/src/log-io/server/node_modules &&
114120
rm -rf /home/user/.cache
115121
";
116122
};

platform-nix-idx/README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Project IDX Setup
2+
3+
Start a free instance for dev/test on Google's Project IDX platform with just a Google account.
4+
5+
1 - Access the Project IDX platform, click on the "Get Started" button
6+
7+
https://idx.dev
8+
9+
2 - Create a new Workspace importing a GitHub repository.
10+
11+
URL: https://github.com/riclolsen/json-scada
12+
Name: json-scada
13+
14+
3 - Wait for the workspace to be imported and built. This will take a while, do not click the recover button.
15+
16+
4 - When started some terminals will open for initialize and build the project.
17+
18+
5 - Wait until the tasks are finished and the workspace is ready. This will take some minutes.
19+
20+
6 - Click the Project IDX button on left sidebar and select "Backend Ports".
21+
22+
7 - Click the "Open New Window" action for port 8080. This will give access to the web UI for the project. Login with admin/jsonscada credentials.
23+
24+
8 - On the terminal control JSON-SCADA processes with the "supervisorctl" command.
25+
26+
supervisorctl status
27+
supervisorctl start all
28+
supervisorctl stop all
29+
supervisorctl restart all
30+
supervisorctl start iec104client
31+
supervisorctl start iec104client
32+
supervisorctl tail -f iec104client

platform-nix-idx/dev.nix

-126
This file was deleted.

0 commit comments

Comments
 (0)