fix: 暗色样式调整 (#1606)

This commit is contained in:
ssongliu 2023-07-11 16:39:10 +08:00 committed by GitHub
parent 227856b45b
commit 66b12800e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 8 deletions

View File

@ -18,6 +18,7 @@ html.dark {
// * panel-admin // * panel-admin
--panel-text-color: rgb(174, 166, 153); --panel-text-color: rgb(174, 166, 153);
--panel-border: 1px solid #1d2023; --panel-border: 1px solid #1d2023;
--panel-border-color: #394c5e;
--panel-main-bg-color: rgba(12, 12, 12, 1); --panel-main-bg-color: rgba(12, 12, 12, 1);
--panel-button-active: var(--el-color-primary); --panel-button-active: var(--el-color-primary);
@ -56,7 +57,8 @@ html.dark {
--el-table-border-color: rgb(64, 67, 67); --el-table-border-color: rgb(64, 67, 67);
} }
.el-message-box { .el-message-box {
--el-messagebox-title-color: #999999; --el-messagebox-title-color: var(--el-menu-text-color);
border: 1px solid var(--panel-border-color);
} }
.el-alert--info { .el-alert--info {
@ -74,6 +76,7 @@ html.dark {
.el-popover { .el-popover {
--el-popover-title-text-color: #999999; --el-popover-title-text-color: #999999;
border: 1px solid var(--panel-border-color);
} }
// * wangEditor // * wangEditor
@ -194,6 +197,9 @@ html.dark {
.el-drawer .el-drawer__header span { .el-drawer .el-drawer__header span {
color: var(--el-menu-text-color); color: var(--el-menu-text-color);
} }
.el-drawer {
border-left: 0.5px solid var(--panel-border-color);
}
.el-input__wrapper { .el-input__wrapper {
background-color: var(--el-disabled-bg-color); background-color: var(--el-disabled-bg-color);
@ -245,7 +251,11 @@ html.dark {
.el-dialog__header { .el-dialog__header {
border-bottom: var(--panel-border); border-bottom: var(--panel-border);
color: #999999; color: #999999;
.el-dialog__title {
color: var(--el-menu-text-color);
}
} }
border: 1px solid var(--panel-border-color);
} }
.el-tabs__item { .el-tabs__item {
color: #999999; color: #999999;
@ -291,4 +301,9 @@ html.dark {
background: #212426; background: #212426;
} }
} }
.el-alert--warning.is-light {
background-color: rgb(56, 59, 59);
color: var(--el-color-warning);
}
} }

View File

@ -62,11 +62,7 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane :closable="false" name="newTabs"> <el-tab-pane :closable="false" name="newTabs">
<template #label> <template #label>
<el-button <el-button v-popover="popoverRef" class="tagButton" icon="Plus"></el-button>
v-popover="popoverRef"
style="background-color: #ededed; border: 0"
icon="Plus"
></el-button>
<el-popover ref="popoverRef" width="250px" trigger="hover" virtual-triggering persistent> <el-popover ref="popoverRef" width="250px" trigger="hover" virtual-triggering persistent>
<div style="margin-left: 10px"> <div style="margin-left: 10px">
<el-button link type="primary" @click="onNewSsh">{{ $t('terminal.createConn') }}</el-button> <el-button link type="primary" @click="onNewSsh">{{ $t('terminal.createConn') }}</el-button>
@ -401,6 +397,11 @@ defineExpose({
} }
} }
.tagButton {
border: 0;
background-color: var(--el-tabs__item);
}
.vertical-tabs > .el-tabs__content { .vertical-tabs > .el-tabs__content {
padding: 32px; padding: 32px;
color: #6b778c; color: #6b778c;

View File

@ -55,7 +55,9 @@
<el-form-item :label="$t('setting.mfaInterval')" prop="interval"> <el-form-item :label="$t('setting.mfaInterval')" prop="interval">
<el-input v-model.number="form.interval"> <el-input v-model.number="form.interval">
<template #append> <template #append>
<el-button @click="loadMfaCode">{{ $t('commons.button.save') }}</el-button> <el-button @click="loadMfaCodeBefore(formRef)">
{{ $t('commons.button.save') }}
</el-button>
</template> </template>
</el-input> </el-input>
<span class="input-help">{{ $t('setting.mfaIntervalHelper') }}</span> <span class="input-help">{{ $t('setting.mfaIntervalHelper') }}</span>
@ -101,7 +103,7 @@ const form = reactive({
const rules = reactive({ const rules = reactive({
code: [Rules.requiredInput], code: [Rules.requiredInput],
mfaInterval: [Rules.number, checkNumberRange(15, 60)], interval: [Rules.number, checkNumberRange(15, 60)],
}); });
interface DialogProps { interface DialogProps {
@ -123,12 +125,28 @@ const onCopy = async () => {
} }
}; };
const loadMfaCodeBefore = async (formEl: FormInstance | undefined) => {
if (!formEl) return;
const result = await formEl.validateField('interval', callback);
if (!result) {
return;
}
loadMfaCode();
};
const loadMfaCode = async () => { const loadMfaCode = async () => {
const res = await getMFA(form.interval); const res = await getMFA(form.interval);
form.secret = res.data.secret; form.secret = res.data.secret;
qrImage.value = res.data.qrImage; qrImage.value = res.data.qrImage;
}; };
function callback(error: any) {
if (error) {
return error.message;
} else {
return;
}
}
const onBind = async (formEl: FormInstance | undefined) => { const onBind = async (formEl: FormInstance | undefined) => {
if (!formEl) return; if (!formEl) return;
formEl.validate(async (valid) => { formEl.validate(async (valid) => {