Skip to content

Commit

Permalink
feat: 证书部分增加一些提示 (#3349)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkunwang223 authored Dec 15, 2023
1 parent bcd88c6 commit 3dc829a
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/app/api/v1/website_ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (b *BaseApi) ObtainWebsiteCA(c *gin.Context) {
// @Param request body request.WebsiteCAObtain true "request"
// @Success 200
// @Security ApiKeyAuth
// @Router /websites/ca/obtain [post]
// @Router /websites/ca/renew [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_cas","output_column":"name","output_value":"name"}],"formatZH":"自签 SSL 证书 [name]","formatEN":"Obtain SSL [name]"}
func (b *BaseApi) RenewWebsiteCA(c *gin.Context) {
var req request.WebsiteCARenew
Expand Down
55 changes: 53 additions & 2 deletions cmd/server/docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Code generated by swaggo/swag. DO NOT EDIT.

// Package docs GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag
package docs

import "github.com/swaggo/swag"
Expand Down Expand Up @@ -11096,6 +11096,57 @@ const docTemplate = `{
}
},
"/websites/ca/obtain": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "自签 SSL 证书",
"consumes": [
"application/json"
],
"tags": [
"Website CA"
],
"summary": "Obtain SSL",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/request.WebsiteCAObtain"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"x-panel-log": {
"BeforeFunctions": [
{
"db": "website_cas",
"input_column": "id",
"input_value": "id",
"isList": false,
"output_column": "name",
"output_value": "name"
}
],
"bodyKeys": [
"id"
],
"formatEN": "Obtain SSL [name]",
"formatZH": "自签 SSL 证书 [name]",
"paramKeys": []
}
}
},
"/websites/ca/renew": {
"post": {
"security": [
{
Expand Down
51 changes: 51 additions & 0 deletions cmd/server/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -11089,6 +11089,57 @@
}
},
"/websites/ca/obtain": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "自签 SSL 证书",
"consumes": [
"application/json"
],
"tags": [
"Website CA"
],
"summary": "Obtain SSL",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/request.WebsiteCAObtain"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"x-panel-log": {
"BeforeFunctions": [
{
"db": "website_cas",
"input_column": "id",
"input_value": "id",
"isList": false,
"output_column": "name",
"output_value": "name"
}
],
"bodyKeys": [
"id"
],
"formatEN": "Obtain SSL [name]",
"formatZH": "自签 SSL 证书 [name]",
"paramKeys": []
}
}
},
"/websites/ca/renew": {
"post": {
"security": [
{
Expand Down
33 changes: 33 additions & 0 deletions cmd/server/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11807,6 +11807,39 @@ paths:
formatZH: 删除网站 ca [name]
paramKeys: []
/websites/ca/obtain:
post:
consumes:
- application/json
description: 自签 SSL 证书
parameters:
- description: request
in: body
name: request
required: true
schema:
$ref: '#/definitions/request.WebsiteCAObtain'
responses:
"200":
description: OK
security:
- ApiKeyAuth: []
summary: Obtain SSL
tags:
- Website CA
x-panel-log:
BeforeFunctions:
- db: website_cas
input_column: id
input_value: id
isList: false
output_column: name
output_value: name
bodyKeys:
- id
formatEN: Obtain SSL [name]
formatZH: 自签 SSL 证书 [name]
paramKeys: []
/websites/ca/renew:
post:
consumes:
- application/json
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 @@ -1882,6 +1882,7 @@ const message = {
googleHelper:
"<a target=“_blank” href='https://cloud.google.com/certificate-manager/docs/public-ca-tutorial?hl=zh-cn'>如何取得EAB HmacKey 和EAB kid</a > ",
googleCloudHelper: 'Google Cloud API is not accessible in most parts of mainland China',
httpHelper2: 'Unable to apply for a generic domain name certificate in HTTP mode',
},
firewall: {
create: 'Create rule',
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 @@ -1768,6 +1768,7 @@ const message = {
googleHelper:
"<a target=_blankhref='https://cloud.google.com/certificate-manager/docs/public-ca-tutorial?hl=zh-cn'>如何取得EAB HmacKey 和EAB kid</a > ",
googleCloudHelper: 'Google Cloud API 大陸大部分地區無法存取',
httpHelper2: 'HTTP 模式無法申請泛網域憑證',
},
firewall: {
create: '創建規則',
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 @@ -1768,6 +1768,7 @@ const message = {
googleHelper:
"<a target=_blankhref='https://cloud.google.com/certificate-manager/docs/public-ca-tutorial?hl=zh-cn'>如何获取 EAB HmacKey 和 EAB kid</a> ",
googleCloudHelper: 'Google Cloud API 大陆大部分地区无法访问',
httpHelper2: 'HTTP 模式无法申请泛域名证书',
},
firewall: {
create: '创建规则',
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/views/website/ssl/acme-account/create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
<span class="input-help" v-if="account.type === 'buypass'">
{{ $t('ssl.buypassHelper') }}
</span>
<span class="input-help" v-if="account.type == 'google'">
{{ $t('ssl.googleCloudHelper') }}
</span>
</el-form-item>
<el-form-item :label="$t('website.keyType')" prop="keyType">
<el-select v-model="account.keyType">
Expand All @@ -34,7 +37,6 @@
:value="keyType.value"
></el-option>
</el-select>
<span class="input-help">{{ $t('ssl.googleCloudHelper') }}</span>
</el-form-item>
<div v-if="account.type == 'google'">
<el-form-item label="EAB kid" prop="eabKid">
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/views/website/ssl/create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
<span class="input-help" v-if="ssl.provider === 'http'">
{{ $t('ssl.httpHelper') }}
</span>
<span class="input-help text-red-500" v-if="ssl.provider === 'http'">
{{ $t('ssl.httpHelper2') }}
</span>
</el-form-item>
<el-form-item
:label="$t('website.dnsAccount')"
Expand Down

0 comments on commit 3dc829a

Please sign in to comment.