refactor(index.vue): 格式化一下css
This commit is contained in:
@@ -190,7 +190,10 @@ const openDevTools = () => (window as any).electronAPI?.openDevTools?.()
|
|||||||
// 更新检查
|
// 更新检查
|
||||||
const checkUpdate = async () => {
|
const checkUpdate = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await Service.checkUpdateApiUpdateCheckPost({ current_version: version, if_force: true })
|
const response = await Service.checkUpdateApiUpdateCheckPost({
|
||||||
|
current_version: version,
|
||||||
|
if_force: true,
|
||||||
|
})
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
if (response.if_need_update) {
|
if (response.if_need_update) {
|
||||||
updateData.value = response.update_info
|
updateData.value = response.update_info
|
||||||
@@ -229,7 +232,9 @@ const refreshMirrorConfig = async () => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('刷新镜像配置失败', e)
|
console.error('刷新镜像配置失败', e)
|
||||||
message.error('刷新镜像配置失败')
|
message.error('刷新镜像配置失败')
|
||||||
} finally { refreshingConfig.value = false }
|
} finally {
|
||||||
|
refreshingConfig.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const goToMirrorTest = () => router.push('/mirror-test')
|
const goToMirrorTest = () => router.push('/mirror-test')
|
||||||
|
|
||||||
@@ -244,7 +249,9 @@ const testNotify = async () => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('测试通知发送失败', e)
|
console.error('测试通知发送失败', e)
|
||||||
message.error('测试通知发送失败')
|
message.error('测试通知发送失败')
|
||||||
} finally { testingNotify.value = false }
|
} finally {
|
||||||
|
testingNotify.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@@ -291,8 +298,8 @@ onMounted(() => {
|
|||||||
/>
|
/>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane key="advanced" tab="高级设置">
|
<a-tab-pane key="advanced" tab="高级设置">
|
||||||
<TabAdvanced
|
<TabAdvanced
|
||||||
:go-to-logs="goToLogs"
|
:go-to-logs="goToLogs"
|
||||||
:open-dev-tools="openDevTools"
|
:open-dev-tools="openDevTools"
|
||||||
:mirror-config-status="mirrorConfigStatus"
|
:mirror-config-status="mirrorConfigStatus"
|
||||||
:refreshing-config="refreshingConfig"
|
:refreshing-config="refreshingConfig"
|
||||||
@@ -300,53 +307,249 @@ onMounted(() => {
|
|||||||
:go-to-mirror-test="goToMirrorTest"
|
:go-to-mirror-test="goToMirrorTest"
|
||||||
/>
|
/>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane key="others" tab="其他">
|
<a-tab-pane key="others" tab="其他设置">
|
||||||
<TabOthers :version="version" :backend-update-info="backendUpdateInfo" />
|
<TabOthers :version="version" :backend-update-info="backendUpdateInfo" />
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
</div>
|
</div>
|
||||||
<UpdateModal v-if="updateVisible" v-model:visible="updateVisible" :update-data="updateData" @confirmed="onUpdateConfirmed" />
|
<UpdateModal
|
||||||
|
v-if="updateVisible"
|
||||||
|
v-model:visible="updateVisible"
|
||||||
|
:update-data="updateData"
|
||||||
|
@confirmed="onUpdateConfirmed"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* 统一样式,使用 :deep 作用到子组件内部 */
|
/* 统一样式,使用 :deep 作用到子组件内部 */
|
||||||
.settings-container { max-width: 1200px; margin: 0 auto; padding: 20px; }
|
.settings-container {
|
||||||
.settings-header { margin-bottom: 24px; }
|
max-width: 1200px;
|
||||||
.page-title { margin: 0; font-size: 32px; font-weight: 600; color: var(--ant-color-text); }
|
margin: 0 auto;
|
||||||
.settings-content { background: var(--ant-color-bg-container); border-radius: 12px; }
|
padding: 20px;
|
||||||
.settings-tabs { margin: 0; }
|
}
|
||||||
.settings-tabs :deep(.ant-tabs-card > .ant-tabs-nav .ant-tabs-tab) { background: transparent; border: 1px solid var(--ant-color-border); border-radius: 8px 8px 0 0; margin-right: 8px; }
|
.settings-header {
|
||||||
.settings-tabs :deep(.ant-tabs-card > .ant-tabs-nav .ant-tabs-tab-active) { background: var(--ant-color-bg-container); border-bottom-color: var(--ant-color-bg-container); }
|
margin-bottom: 24px;
|
||||||
:deep(.tab-content) { padding: 24px; }
|
}
|
||||||
:deep(.form-section) { margin-bottom: 32px; }
|
.page-title {
|
||||||
:deep(.form-section:last-child) { margin-bottom: 0; }
|
margin: 0;
|
||||||
:deep(.section-header) { margin-bottom: 20px; padding-bottom: 8px; border-bottom: 2px solid var(--ant-color-border-secondary); display: flex; justify-content: space-between; align-items: center; }
|
font-size: 32px;
|
||||||
:deep(.section-header h3) { margin: 0; font-size: 20px; font-weight: 700; color: var(--ant-color-text); display: flex; align-items: center; gap: 12px; }
|
font-weight: 600;
|
||||||
:deep(.section-header h3::before) { content: ''; width: 4px; height: 24px; background: linear-gradient(135deg, var(--ant-color-primary), var(--ant-color-primary-hover)); border-radius: 2px; }
|
color: var(--ant-color-text);
|
||||||
:deep(.section-description) { margin: 4px 0 0; font-size: 13px; color: var(--ant-color-text-secondary); }
|
}
|
||||||
:deep(.section-doc-link) { color: var(--ant-color-primary) !important; text-decoration: none; font-size: 14px; font-weight: 500; padding: 4px 8px; border-radius: 4px; border: 1px solid var(--ant-color-primary); transition: all .2s ease; display: flex; align-items: center; gap: 4px; }
|
.settings-content {
|
||||||
:deep(.section-doc-link:hover) { color: var(--ant-color-primary-hover) !important; background-color: var(--ant-color-primary-bg); border-color: var(--ant-color-primary-hover); text-decoration: none; }
|
background: var(--ant-color-bg-container);
|
||||||
:deep(.section-update-button) { height: 32px; padding: 0 12px; font-size: 13px; font-weight: 600; border-radius: 6px; box-shadow: 0 2px 6px rgba(22,119,255,.2); transition: all .3s cubic-bezier(.4,0,.2,1); display: flex; align-items: center; gap: 6px; background: linear-gradient(135deg, var(--ant-color-primary), var(--ant-color-primary-hover)) !important; border: none !important; color: #fff !important; }
|
border-radius: 12px;
|
||||||
:deep(.section-update-button:hover) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(22,119,255,.3); background: linear-gradient(135deg,#4096ff,#1677ff) !important; color: #fff !important; }
|
}
|
||||||
:deep(.section-update-button:active) { transform: translateY(0); color: #fff !important; }
|
.settings-tabs {
|
||||||
:deep(.section-update-button svg) { transition: transform .3s ease; }
|
margin: 0;
|
||||||
:deep(.section-update-button:hover svg) { transform: rotate(180deg); }
|
}
|
||||||
:deep(.form-item-vertical) { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
|
.settings-tabs :deep(.ant-tabs-card > .ant-tabs-nav .ant-tabs-tab) {
|
||||||
:deep(.form-label-wrapper) { display: flex; align-items: center; gap: 8px; }
|
background: transparent;
|
||||||
:deep(.form-label) { font-weight: 600; color: var(--ant-color-text); font-size: 14px; }
|
border: 1px solid var(--ant-color-border);
|
||||||
:deep(.help-icon) { color: #8c8c8c; font-size: 14px; }
|
border-radius: 8px 8px 0 0;
|
||||||
:deep(.tooltip-link) { color: var(--ant-color-primary) !important; text-decoration: underline; transition: color .2s ease; }
|
margin-right: 8px;
|
||||||
:deep(.tooltip-link:hover) { color: var(--ant-color-primary-hover) !important; text-decoration: underline; }
|
}
|
||||||
:deep(.link-card) { background: var(--ant-color-bg-container); border: 1px solid var(--ant-color-border); border-radius: 8px; padding: 20px; text-align: center; transition: all .3s ease; height: 100%; display: flex; flex-direction: column; align-items: center; }
|
.settings-tabs :deep(.ant-tabs-card > .ant-tabs-nav .ant-tabs-tab-active) {
|
||||||
:deep(.link-card:hover) { border-color: var(--ant-color-primary); box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-2px); }
|
background: var(--ant-color-bg-container);
|
||||||
:deep(.link-icon) { font-size: 48px; margin-bottom: 16px; line-height: 1; color: var(--ant-color-primary); display: flex; justify-content: center; align-items: center; }
|
border-bottom-color: var(--ant-color-bg-container);
|
||||||
:deep(.link-content) { flex: 1; display: flex; flex-direction: column; }
|
}
|
||||||
:deep(.link-content h4) { margin: 0 0 8px; font-size: 18px; font-weight: 600; color: var(--ant-color-text); }
|
:deep(.tab-content) {
|
||||||
:deep(.link-content p) { margin: 0 0 16px; font-size: 14px; color: var(--ant-color-text-secondary); line-height: 1.5; flex: 1; }
|
padding: 24px;
|
||||||
:deep(.link-button) { display: inline-block; padding: 8px 16px; background: var(--ant-color-primary); color: #fff !important; text-decoration: none; border-radius: 4px; font-size: 14px; font-weight: 500; transition: background-color .2s ease; margin-top: auto; }
|
}
|
||||||
:deep(.link-button:hover) { background: var(--ant-color-primary-hover); color: #fff !important; text-decoration: none; }
|
:deep(.form-section) {
|
||||||
:deep(.info-item) { display: flex; align-items: center; margin-bottom: 12px; line-height: 1.5; }
|
margin-bottom: 32px;
|
||||||
:deep(.info-label) { font-weight: 600; color: var(--ant-color-text); min-width: 100px; flex-shrink: 0; }
|
}
|
||||||
:deep(.info-value) { color: var(--ant-color-text-secondary); margin-left: 8px; }
|
:deep(.form-section:last-child) {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
:deep(.section-header) {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
border-bottom: 2px solid var(--ant-color-border-secondary);
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
:deep(.section-header h3) {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--ant-color-text);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
:deep(.section-header h3::before) {
|
||||||
|
content: '';
|
||||||
|
width: 4px;
|
||||||
|
height: 24px;
|
||||||
|
background: linear-gradient(135deg, var(--ant-color-primary), var(--ant-color-primary-hover));
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
:deep(.section-description) {
|
||||||
|
margin: 4px 0 0;
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--ant-color-text-secondary);
|
||||||
|
}
|
||||||
|
:deep(.section-doc-link) {
|
||||||
|
color: var(--ant-color-primary) !important;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 4px 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid var(--ant-color-primary);
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
:deep(.section-doc-link:hover) {
|
||||||
|
color: var(--ant-color-primary-hover) !important;
|
||||||
|
background-color: var(--ant-color-primary-bg);
|
||||||
|
border-color: var(--ant-color-primary-hover);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
:deep(.section-update-button) {
|
||||||
|
height: 32px;
|
||||||
|
padding: 0 12px;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0 2px 6px rgba(22, 119, 255, 0.2);
|
||||||
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
background: linear-gradient(
|
||||||
|
135deg,
|
||||||
|
var(--ant-color-primary),
|
||||||
|
var(--ant-color-primary-hover)
|
||||||
|
) !important;
|
||||||
|
border: none !important;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
:deep(.section-update-button:hover) {
|
||||||
|
transform: translateY(-1px);
|
||||||
|
box-shadow: 0 4px 12px rgba(22, 119, 255, 0.3);
|
||||||
|
background: linear-gradient(135deg, #4096ff, #1677ff) !important;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
:deep(.section-update-button:active) {
|
||||||
|
transform: translateY(0);
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
:deep(.section-update-button svg) {
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
}
|
||||||
|
:deep(.section-update-button:hover svg) {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
:deep(.form-item-vertical) {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
:deep(.form-label-wrapper) {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
:deep(.form-label) {
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--ant-color-text);
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
:deep(.help-icon) {
|
||||||
|
color: #8c8c8c;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
:deep(.tooltip-link) {
|
||||||
|
color: var(--ant-color-primary) !important;
|
||||||
|
text-decoration: underline;
|
||||||
|
transition: color 0.2s ease;
|
||||||
|
}
|
||||||
|
:deep(.tooltip-link:hover) {
|
||||||
|
color: var(--ant-color-primary-hover) !important;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
:deep(.link-card) {
|
||||||
|
background: var(--ant-color-bg-container);
|
||||||
|
border: 1px solid var(--ant-color-border);
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
:deep(.link-card:hover) {
|
||||||
|
border-color: var(--ant-color-primary);
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||||
|
transform: translateY(-2px);
|
||||||
|
}
|
||||||
|
:deep(.link-icon) {
|
||||||
|
font-size: 48px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
line-height: 1;
|
||||||
|
color: var(--ant-color-primary);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
:deep(.link-content) {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
:deep(.link-content h4) {
|
||||||
|
margin: 0 0 8px;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--ant-color-text);
|
||||||
|
}
|
||||||
|
:deep(.link-content p) {
|
||||||
|
margin: 0 0 16px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: var(--ant-color-text-secondary);
|
||||||
|
line-height: 1.5;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
:deep(.link-button) {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 8px 16px;
|
||||||
|
background: var(--ant-color-primary);
|
||||||
|
color: #fff !important;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
transition: background-color 0.2s ease;
|
||||||
|
margin-top: auto;
|
||||||
|
}
|
||||||
|
:deep(.link-button:hover) {
|
||||||
|
background: var(--ant-color-primary-hover);
|
||||||
|
color: #fff !important;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
:deep(.info-item) {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
:deep(.info-label) {
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--ant-color-text);
|
||||||
|
min-width: 100px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
:deep(.info-value) {
|
||||||
|
color: var(--ant-color-text-secondary);
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user