Dynamic metrics widget

Материал из SmartPlayer
Версия от 15:27, 19 марта 2025; N.Bloshkin (обсуждение | вклад) (Новая страница: «== '''Description of the Situation''' == The "Dynamic Metrics Control" widget was created to demonstrate the capabilities of the platform and is responsible for accounting and controlling the metrics necessary for display on screens. thumb|center| Example of a configured widget display |800px == '''Adding the Widget to the Personal Account''' == To add this widget to the personal account, the user n...»)

Description of the Situation

The "Dynamic Metrics Control" widget was created to demonstrate the capabilities of the platform and is responsible for accounting and controlling the metrics necessary for display on screens.

Example of a configured widget display

Adding the Widget to the Personal Account

To add this widget to the personal account, the user needs to request the widget from the technical support team specialist. It will be provided in a ".zip" archive format.

Example of the widget in a ".zip" archive

After that, the user must log in to their personal account and go to the "Content" section.

Example of the "Content" section in the personal account

In the "Content" section, the user needs to drag and drop the widget from local storage into the "Content" section. Once the user moves the widget to the personal account, it will appear in the content list.

Example of widget transfer using drag-and-drop

{{Note|If the user has a lot of different content in their personal account, they can use the sorting function and select the "Widget" content type. By using this functionality, they can view all widgets added to the personal account.

Example of correct sorting for easier widget search
|warn}

Preparing the SFTP Server

The widget works in conjunction with an SFTP server. The SFTP server can be deployed in advance by the customer or deployed specifically for working with this widget.
An ".xlsx" file with specific filled fields and data is added to the SFTP server.

An example file for the SFTP server can be downloaded via [link].

Then, the server application checks for the presence of the file at a specified interval (by default, every 10 seconds, this parameter is adjustable).
If the required ".xlsx" file is present, it reads the file and writes the information from it to the database (DB). After writing, the file itself is deleted from the cache.
Next, the widget requests data from the DB located on the server using a specific method. The server must return the necessary data specifically to the widget.
After receiving the information from the server, the widget processes it and displays it on the device screen.

Widget Main Page

After opening the widget in the SmartPlayer personal account in the "Content" section, the user will see the widget's main page. It will display the required metrics (if the SFTP server is configured correctly and sends data to the widget) and a settings icon in the form of a gear. To access the widget settings, the user needs to click on the gear icon.

Example of the settings icon display

Настройки виджета

Перейдя с помощью иконки в виде шестерёнки пользователю откроется страница настроек виджета. На этой странице пользователь может настроить следующие параметры:

  • Выбор языка - позволяет выбрать один из доступных языков для работы с виджетом: русский, английский, испанский, португальский, казахский
  • URL-адрес сервера - прописывается URL-адрес для подключения по API. Например: "https://develop-api.smartplayer.org/"
  • ID-устройства - указывается идентификатор устройства, который можно получить просмотреть для каждого устройства отдельно в параметрах устройства в разделе "Устройства". Пример ID-устройства: "3ac6f92191bdc4ecb96e23019202fead6cf6959131b6723eaa9b7c00c8c3a4e2"
  • Шрифт - позволяет выбрать один из доступных для виджета шрифтов: "Helvetica", "Pixeloid Sans","Dited"
  • Чекбокс(галочка) отображать на всю ширину экрана - активирует функциональность растягивания на всю ширину экрана, после создания трансляции с данным виджетом на устройстве
  • Интервал смены таблицы - указывается время (в секундах), через которое будет меняться отображаема на экране таблица
Пример отображения настроек виджета

После завершения настройки виджета пользователь должен нажать на кнопку "Применить настройки" в правой нижней части экрана.

Пример отображения кнопки "Применить настройки"

Далее виджет растянется на весь экран и пользователю должен нажать на кнопку "Сохранить", внизу по центру экрана.

Пример отображения кнопки "Сохранить"

Загрузка и скачивание настроек

В процессе взаимодействия с настройками виджета пользователь может загрузить и выгрузить настройки виджета. Каждое из указанных действий можно сделать по отдельным иконкам в интерфейсе виджета. Иконки расположены в виджете снизу по центру.

Пример отображения иконок загрузить и выгрузить настройки виджета

Добавление настроенного виджета в трансляцию

Чтобы полностью ознакомиться с работой данной функциональность пользователю необходимо запустить трансляцию с расписанием и добавить в качестве контента данный виджет. Чтобы ознакомиться с описанными ранее шагами по созданию трансляции и расписания рекомендуется просмотреть следующие статьи из Wikipedia:

Видеоинструкция

Виджет контроля показателей

Дополнительная информация

Если данная статья не помогает использовать функционал по назначению или после ее прочтения остаются вопросы можно озвучить данные вопросы в разделе "Обсуждения" вверху страницы.

Пример отображения вкладки "Обсуждения" на wiki-странице

Также дополнительную информацию можно узнать на странице Как взаимодействовать пользователю с разделом "Обсуждения"