|
15 | 15 | trigger_name: x.trigger_name, |
16 | 16 | event_name: x.event_name?.trim(), |
17 | 17 | entity_type: x.entity_type?.trim(), |
18 | | - disabled: x.disabled |
| 18 | + disabled: x.disabled, |
| 19 | + criteria: x.criteria |
19 | 20 | }; |
20 | 21 | }); |
21 | 22 |
|
|
43 | 44 | getAgentRuleOptions().then(data => { |
44 | 45 | const list = data?.map(x => { |
45 | 46 | return { |
46 | | - trigger_name: x.trigger_name, |
| 47 | + name: x.trigger_name, |
47 | 48 | displayName: "" |
48 | 49 | }; |
49 | 50 | }) || []; |
50 | 51 | ruleOptions = [{ |
51 | | - trigger_name: "", |
| 52 | + name: "", |
52 | 53 | displayName: "" |
53 | 54 | }, ...list]; |
54 | 55 | }); |
|
87 | 88 | event_name: '', |
88 | 89 | entity_type: '', |
89 | 90 | displayName: '', |
90 | | - disabled: false |
| 91 | + disabled: false, |
| 92 | + criteria: '' |
91 | 93 | } |
92 | 94 | ]; |
93 | 95 | } |
|
123 | 125 | found.event_name = val; |
124 | 126 | } else if (field === 'entity_type') { |
125 | 127 | found.entity_type = val; |
| 128 | + } else if (field === 'criteria') { |
| 129 | + found.criteria = val; |
126 | 130 | } |
127 | 131 | refresh(innerRules); |
128 | 132 | } |
|
136 | 140 | event_name: x.event_name, |
137 | 141 | entity_type: x.entity_type, |
138 | 142 | displayName: x.displayName, |
139 | | - disabled: x.disabled |
| 143 | + disabled: x.disabled, |
| 144 | + criteria: x.criteria |
140 | 145 | } |
141 | 146 | }) || []; |
142 | 147 | } |
|
181 | 186 | on:change={e => changeRule(e, uid)} |
182 | 187 | > |
183 | 188 | {#each [...ruleOptions] as option} |
184 | | - <option value={option.trigger_name} selected={option.trigger_name == rule.trigger_name}> |
185 | | - {option.displayName || option.trigger_name} |
| 189 | + <option value={option.name} selected={option.name == rule.trigger_name}> |
| 190 | + {option.displayName || option.name} |
186 | 191 | </option> |
187 | 192 | {/each} |
188 | 193 | </Input> |
|
238 | 243 | </div> |
239 | 244 | </div> |
240 | 245 | </div> |
| 246 | + <div class="utility-content"> |
| 247 | + <div class="utility-list-item"> |
| 248 | + <div class="utility-label line-align-center"> |
| 249 | + {'Criteria'} |
| 250 | + </div> |
| 251 | + <div class="utility-value"> |
| 252 | + <div class="utility-input line-align-center"> |
| 253 | + <Input |
| 254 | + type="text" |
| 255 | + disabled={rule.disabled} |
| 256 | + maxlength={textLimit} |
| 257 | + value={rule.criteria} |
| 258 | + on:input={e => changeContent(e, uid, 'criteria')} |
| 259 | + /> |
| 260 | + </div> |
| 261 | + <div class="utility-delete line-align-center"></div> |
| 262 | + </div> |
| 263 | + </div> |
| 264 | + </div> |
241 | 265 | </div> |
242 | 266 | </div> |
243 | 267 | {/each} |
|
0 commit comments