Skip to content

Commit

Permalink
feature: 白名单IP添加时增加对“执行方式”的判断,如仅开文件分发则在脚本执行中不可选中 TencentBlueKing#115
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx committed Sep 16, 2021
1 parent b8b0e84 commit aec9b0f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
return;
}
const IPReg = /(((\d+:)?)(?:(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d))))/;
const IPList = [];
const ipList = [];
// 无法解析出 IP 的内容
const errorIPList = [];
this.inputItemList.forEach((IPText) => {
Expand All @@ -255,7 +255,7 @@
errorIPList.push(IPText);
} else {
// 提取识别成功的 IP
IPList.push(IPStr);
ipList.push(IPStr);
// 将剩下的内容作为错误 IP 处理
const errorText = IPText.replace(new RegExp(`(${encodeRegexp(IPStr)})|(\\s)`, 'g'), '');
if (errorText) {
Expand All @@ -271,7 +271,7 @@
this.isSubmiting = true;

const params = {
ipList: IPList,
ipList,
};
if (window.IPInputScope) {
params.actionScope = window.IPInputScope;
Expand Down Expand Up @@ -306,7 +306,7 @@
});
}
// 正确的 IP 输入,但是 IP 不存于当前业务下
this.invalidIPList = IPList.reduce((result, IPItem) => {
this.invalidIPList = ipList.reduce((result, IPItem) => {
if (!hostIPMap[IPItem]) {
result.push(IPItem);
}
Expand Down

0 comments on commit aec9b0f

Please sign in to comment.