|
90 | 90 | <Form v-if="addHookForm" ref="formZabbixHostsHook" :model="formZabbixHostsHook" :rules="ruleZabbixHostHook" :label-width="90"> |
91 | 91 | <FormItem label="告警标题" prop="alert_title"> |
92 | 92 | <Alert type="success"> |
93 | | - <p>【解释】:ZABBIX WebHooks告警传来的告警标题,如:Zabbix agent on Zabbix server is unreachable for 5 minutes</p> |
| 93 | + <p>【解释】:ZABBIX WebHooks告警传来的告警标题,如:Zabbix agent on Zabbix server is unreachable for 5 minutes。匹配标题触发钩子</p> |
94 | 94 | </Alert> |
95 | 95 | <Input v-model="formZabbixHostsHook.alert_title"></Input> |
96 | 96 | </FormItem> |
97 | 97 | <FormItem label="审批/自动"> |
98 | | - <Alert type="success"> |
99 | | - <p>【解释】:自动执行:不需要审批和定时,直接执行。审批执行则需要有模板权限的人来审批或者设置定时执行</p> |
100 | | - </Alert> |
101 | 98 | <RadioGroup v-model="formZabbixHostsHook.schedule"> |
102 | 99 | <Radio label="ready">自动执行</Radio> |
103 | 100 | <Radio label="new"> 审批执行</Radio> |
|
113 | 110 | </Select> |
114 | 111 | </FormItem> |
115 | 112 |
|
116 | | - <FormItem label="参数字典"> |
| 113 | + <FormItem label="执行主机"> |
117 | 114 | <Alert type="success"> |
118 | | - <p>【解释】:任务命令中使用的参数,必须json格式的。例如: {"hosts_dict": {"1":"127.0.0.1","2":"192.168.1.2", "MAILTO": "191715030@qq.com"}} |
119 | | - hosts_dict 指每组任务在那些主机上执行。默认 {"hosts_dict": {"1": "127.0.0.1"}} |
120 | | - </p> |
| 115 | + <p>【解释】:任务在那台主机上执行,默认为第一组,主机:127.0.0.1</p> |
121 | 116 | </Alert> |
122 | | - <Input v-model="formZabbixHostsHook.hook_args" :maxlength=255 type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="字典格式的参数信息"></Input> |
| 117 | + <Input v-model="formZabbixHostsHook.exec_host" :maxlength=50 type="text" placeholder="任务会在执行主机上执行"></Input> |
123 | 118 | </FormItem> |
124 | | - |
125 | 119 | <FormItem> |
126 | 120 | <Button type="primary" @click="addZabbixHostHookSubmit('formZabbixHostsHook')">保存</Button> |
127 | 121 | </FormItem> |
|
185 | 179 | }, |
186 | 180 | formZabbixHostsHook: { |
187 | 181 | alert_title: '', |
188 | | - hook_args: '', |
| 182 | + exec_host: '127.0.0.1', |
189 | 183 | schedule: 'ready', |
190 | 184 | temp_id: '', |
191 | 185 | }, |
|
277 | 271 | const ZabbixHooks = JSON.parse(this.hostInfo.zabbix_hooks) |
278 | 272 | this.formZabbixHostsHook = ZabbixHooks[params.row.alert_title] |
279 | 273 | this.formZabbixHostsHook['alert_title'] = params.row.alert_title |
280 | | - this.formZabbixHostsHook['hook_args'] = JSON.stringify(this.formZabbixHostsHook['hook_args']) |
| 274 | + // this.formZabbixHostsHook['exec_host'] = JSON.stringify(this.formZabbixHostsHook['exec_host']) |
281 | 275 | } |
282 | 276 | } |
283 | 277 | }, |
|
765 | 759 | this.addHookForm = false |
766 | 760 | this.formZabbixHostsHook = { |
767 | 761 | alert_title: '', |
768 | | - hook_args: '', |
| 762 | + exec_host: '127.0.0.1', |
769 | 763 | schedule: 'ready', |
770 | 764 | temp_id: '', |
771 | 765 | } |
|
0 commit comments