MCPcopy Create free account
hub / github.com/bywwcnll/StreamPanel / addFilterCondition

Function addFilterCondition

devtools/modules/filterManager.js:136–159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134}
135
136export function addFilterCondition() {
137 const availableFields = getAvailableFields();
138 if (availableFields.length === 0) {
139 alert('当前没有可用的字段,请先选择连接并等待消息数据。');
140 return;
141 }
142
143 state.pendingFilters.push({
144 field: '',
145 mode: 'equals',
146 value: ''
147 });
148
149 elements.messageFilterContainer.style.display = 'block';
150 elements.btnToggleFilter.classList.add('expanded');
151 renderFilterConditions();
152
153 const lastInput = elements.filterConditions.querySelector(
154 `.filter-field-input[data-index="${state.pendingFilters.length - 1}"]`
155 );
156 if (lastInput) {
157 lastInput.focus();
158 }
159}
160
161export function removeFilterCondition(index) {
162 state.pendingFilters.splice(index, 1);

Callers

nothing calls this directly

Calls 2

getAvailableFieldsFunction · 0.70
renderFilterConditionsFunction · 0.70

Tested by

no test coverage detected