Updated on 2023-06-02 GMT+08:00

Screen Combination

You can combine two or more screens into one screen so that you can view multiple screens in one screen at the same time. After creating a combined screen, you can publish it and share its link with other users. Other users can access the combined screen through the screen link in the browser or application. When viewing a combined screen on a browser, you can switch between multiple screens.

Prerequisites

At least two screens are prepared for screen combination. For details about how to publish screens, see Publishing Screens.

Combining Screens

  1. Log in to the DLV console.
  2. Click the workspace drop-down list in the upper left corner of the page. On the displayed workspace panel, click the workspace that you want to switch to.

    Figure 1 Switching a workspace

  3. On the Screen Combination page, click Create Screen Combination.
  4. Select at least two screens and click Next.
  5. Click or to adjust the screen sequence, and then click Next.
  6. Set the name and related parameters of the combined screen and click Submit.

    • A combined screen name can contain only letters, digits, underscores (_), and hyphens (-), and cannot exceed 32 characters.
    • Horizontal scrolling: If this option is selected, you can click the buttons on the left and right sides of the screen to switch between screens.
    • Bottom navigation: If this option is selected, you can click the navigation button at the bottom of the screen to switch between screens

    Select at least one of the preceding two options. Otherwise, the screens cannot be switched.

Publishing Combined Screens

  1. Log in to the DLV console.
  2. On the Screen Combination page, locate the combined screen to be published and click on the screen.

    Figure 2 Publishing a combined screen

  3. On the displayed page, configure publish parameters.

    Figure 3 Configuring publish parameters

    Publish

    Specifies whether others can share your created screens (see Figure 3). After the screen is published, other users can access the screen without logging in to DLV. They only need to open the browser and enter the shared link in the address box to access the screen.

    Version management

    Specifies a sharable version.

    • Real-time version: When the current version of screen is modified, users who are sharing it can synchronously use the latest version of screen. It is the default option and cannot be deleted.
    • Historical version: When the current version of screen is modified, users who are sharing it cannot use the latest version of screen but can only use the original one.

    Share Key

    Specifies a screen sharing mode.

    • Public sharing: If a user does not configure password access or token authentication for a screen, the screen is accessed through the shared link. The basic edition of DLV supports only the public sharing mode.
    • Password access: On the Set Access Password tab page, enable password access and set a password. After the password is set successfully, other users need to enter the password each time when they want to access the screen through the shared link.
      Figure 4 Setting an access password
    • Token access: On the Set Token tab page, enable token verification.

      The system randomly generates a token. You need to record it for future use.

      Figure 5 Setting a token

      After the token for the screen is generated, you have to perform the following steps before accessing the screen:

      To prevent replay attacks, ensure that your server time is GMT +08:00. DLV allows only one minute difference. If the time difference exceeds one minute, authentication fails.

      1. Publish the screen and record the shared screen code (a character string behind share in the shared link).
      2. Connect the screen code with the current time (millisecond) and separate them with a vertical bar (|).
      3. Use the token to encrypt the character string in 3.b through HMAC-SHA256 base64.
      4. Name the time and the encrypted signature dlv_time and dlv_signature, respectively.
      5. Add them to querystring of the shared link.

      An example is provided as follows:

      Java:

       package com.test;
       import java.security.*;
       import javax.crypto.*;
       import javax.crypto.spec.SecretKeySpec;
       import org.apache.commons.codec.binary.Base64;
       import java.net.URLEncoder;
      
       public class ShareWithTokenTest {
      
           public static void main(String[] args) throws Exception {
               System.out.println(getShareUrlWithToken("b668e3b44722467a9477b5b888211bca", "nrU4iher1tyy1C7Jenni3pzJxeIlPz8P"));
           }
      
           public static String getShareUrlWithToken(String shareID, String token){
               long time = System.currentTimeMillis();
               String data = shareID + "|" + time;
               String signature = HMACSHA256(data.getBytes(), token.getBytes());
               String url = "https://console.huaweicloud.com/dlv/vision/combo/share/?id="+shareID +"&dlv_time="+time+"&dlv_signature="+ signature+"&locale=zh-cn&region=cn-north-4";
               return url;
           }
      
          //Use HmacSHA256 for signature.
           public static String HMACSHA256(byte[] data, byte[] key)
           {
               try  {
                   SecretKeySpec signingKey = new SecretKeySpec(key, "HmacSHA256");
                   Mac mac = Mac.getInstance("HmacSHA256");
                   mac.init(signingKey);
                   return URLEncoder.encode(Base64.encodeBase64String(mac.doFinal(data)));
               } catch (NoSuchAlgorithmException e) {
                   e.printStackTrace();
               } catch (InvalidKeyException e) {
                   e.printStackTrace();
               }
               return null;
           }
       }
    Replace the following parameters in the preceding code based on the site requirements:
    b668e3b44722467a9477b5b888211bca in System.out.println(getShareUrlWithToken("b668e3b44722467a9477b5b888211bca", "nrU4iher1tyy1C7Jenni3pzJxeIlPz8P") is the parameter after share in the shared link, and nrU4iher1tyy1C7Jenni3pzJxeIlPz8P is the parameter in the shared key.
    In String url = "https://console.huaweicloud.com/dlv/vision/combo/share/?id="+shareID +"&dlv_time="+time+"&dlv_signature="+ signature+"&locale=zh-cn&region=cn-north-4, locale=zh-cn indicates the language ID, en-us indicates the English language, and region=cn-north-4 indicates the area where the service is deployed. 

Editing Screen Combinations

  1. Log in to the DLV console.
  2. On the Screen Combination page, mouse over the required screen combination. A row of operation buttons are displayed on the screen.

    Figure 6 Managing a combined screen

  3. Click . The page for editing the combined screen is displayed.
  4. The procedure for editing a combined screen is similar to that for creating a combined screen. For details, see Combining Screens.

Previewing Combined Screens

  1. Log in to the DLV console.
  2. On the Screen Combination page, mouse over the required screen combination. A row of operation buttons are displayed on the screen.

    Figure 7 Managing a combined screen

  3. Click to preview the combined screen.

Deleting Combined Screens

  1. Log in to the DLV console.
  2. On the Screen Combination page, mouse over the required screen combination. A row of operation buttons are displayed on the screen.

    Figure 8 Managing a combined screen

  3. Click .
  4. In the displayed dialog box, click Yes.