Skip to content

Commit 05029a3

Browse files
authored
fix: 调整面板设置样式 (#2765)
1 parent d15bd1d commit 05029a3

File tree

6 files changed

+72
-83
lines changed

6 files changed

+72
-83
lines changed

backend/server/server.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ func Start() {
6363
*net.TCPListener
6464
}
6565
if global.CONF.System.SSL == "enable" {
66-
certificate, err := os.ReadFile(path.Join(global.CONF.System.BaseDir, "1panel/secret/server.crt"))
66+
certPath := path.Join(global.CONF.System.BaseDir, "1panel/secret/server.crt")
67+
keyPath := path.Join(global.CONF.System.BaseDir, "1panel/secret/server.key")
68+
certificate, err := os.ReadFile(certPath)
6769
if err != nil {
6870
panic(err)
6971
}
70-
key, err := os.ReadFile(path.Join(global.CONF.System.BaseDir, "1panel/secret/server.key"))
72+
key, err := os.ReadFile(keyPath)
7173
if err != nil {
7274
panic(err)
7375
}
@@ -80,7 +82,7 @@ func Start() {
8082
}
8183
global.LOG.Infof("listen at https://%s:%s [%s]", global.CONF.System.BindAddress, global.CONF.System.Port, tcpItem)
8284

83-
if err := server.ServeTLS(tcpKeepAliveListener{ln.(*net.TCPListener)}, "", ""); err != nil {
85+
if err := server.ServeTLS(tcpKeepAliveListener{ln.(*net.TCPListener)}, certPath, keyPath); err != nil {
8486
panic(err)
8587
}
8688
} else {

frontend/src/lang/modules/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,7 @@ const message = {
11621162

11631163
bindDomain: 'Bind Domain',
11641164
unBindDomain: 'Unbind domain',
1165+
panelSSL: 'Panel SSL',
11651166
unBindDomainHelper:
11661167
'The action of unbinding a domain name may cause system insecurity. Do you want to continue?',
11671168
bindDomainHelper:

frontend/src/lang/modules/tw.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,7 @@ const message = {
11501150
complexityHelper: '開啟後密碼必須滿足密碼長度大於 8 位且包含字母、數字及特殊字符',
11511151
bindDomain: '域名綁定',
11521152
unBindDomain: '域名解綁',
1153+
panelSSL: '面板 SSL',
11531154
unBindDomainHelper: '解除域名綁定可能造成系統不安全,是否繼續?',
11541155
bindDomainHelper: '設置域名綁定後,僅能通過設置中域名訪問 1Panel 服務',
11551156
bindDomainHelper1: '綁定域名為空時,則取消域名綁定',

frontend/src/lang/modules/zh.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,7 @@ const message = {
11511151
complexityHelper: '开启后密码必须满足密码长度大于 8 位且包含字母、数字及特殊字符',
11521152
bindDomain: '域名绑定',
11531153
unBindDomain: '域名解绑',
1154+
panelSSL: '面板 SSL',
11541155
unBindDomainHelper: '解除域名绑定可能造成系统不安全,是否继续?',
11551156
bindDomainHelper: '设置域名绑定后,仅能通过设置中域名访问 1Panel 服务',
11561157
bindDomainHelper1: '绑定域名为空时,则取消域名绑定',

frontend/src/views/cronjob/record/index.vue

Lines changed: 43 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -126,41 +126,39 @@
126126
<div class="mainClass">
127127
<el-row :gutter="20" v-show="hasRecords" class="mainRowClass">
128128
<el-col :span="6">
129-
<div>
130-
<ul class="infinite-list" style="overflow: auto">
131-
<el-card
132-
v-for="(item, index) in records"
133-
:key="index"
134-
:class="item.id === currentRecord.id ? 'select-card' : 'primary-card'"
135-
@click="forDetail(item)"
136-
>
137-
<el-tag v-if="item.status === 'Success'" type="success">
138-
{{ $t('commons.status.success') }}
139-
</el-tag>
140-
<el-tag v-if="item.status === 'Waiting'" type="info">
141-
{{ $t('commons.status.waiting') }}
142-
</el-tag>
143-
<el-tag v-if="item.status === 'Failed'" type="danger">
144-
{{ $t('commons.status.failed') }}
145-
</el-tag>
146-
<span>
147-
{{ dateFormat(0, 0, item.startTime) }}
148-
</span>
149-
</el-card>
150-
</ul>
151-
<div class="page-item">
152-
<el-pagination
153-
:page-size="searchInfo.pageSize"
154-
:current-page="searchInfo.page"
155-
@current-change="handleCurrentChange"
156-
@size-change="handleSizeChange"
157-
:pager-count="5"
158-
:page-sizes="[6, 8, 10, 12, 14]"
159-
small
160-
layout="total, sizes, prev, pager, next"
161-
:total="searchInfo.recordTotal"
162-
/>
163-
</div>
129+
<div class="infinite-list" style="overflow: auto">
130+
<el-table :data="records" border :show-header="false" @row-click="forDetail">
131+
<el-table-column>
132+
<template #default="{ row }">
133+
<span v-if="row.id === currentRecord.id" class="select-sign"></span>
134+
<el-tag v-if="row.status === 'Success'" type="success">
135+
{{ $t('commons.status.success') }}
136+
</el-tag>
137+
<el-tag v-if="row.status === 'Waiting'" type="info">
138+
{{ $t('commons.status.waiting') }}
139+
</el-tag>
140+
<el-tag v-if="row.status === 'Failed'" type="danger">
141+
{{ $t('commons.status.failed') }}
142+
</el-tag>
143+
<span>
144+
{{ dateFormat(0, 0, row.startTime) }}
145+
</span>
146+
</template>
147+
</el-table-column>
148+
</el-table>
149+
</div>
150+
<div class="page-item">
151+
<el-pagination
152+
:page-size="searchInfo.pageSize"
153+
:current-page="searchInfo.page"
154+
@current-change="handleCurrentChange"
155+
@size-change="handleSizeChange"
156+
:pager-count="5"
157+
:page-sizes="[6, 8, 10, 12, 14]"
158+
small
159+
layout="total, sizes, prev, pager, next"
160+
:total="searchInfo.recordTotal"
161+
/>
164162
</div>
165163
</el-col>
166164
<el-col :span="18">
@@ -318,7 +316,7 @@
318316
:placeholder="$t('cronjob.noLogs')"
319317
:indent-with-tab="true"
320318
:tabSize="4"
321-
style="height: calc(100vh - 484px); width: 100%; margin-top: 5px"
319+
style="height: calc(100vh - 488px); width: 100%; margin-top: 5px"
322320
:lineWrapping="true"
323321
:matchBrackets="true"
324322
theme="cobalt"
@@ -719,36 +717,22 @@ defineExpose({
719717

720718
<style lang="scss" scoped>
721719
.infinite-list {
722-
height: calc(100vh - 416px);
723-
padding: 0;
724-
margin: 0;
725-
.el-card {
726-
border: var(--panel-border) !important;
727-
&:hover {
728-
box-shadow: 2px 2px 2px #888888;
729-
}
730-
display: flex;
731-
align-items: center;
732-
height: 40px;
733-
font-size: 14px;
734-
margin: 5px;
735-
cursor: pointer;
736-
}
737-
.select-card {
738-
color: var(--el-color-primary);
739-
border: 1px solid var(--el-color-primary) !important;
740-
box-shadow: 2px 2px 2px #888888;
720+
height: calc(100vh - 420px);
721+
.select-sign {
741722
&::before {
742-
position: absolute;
723+
float: left;
724+
margin-left: -3px;
725+
position: relative;
743726
width: 3px;
744-
height: 40px;
727+
height: 24px;
745728
content: '';
746729
background: $primary-color;
747-
border-radius: 10px;
730+
border-radius: 20px;
748731
}
749732
}
750733
.el-tag {
751-
margin-right: 15px;
734+
margin-left: 20px;
735+
margin-right: 20px;
752736
}
753737
}
754738

frontend/src/views/setting/safe/index.vue

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,27 @@
8888
<span class="input-help">{{ $t('setting.bindDomainHelper') }}</span>
8989
</el-form-item>
9090

91+
<el-form-item :label="$t('setting.panelSSL')" prop="ssl">
92+
<el-switch
93+
@change="handleSSL"
94+
v-model="form.ssl"
95+
active-value="enable"
96+
inactive-value="disable"
97+
/>
98+
<span class="input-help">{{ $t('setting.https') }}</span>
99+
<div v-if="form.ssl === 'enable' && sslInfo">
100+
<el-tag>{{ $t('setting.domainOrIP') }} {{ sslInfo.domain }}</el-tag>
101+
<el-tag style="margin-left: 5px">
102+
{{ $t('setting.timeOut') }} {{ sslInfo.timeout }}
103+
</el-tag>
104+
<div>
105+
<el-button link type="primary" @click="handleSSL">
106+
{{ $t('commons.button.view') }}
107+
</el-button>
108+
</div>
109+
</div>
110+
</el-form-item>
111+
91112
<el-form-item :label="$t('setting.expirationTime')" prop="expirationTime">
92113
<el-input disabled v-model="form.expirationTime">
93114
<template #append>
@@ -128,27 +149,6 @@
128149
{{ $t('setting.mfaHelper') }}
129150
</span>
130151
</el-form-item>
131-
132-
<el-form-item label="HTTPS" prop="ssl">
133-
<el-switch
134-
@change="handleSSL"
135-
v-model="form.ssl"
136-
active-value="enable"
137-
inactive-value="disable"
138-
/>
139-
<span class="input-help">{{ $t('setting.https') }}</span>
140-
<div v-if="form.ssl === 'enable' && sslInfo">
141-
<el-tag>{{ $t('setting.domainOrIP') }} {{ sslInfo.domain }}</el-tag>
142-
<el-tag style="margin-left: 5px">
143-
{{ $t('setting.timeOut') }} {{ sslInfo.timeout }}
144-
</el-tag>
145-
<div>
146-
<el-button link type="primary" @click="handleSSL">
147-
{{ $t('commons.button.view') }}
148-
</el-button>
149-
</div>
150-
</div>
151-
</el-form-item>
152152
</el-col>
153153
</el-row>
154154
</el-form>

0 commit comments

Comments
 (0)