Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:修复部分空间样式和交互问题 #2705

Merged
merged 4 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bcs-services/bcs-bscp/ui/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const routes = [
const { spaceList } = useGlobalStore();
const firstHasPermSpace = spaceList.find((item: ISpaceDetail) => item.permission);
const spaceId = firstHasPermSpace ? firstHasPermSpace.space_id : spaceList[0]?.space_id;
return { name: 'service-mine', params: { spaceId } };
return { name: 'service-all', params: { spaceId } };
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -713,4 +713,10 @@ const goToIAM = () => {
display: none;
}
}
.delete-service-dialog {
.bk-modal-footer {
background-color: #fff !important;
border-top: none !important;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
</bk-form-item>
<bk-form-item class="radio-group-form" label="分组规则" required property="rules">
<div v-for="(rule, index) in formData.rules" class="rule-config" :key="index">
<bk-input v-model="rule.key" style="width: 176px" placeholder="" @change="ruleChange"></bk-input>
<bk-input v-model="rule.key" style="width: 174px" placeholder="" @change="ruleChange"></bk-input>
<bk-select
:model-value="rule.op"
style="width: 120px"
style="width: 72px"
:clearable="false"
@change="handleLogicChange(index, $event)"
>
Expand Down Expand Up @@ -271,7 +271,7 @@ defineExpose({
cursor: pointer;
}
.value-input {
width: 250px;
width: 280px;
}
}
.action-btns {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@
</bk-form-item>
<bk-form-item class="fixed-width-form" property="tag" label="分类标签">
<!-- <bk-input v-model="formData.tag" /> -->
<bk-select
v-model="formData.tag"
<bk-tag-input
v-model="selectTags"
placeholder="请选择标签或输入新标签按Enter结束"
:loading="tagsLoading"
display-key="tag"
save-key="tag"
search-key="tag"
:max-data="1"
:list="tagsData"
:allow-create="true"
:filterable="true"
>
<bk-option
v-for="option in tagsData"
:key="option.tag"
:value="option.tag"
:label="option.tag"
></bk-option>
</bk-select>
trigger="focus"
/>
</bk-form-item>
<bk-form-item class="fixed-width-form" property="memo" label="脚本描述">
<bk-input v-model="formData.memo" type="textarea" :rows="3" :maxlength="200" :resize="false"/>
<bk-input v-model="formData.memo" type="textarea" :rows="3" :maxlength="200" :resize="false" />
</bk-form-item>
<bk-form-item label="脚本内容" property="content" required>
<div class="script-content-wrapper">
Expand Down Expand Up @@ -74,17 +71,18 @@ const SCRIPT_TYPE = [
{ id: EScriptType.Python, name: 'Python' },
];

const formRef = ref();
const pending = ref(false);
const tagsLoading = ref(false);
const tagsData = ref<IScriptTagItem[]>([]);
const selectTags = ref<string[]>([]);
const formData = ref<IScriptEditingForm>({
name: '',
tag: '',
memo: '',
type: EScriptType.Shell,
content: '',
});
const formRef = ref();
const pending = ref(false);
const tagsLoading = ref(false);
const tagsData = ref<IScriptTagItem[]>([]);

onMounted(() => {
getTags();
Expand All @@ -102,6 +100,7 @@ const handleCreate = async () => {
await formRef.value.validate();
try {
pending.value = true;
formData.value.tag = selectTags.value[0];
await createScript(spaceId.value, formData.value);
BkMessage({
theme: 'success',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@ const rules = {
message: '文件权限 不能为空',
trigger: 'change',
},
{
validator: () => {
const privilege = parseInt(privilegeInputVal.value[0]);
return privilege >= 4;
},
message: '文件own必须有读取权限',
trigger: 'blur',
},
],
path: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const handleValidateEditor = () => {
errorInfo: '请检查是否已正确使用分隔符',
lineNumber: index + 1,
});
} else if (!key.startsWith('bk_bscp_')) {
} else if (!key.startsWith('bk_bscp_') && !key.startsWith('BK_BSCP_')) {
errorLine.value.push({
errorInfo: '变量必须以bk_bscp_开头',
lineNumber: index + 1,
Expand All @@ -134,7 +134,7 @@ const handleValidateEditor = () => {
errorInfo: '类型必须为 string 或者 number',
lineNumber: index + 1,
});
} else if (type === 'number' && !/^\d+$/.test(value)) {
} else if (type === 'number' && !/^\d+(\.\d+)?$/.test(value)) {
errorLine.value.push({
errorInfo: '类型为number 值不为number',
lineNumber: index + 1,
Expand Down
Loading