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 Jul 27, 2021
1 parent f99070c commit 3ea4a5a
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,14 @@

this.isSubmiting = true;

AppManageService.fetchHostOfHost(IPList)
const params = {
ipList: IPList,
};
if (window.IPInputScope) {
params.actionScope = window.IPInputScope;
}

AppManageService.fetchHostOfHost(params)
.then((data) => {
// 输入的有效 IP
const hostList = [];
Expand Down
4 changes: 3 additions & 1 deletion src/frontend/src/components/choose-ip/view/host.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@
ipList.push(realId);
ipMap[realId] = Object.assign({ realId }, currentHost);
});
AppManageService.fetchHostOfHost(ipList)
AppManageService.fetchHostOfHost({
ipList,
})
.then((data) => {
const list = [];
this.invalidList = [];
Expand Down
7 changes: 7 additions & 0 deletions src/frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ console.log(process.env.JOB_WELCOME);
*/
window.changeAlert = false;

/**
* @desc 因为 IP 有白名单功能,生效范围需要更新场景区分
* - '' 所有
* - SCRIPT_EXECUTE 生效范围脚本执行
* - FILE_DISTRIBUTION 生效范围文件分发
*/
window.IPInputScope = '';
/**
* @desc 开启路由回溯
*/
Expand Down
4 changes: 4 additions & 0 deletions src/frontend/src/views/fast-execution/distro-file/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@
this.$once('hook:beforeDestroy', () => {
window.removeEventListener('resize', this.calcTargetPathTipsPlacement);
});
window.IPInputScope = 'FILE_DISTRIBUTION';
this.$once('hook:beforeDestroy', () => {
window.IPInputScope = '';
});
},
methods: {
/**
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/src/views/fast-execution/exec-script/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@
created () {
this.parseUrlParams();
},
mounted () {
window.IPInputScope = 'SCRIPT_EXECUTE';
this.$once('hook:beforeDestroy', () => {
window.IPInputScope = '';
});
},
/**
* @desc 销毁时清空脚本调试的数据
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@
immediate: true,
},
},
mounted () {
window.IPInputScope = 'FILE_DISTRIBUTION';
this.$once('hook:beforeDestroy', () => {
window.IPInputScope = '';
});
},
methods: {
/**
* @desc 表单字段更新
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@
immediate: true,
},
},
mounted () {
window.IPInputScope = 'SCRIPT_EXECUTE';
this.$once('hook:beforeDestroy', () => {
window.IPInputScope = '';
});
},
methods: {
handleChange (field, value) {
this.formData[field] = value;
Expand Down

0 comments on commit 3ea4a5a

Please sign in to comment.