feat: 增加运行的内置变量,优化self资源的代码

This commit is contained in:
Aaron3S
2022-12-06 19:43:32 +08:00
parent d92b198a12
commit 07b3774d3d
9 changed files with 14055 additions and 8 deletions

33
apps/ops/variables.py Normal file
View File

@@ -0,0 +1,33 @@
from django.utils.translation import gettext_lazy as _
# JumpServer
JMS_USERNAME = "jms_username"
# ASSENT
JMS_ASSET_ID = "jms_asset.id"
JMS_ASSET_TYPE = "jms_asset.type"
JMS_ASSET_CATEGORY = "jms_asset.category"
JMS_ASSET_PROTOCOL = "jms_asset.protocol"
JMS_ASSET_PORT = "jms_asset.port"
JMS_ASSET_NAME = "jms_asset.name"
JMS_ASSET_ADDRESS = "jms_asset.address"
# Account
JMS_ACCOUNT_ID = "jms_account.id"
JMS_ACCOUNT_USERNAME = "jms_account.name"
# JOB
JMS_JOB_ID = "jms_job_id"
JMS_JOB_NAME = "jms_job_name"
JMS_JOB_VARIABLE_HELP = {
JMS_USERNAME: _('The current user`s username of JumpServer'),
JMS_ASSET_ID: _('The id of the asset in the JumpServer'),
JMS_ASSET_TYPE: _('The type of the asset in the JumpServer'),
JMS_ASSET_CATEGORY: _('The category of the asset in the JumpServer'),
JMS_ASSET_NAME: _('The name of the asset in the JumpServer'),
JMS_ASSET_ADDRESS: _('Address used to connect this asset in JumpServer'),
JMS_ASSET_PORT: _('Port used to connect this asset in JumpServer'),
JMS_JOB_ID: _('ID of the job'),
JMS_JOB_NAME: _('Name of the job'),
}