All Products
Search
Document Center

DataV:Status card

Last Updated:Jan 09, 2025

This topic provides a guide on the use of status cards.

Component overview

A status card is a text widget that displays the current status and related information of an entity, such as a server, using a colored dot. It allows for the configuration of multiple status categories.

Scenarios

Status cards are widely used in visualization applications to display status information across various categories. For instance, they can indicate the operational status of servers within a cluster.

Effect display

  • Horizontal layoutimage

  • Portrait layoutimage

  • Interactive scenarios7501E2BF-91B3-4F1E-B08E-1AE6221E5F40

Prerequisites

  • A data dashboard is available that supports creation using a template, a blank canvas.

  • Business data is ready for use. For more information, see Data Source.

Add status card

  1. Access the DataV console.

  2. In the Workbench > All Applications > Data Dashboard, click the desired dashboard to access the canvas editing page.

  3. From the Widget Library > Information list in the left-side navigation pane, select the Status Card widget to add it to the canvas.

You can also use global search to find and add widgets.

Connect to business data

Once the widget is added, connect it to the prepared business data for display. Click the status card and, in the Data Source tab on the right, select the data for the widget to display.image

  • The data fields accepted by the status card are outlined below.

    Field

    Description

    name

    Set the text content corresponding to each status in the status card.

    value

    Set the status type of the status card (that is, the dot before the text). It must correspond to the content of the Style > Edition > Status Category > Status Type Name configuration item and use the style defined in the status type for rendering. If it exceeds the value range of Status Type Name, the corresponding status type cannot be displayed.

    Below is the data structure and effect display of a sample status card.

    [
      {
        "name": "Normal status",
        "value": "normal"
      },
      [
        "Error status",
        "error"
      ],
      [
        "Virtual machine disconnected",
        "not connected"
      ]
    ]

    image

  • The key configuration items for the data source are as follows.

    Configuration Item

    Description

    Select Data Source

    Supports integrating various types of data such as CSV files, APIs, and various databases. For more information, see Data Source. You can edit data fields using a visual table or code.

    Configure Filter (Optional)

    Used to customize filter code to achieve data structure transformation, filtering, display, and simple calculations. For more information, see Manage Data Filters.

    Configure Data Mapping

    Used to map fields from the selected data source to the corresponding fields of the widget to achieve real-time data matching. Click the image icon to configure field styles.

    View Response Results

    Used to display the data integrated into the widget in real-time. When the widget data source changes, the latest data will be displayed here.

    • Click the data response result to view the code of the data fields written.

    • Click to view the example to see the array type and code example received by the data source. You can refer to the example to write related fields.

    Other data request configurations:

    • Disable Loading State: When selected, the loading content during widget initialization will not be displayed when updating or previewing the data dashboard.

    • Controlled Mode: When selected, the widget will not request data in the initialization state. At this time, data requests can only be initiated through the blueprint editor or global variable events.

    • Automatic Update Request: When selected, the platform will dynamically poll and update data according to the polling time you set. If not selected, you need to manually refresh the page or trigger a request to update data through the blueprint editor and global variable events.

Configure status card

Select the status card widget to configure its basic style, interaction occurrences, and blueprint interaction in the right-side panel.

Style configuration

In the Style panel, configure the layout, text style, and dot style of the status card. The configuration items are detailed below.

Note

Use the image icon to quickly locate configuration items by keyword search, which supports fuzzy match. For more information, see Search Configuration Items.

The configuration items are described below.

Configuration item

Description

Illustration

Global configuration

Defines the position distribution, transparency, and interaction penetration of the widget in the data dashboard.

  • Opacity: The smaller the value, the more transparent the widget. The value range is within 0~1.

  • Interaction Penetration: When enabled, the mouse can penetrate this widget to avoid the widget blocking the interaction between the mouse and the underlying widget when there are many widgets on the dashboard.

image

Basic style configuration

Define the layout of the status types (horizontal/portrait arrangement), the font of the status text, color, and the position and size of the dots.

When auto-arrangement is enabled, the platform will arrange the layout in a default horizontal single row (suitable for scenarios with fewer status types). When disabled, you can select horizontal/portrait layout as needed and set the number of statuses per row/column.

image

Edition configuration

Define the status categories and their corresponding dot colors, specifying the total number of statuses and the dot representation for each status.

Note

The status type values (Value) in the data source can be considered as the IDs of the statuses. The Status Type Name in the edition configuration is used to obtain the status ID and display the corresponding status. If it exceeds the value range of Value, the corresponding status cannot be displayed.

image

Advanced configuration

Define the interactions between the status card and other widgets. The configuration items are detailed below.

Configuration item

Description

Illustration

Interaction occurrences

Define the interaction behavior with other widgets to achieve filter interaction. For example, use a list carousel to display the statuses of virtual machines in different regions. By interacting with the status card, clicking a row in the list carousel will display the virtual machine status of that region on the status card.7501E2BF-91B3-4F1E-B08E-1AE6221E5F40

Click the image icon to define the related interaction occurrences and interaction actions.

image

Blueprint interaction

Use the Blueprint Editor to visually define the interaction relationships and behavior logic between widgets.

Procedure

  1. On the canvas editing page, click the image icon at the top menu bar's left side to enter the blueprint editor.

  2. In the layer node list, hover over the status card widget and click the image icon to add the widget to the main canvas.

  3. Connect the components as needed to set up the blueprint interaction effects between related widgets.

    An example is shown below.image

Configuration item description

The related interaction occurrences and actions are described below.

Note

Click the image icon next to the event or action in the blueprint configuration interface for detailed parameter descriptions.

Category

Subcategory

Description

Event

When Data Is Updated

This event is triggered when the widget data is updated.

When Request Status Changes

This event is triggered when the data request status changes. Status values include Void, Loading, Success, and Error.

Action

Import Data

Process the data according to the widget rendering format and import it into the widget for re-rendering. There is no need to request server data again. The sample data is as follows.

[
  {
    "name": "Virtual machine started",
    "value": "1"  //This corresponds to the content of the status type name in the style panel
  }
]

Request Data

Request server data again. The data thrown by the upstream data processing node or layer node will be used as parameters. For example, if the API data source configured for the status card is https://api.test and the data passed to the Request Data action is { id: '1'}, the final request will be https://api.test?id=1.

Shift

Move the widget to a specified position. The data example is as follows.

    {
      // Movement method. Absolute positioning: to, relative positioning: by. Default value: to.
        "positionType": "to",
      // Specified position. x-coordinate, y-coordinate.
      "attr": {
        "x": 0,
        "y": 0
      },
      // Animation method.
      "animation": {
        "enable": false,
        // Animation delay.
        "animationDuration": 1000,
        // Animation curve. Optional values are: linear|easeInOutQuad|easeInOutExpo.
        "animationEasing": "linear"
      }
    }

Switch Visibility

Switch the widget to show or hide. The data example is as follows.

{
  "animationType": "fade",
  "animationDuration": 1000,
  "animationEasing": "linear"
}
  • animationType: Animation method. It can be configured as appear (appear/disappear), fade (fade in/fade out), slideToUp (fly in/fly out). If not configured, it means no animation.

  • animationDuration: Animation delay, default is 1000ms.

  • animationEasing: Animation curve. It can be configured as linear (uniform speed), easeInOutQuad (smooth), easeInOutExpo (slow-fast-slow).

Show

Hide

Update Widget Configuration

Dynamically update the style configuration of the widget.

  1. First, in the Style panel of the widget, click Copy Configuration To Clipboard to obtain the configuration data of the widget.

  2. As needed, change the field values of the corresponding style in the data processing node on the blueprint editor configuration page.

Case demonstration

This case demonstrates the interaction between a list carousel and a status card, displaying the statuses of virtual machines in different regions. Clicking a row in the list carousel dynamically updates the status card with the virtual machines' status in the selected region.

  1. Add widgets to the canvas.

    1. Access the DataV console.

    2. Select a data dashboard and click Edit to enter the canvas editor.

    3. In the widget library in the left-side navigation pane, add the List Carousel and Status Card widgets to the canvas.

  2. Configure the list carousel.

    1. Modify the input data.

      Click the list carousel and update the static data in the data source panel as shown below.

      image

      The sample data is as follows.

      [
        {
          "cluster": "East China",
          "vm": "vm-001",
          "status": "normal"
        },
        {
          "cluster": "South China",
          "vm": "vm-002",
          "status": "not connected"
        },
        {
          "cluster": "West China",
          "vm": "vm-003",
          "status": "error"
        },
        {
          "cluster": "North China",
          "vm": "vm-004",
          "status": "normal"
        }
      ]
    2. Configure the widget style.

      In the style panel, set the number of rows to 3 and enable the carousel. Modify the custom column labels as follows:

      • Column field names: Change to "cluster", "vm", and "status" respectively.

      • Column display names: Change to "cluster", "vm", and "status" respectively.

      image

  3. Configure the status card.

    1. Modify the input data.

      Click the status card and update the static data in the data source panel as shown below.

      image

      The sample code is as follows.

      [
        {
          "name": "Normal status",
          "value": "normal"
        },
        [
          "Error status",
          "error"
        ],
        [
          "Virtual machine disconnected",
          "not connected"
        ]
      ]
    2. Configure the widget style.

      In the style panel, set the status categories of the status card to Normal (green), Error (red), and Disconnected (white) as shown below.image

  4. Set up blueprint interaction.

    1. Enter the blueprint page by clicking the image icon in the upper-left corner.

    2. In the Layer Node tab, hover over the widget and click the image to add it to the main canvas. Perform this step for both the list carousel and status card widgets.

      To add the list carousel and status card widgets to the main canvas, you must perform this operation in sequence.

    3. In the Logic Node tab, hover over the serial data processing node and click the image to add it to the main canvas.

    4. Connect the components as illustrated below to map the selected row's status from the list carousel to the status card.image

    5. Configure the serial data processing node to handle the data accordingly.image

      Upon clicking a specific row in the list carousel, the status card will import the virtual machine name and status from that row. The sample code is as follows.

      return [
        {
          "name": data.vm,
          "value": data.status,
        }
      ]
  5. To preview the display result, click Preview in the upper-right corner of the page.7501E2BF-91B3-4F1E-B08E-1AE6221E5F40