Editing resource type styles

You assign existing or new custom icons to particular resource types using the Resource types page accessed through DASH. Here you can also apply further resource type style edits, such as adding custom labels to a resource type, and changing its shape, size, border and background.

Before you begin

To access the Resource types page, you must have the admin role inasm_admin assigned to you. See the Configuring DASH user roles topic for more information.

About this task

Tip: If you intend to create a number of icons without assigning them to specific resource types, or simply want to edit or delete icons, use the procedure described in the Defining custom icons topic. However, it may be more convenient to define custom icons as described from step four of the following procedure, as the custom icon is then immediately assigned to the previously selected resource type.
Tip: You can select more than one resource type and reset them to their default values, or perform a batch edit. You can also apply a filter to reduce the number of types displayed.

Procedure

Access resource types

  1. As a user with the inasm_admin role, log into your DASH web application.
  2. Select Administration > Topology configuration, then click Configure on the Resource types card.
    The Resource types page is displayed, which lists all your existing customized resource types in table format, in sortable columns. The table also displays the icons for the resource types and their names, categories (if defined), whether they are system icons or custom icons, and whether they have custom labels, styles or shapes. From here, you edit existing resource types and associate existing icons with them, and also apply resource styling.
    Tip: To reduce the number of resource types displayed in the table, use the Filter table text field. The resource types displayed are filtered as you enter the search text. You can also click Refresh (top right) to reload the resource types. This can be useful if other users are customizing them.

Reset defaults

  1. Select one or more of the resource types, and click Reset to defaults.
    The Reset settings to default values page is displayed.
  2. Select the setting for which you want to restore the default value, then click Reset to defaults.

Edit resource types

  1. Select one or more of the resource types, and click either Edit resource type or Batch edit resource types.
    The Edit resource type page is displayed. From here, you customize the resource icon, label, and style (such as border, background color and size) to be used when displaying the resource in a topology view.
    Tip: For some configuration options, you can enter text or a number, pick a value from a drop-down list, or pick a color from a palette, which the system then converts to a JavaScript function. Alternatively, you can switch to Advanced mode and define a JavaScript function using the simple script editor. In Advanced mode, you can click Example for more guidance.
  2. Expand the Identification section and define the selected resource type's icon, label and shape.
    Restriction: You cannot change the name of an existing resource type.
    1. Choose an icon to associate with the resource type using one of the following methods:
      From the Icon drop-down list
      If you open the Icon drop-down list, all existing icons are listed by name in alphabetical order.
      From the </> (Advanced mode) option
      Define a JavaScript function using the simple script editor to set a different icon based on a resource type's properties, such as tag or status. Ensure that the returned value is a string that matches the name of the icon to be displayed in the topology.
      Click Example for more guidance.
      From the (+) (Define a new custom icon) button
      From here you can define a custom icon, which is automatically associated with the resource type when done.
      Click the (+) button to display the New custom icon page.
      Use the following information to define the icon:
      Icon properties
      Name
      Each icon must have a name, which uniquely identifies the icon when assigning it to a type.
      You cannot change the name of an existing icon. If you want an icon to have a different name, create a new icon, then delete the old one.
      Category
      Optionally, each icon can be assigned to a category. You can use categories to group icons of the same type or function together.
      If you sort the full list of icons by category, icons with the same category are displayed together.
      SVG XML
      Use the XML editor to enter or edit the SVG text. Each icon definition must be valid SVG XML with a given viewBox, which is important to ensure scaling of the image. The SVG editor rejects any invalid XML entered.
      The SVG definition must include inline styling of the image, such as stroke color and fill color. If style classes are used, naming must be unique for each SVG image to prevent class definitions from being overwritten.
      Note:
      • Height or width should not be specified.
      • Inline styles should be used and not style classes.
      • SVG namespace is required:
        xmlns="http://www.w3.org/2000/svg"
      The XML editor includes a Preview area where the results of your SVG edits are displayed.
      Example: Use the following definition for the 'disk' icon as guidance:
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
         <ellipse style="fill-opacity:0;stroke:currentColor;stroke-width:12.12270069;" id="path4139" cx="33.627117" cy="32.949142" rx="16.803904" ry="17.210684"/>
         <circle cx="33.827423" cy="33.055576" r="3.3037829"/>
      </svg>
      Remember: You can also create custom icons from the Custom icons page accessed through DASH, which is described in the Defining custom icons topic.
    2. Define the label for the resource type by editing the following fields:
      Label property
      The default value is the resource name property.
      Simple mode: Select a label property from the drop-down list, if available. If no resources for this resource type exist in the system, type in a new property name instead.
      Advanced mode: Define a JavaScript function as label for the resource type. For example, you can display the full name unaltered by the label function in the tooltip by using the inAsmTooltip property, as in the following example:
      if (inAsmTooltip) {
          return asmProperties.name;
      } else if (asmProperties.name && asmProperties.name.length > 10) {
          const clipName = asmProperties.name.slice(0, 10);
          return `${clipName}...`;
      }
      return asmProperties.name;
      Maximum label length
      Simple mode:You can override the default label length of 15 characters to avoid truncating the displayed label by using the + and - buttons.
      Warning: Avoid labels that are too long, as long labels may overlap in the topology. The maximum suggested label length is 20 characters.
      Advanced mode: Define a JavaScript function to set the maximum label length.
    3. Choose a shape for the resource type from the Resource shape drop-down list.
      The default shape for a resource in the Topology Viewer is a circle (or a square for a host server). You can change the shape of the resource type to one of the following shapes:
      • Circle
      • Square
      • Hexagon
      • Vertical hexagon
  3. Expand the Styling section and define the selected resource type's border color and pattern, as well as its background color and resource display size.
    Restriction: If you use the advanced JavaScript format to define customized styling, take care to use valid JavaScript and to observe the conventions defined here, as using invalid syntax or formats could prevent topologies from being rendered.
    1. Change the Border color from the default color of #E0E0E0.

      Simple mode: Enter a hex definition, or use the color palette icon to open a color picker, from which you can choose your required color option.

      Advanced mode: Define a JavaScript function as border color for the resource type.

    2. Change the Border pattern from the default solid line.

      Simple mode: Choose a border pattern from the drop-down list.

      Advanced mode: Define a JavaScript function as border pattern for the resource type.

    3. Change the Background color for the resource from the default #FFFFFF.

      Simple mode: Enter a hex definition, or use the color palette icon to open a color picker, from which you can choose your required color option.

      Advanced mode: Define a JavaScript function as background color for the resource type.

    4. Select a Size for the resource type from the drop-down list. The default is medium.

      Simple mode: Choose a size from the drop-down list. The options are Small, Medium, and Large.

      Advanced mode: Define a JavaScript function to define the resource type size. For example, you can refine the size function by specifying how certain resource properties affect the size of the resource type displayed; for example, resource types can appear larger depending on the number of connections they have with other resources.

  4. Click Save to return to the Resource types page.

Results

The changes you have made to the resource type and its associated icon are now displayed in the Resource types table. Refresh your topology to see the changes.