Overview概述
Step 1 步骤 1
To define your own theme you’ll need to create a CSS file and save it in the styles/ folder (for example, custom-theme.css). You can either copy the files from a different theme and create your theme based on it or start from scratch.为了制作属于您自己的主题,您需要在 styles/ 文件夹下创建一个 CSS 文件(例如: custom-theme.css)。您可以从不同的主题复制文件,并据此创建主题,或从头开始创作。
Step 2 步骤 2
Add your theme to the list of themes returned by the Z::getThemes() method. You can do this by overriding the ZBase::getThemes() method in the Z class. This can be done by adding the following code before the closing brace in include/classes/core/Z.php:您可以通过 Z::getThemes() 方法将您的主题添加到主题列表中。您可以通过覆盖Z类中的 ZBase::getThemes() 方法来执行此操作。这可以通过在 include/classes/core/Z.php: 中的关闭括号之前添加以下代码:
To add multiple themes, just list them under the first theme, for example:添加多个主题,只需要将它们罗列在第一个主题下面即可,例如:
return array_merge(parent::getThemes(), array(
));
Note that every theme except the last one must have a trailing comma.注意:除了最后的一个主题外,其他主题必须用逗号分隔。
Step 3 步骤 3
Activate the new theme.激活新主题
In Zabbix frontend, you may either set this theme to be the default one or change your theme in the user profile. 在Zabbix前端,您可以将此主题设置为默认主题或在用户资料改主题。