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(frontend): spider添加授权规则交互调整 #4992 #4993

Merged
merged 1 commit into from
Jun 17, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,15 @@
@cancel="handleVerifyCancel"
@confirm="handleVerifyConfirm">
<BkButton
class="mr-8"
class="w-88 mr-8"
:loading="state.isSubmitting"
theme="primary"
@click="handleSubmit">
{{ t('确定') }}
</BkButton>
</BkPopConfirm>
<BkButton
class="w-88"
:disabled="state.isSubmitting"
@click="handleClose">
{{ t('取消') }}
Expand Down Expand Up @@ -465,13 +466,15 @@
return;
}
submitCreateAccountRule(params);
}).finally(() => {
state.isSubmitting = false;
});
};
</script>

<style lang="less" scoped>
.rule-form {
padding: 24px 40px 40px;
padding: 24px 40px 32px;

.rule-setting-box {
padding: 16px 0 16px 16px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
* 操作类型
*/
export const dbOperations = {
dml: ['select', 'insert', 'update', 'delete', 'show view'],
ddl: ['create', 'alter', 'drop', 'index', 'create view', 'execute', 'trigger', 'event', 'create routine', 'alter routine', 'references', 'create temporary tables'],
glob: ['file', 'reload', 'show databases', 'process', 'replication slave', 'replication client'],
dml: ['select', 'insert', 'update', 'delete'],
ddl: ['execute'],
glob: ['file', 'reload', 'process', 'show databases'],
};

export const ddlSensitiveWords = ['trigger', 'event', 'create routine', 'alter routine', 'references', 'create temporary tables'];

/**
* 密码策略
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,6 @@
:disabled="checkAllPrivileges"
:label="option">
{{ option }}
<span
v-if="ddlSensitiveWords.includes(option)"
class="sensitive-tip">
{{ t('敏感') }}
</span>
</BkCheckbox>
</BkCheckboxGroup>
</div>
Expand Down Expand Up @@ -190,14 +185,15 @@
@cancel="handleVerifyCancel"
@confirm="handleVerifyConfirm">
<BkButton
class="mr-8"
class="w-88 mr-8"
:loading="isSubmitting"
theme="primary"
@click="handleSubmit">
{{ t('确定') }}
</BkButton>
</BkPopConfirm>
<BkButton
class="w-88"
:disabled="isSubmitting"
@click="handleClose">
{{ t('取消') }}
Expand Down Expand Up @@ -228,7 +224,7 @@

import { AccountTypes } from '@common/const';

import { dbOperations, ddlSensitiveWords } from '../common/consts';
import { dbOperations } from '../common/consts';

type AuthItemKey = keyof typeof dbOperations;

Expand Down Expand Up @@ -454,13 +450,15 @@
return;
}
createAccountRuleRun(params);
}).finally(() => {
isSubmitting.value = false;
});
};
</script>

<style lang="less" scoped>
.rule-form {
padding: 24px 40px 40px;
padding: 24px 40px 32px;

.rule-setting-box {
padding: 16px 0 16px 16px;
Expand Down
Loading