optimize: 页面样式优化

release-2.0.0.1
王良 2025-03-05 21:37:43 +08:00
parent 632b75f842
commit 982fa53d39
20 changed files with 66 additions and 137 deletions

View File

@ -14,15 +14,11 @@ module.exports = {
'yarnRegistry': 'default',
'registry': 'https://registry.npmjs.org', // 可以选择切换官方或者淘宝镜像
},
// intercepts: {
// 'cdn.cypress.io': [{ regexp: '/desktop/.*', proxy: 'http://npmmirror.com/mirrors/cypress/' }]
// },
variables: {
phantomjs_cdnurl: 'https://npmmirror.com/mirrors/phantomjs',
chromedriver_cdnurl: 'https://npmmirror.com/mirrors/chromedriver',
sass_binary_site: 'https://npmmirror.com/mirrors/node-sass',
ELECTRON_MIRROR: 'https://npmmirror.com/mirrors/electron/',
// CYPRESS_DOWNLOAD_MIRROR: 'https://cdn.cypress.io',
NVM_NODEJS_ORG_MIRROR: 'https://npmmirror.com/mirrors/node',
CHROMEDRIVER_CDNURL: 'https://npmmirror.com/mirrors/chromedriver',
OPERADRIVER: 'https://npmmirror.com/mirrors/operadriver',

View File

@ -52,8 +52,7 @@ const PipPlugin = function (context) {
cmds.push(`${command} config unset global.${item.key}`)
}
}
const ret = await shell.exec(cmds, { type: 'cmd' })
return ret
return await shell.exec(cmds, { type: 'cmd' })
},
async unsetPipEnv (list) {
@ -62,8 +61,7 @@ const PipPlugin = function (context) {
for (const item of list) {
cmds.push(`${command} config unset global.${item} `)
}
const ret = await shell.exec(cmds, { type: 'cmd' })
return ret
return await shell.exec(cmds, { type: 'cmd' })
},
async setRegistry ({ registry }) {

View File

@ -104,7 +104,7 @@ const serverApi = {
log.error('server process uncaughtException:', err)
})
serverProcess.on('message', (msg) => {
log.info('收到子进程消息:', JSON.stringify(msg))
log.debug('收到子进程消息:', JSON.stringify(msg))
if (msg.type === 'status') {
fireStatus(msg.event)
} else if (msg.type === 'error') {

View File

@ -5,8 +5,7 @@ const execute = Shell.execute
const executor = {
async windows (exec, { port }) {
const cmds = [`for /f "tokens=5" %a in ('netstat -aon ^| find ":${port}" ^| find "LISTENING"') do (taskkill /f /pid %a & exit /B) `]
// eslint-disable-next-line no-unused-vars
const ret = await exec(cmds, { type: 'cmd' })
await exec(cmds, { type: 'cmd' })
return true
},
async linux (exec, { port }) {

View File

@ -11,8 +11,7 @@ const executor = {
for (const item of list) {
cmds.push(`npm config set ${item.key} ${item.value}`)
}
const ret = await exec(cmds, { type: 'cmd' })
return ret
return await exec(cmds, { type: 'cmd' })
},
async linux (exec, { port }) {
throw new Error('暂未实现此功能')

View File

@ -19,8 +19,7 @@ const executor = {
// [Environment]::SetEnvironmentVariable('FOO', 'bar', 'Machine')
cmds2.push(`set ${item.key}=""`)
}
// eslint-disable-next-line no-unused-vars
const ret2 = await exec(cmds2, { type: 'cmd' })
await exec(cmds2, { type: 'cmd' })
return ret
},
async linux (exec, { port }) {

View File

@ -54,9 +54,7 @@ class WindowsSystemShell extends SystemShell {
}
try {
const ret = await ps.invoke()
// log.info('ps complete', cmds)
return ret
return await ps.invoke()
} finally {
ps.dispose()
}
@ -66,9 +64,7 @@ class WindowsSystemShell extends SystemShell {
compose += ` && ${cmd}`
}
// compose += '&& exit'
const ret = await childExec(compose, args)
// log.info('cmd complete:', compose)
return ret
return await childExec(compose, args)
}
}
}

View File

@ -18,9 +18,8 @@ updaterCacheDirName: '@docmirrordev-sidecar-gui-updater'
fs.writeFileSync(filePath, fileContent)
}
exports.default = async function (context) {
// console.log('context', context)
let targetPath
let systemType = ''
let systemType
if (context.packager.platform.nodeName === 'darwin') {
targetPath = path.join(context.appOutDir, `${context.packager.appInfo.productName}.app/Contents/Resources`)
systemType = 'mac'

View File

@ -148,7 +148,7 @@ export default {
style="inset:auto auto 53px 210px; background-color:#ddd"
/>
<a-layout>
<a-layout-sider :theme="theme">
<a-layout-sider :theme="theme" style="overflow-y: auto">
<div class="logo" />
<div class="aside">
<a-menu
@ -191,15 +191,6 @@ export default {
body {
height: 100%;
}
.mt10 {
margin-top: 10px;
}
.mt5 {
margin-top: 5px;
}
.mt20 {
margin-top: 20px;
}
.ds_layout {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;

View File

@ -29,40 +29,5 @@ export default {
</script>
<template>
<span ref="input" class="fake-input" contenteditable="true" spellcheck="false" :title="value" @blur="onBlur" @keydown="onKeydown" v-html="value" />
<span ref="input" class="ant-input" contenteditable="true" spellcheck="false" :title="value" @blur="onBlur" @keydown="onKeydown" v-html="value" />
</template>
<style lang="scss">
.fake-input {
/* 鼠标样式 */
cursor: text;
/* 内容不换行 */
white-space: nowrap;
overflow: hidden;
vertical-align: middle;
/* 复制 ant-input 样式 */
box-sizing: border-box;
margin: 0;
padding: 4px 11px;
font-variant: tabular-nums;
list-style: none;
font-feature-settings: 'tnum';
position: relative;
display: inline-block;
width: 100%;
height: 32px;
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
line-height: 1.5;
background-color: #fff;
background-image: none;
border: 1px solid #d9d9d9;
border-radius: 4px;
transition: all 0.3s;
}
.fine-tuning .fake-input {
margin-top: -2px;
}
</style>

View File

@ -27,8 +27,8 @@ export default {
帮助中心
</template>
<template slot="header-right">
<a-button class="md-mr-10" @click="openExternal('https://github.com/docmirror/dev-sidecar/issues/new/choose')"></a-button>
<a-button class="md-mr-10" icon="profile" @click="openLog()"></a-button>
<a-button class="mr10" @click="openExternal('https://github.com/docmirror/dev-sidecar/issues/new/choose')"></a-button>
<a-button class="mr10" icon="profile" @click="openLog()"></a-button>
</template>
<div v-if="config" class="help-list">

View File

@ -109,8 +109,8 @@ export default {
</a-col>
</a-row>
<a-row v-for="(item, index) of noProxyUrls" :key="index" :gutter="10">
<a-col :span="22" class="fine-tuning">
<MockInput v-model="item.key" />
<a-col :span="22">
<MockInput v-model="item.key" class="mt-2" />
</a-col>
<a-col :span="2">
<a-button type="danger" icon="minus" @click="delNoProxyUrl(item, index)" />
@ -122,7 +122,7 @@ export default {
</div>
<template slot="footer">
<div class="footer-bar">
<a-button :loading="resetDefaultLoading" class="md-mr-10" icon="sync" @click="resetDefault()">
<a-button :loading="resetDefaultLoading" class="mr10" icon="sync" @click="resetDefault()">
恢复默认
</a-button>
<a-button :loading="applyLoading" icon="check" type="primary" @click="apply()">

View File

@ -136,7 +136,7 @@ export default {
</div>
<template slot="footer">
<div class="footer-bar">
<a-button :loading="resetDefaultLoading" class="md-mr-10" icon="sync" @click="resetDefault()">
<a-button :loading="resetDefaultLoading" class="mr10" icon="sync" @click="resetDefault()">
恢复默认
</a-button>
<a-button :loading="applyLoading" icon="check" type="primary" @click="apply()">

View File

@ -170,8 +170,8 @@ export default {
</a-col>
</a-row>
<a-row v-for="(item, index) of targets" :key="index" :gutter="10">
<a-col :span="18" class="fine-tuning">
<MockInput v-model="item.key" />
<a-col :span="18">
<MockInput v-model="item.key" class="mt-2" />
</a-col>
<a-col :span="4">
<a-select v-model="item.value" style="width:100%">
@ -198,13 +198,13 @@ export default {
</a-row>
<a-row v-for="(item, index) of servers" :key="index" :gutter="10">
<a-col :span="6">
<a-input v-model="item.key" addon-before="" placeholder="yourdomain.com" spellcheck="false" />
<a-input v-model="item.key" :title="item.key" addon-before="" placeholder="yourdomain.com" spellcheck="false" />
</a-col>
<a-col :span="5">
<a-input v-model="item.value.port" addon-before="" placeholder="443" spellcheck="false" />
<a-input v-model="item.value.port" :title="item.value.port" addon-before="" placeholder="443" spellcheck="false" />
</a-col>
<a-col :span="6">
<a-input v-model="item.value.path" addon-before="" placeholder="xxxxxx" spellcheck="false" />
<a-input v-model="item.value.path" :title="item.value.path" addon-before="" placeholder="xxxxxx" spellcheck="false" />
</a-col>
<a-col :span="5">
<a-input v-model="item.value.password" addon-before="" type="password" placeholder="password" spellcheck="false" />
@ -223,7 +223,7 @@ export default {
</div>
<template slot="footer">
<div class="footer-bar">
<a-button :loading="resetDefaultLoading" class="md-mr-10" icon="sync" @click="resetDefault()">
<a-button :loading="resetDefaultLoading" class="mr10" icon="sync" @click="resetDefault()">
恢复默认
</a-button>
<a-button :loading="applyLoading" icon="check" type="primary" @click="apply()">
@ -239,7 +239,7 @@ export default {
.fine-tuning2 .ant-btn-danger {
margin-top: 2px !important;
}
.ant-input-group-addon {
padding: 0 6px !important;
.ant-input-group-addon:first-child {
padding: 0 5px !important;
}
</style>

View File

@ -122,7 +122,7 @@ export default {
</div>
<template slot="footer">
<div class="footer-bar">
<a-button :loading="resetDefaultLoading" class="md-mr-10" icon="sync" @click="resetDefault()">
<a-button :loading="resetDefaultLoading" class="mr10" icon="sync" @click="resetDefault()">
恢复默认
</a-button>
<a-button :loading="applyLoading" icon="check" type="primary" @click="apply()">

View File

@ -168,7 +168,7 @@ export default {
</a-row>
<a-row v-for="(item, index) of excludeIpList" :key="index" :gutter="10" class="fine-tuning">
<a-col :span="17">
<MockInput v-model="item.key" />
<MockInput v-model="item.key" class="mt-1" />
</a-col>
<a-col :span="5">
<a-select v-model="item.value" style="width:100%">
@ -185,7 +185,7 @@ export default {
</div>
<template slot="footer">
<div class="footer-bar">
<a-button :loading="resetDefaultLoading" class="md-mr-10" icon="sync" @click="resetDefault()">
<a-button :loading="resetDefaultLoading" class="mr10" icon="sync" @click="resetDefault()">
恢复默认
</a-button>
<a-button :loading="applyLoading" icon="check" type="primary" @click="apply()">

View File

@ -437,7 +437,7 @@ export default {
<a-button type="primary" icon="plus" @click="reSpeedTest()">
立即重新测速
</a-button>
<a-button class="md-ml-10" type="primary" icon="reload" @click="reloadAllSpeedTester()">
<a-button class="ml10" type="primary" icon="reload" @click="reloadAllSpeedTester()">
刷新
</a-button>
</a-col>
@ -445,7 +445,7 @@ export default {
<a-row :gutter="20">
<a-col v-for="(item, key) of speedTestList" :key="key" span="12">
<a-card size="small" class="md-mt-10" :title="key">
<a-card size="small" class="mt10" :title="key">
<a slot="extra" href="javascript:void(0)" :title="key" style="cursor:default">
<a-icon v-if="item.alive.length > 0" type="check" />
<a-icon v-else type="info-circle" />
@ -465,7 +465,7 @@ export default {
</div>
<template slot="footer">
<div class="footer-bar">
<a-button :loading="resetDefaultLoading" class="md-mr-10" icon="sync" @click="resetDefault()">
<a-button :loading="resetDefaultLoading" class="mr10" icon="sync" @click="resetDefault()">
恢复默认
</a-button>
<a-button :loading="applyLoading" icon="check" type="primary" @click="apply()">
@ -506,7 +506,7 @@ export default {
overflow-x: hidden;
}
.ant-input-group-addon:first-child {
width: 50px;
width: 45px;
}
}
</style>

View File

@ -344,7 +344,7 @@ export default {
设置
</template>
<template slot="header-right">
<a-button class="md-mr-10" icon="profile" @click="openLog()"></a-button>
<a-button class="mr10" icon="profile" @click="openLog()"></a-button>
</template>
<div v-if="config">
@ -495,7 +495,7 @@ export default {
</a-form-item>
<a-form-item label="最大日志文件大小" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-input-number ref="maxLogFileSize" v-model="config.app.maxLogFileSize" :step="maxLogFileSizeStep" :min="0" spellcheck="false" />
<a-select v-model="config.app.maxLogFileSizeUnit" class="md-ml-5" @change="onMaxLogFileSizeUnitChange">
<a-select v-model="config.app.maxLogFileSizeUnit" class="ml5" @change="onMaxLogFileSizeUnitChange">
<a-select-option v-for="(item) of maxLogFileSizeUnit" :key="item.value" :value="item.value">
{{ item.label }}
</a-select-option>
@ -514,10 +514,10 @@ export default {
</div>
<template slot="footer">
<div class="footer-bar">
<a-button :loading="removeUserConfigLoading" class="md-mr-10" icon="sync" @click="restoreFactorySettings()">
<a-button :loading="removeUserConfigLoading" class="mr10" icon="sync" @click="restoreFactorySettings()">
恢复出厂设置
</a-button>
<a-button :loading="resetDefaultLoading" class="md-mr-10" icon="sync" @click="resetDefault()">
<a-button :loading="resetDefaultLoading" class="mr10" icon="sync" @click="resetDefault()">
恢复默认
</a-button>
<a-button :loading="applyLoading" icon="check" type="primary" @click="apply()">

View File

@ -17,60 +17,35 @@
}
}
.md-mr-5 {
margin-right: 5px;
}
.md-mr-10 {
margin-right: 10px;
}
.md-mr-15 {
margin-right: 15px;
}
.md-mr-20 {
margin-right: 20px;
span.ant-input {
white-space: nowrap;
overflow: hidden;
vertical-align: middle;
}
.md-mt-0 {
margin-top: 0;
.mr10 {
margin-right: 10px;
}
.md-mt-5 {
margin-top: 5px;
.mt-1 {
margin-top: -1px;
}
.md-mt-10 {
.mt-2 {
margin-top: -2px;
}
.mt10 {
margin-top: 10px;
}
.md-mt-15 {
margin-top: 15px;
}
.md-mt-20 {
.mt20 {
margin-top: 20px;
}
.md-ml-5 {
.ml5 {
margin-left: 5px;
}
.md-ml-10 {
.ml10 {
margin-left: 10px;
}
.md-ml-15 {
margin-left: 15px;
}
.md-ml-20 {
margin-left: 20px;
}
.md-mb-5 {
margin-bottom: 5px;
}
.md-mb-10 {
margin-bottom: 10px;
}
.md-mb-15 {
margin-bottom: 15px;
}
.md-mb-20 {
margin-bottom: 20px;
}
ol {
margin-block-start: 0em;

View File

@ -99,7 +99,7 @@ $dark-input: #777; //输入框:背景色
}
/* 输入框、下拉框 */
.ant-input, .fake-input,
.ant-input,
.ant-input-number-input,
.ant-input-number,
.ant-select-selection,
@ -109,7 +109,19 @@ $dark-input: #777; //输入框:背景色
color: $dark-text;
&:hover,
&:focus {
border-color: #fff;
border-color: #eee;
}
&:focus {
box-shadow: 0 0 0 2px rgb(255 255 255 / 35%);
}
}
/* 选中的下拉框 */
.ant-select-open,
.ant-select-focused {
.ant-select-selection {
box-shadow: 0 0 0 2px rgb(255 255 255 / 35%);
}
}