add plugin vars separation

This commit is contained in:
jr-k 2024-03-01 11:03:08 +01:00
parent 2754d82c9e
commit cb4e514425
25 changed files with 453 additions and 66 deletions

View File

@ -47,9 +47,9 @@
"js_fleet_screen_delete_confirmation": "Are you sure?",
"settings_page_title": "Settings",
"settings_variable_panel": "Variables",
"settings_variable_panel_th_name": "Name",
"settings_variable_panel_th_description": "Help",
"settings_variable_panel_system_variables": "Variables du système",
"settings_variable_panel_plugin_variables": "Variables des plugins",
"settings_variable_panel_th_description": "Description",
"settings_variable_panel_th_value": "Value",
"settings_variable_panel_th_activity": "Options",
"settings_variable_form_edit_title": "Edit Variable",

View File

@ -47,9 +47,9 @@
"js_fleet_screen_delete_confirmation": "Êtes-vous sûr ?",
"settings_page_title": "Paramètres",
"settings_variable_panel": "Variables",
"settings_variable_panel_th_name": "Nom",
"settings_variable_panel_th_description": "Aide",
"settings_variable_panel_system_variables": "System Variables",
"settings_variable_panel_plugin_variables": "Plugins Variables",
"settings_variable_panel_th_description": "Description",
"settings_variable_panel_th_value": "Valeur",
"settings_variable_panel_th_activity": "Options",
"settings_variable_form_edit_title": "Modification de la variable",

291
main.log Normal file
View File

@ -0,0 +1,291 @@
2024-03-01 10:46:46,133 - INFO - Removing dead plugin variable plugin_fleetmode_screen_restart_enabled
2024-03-01 10:46:51,147 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
* Running on http://192.168.1.146:5000
2024-03-01 10:46:51,147 - INFO - Press CTRL+C to quit
2024-03-01 10:46:51,152 - INFO - * Restarting with stat
2024-03-01 10:46:51,280 - WARNING - * Debugger is active!
2024-03-01 10:46:51,284 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:46:58,282 - INFO - Shutting down...
2024-03-01 10:47:22,059 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
* Running on http://192.168.1.146:5000
2024-03-01 10:47:22,061 - INFO - Press CTRL+C to quit
2024-03-01 10:47:22,068 - INFO - * Restarting with stat
2024-03-01 10:47:22,200 - INFO - Removing dead plugin variable plugin_fleetmode_screen_restart_enabled
2024-03-01 10:47:22,204 - WARNING - * Debugger is active!
2024-03-01 10:47:22,208 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:47:25,066 - INFO - Shutting down...
2024-03-01 10:47:25,066 - INFO - Shutting down...
2024-03-01 10:48:06,077 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
* Running on http://192.168.1.146:5000
2024-03-01 10:48:06,077 - INFO - Press CTRL+C to quit
2024-03-01 10:48:06,082 - INFO - * Restarting with stat
2024-03-01 10:48:06,197 - INFO - Removing dead plugin variable plugin_fleetmode_screen_restart_enabled
2024-03-01 10:48:06,201 - WARNING - * Debugger is active!
2024-03-01 10:48:06,205 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:48:24,811 - INFO - Shutting down...
2024-03-01 10:48:24,811 - INFO - Shutting down...
2024-03-01 10:48:30,440 - INFO - Shutting down...
2024-03-01 10:48:59,129 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
* Running on http://192.168.1.146:5000
2024-03-01 10:48:59,130 - INFO - Press CTRL+C to quit
2024-03-01 10:48:59,131 - INFO - * Restarting with stat
2024-03-01 10:48:59,243 - INFO - Removing dead plugin variable plugin_fleetmode_screen_restart_enabled
2024-03-01 10:48:59,247 - WARNING - * Debugger is active!
2024-03-01 10:48:59,251 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:49:33,163 - INFO - Shutting down...
2024-03-01 10:49:33,163 - INFO - Shutting down...
2024-03-01 10:49:44,306 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
* Running on http://192.168.1.146:5000
2024-03-01 10:49:44,307 - INFO - Press CTRL+C to quit
2024-03-01 10:49:44,307 - INFO - * Restarting with stat
2024-03-01 10:49:44,412 - WARNING - * Debugger is active!
2024-03-01 10:49:44,417 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:49:53,946 - INFO - * Detected change in '/Users/jessym/obscreen/src/Application.py', reloading
2024-03-01 10:49:53,968 - INFO - * Restarting with stat
2024-03-01 10:49:54,069 - WARNING - * Debugger is active!
2024-03-01 10:49:54,073 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:50:01,258 - INFO - * Detected change in '/Users/jessym/obscreen/src/manager/VariableManager.py', reloading
2024-03-01 10:50:01,275 - INFO - * Restarting with stat
2024-03-01 10:50:01,379 - WARNING - * Debugger is active!
2024-03-01 10:50:01,383 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:51:06,983 - INFO - 127.0.0.1 - - [01/Mar/2024 10:51:06] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:51:07,039 - INFO - 127.0.0.1 - - [01/Mar/2024 10:51:07] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:51:07,044 - INFO - 127.0.0.1 - - [01/Mar/2024 10:51:07] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:51:07,056 - INFO - 127.0.0.1 - - [01/Mar/2024 10:51:07] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:51:07,750 - INFO - 127.0.0.1 - - [01/Mar/2024 10:51:07] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:51:07,782 - INFO - 127.0.0.1 - - [01/Mar/2024 10:51:07] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:51:07,783 - INFO - 127.0.0.1 - - [01/Mar/2024 10:51:07] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:51:07,784 - INFO - 127.0.0.1 - - [01/Mar/2024 10:51:07] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:53:18,776 - INFO - * Detected change in '/Users/jessym/obscreen/src/manager/VariableManager.py', reloading
2024-03-01 10:53:18,794 - INFO - * Restarting with stat
2024-03-01 10:53:18,891 - WARNING - * Debugger is active!
2024-03-01 10:53:18,895 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:53:28,418 - INFO - * Detected change in '/Users/jessym/obscreen/src/manager/VariableManager.py', reloading
2024-03-01 10:53:28,436 - INFO - * Restarting with stat
2024-03-01 10:53:28,530 - WARNING - * Debugger is active!
2024-03-01 10:53:28,534 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:53:59,877 - INFO - 127.0.0.1 - - [01/Mar/2024 10:53:59] "GET /settings/variable/list HTTP/1.1" 500 -
2024-03-01 10:53:59,905 - INFO - 127.0.0.1 - - [01/Mar/2024 10:53:59] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
2024-03-01 10:53:59,906 - INFO - 127.0.0.1 - - [01/Mar/2024 10:53:59] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
2024-03-01 10:53:59,940 - INFO - 127.0.0.1 - - [01/Mar/2024 10:53:59] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:53:59,973 - INFO - 127.0.0.1 - - [01/Mar/2024 10:53:59] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:54:00,154 - INFO - * Detected change in '/Users/jessym/obscreen/src/controller/SettingsController.py', reloading
2024-03-01 10:54:00,173 - INFO - * Restarting with stat
2024-03-01 10:54:00,276 - WARNING - * Debugger is active!
2024-03-01 10:54:00,280 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:54:16,690 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:16] "GET /settings/variable/list HTTP/1.1" 500 -
2024-03-01 10:54:16,710 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:16] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 304 -
2024-03-01 10:54:16,710 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:16] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 304 -
2024-03-01 10:54:16,734 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:16] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:54:16,756 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:16] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:54:16,831 - INFO - * Detected change in '/Users/jessym/obscreen/src/manager/VariableManager.py', reloading
2024-03-01 10:54:16,852 - INFO - * Restarting with stat
2024-03-01 10:54:16,963 - WARNING - * Debugger is active!
2024-03-01 10:54:16,968 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:54:17,325 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:17] "GET /settings/variable/list HTTP/1.1" 500 -
2024-03-01 10:54:17,345 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:17] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 304 -
2024-03-01 10:54:17,345 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:17] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 304 -
2024-03-01 10:54:17,374 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:17] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:54:17,395 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:17] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:54:18,071 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:18] "GET /settings/variable/list HTTP/1.1" 500 -
2024-03-01 10:54:18,095 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:18] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 304 -
2024-03-01 10:54:18,101 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:18] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 304 -
2024-03-01 10:54:18,124 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:18] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:54:18,146 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:18] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:54:35,834 - INFO - * Detected change in '/Users/jessym/obscreen/src/manager/VariableManager.py', reloading
2024-03-01 10:54:35,856 - INFO - * Restarting with stat
2024-03-01 10:54:35,956 - WARNING - * Debugger is active!
2024-03-01 10:54:35,960 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:54:36,105 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:36] "GET /settings/variable/list HTTP/1.1" 500 -
2024-03-01 10:54:36,128 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:36] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 304 -
2024-03-01 10:54:36,131 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:36] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 304 -
2024-03-01 10:54:36,156 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:36] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:54:36,179 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:36] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:54:36,947 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:36] "GET /settings/variable/list HTTP/1.1" 500 -
2024-03-01 10:54:36,973 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:36] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 304 -
2024-03-01 10:54:36,979 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:36] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 304 -
2024-03-01 10:54:37,002 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:37] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:54:37,028 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:37] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:54:45,044 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:45] "GET /settings/variable/list HTTP/1.1" 500 -
2024-03-01 10:54:45,064 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:45] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 304 -
2024-03-01 10:54:45,065 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:45] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 304 -
2024-03-01 10:54:45,091 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:45] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:54:45,114 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:45] "GET /settings/variable/list?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
2024-03-01 10:54:45,573 - INFO - * Detected change in '/Users/jessym/obscreen/src/manager/VariableManager.py', reloading
2024-03-01 10:54:45,595 - INFO - * Restarting with stat
2024-03-01 10:54:45,690 - WARNING - * Debugger is active!
2024-03-01 10:54:45,694 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:54:45,838 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:45] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:54:45,866 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:45] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:54:45,867 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:45] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:54:45,879 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:45] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:54:50,579 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:50] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:54:50,596 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:50] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:54:50,596 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:50] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:54:50,597 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:50] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:54:50,614 - INFO - * Detected change in '/Users/jessym/obscreen/src/controller/SettingsController.py', reloading
2024-03-01 10:54:50,637 - INFO - * Restarting with stat
2024-03-01 10:54:50,742 - WARNING - * Debugger is active!
2024-03-01 10:54:50,746 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:54:51,523 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:51] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:54:51,552 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:51] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:54:51,553 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:51] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:54:51,554 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:51] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:54:52,687 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:52] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:54:52,703 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:52] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:54:52,715 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:52] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:54:52,718 - INFO - 127.0.0.1 - - [01/Mar/2024 10:54:52] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:55:37,488 - INFO - * Detected change in '/Users/jessym/obscreen/src/manager/VariableManager.py', reloading
2024-03-01 10:55:37,505 - INFO - * Restarting with stat
2024-03-01 10:56:03,056 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
* Running on http://192.168.1.146:5000
2024-03-01 10:56:03,056 - INFO - Press CTRL+C to quit
2024-03-01 10:56:03,057 - INFO - * Restarting with stat
2024-03-01 10:56:03,170 - WARNING - * Debugger is active!
2024-03-01 10:56:03,175 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:56:03,574 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:03] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:56:03,595 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:03] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:56:03,595 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:03] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:56:03,645 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:03] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:56:03,754 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:03] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:56:03,782 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:03] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:56:03,783 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:03] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:56:03,784 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:03] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:56:04,474 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:04] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:56:04,490 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:04] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:56:04,491 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:04] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:56:04,491 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:04] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:56:08,063 - INFO - * Detected change in '/Users/jessym/obscreen/src/controller/SettingsController.py', reloading
2024-03-01 10:56:08,082 - INFO - * Restarting with stat
2024-03-01 10:56:08,187 - WARNING - * Debugger is active!
2024-03-01 10:56:08,192 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:56:08,340 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:08] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:56:08,361 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:08] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:56:08,361 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:08] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:56:08,363 - INFO - 127.0.0.1 - - [01/Mar/2024 10:56:08] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:56:24,778 - INFO - * Detected change in '/Users/jessym/obscreen/src/controller/SettingsController.py', reloading
2024-03-01 10:56:24,798 - INFO - * Restarting with stat
2024-03-01 10:56:24,896 - WARNING - * Debugger is active!
2024-03-01 10:56:24,903 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:57:00,821 - INFO - 127.0.0.1 - - [01/Mar/2024 10:57:00] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:57:01,112 - INFO - 127.0.0.1 - - [01/Mar/2024 10:57:01] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:57:01,112 - INFO - 127.0.0.1 - - [01/Mar/2024 10:57:01] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:57:01,119 - INFO - 127.0.0.1 - - [01/Mar/2024 10:57:01] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:58:02,626 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:02] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:58:02,662 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:02] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:58:02,663 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:02] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:58:02,671 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:02] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:58:10,796 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:10] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:58:10,820 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:10] "GET /data/www/img/logo.png HTTP/1.1" 200 -
2024-03-01 10:58:10,820 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:10] "GET /data/www/css/main.css HTTP/1.1" 200 -
2024-03-01 10:58:10,833 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:10] "GET /data/www/js/settings.js HTTP/1.1" 200 -
2024-03-01 10:58:10,953 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:10] "GET /favicon.ico HTTP/1.1" 404 -
2024-03-01 10:58:11,305 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:11] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:58:11,326 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:11] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:58:11,327 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:11] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:58:11,330 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:11] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:58:16,287 - INFO - Shutting down...
2024-03-01 10:58:16,287 - INFO - Shutting down...
2024-03-01 10:58:21,883 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
* Running on http://192.168.1.146:5000
2024-03-01 10:58:21,883 - INFO - Press CTRL+C to quit
2024-03-01 10:58:21,885 - INFO - * Restarting with stat
2024-03-01 10:58:22,028 - WARNING - * Debugger is active!
2024-03-01 10:58:22,032 - INFO - * Debugger PIN: 303-013-682
2024-03-01 10:58:22,208 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:22] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:58:22,226 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:22] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:58:22,228 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:22] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:58:22,229 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:22] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:58:31,124 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:31] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:58:31,156 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:31] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:58:31,157 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:31] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:58:31,157 - INFO - 127.0.0.1 - - [01/Mar/2024 10:58:31] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 10:59:54,444 - INFO - 127.0.0.1 - - [01/Mar/2024 10:59:54] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 10:59:54,474 - INFO - 127.0.0.1 - - [01/Mar/2024 10:59:54] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 10:59:54,474 - INFO - 127.0.0.1 - - [01/Mar/2024 10:59:54] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 10:59:54,482 - INFO - 127.0.0.1 - - [01/Mar/2024 10:59:54] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:00:18,563 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:18] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:00:18,582 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:18] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:00:18,582 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:18] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:00:18,584 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:18] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:00:19,096 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:19] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:00:19,114 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:19] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:00:19,114 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:19] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:00:19,116 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:19] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:00:27,323 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:27] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:00:27,339 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:27] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:00:27,339 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:27] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:00:27,340 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:27] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:00:37,956 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:37] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:00:37,975 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:37] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:00:37,976 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:37] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:00:37,976 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:37] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:00:44,620 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:44] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:00:44,637 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:44] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:00:44,639 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:44] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:00:44,639 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:44] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:00:49,608 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:49] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:00:49,634 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:49] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:00:49,664 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:49] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:00:49,666 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:49] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:00:57,396 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:57] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:00:57,426 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:57] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:00:57,427 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:57] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:00:57,427 - INFO - 127.0.0.1 - - [01/Mar/2024 11:00:57] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:01:00,854 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:00] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:01:00,869 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:00] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:01:00,869 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:00] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:01:00,872 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:00] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:01:04,789 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:04] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:01:04,805 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:04] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:01:04,805 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:04] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:01:04,805 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:04] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:01:16,065 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:16] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:01:16,085 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:16] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:01:16,086 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:16] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:01:16,087 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:16] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:01:22,914 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:22] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:01:22,933 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:22] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:01:22,933 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:22] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:01:22,933 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:22] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:01:27,634 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:27] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:01:27,650 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:27] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:01:27,650 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:27] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:01:27,651 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:27] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:01:31,124 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:31] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:01:31,143 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:31] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:01:31,143 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:31] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:01:31,150 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:31] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:01:31,575 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:31] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:01:31,592 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:31] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:01:31,592 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:31] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:01:31,592 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:31] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:01:51,442 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:51] "GET /settings/variable/list HTTP/1.1" 200 -
2024-03-01 11:01:51,469 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:51] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:01:51,472 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:51] "GET /data/www/js/settings.js HTTP/1.1" 304 -
2024-03-01 11:01:51,470 - INFO - 127.0.0.1 - - [01/Mar/2024 11:01:51] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:02:25,700 - INFO - 127.0.0.1 - - [01/Mar/2024 11:02:25] "GET /fleet/screen/list HTTP/1.1" 200 -
2024-03-01 11:02:25,747 - INFO - 127.0.0.1 - - [01/Mar/2024 11:02:25] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:02:25,749 - INFO - 127.0.0.1 - - [01/Mar/2024 11:02:25] "GET /data/www/js/tablednd-fixed.js HTTP/1.1" 304 -
2024-03-01 11:02:25,750 - INFO - 127.0.0.1 - - [01/Mar/2024 11:02:25] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:02:25,760 - INFO - 127.0.0.1 - - [01/Mar/2024 11:02:25] "GET /data/www/js/fleet.js HTTP/1.1" 304 -
2024-03-01 11:02:26,305 - INFO - 127.0.0.1 - - [01/Mar/2024 11:02:26] "GET /slideshow HTTP/1.1" 200 -
2024-03-01 11:02:26,328 - INFO - 127.0.0.1 - - [01/Mar/2024 11:02:26] "GET /data/www/css/main.css HTTP/1.1" 304 -
2024-03-01 11:02:26,330 - INFO - 127.0.0.1 - - [01/Mar/2024 11:02:26] "GET /data/www/img/logo.png HTTP/1.1" 304 -
2024-03-01 11:02:26,330 - INFO - 127.0.0.1 - - [01/Mar/2024 11:02:26] "GET /data/www/js/tablednd-fixed.js HTTP/1.1" 304 -
2024-03-01 11:02:26,351 - INFO - 127.0.0.1 - - [01/Mar/2024 11:02:26] "GET /data/www/js/slideshow.js HTTP/1.1" 304 -
2024-03-01 11:02:26,352 - INFO - 127.0.0.1 - - [01/Mar/2024 11:02:26] "GET /data/www/js/restart.js HTTP/1.1" 304 -

View File

@ -1,10 +1,10 @@
from plugins.system.ObPlugin import ObPlugin
from typing import List, Dict
from src.model.Variable import Variable
from src.model.VariableType import VariableType
from src.model.HookType import HookType
from src.model.HookRegistration import HookRegistration
from src.model.entity.Variable import Variable
from src.model.enum.VariableType import VariableType
from src.model.enum.HookType import HookType
from src.model.hook.HookRegistration import HookRegistration
class FleetmodeScreenRestart(ObPlugin):
@ -20,5 +20,5 @@ class FleetmodeScreenRestart(ObPlugin):
def use_hooks_registrations(self) -> List[HookRegistration]:
return [
super().set_hook_registration(hook=HookType.H_FLEETMODE_SLIDESHOW_TOOLBAR_ACTIONS, priority=10)
super().add_static_hook_registration(hook=HookType.H_FLEETMODE_SLIDESHOW_TOOLBAR_ACTIONS, priority=10)
]

View File

@ -1,10 +1,12 @@
import abc
from typing import Optional, List, Dict, Union
from src.model.Variable import Variable
from src.model.VariableType import VariableType
from src.model.HookType import HookType
from src.model.HookRegistration import HookRegistration
from src.model.entity.Variable import Variable
from src.model.enum.VariableType import VariableType
from src.model.enum.HookType import HookType
from src.model.hook.HookRegistration import HookRegistration
from src.model.hook.StaticHookRegistration import StaticHookRegistration
from src.model.hook.FunctionalHookRegistration import FunctionalHookRegistration
from src.service.ModelStore import ModelStore
@ -41,10 +43,13 @@ class ObPlugin(abc.ABC):
def get_plugin_variable_name(self, name: str) -> str:
return "{}_{}".format(self.get_plugin_variable_prefix(), name)
def set_variable(self, name: str, value, type: VariableType, editable: bool, description: str) -> Variable:
def add_variable(self, name: str, value, type: VariableType, editable: bool, description: str) -> Variable:
return self._model_store.variable().set_variable(
name=self.get_plugin_variable_name(name), value=value, type=type, editable=editable, description=description
name=self.get_plugin_variable_name(name), value=value, type=type, editable=editable, description=description, plugin=self.use_id()
)
def set_hook_registration(self, hook: HookType, priority: int = 0) -> HookRegistration:
return HookRegistration(plugin=self, hook=hook, priority=priority)
def add_static_hook_registration(self, hook: HookType, priority: int = 0) -> StaticHookRegistration:
return StaticHookRegistration(plugin=self, hook=hook, priority=priority)
def add_functional_hook_registration(self, hook: HookType, priority: int = 0, function=None) -> FunctionalHookRegistration:
return FunctionalHookRegistration(plugin=self, hook=hook, priority=priority, function=function)

View File

@ -2,7 +2,7 @@ import json
from flask import Flask, render_template, redirect, request, url_for, jsonify
from src.service.ModelStore import ModelStore
from src.model.Screen import Screen
from src.model.entity.Screen import Screen
class FleetController:

View File

@ -19,7 +19,8 @@ class SettingsController:
return render_template(
'settings/list.jinja.html',
l=self._model_store.lang().map(),
variables=self._model_store.variable().get_editable_variables(),
system_variables=self._model_store.variable().get_editable_variables(plugin=False),
plugin_variables=self._model_store.variable().get_editable_variables(plugin=True),
)
def settings_variable_edit(self):

View File

@ -5,8 +5,8 @@ import time
from flask import Flask, render_template, redirect, request, url_for, send_from_directory, jsonify
from werkzeug.utils import secure_filename
from src.service.ModelStore import ModelStore
from src.model.Slide import Slide
from src.model.SlideType import SlideType
from src.model.entity.Slide import Slide
from src.model.enum.SlideType import SlideType
from src.utils import str_to_enum

View File

@ -1,5 +1,5 @@
from typing import Dict, Optional, List, Tuple, Union
from src.model.Screen import Screen
from src.model.entity.Screen import Screen
from pysondb import PysonDB
from pysondb.errors import IdDoesNotExistError

View File

@ -1,7 +1,7 @@
import os
from typing import Dict, Optional, List, Tuple, Union
from src.model.Slide import Slide
from src.model.entity.Slide import Slide
from src.utils import str_to_enum
from pysondb import PysonDB
from pysondb.errors import IdDoesNotExistError

View File

@ -1,6 +1,6 @@
from typing import Dict, Optional, List, Tuple, Union
from src.model.Variable import Variable
from src.model.VariableType import VariableType
from src.model.entity.Variable import Variable
from src.model.enum.VariableType import VariableType
from pysondb import PysonDB
from pysondb.errors import IdDoesNotExistError
import time
@ -15,7 +15,7 @@ class VariableManager:
self._var_map = {}
self.reload()
def set_variable(self, name: str, value, type: VariableType, editable: bool, description: str) -> Variable:
def set_variable(self, name: str, value, type: VariableType, editable: bool, description: str, plugin: Optional[None] = None) -> Variable:
if isinstance(value, bool) and value:
value = '1'
elif isinstance(value, bool) and not value:
@ -26,7 +26,8 @@ class VariableManager:
"value": value,
"type": type.value,
"editable": editable,
"description": description
"description": description,
"plugin": plugin
}
variable = self.get_one_by_name(default_var['name'])
@ -99,6 +100,9 @@ class VariableManager:
def get_by_prefix(self, prefix: str) -> List[Variable]:
return self.hydrate_dict(self._db.get_by_query(query=lambda v: v['name'].startswith(prefix)))
def get_by_plugin(self, plugin: str) -> List[Variable]:
return self.hydrate_dict(self._db.get_by_query(query=lambda v: v['plugin'] == plugin))
def get_one_by_name(self, name: str) -> Optional[Variable]:
return self.get_one_by(query=lambda v: v['name'] == name)
@ -118,8 +122,9 @@ class VariableManager:
return VariableManager.hydrate_list(raw_variables)
def get_editable_variables(self) -> List[Variable]:
return [variable for variable in self.get_all() if variable.editable]
def get_editable_variables(self, plugin: bool = True) -> List[Variable]:
query = lambda v: (not plugin and not isinstance(v['plugin'], str)) or (plugin and isinstance(v['plugin'], str))
return [variable for variable in self.get_by(query=query) if variable.editable]
def get_readonly_variables(self) -> List[Variable]:
return [variable for variable in self.get_all() if not variable.editable]

View File

@ -1,7 +1,7 @@
import json
from typing import Optional, Union
from src.model.SlideType import SlideType
from src.model.enum.SlideType import SlideType
from src.utils import str_to_enum

View File

@ -2,18 +2,22 @@ import json
import time
from typing import Optional, Union
from src.model.VariableType import VariableType
from src.model.enum.VariableType import VariableType
from src.utils import str_to_enum
class Variable:
def __init__(self, name: str = '', description: str = '', type: Union[VariableType, str] = VariableType.STRING, value: Union[int, bool, str] = '', editable: bool = True, id: Optional[str] = None):
def __init__(self, name: str = '', description: str = '', type: Union[VariableType, str] = VariableType.STRING,
value: Union[int, bool, str] = '', editable: bool = True, id: Optional[str] = None,
plugin: Optional[str] = None):
self._id = id if id else None
self._name = name
self._type = str_to_enum(type, VariableType) if isinstance(type, str) else type
self._description = description
self._value = value
self._editable = editable
self._plugin = plugin
@property
def id(self) -> Union[int, str]:
@ -59,6 +63,14 @@ class Variable:
def value(self, value: Union[int, bool, str]):
self._value = value
@property
def plugin(self) -> Optional[str]:
return self._plugin
@plugin.setter
def plugin(self, value: Optional[str]):
self._plugin = value
def __str__(self) -> str:
return f"Variable(" \
f"id='{self.id}',\n" \
@ -67,6 +79,7 @@ class Variable:
f"type='{self.type}',\n" \
f"description='{self.description}',\n" \
f"editable='{self.editable}',\n" \
f"plugin='{self.plugin}',\n" \
f")"
def to_json(self) -> str:
@ -80,6 +93,7 @@ class Variable:
"type": self.type.value,
"description": self.description,
"editable": self.editable,
"plugin": self.plugin,
}
def as_bool(self) -> bool:
@ -104,3 +118,5 @@ class Variable:
return self.as_string()
def is_from_plugin(self):
return self.plugin

View File

@ -0,0 +1,27 @@
from src.model.enum.HookType import HookType
from src.model.hook.HookRegistration import HookRegistration
from typing import Optional
class FunctionalHookRegistration(HookRegistration):
def __init__(self, plugin, hook: HookType, priority: int = 0, function=None):
super().__init__(plugin, hook, priority)
self._function = function
@property
def function(self):
return self._function
@function.setter
def function(self, value):
self._function = value
def __str__(self) -> str:
return f"FunctionalHookRegistration(" \
f"plugin='{self.plugin.get_id()}',\n" \
f"hook='{self.hook}',\n" \
f"priority='{self.priority}',\n" \
f"function='{self.function}',\n" \
f")"

View File

@ -1,14 +1,12 @@
from src.model.HookType import HookType
from typing import Optional
from src.model.enum.HookType import HookType
class HookRegistration:
def __init__(self, plugin, hook: HookType, priority: int = 0, template: Optional[str] = None):
def __init__(self, plugin, hook: HookType, priority: int = 0):
self._plugin = plugin
self._hook = hook
self._priority = priority
self._template = template
@property
def plugin(self):
@ -34,18 +32,9 @@ class HookRegistration:
def priority(self, value: int):
self._priority = value
@property
def template(self) -> Optional[str]:
return self._template
@template.setter
def template(self, value: Optional[str]):
self._template = value
def __str__(self) -> str:
return f"HookRegistration(" \
f"plugin='{self.plugin.get_id()}',\n" \
f"hook='{self.hook}',\n" \
f"priority='{self.priority}',\n" \
f"template='{self.template}',\n" \
f")"

View File

@ -0,0 +1,27 @@
from src.model.enum.HookType import HookType
from src.model.hook.HookRegistration import HookRegistration
from typing import Optional
class StaticHookRegistration(HookRegistration):
def __init__(self, plugin, hook: HookType, priority: int = 0, template: Optional[str] = None):
super().__init__(plugin, hook, priority)
self._template = template
@property
def template(self) -> Optional[str]:
return self._template
@template.setter
def template(self, value: Optional[str]):
self._template = value
def __str__(self) -> str:
return f"StaticHookRegistration(" \
f"plugin='{self.plugin.get_id()}',\n" \
f"hook='{self.hook}',\n" \
f"priority='{self.priority}',\n" \
f"template='{self.template}',\n" \
f")"

View File

@ -6,9 +6,10 @@ import importlib
from plugins.system.ObPlugin import ObPlugin
from src.service.ModelStore import ModelStore
from src.manager.VariableManager import VariableManager
from src.model.VariableType import VariableType
from src.model.HookType import HookType
from src.model.HookRegistration import HookRegistration
from src.model.enum.VariableType import VariableType
from src.model.enum.HookType import HookType
from src.model.hook.HookRegistration import HookRegistration
from src.model.hook.StaticHookRegistration import StaticHookRegistration
from typing import List, Dict, Union
@ -68,7 +69,7 @@ class PluginStore:
def setup_plugin(self, plugin: ObPlugin) -> None:
# VARIABLES
variables = plugin.use_variables() + [
plugin.set_variable(
plugin.add_variable(
name=self.DEFAULT_PLUGIN_ENABLED_VARIABLE,
value=False,
type=VariableType.BOOL,
@ -77,13 +78,13 @@ class PluginStore:
)
]
if not self.is_plugin_enabled(plugin):
return
for variable in variables:
if variable.name in self._dead_variables_candidates:
del self._dead_variables_candidates[variable.name]
if not self.is_plugin_enabled(plugin):
return
# HOOKS
hooks_registrations = plugin.use_hooks_registrations()
@ -92,7 +93,9 @@ class PluginStore:
logging.error("Hook {} does not exist".format(hook.name))
continue
hook_registration.template = "{}/views/{}.jinja.html".format(plugin.get_directory(), hook_registration.hook.value)
if isinstance(hook_registration, StaticHookRegistration):
hook_registration.template = "{}/views/{}.jinja.html".format(plugin.get_directory(), hook_registration.hook.value)
self._hooks[hook_registration.hook].append(hook_registration)
logging.info("Plugin {} loaded ({} var{} and {} hook) from {}".format(

View File

@ -10,7 +10,7 @@ from src.controller.SlideshowController import SlideshowController
from src.controller.FleetController import FleetController
from src.controller.SysinfoController import SysinfoController
from src.controller.SettingsController import SettingsController
from src.model.HookType import HookType
from src.model.enum.HookType import HookType
class WebServer:
@ -19,6 +19,7 @@ class WebServer:
FOLDER_STATIC = "data"
FOLDER_STATIC_WEB_UPLOADS = "uploads"
FOLDER_STATIC_WEB_ASSETS = "www"
FOLDER_PLUGIN_HOOKS = "hooks"
MAX_UPLOADS = 16 * 1024 * 1024
def __init__(self, project_dir: str, model_store: ModelStore, plugin_store: PluginStore):
@ -101,11 +102,14 @@ class WebServer:
for hook_registration in self._plugin_store.map_hooks()[hook]:
env = Environment(
loader=FileSystemLoader("{}/{}".format(hook_registration.plugin.get_directory(), self.FOLDER_TEMPLATES)),
loader=FileSystemLoader("{}/{}".format(
hook_registration.plugin.get_directory(),
self.FOLDER_TEMPLATES
)),
autoescape=select_autoescape(['html', 'xml'])
)
template = env.get_template(os.path.basename(hook_registration.template))
template = env.get_template("{}/{}".format(self.FOLDER_PLUGIN_HOOKS, os.path.basename(hook_registration.template)))
content.append(
template.render(
l=self._model_store.lang().map()

View File

@ -1,19 +1,28 @@
<table class="variables">
<thead>
<tr>
<th>{{ l.settings_variable_panel_th_name }}</th>
<th>{{ l.settings_variable_panel_th_value }}</th>
<th>{{ l.settings_variable_panel_th_description }}</th>
<th>{{ l.settings_variable_panel_th_value }}</th>
<th class="tac">{{ l.settings_variable_panel_th_activity }}</th>
</tr>
</thead>
<tbody>
{% set last_plugin = '' %}
{% for variable in variables %}
{% if variable.plugin and last_plugin != variable.plugin %}
<tr>
<td colspan="2">
<h3>
<i class="fa fa-puzzle-piece"></i> {{ variable.plugin.replace('_',' ')|capitalize }}
</h3>
</td>
</tr>
{% endif %}
<tr class="variable-item" data-level="{{ variable.id }}" data-entity="{{ variable.to_json() }}">
<td class="infos">
<div class="inner">
<i class="fa fa-cog icon-left"></i>
{{ variable.name }}
{{ variable.description }}
</div>
</td>
<td>
@ -23,15 +32,13 @@
<span class="empty">{{ l.common_empty }}</span>
{% endif %}
</td>
<td>
{{ variable.description }}
</td>
<td class="actions tac">
<a href="javascript:void(0);" class="item-edit variable-edit">
<i class="fa fa-pencil"></i>
</a>
</td>
</tr>
{% set last_plugin = variable.plugin %}
{% endfor %}
</tbody>
</table>

View File

@ -15,9 +15,21 @@
</div>
<div class="panel">
<div class="panel-body">
<h3>{{ l.settings_variable_panel }}</h3>
<h3>{{ l.settings_variable_panel_system_variables }}</h3>
{% include 'settings/component/table.jinja.html' %}
{% with variables=system_variables %}
{% include 'settings/component/table.jinja.html' %}
{% endwith %}
</div>
</div>
<div class="panel panel-inactive">
<div class="panel-body">
<h3>{{ l.settings_variable_panel_plugin_variables }}</h3>
{% with variables=plugin_variables %}
{% include 'settings/component/table.jinja.html' %}
{% endwith %}
</div>
</div>