Skip to content
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
2 changes: 1 addition & 1 deletion agent/app/service/website_ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (w WebsiteSSLService) ObtainSSL(apply request.WebsiteSSLApply) error {
return err
}
case constant.DnsManual:
if err := client.UseManualDns(); err != nil {
if err := client.UseManualDns(*websiteSSL); err != nil {
return err
}
}
Expand Down
33 changes: 27 additions & 6 deletions agent/utils/ssl/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ var (
propagationTimeout = 30 * time.Minute
pollingInterval = 10 * time.Second
ttl = 3600
dnsTimeOut = 30 * time.Minute
)

func (c *AcmeClient) UseDns(dnsType DnsType, params string, websiteSSL model.WebsiteSSL) error {
Expand Down Expand Up @@ -136,7 +137,7 @@ func (c *AcmeClient) UseDns(dnsType DnsType, params string, websiteSSL model.Web
cloudflareConfig.AuthToken = param.APIkey
cloudflareConfig.PropagationTimeout = propagationTimeout
cloudflareConfig.PollingInterval = pollingInterval
cloudflareConfig.TTL = 3600
cloudflareConfig.TTL = ttl
p, err = cloudflare.NewDNSProviderConfig(cloudflareConfig)
case CloudDns:
clouddnsConfig := clouddns.NewDefaultConfig()
Expand Down Expand Up @@ -231,14 +232,34 @@ func (c *AcmeClient) UseDns(dnsType DnsType, params string, websiteSSL model.Web
dns01.CondOption(len(nameservers) > 0,
dns01.AddRecursiveNameservers(nameservers)),
dns01.CondOption(websiteSSL.SkipDNS,
dns01.DisableCompletePropagationRequirement()),
dns01.AddDNSTimeout(10*time.Minute),
dns01.DisableAuthoritativeNssPropagationRequirement()),
dns01.AddDNSTimeout(dnsTimeOut),
)
}

func (c *AcmeClient) UseManualDns() error {
p := &manualDnsProvider{}
if err := c.Client.Challenge.SetDNS01Provider(p, dns01.AddDNSTimeout(10*time.Minute)); err != nil {
func (c *AcmeClient) UseManualDns(websiteSSL model.WebsiteSSL) error {
p, err := dns01.NewDNSProviderManual()
if err != nil {
return err
}
var nameservers []string
if websiteSSL.Nameserver1 != "" {
nameservers = append(nameservers, websiteSSL.Nameserver1)
}
if websiteSSL.Nameserver2 != "" {
nameservers = append(nameservers, websiteSSL.Nameserver2)
}
if websiteSSL.DisableCNAME {
_ = os.Setenv("LEGO_DISABLE_CNAME_SUPPORT", "true")
} else {
_ = os.Setenv("LEGO_DISABLE_CNAME_SUPPORT", "false")
}
if err = c.Client.Challenge.SetDNS01Provider(p,
dns01.CondOption(len(nameservers) > 0,
dns01.AddRecursiveNameservers(nameservers)),
dns01.CondOption(websiteSSL.SkipDNS,
dns01.DisableAuthoritativeNssPropagationRequirement()),
dns01.AddDNSTimeout(dnsTimeOut)); err != nil {
return err
}
return nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be a minor typo at line 135 where it's supposed to say:

nameservers = append(nameservers, websiteSSL.FastlySrvs...)

Please update accordingly. Also consider optimizing the DNS provider selection logic with conditional checks that will directly use clouddns or dns01 based on DNS_TYPE, which improves performance and readability.

I also recommend adding more comments to explain each function's purpose and what it does if not already present. This provides clarity for the users of the code.

Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ const message = {
healthy: 'Normal',
executing: 'Executing',
installerr: 'Installation failed',
applyerror: 'Apply failed',
},
units: {
second: 'Second',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ const message = {
healthy: '正常',
executing: '実行中',
installerr: 'インストールに失敗しました',
applyerror: '適用に失敗しました',
},
units: {
second: '2番目|2番目|秒',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ const message = {
healthy: '정상',
executing: '실행 중',
installerr: '설치 실패',
applyerror: '적용 실패',
},
units: {
second: '초 | 초 | 초',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ const message = {
healthy: 'Sihat',
executing: 'Melaksanakan',
installerr: 'Pemasangan gagal',
applyerror: 'Permohonan gagal',
},
units: {
second: 'saat | saat | saat',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ const message = {
healthy: 'Saudável',
executing: 'Executando',
installerr: 'Falha na instalação',
applyerror: 'Falha na aplicação',
},
units: {
second: 'segundo | segundos | segundos',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ const message = {
healthy: 'Нормально',
executing: 'Выполнение',
installerr: 'Ошибка установки',
applyerror: 'Ошибка применения',
},
units: {
second: ' секунда | секунда | секунд',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ const message = {
healthy: '正常',
executing: '執行中',
installerr: '安裝失敗',
applyerror: '申請失敗',
},
units: {
second: '秒',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ const message = {
healthy: '正常',
executing: '执行中',
installerr: '安装失败',
applyerror: '申请失败',
},
units: {
second: '秒',
Expand Down
139 changes: 1 addition & 138 deletions frontend/src/styles/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,18 @@ html {
align-items: center;
justify-content: center;
}
.flx-justify-between {
display: flex;
align-items: center;
justify-content: space-between;
}

.flx-align-center {
display: flex;
align-items: center;
}

.flx-wrap {
display: flex;
flex-wrap: wrap;
}

.clearfix::after {
display: block;
height: 0;
overflow: hidden;
clear: both;
content: '';
}

.sle {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.mle {
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}

.break-word {
word-break: break-all;
word-wrap: break-word;
}

.fade-transform-leave-active,
.fade-transform-enter-active {
transition: all 0.2s;
Expand Down Expand Up @@ -87,18 +58,6 @@ html {
border-radius: 20px;
box-shadow: inset 0 0 0 white;
}
.content-box {
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
.text {
margin: 30px 0;
font-size: 23px;
font-weight: bold;
color: rgb(88 88 88);
}
}

#nprogress {
.bar {
Expand All @@ -113,10 +72,6 @@ html {
}
}

.inline-block {
display: inline-block;
}

.form-button {
float: right;
}
Expand All @@ -141,37 +96,6 @@ html {
white-space: normal;
}

.myTable {
border-collapse: collapse;
font-size: 12px;
table-layout: fixed;
td {
width: 35%;
padding: 8px;
height: 23px;
border: 1px solid #383c42;
word-wrap: break-word;
div {
margin-top: 2px;
}
th {
border: 0;
height: 30px;
}
tr {
&:hover {
background-color: #d9dde2;
}
&:first-child:hover {
background-color: transparent !important;
}
td:nth-child(even) {
color: #85888e;
}
}
}
}

.mask {
width: 100%;
height: 100%;
Expand All @@ -195,48 +119,6 @@ html {
}
}

.table-button {
display: inline;
margin-right: 5px;
}

.button-left {
float: left;
}

.topRouterCard {
.el-card__body {
--el-card-border-color: var(--el-border-color-light);
--el-card-border-radius: 4px;
--el-card-padding: 0px;
--el-card-bg-color: var(--el-fill-color-blank);
}
}
.topRouterButton {
.el-radio-button__inner {
display: inline-block;
line-height: 1;
white-space: nowrap;
vertical-align: middle;
background: var(--el-button-bg-color, var(--el-fill-color-blank));
border: 0;
font-weight: 350;
color: var(--el-button-text-color, var(--el-text-color-regular));
text-align: center;
box-sizing: border-box;
outline: 0;
margin: 0;
position: relative;
cursor: pointer;
transition: var(--el-transition-all);
-webkit-user-select: none;
user-select: none;
padding: 8px 15px;
font-size: var(--el-font-size-base);
border-radius: 0;
}
}

.sidebar-container-popper {
.el-menu--popup-right-start {
background-color: rgba(0, 94, 235, 0.1);
Expand All @@ -247,7 +129,6 @@ html {
width: 250px;
}

// drawer头部增加按钮
.drawer-header-button {
span {
color: currentColor !important;
Expand Down Expand Up @@ -288,9 +169,6 @@ html {
background-color: #000000;
}

.middle-center {
vertical-align: middle;
}
.status-count {
font-size: 24px;
}
Expand Down Expand Up @@ -338,10 +216,6 @@ html {
width: 40% !important;
}

.left-button {
margin-left: 10px;
}

.pre-select {
width: 85px !important;
}
Expand Down Expand Up @@ -377,12 +251,6 @@ html {
margin-right: 20px;
}

.text-parent {
display: flex;
width: 100%;
margin-left: 2px;
}

.text-ellipsis {
overflow: hidden;
text-overflow: ellipsis;
Expand All @@ -399,10 +267,6 @@ html {
margin-left: 5px !important;
}

.p-mb-5 {
margin-bottom: 5px !important;
}

.p-w-200 {
width: 200px !important;
}
Expand Down Expand Up @@ -469,7 +333,6 @@ html {
}
}


.el-descriptions {
overflow: hidden;
text-overflow: ellipsis;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No regularity detected. The code seems to be in good shape, with no syntax errors, missing or extra braces/brackets/etc.

For optimization/suggestion:

  • Avoid creating unnecessary elements (like <span> etc.) that could potentially slow down rendering due to their size/hardcoded values not being used elsewhere e.g. currentColor or similar hard-coded colors/font sizes.
  • Ensure there's consistent naming convention across different modules/views/stylesheets for a cleaner and easier maintenance experience especially when new components/modules are added.

If you need specific optimizations on certain aspects of this example please specify so I can further help you out!

Expand Down
5 changes: 0 additions & 5 deletions frontend/src/views/app-store/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@
}
}

.table-button {
display: inline;
margin-right: 5px;
}

.app-divider {
margin-top: 5px;
border: 0;
Expand Down
13 changes: 3 additions & 10 deletions frontend/src/views/app-store/installed/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,25 +233,18 @@
<div
class="d-description flex flex-wrap items-center justify-start gap-1.5"
>
<el-button class="tagMargin" plain size="small">
<el-button class="mr-1" plain size="small">
{{ $t('app.version') }}:{{ installed.version }}
</el-button>

<el-button
v-if="installed.httpPort > 0"
class="tagMargin"
class="mr-1"
plain
size="small"
>
{{ $t('app.busPort') }}:{{ installed.httpPort }}
</el-button>

<el-button
v-if="installed.httpsPort > 0"
class="tagMargin"
plain
size="small"
>
<el-button v-if="installed.httpsPort > 0" plain size="small">
{{ $t('app.busPort') }}:{{ installed.httpsPort }}
</el-button>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No obvious issues were found with the provided code. It appears to be functioning as expected and there are no areas that can be modified or improved for efficiency, functionality, or readability. There is no room for improvement at this point.

Expand Down
Loading
Loading