Widget Gallery (System Admin)
Description of the situation
SmartPlayer, as a platform, offers a vast range of functionalities. Users can explore all the capabilities within their personal accounts. If a user wishes to expand the platform's capabilities, they can make use of widgets. To store and provide widgets in one centralized location, the "Widget Gallery" was created.
Functionality Benefits
Currently, users can obtain widgets by directly requesting them from SmartPlayer. To streamline widget management, simplify access, and automate the process, the "Widget Gallery" was established.
Technical Implementation:
Widget Storage
Initially, all widgets are stored on the SmartPlayer server. After payment, the widgets are transferred to client-side storage, which can be of two types:
- Local Storage
- AWS Storage
Widget setup
Moving Widgets
After purchasing a widget, it becomes available in the "Widget Gallery." Once the user clicks the "Upload" button, the CLI (Command Line Interface) command will begin its operation: ./cli.js widgets upload - this command is executed on the server.
This command transfers the widget archive from our server to the user's server. It handles the widgets, moves them to the appropriate storage, and ensures their proper functionality.
Configuration Process
- Widget archives are uploaded to the client's server. The goal for the system administrator on the SmartPlayer side is to place the widget archives in the most convenient manner. When copying, it's crucial to provide the correct path.
- Afterward, return to the cloud server and navigate to the SmartPlayer folder. Locate the "Widgets" section and move all the archives into one folder. All the folders are located at the path:
home/smartplayer/smartplayer
. - To display the "Widget Gallery," a special CLI command is used. It is configured only from a specific path:
/home/smartplayer/smartplayer/backend/app
.
At this location is a script called: cli.js
. Inside this script is the command to download:
- As a result, a "Widget Gallery" section will appear in the user's account.
Server version for "Widget Gallery" functionality - ver. 2.132.18.
What the User Sees:
After the command triggers within the client application, the user can see the installed widgets inside the "Widget Gallery" and can download them. The user can install a needed widget in two ways:
- Installation through the special "Download" button within the "Widget Gallery."
- Installation through the special "Download" button while working with content.
Differences for Online and Local Servers:
- For online servers, the widget gallery functions as a shared storage for multiple clients. Any client connected to this server sees the same set of widgets and can download them to their personal account.
- For local servers, the widget gallery works on a similar principle. However, instead of multiple users, there's only one user on this server. They also gain access to all the purchased widgets.
Final Result
The user can easily and conveniently install widgets using the "Widget Gallery."