Skip to content

Commit

Permalink
merge:3.5.x TencentBlueKing#1349
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx committed Sep 22, 2022
2 parents 689ef08 + 25c4ddc commit 472b826
Show file tree
Hide file tree
Showing 39 changed files with 668 additions and 126 deletions.
14 changes: 11 additions & 3 deletions src/frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
<bk-popover
theme="light site-header-dropdown"
style="margin-right: 8px;"
:arrow="false">
:arrow="false"
:tippy-options="{ hideOnClick: false }">
<div class="flag-box">
<Icon
id="siteLocal"
Expand All @@ -58,7 +59,11 @@
</div>
</div>
</bk-popover>
<bk-popover theme="light site-header-dropdown" style="margin-right: 14px;" :arrow="false">
<bk-popover
theme="light site-header-dropdown"
style="margin-right: 14px;"
:arrow="false"
:tippy-options="{ hideOnClick: false }">
<div class="flag-box">
<Icon id="siteHelp" type="help-document-fill" />
</div>
Expand All @@ -68,7 +73,10 @@
<div class="item" @click="handleLocationFeedback">{{ $t('问题反馈') }}</div>
</div>
</bk-popover>
<bk-popover theme="light site-header-dropdown" :arrow="false">
<bk-popover
theme="light site-header-dropdown"
:arrow="false"
:tippy-options="{ hideOnClick: false }">
<div class="user-flag">
<span style="margin-right: 5px;">{{ currentUser.username }}</span>
<i class="bk-icon icon-down-shape" />
Expand Down
37 changes: 24 additions & 13 deletions src/frontend/src/components/jb-edit/tag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,15 @@
class="tag-shortcurt-box"
@click.stop="">
<div class="shortcurt-action-btn">
<Icon type="copy" @click="handleCopy" />
<Icon type="paste" class="paste-btn" @click="handlePaste" />
<Icon
v-bk-tooltips="$t('复制')"
type="copy"
@click="handleCopy" />
<Icon
v-bk-tooltips="$t('粘贴')"
type="paste"
class="paste-btn"
@click="handlePaste" />
</div>
</div>
<div v-else class="tag-normal-box">
Expand Down Expand Up @@ -233,6 +240,7 @@
return;
}
copyMemo = _.cloneDeep(this.localValue);
console.log('form copyMemocopyMemo = ', copyMemo);
execCopy(this.text);
},
/**
Expand All @@ -246,12 +254,10 @@
});
return;
}
this.localValue = [
...new Set([
...this.localValue,
...copyMemo,
]),
];
this.localValue = _.uniqBy([
...this.localValue,
...copyMemo,
], _ => _.id);
this.triggerRemote();
},
},
Expand Down Expand Up @@ -285,11 +291,17 @@
cursor: pointer;
border-radius: 2px;

&.shortcurt:hover {
background: #e1e2e6;
&.shortcurt {
.render-value-box {
padding-left: 4px;
}

.shortcurt-action-btn {
display: flex;
&:hover {
background: #e1e2e6;

.shortcurt-action-btn {
display: flex;
}
}
}

Expand All @@ -305,7 +317,6 @@
.render-value-box {
display: flex;
height: 30px;
padding-left: 4px;
line-height: 30px;
align-items: center;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
@input="handleInputChange"
@keydown="handleInputKeydown" />
</div>
<div
<!-- <div
v-if="focused"
v-once
style="margin-top: 4px; font-size: 12px; line-height: 22px; color: #c4c6cc;">
{{ inputTips }}
</div>
</div> -->
</div>
<div class="search-nextfix">
<i
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/components/render-list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
selectNums: 0,
params: {},
pagination: {
showTotalCount: true,
count: 0,
current: 1,
limit: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,30 +96,31 @@
handler (newData) {
this.isReadonly = newData[this.scriptSourceField] !== TaskStepModel.scriptStep.TYPE_SOURCE_LOCAL;
this.lang = formatScriptTypeValue(newData[this.languageField]);
if (this.isReadonly) {
this.rules = [];
} else {
this.rules = [
{
required: true,
message: I18n.t('脚本内容必填'),
trigger: 'change',
},
{
validator: value => ScriptManageService.getScriptValidation({
content: value,
scriptType: newData[this.languageField],
}).then((data) => {
// 高危语句报错状态需要全局保存
const dangerousContent = _.find(data, _ => _.isDangerous);
this.$store.commit('setScriptCheckError', dangerousContent);
return true;
}),
message: I18n.t('脚本内容检测失败'),
trigger: 'blur',
},
];

const rules = [
{
validator: value => ScriptManageService.getScriptValidation({
content: value,
scriptType: newData[this.languageField],
}).then((data) => {
// 高危语句报错状态需要全局保存
const dangerousContent = _.find(data, _ => _.isDangerous);
this.$store.commit('setScriptCheckError', dangerousContent);
return true;
}),
message: I18n.t('脚本内容检测失败'),
trigger: 'blur',
},
];

if (!this.isReadonly) {
rules.unshift({
required: true,
message: I18n.t('脚本内容必填'),
trigger: 'change',
});
}
this.rules = rules;
},
deep: true,
immediate: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
</bk-option>
</bk-select>
<bk-select
ref="scriptSelect"
:placeholder="$t('选择引用脚本')"
style="width: 375px;"
:value="formData[scriptVersionIdField]"
Expand Down Expand Up @@ -250,13 +251,24 @@
this.$refs.scriptId.clearValidator();
}
},
// 需要同步的脚本默认展开脚本列表
scriptListDisplay () {
if (this.scriptListDisplay.length > 1 && !this.hasShowScriptSelect) {
setTimeout(() => {
this.hasShowScriptSelect = true;
this.$refs.scriptSelect.$el.querySelector('.bk-select-name').click();
}, 30);
}
},
},
created () {
this.scriptListMemo = [];
this.publicScriptListMemo = [];
this.initScriptContent();
this.fetchScriptList();
this.fetchPublicScriptList();

this.hasShowScriptSelect = false;
},
methods: {
/**
Expand Down
10 changes: 8 additions & 2 deletions src/frontend/src/i18n/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,11 @@ export default {
'作业平台的核心功能包括面向服务器操作系统的命令执行、文件分发,以及将多个操作组合成作业流程,并支持设置定时执行。': 'The core functions of the Job include command execution for server operating systems, file distribution, and combining multiple operations into job processes, and support for setting up timed execution.',
申请业务权限: 'Apply Business Permission',
'申请已有业务权限 / 创建新的业务': 'Apply for business permission or Create one',
'不同团队在作业平台上的资源以“业务”分隔,而“业务”是统一由配置平台进行创建和管理的,你可以选择 申请已有业务的权限,亦或是 新建 一个全新的业务。': 'The resources of different teams on the job platform are separated by "Business", which is created and managed by the CMDB platform, and you can choose to request the permission of an existing business or create a new one.',
'不同团队在作业平台上的资源以“业务”分隔,而“业务”是统一由配置平台进行创建和管理的,你可以选择': 'The resources of different teams on the job platform are separated by "Business", which is created and managed by the CMDB platform, and you can choose to ',
申请已有业务的权限: 'Apply Business Permission',
',亦或是': ' or ',
' 新建 ': 'create now.',
'一个全新的业务。': '',
开始使用作业平台: 'Getting Started with Job',
作业平台的目标服务器信息同样来自: 'The target host of the job platform also comes from the ',
配置平台: 'CMDB',
Expand Down Expand Up @@ -563,5 +567,7 @@ export default {
请确定是否要继续执行: 'Are you sure want to continue to run?',
继续执行: 'YES',
立即取消: 'CANCEL',

复制: 'Copy',
粘贴: 'Paste',
快速执行详情: 'Quick Launch Details',
};
4 changes: 2 additions & 2 deletions src/frontend/src/layout-new.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@
<div slot="title">{{ $t('安全.menuGroup') }}</div>
<div slot="flod-title">{{ $t('安全.flodTitle') }}</div>
<jb-item index="dangerousRuleManage">
<Icon type="job-white-list" />
<Icon type="gaoweiyujujiance" />
{{ $t('高危语句规则') }}
</jb-item>
<jb-item index="detectRecords">
<Icon type="job-setting" />
<Icon type="lanjiejilu" />
{{ $t('检测记录') }}
</jb-item>
</jb-item-group>
Expand Down
10 changes: 5 additions & 5 deletions src/frontend/src/views/account-manage/index/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
label="ID"
prop="id"
key="id"
sortable
sortable="custom"
width="80"
align="left" />
<bk-table-column
Expand All @@ -65,31 +65,31 @@
prop="alias"
key="alias"
min-width="180"
sortable
sortable="custom"
align="left" />
<bk-table-column
v-if="allRenderColumnMap.account"
:label="$t('account.账号名称.colHead')"
prop="account"
key="account"
min-width="180"
sortable
sortable="custom"
align="left" />
<bk-table-column
v-if="allRenderColumnMap.categoryName"
:label="$t('account.账号用途.colHead')"
prop="categoryName"
key="categoryName"
width="120"
sortable
sortable="custom"
align="left" />
<bk-table-column
v-if="allRenderColumnMap.typeName"
:label="$t('account.账号类型.colHead')"
prop="typeName"
key="typeName"
width="120"
sortable
sortable="custom"
align="left" />
<bk-table-column
v-if="allRenderColumnMap.creator"
Expand Down
16 changes: 14 additions & 2 deletions src/frontend/src/views/business-permission.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,19 @@
</div>
<div class="feature-box">
<div class="feature-title">{{ $t('申请已有业务权限 / 创建新的业务') }}</div>
<div>{{ $t('不同团队在作业平台上的资源以“业务”分隔,而“业务”是统一由配置平台进行创建和管理的,你可以选择 申请已有业务的权限,亦或是 新建 一个全新的业务。') }}</div>
<div>
{{ $t('不同团队在作业平台上的资源以“业务”分隔,而“业务”是统一由配置平台进行创建和管理的,你可以选择') }}
<a @click="handleGoApplyPermission">
{{ $t('申请已有业务的权限') }}
</a>
{{ $t(',亦或是') }}
<a
target="_blank"
:href="`${relatedSystemUrls.BK_CMDB_ROOT_URL}/#/resource/business`">
{{ $t('新建') }}
</a>
{{ $t('一个全新的业务。') }}
</div>
</div>
</div>
<div class="divide-line" />
Expand Down Expand Up @@ -103,7 +115,7 @@
<div style="margin-top: 10px;">
<span>{{ $t('了解更多关于作业平台产品的功能介绍,点击前往') }}</span>
<a
:href="`${relatedSystemUrls.BK_DOC_JOB_ROOT_URL}`"
:href="`${relatedSystemUrls.BK_DOC_JOB_ROOT_URL}/markdown/作业平台/产品白皮书/Introduction/What-is-Job.md`"
target="_blank">
<span>{{ $t('产品文档') }}</span>
<Icon type="link" />
Expand Down
Loading

0 comments on commit 472b826

Please sign in to comment.