frangoteam / FUXA

Web-based Process Visualization (SCADA/HMI/Dashboard) software
https://frangoteam.org
MIT License
2.85k stars 827 forks source link

[FEATURE] Implement onOpen and onClose Methods for Enhanced View Management #1482

Open mauroalexandre opened 1 week ago

mauroalexandre commented 1 week ago

Feature Description

The goal of this feature is to introduce onOpen and onClose methods within the View class to manage behaviors linked to the lifecycle of views more effectively. These methods will allow developers to define custom scripts and logic that should run when a view is either opened or displayed to the user, or closed. This enhancement seeks to improve the application's interactivity and responsiveness by allowing more granular control over the view's setup and teardown processes.

Expected Benefits

Use Cases

When user open view we can execute script to check client device type (smartphone, desktop, etc) and redirect to view specific for device layout.

image

Pull Request Pull request here.

unocelli commented 6 days ago

Thanks @mauroalexandre