mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-01-09 16:44:21 +08:00
feat: merge code from dev (#8504)
This commit is contained in:
parent
3f9eaecf37
commit
2bde755fc4
16 changed files with 92 additions and 16 deletions
|
|
@ -171,6 +171,7 @@ require (
|
|||
github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04 // indirect
|
||||
github.com/nrdcg/dnspod-go v0.4.0 // indirect
|
||||
github.com/nrdcg/freemyip v0.3.0 // indirect
|
||||
github.com/nrdcg/mailinabox v0.2.0 // indirect
|
||||
github.com/nrdcg/namesilo v0.2.1 // indirect
|
||||
github.com/nwaples/rardecode/v2 v2.0.0-beta.2 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
|
|
|
|||
|
|
@ -712,6 +712,8 @@ github.com/nrdcg/dnspod-go v0.4.0 h1:c/jn1mLZNKF3/osJ6mz3QPxTudvPArXTjpkmYj0uK6U
|
|||
github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ=
|
||||
github.com/nrdcg/freemyip v0.3.0 h1:0D2rXgvLwe2RRaVIjyUcQ4S26+cIS2iFwnhzDsEuuwc=
|
||||
github.com/nrdcg/freemyip v0.3.0/go.mod h1:c1PscDvA0ukBF0dwelU/IwOakNKnVxetpAQ863RMJoM=
|
||||
github.com/nrdcg/mailinabox v0.2.0 h1:IKq8mfKiVwNW2hQii/ng1dJ4yYMMv3HAP3fMFIq2CFk=
|
||||
github.com/nrdcg/mailinabox v0.2.0/go.mod h1:0yxqeYOiGyxAu7Sb94eMxHPIOsPYXAjTeA9ZhePhGnc=
|
||||
github.com/nrdcg/namesilo v0.2.1 h1:kLjCjsufdW/IlC+iSfAqj0iQGgKjlbUUeDJio5Y6eMg=
|
||||
github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw=
|
||||
github.com/nwaples/rardecode/v2 v2.0.0-beta.2 h1:e3mzJFJs4k83GXBEiTaQ5HgSc/kOK8q0rDaRO0MPaOk=
|
||||
|
|
|
|||
|
|
@ -61,9 +61,6 @@ var AddTable = &gormigrate.Migration{
|
|||
&model.Group{},
|
||||
&model.AppIgnoreUpgrade{},
|
||||
&model.McpServer{},
|
||||
&model.MonitorBase{},
|
||||
&model.MonitorIO{},
|
||||
&model.MonitorNetwork{},
|
||||
)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"github.com/go-acme/lego/v4/providers/dns/alidns"
|
||||
"github.com/go-acme/lego/v4/providers/dns/clouddns"
|
||||
"github.com/go-acme/lego/v4/providers/dns/cloudflare"
|
||||
"github.com/go-acme/lego/v4/providers/dns/cloudns"
|
||||
"github.com/go-acme/lego/v4/providers/dns/dnspod"
|
||||
"github.com/go-acme/lego/v4/providers/dns/freemyip"
|
||||
"github.com/go-acme/lego/v4/providers/dns/godaddy"
|
||||
|
|
@ -19,6 +20,7 @@ import (
|
|||
"github.com/go-acme/lego/v4/providers/dns/tencentcloud"
|
||||
"github.com/go-acme/lego/v4/providers/dns/vercel"
|
||||
"github.com/go-acme/lego/v4/providers/dns/volcengine"
|
||||
"github.com/go-acme/lego/v4/providers/dns/westcn"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
|
@ -101,21 +103,27 @@ const (
|
|||
FreeMyIP DnsType = "FreeMyIP"
|
||||
Vercel DnsType = "Vercel"
|
||||
Spaceship DnsType = "Spaceship"
|
||||
WestCN DnsType = "WestCN"
|
||||
ClouDNS DnsType = "ClouDNS"
|
||||
)
|
||||
|
||||
type DNSParam struct {
|
||||
ID string `json:"id"`
|
||||
Token string `json:"token"`
|
||||
AccessKey string `json:"accessKey"`
|
||||
SecretKey string `json:"secretKey"`
|
||||
Email string `json:"email"`
|
||||
APIkey string `json:"apiKey"`
|
||||
APIUser string `json:"apiUser"`
|
||||
APISecret string `json:"apiSecret"`
|
||||
SecretID string `json:"secretID"`
|
||||
ClientID string `json:"clientID"`
|
||||
Password string `json:"password"`
|
||||
Region string `json:"region"`
|
||||
ID string `json:"id"`
|
||||
Token string `json:"token"`
|
||||
AccessKey string `json:"accessKey"`
|
||||
SecretKey string `json:"secretKey"`
|
||||
Email string `json:"email"`
|
||||
APIkey string `json:"apiKey"`
|
||||
APIUser string `json:"apiUser"`
|
||||
APISecret string `json:"apiSecret"`
|
||||
SecretID string `json:"secretID"`
|
||||
ClientID string `json:"clientID"`
|
||||
Password string `json:"password"`
|
||||
Region string `json:"region"`
|
||||
Username string `json:"username"`
|
||||
AuthID string `json:"authID"`
|
||||
SubAuthID string `json:"subAuthID"`
|
||||
AuthPassword string `json:"authPassword"`
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
@ -250,6 +258,24 @@ func getDNSProviderConfig(dnsType DnsType, params string) (challenge.Provider, e
|
|||
spaceshipConfig.PollingInterval = pollingInterval
|
||||
spaceshipConfig.TTL = ttl
|
||||
p, err = spaceship.NewDNSProviderConfig(spaceshipConfig)
|
||||
case WestCN:
|
||||
westcnConfig := westcn.NewDefaultConfig()
|
||||
westcnConfig.Username = param.Username
|
||||
westcnConfig.Password = param.Password
|
||||
westcnConfig.PropagationTimeout = propagationTimeout
|
||||
westcnConfig.PollingInterval = pollingInterval
|
||||
westcnConfig.TTL = ttl
|
||||
p, err = westcn.NewDNSProviderConfig(westcnConfig)
|
||||
|
||||
case ClouDNS:
|
||||
cloudnsConfig := cloudns.NewDefaultConfig()
|
||||
cloudnsConfig.AuthID = param.AuthID
|
||||
cloudnsConfig.SubAuthID = param.SubAuthID
|
||||
cloudnsConfig.AuthPassword = param.AuthPassword
|
||||
cloudnsConfig.PropagationTimeout = propagationTimeout
|
||||
cloudnsConfig.PollingInterval = pollingInterval
|
||||
cloudnsConfig.TTL = ttl
|
||||
p, err = cloudns.NewDNSProviderConfig(cloudnsConfig)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -36,6 +36,12 @@ func (b *BaseApi) Login(c *gin.Context) {
|
|||
if len(entranceItem) != 0 {
|
||||
entrance, _ = base64.StdEncoding.DecodeString(entranceItem)
|
||||
}
|
||||
if len(entrance) == 0 {
|
||||
cookieValue, err := c.Cookie("SecurityEntrance")
|
||||
if err == nil {
|
||||
entrance, _ = base64.StdEncoding.DecodeString(cookieValue)
|
||||
}
|
||||
}
|
||||
|
||||
user, msgKey, err := authService.Login(c, req, string(entrance))
|
||||
go saveLoginLogs(c, err)
|
||||
|
|
|
|||
|
|
@ -220,6 +220,14 @@ export const DNSTypes = [
|
|||
label: i18n.global.t('website.rainyun'),
|
||||
value: 'RainYun',
|
||||
},
|
||||
{
|
||||
label: i18n.global.t('website.westCN'),
|
||||
value: 'WestCN',
|
||||
},
|
||||
{
|
||||
label: 'ClouDNS',
|
||||
value: 'ClouDNS',
|
||||
},
|
||||
{
|
||||
label: 'Spaceship',
|
||||
value: 'Spaceship',
|
||||
|
|
|
|||
|
|
@ -2449,6 +2449,7 @@ const message = {
|
|||
cancelFavorite: 'Cancel Favorite',
|
||||
useProxy: 'Use Proxy',
|
||||
useProxyHelper: 'Use the proxy server address in the panel settings',
|
||||
westCN: 'West Digital',
|
||||
},
|
||||
php: {
|
||||
short_open_tag: 'Short tag support',
|
||||
|
|
|
|||
|
|
@ -2356,6 +2356,7 @@ const message = {
|
|||
cancelFavorite: 'お気に入りを解除',
|
||||
useProxy: 'プロキシを使用',
|
||||
useProxyHelper: 'パネル設定のプロキシサーバーアドレスを使用',
|
||||
westCN: '西部デジタル',
|
||||
},
|
||||
php: {
|
||||
short_open_tag: '短いタグサポート',
|
||||
|
|
|
|||
|
|
@ -2317,6 +2317,7 @@ const message = {
|
|||
cancelFavorite: '즐겨찾기 취소',
|
||||
useProxy: '프록시 사용',
|
||||
useProxyHelper: '패널 설정의 프록시 서버 주소 사용',
|
||||
westCN: '서부 디지털',
|
||||
},
|
||||
php: {
|
||||
short_open_tag: '짧은 태그 지원',
|
||||
|
|
|
|||
|
|
@ -2410,6 +2410,7 @@ const message = {
|
|||
cancelFavorite: 'Batalkan Kegemaran',
|
||||
useProxy: 'Gunakan Proksi',
|
||||
useProxyHelper: 'Gunakan alamat pelayan proksi dalam tetapan panel',
|
||||
westCN: 'West Digital',
|
||||
},
|
||||
php: {
|
||||
short_open_tag: 'Sokongan tag pendek',
|
||||
|
|
|
|||
|
|
@ -2406,6 +2406,7 @@ const message = {
|
|||
cancelFavorite: 'Cancelar Favorito',
|
||||
useProxy: 'Usar Proxy',
|
||||
useProxyHelper: 'Usar o endereço do servidor proxy nas configurações do painel',
|
||||
westCN: 'West Digital',
|
||||
},
|
||||
php: {
|
||||
short_open_tag: 'Suporte para short tags',
|
||||
|
|
|
|||
|
|
@ -2407,6 +2407,7 @@ const message = {
|
|||
cancelFavorite: 'Отменить избранное',
|
||||
useProxy: 'Использовать прокси',
|
||||
useProxyHelper: 'Использовать адрес прокси-сервера в настройках панели',
|
||||
westCN: 'Западный цифровой',
|
||||
},
|
||||
php: {
|
||||
short_open_tag: 'Поддержка коротких тегов',
|
||||
|
|
|
|||
|
|
@ -2273,6 +2273,7 @@ const message = {
|
|||
cancelFavorite: '取消收藏',
|
||||
useProxy: '使用代理',
|
||||
useProxyHelper: '使用面板設置中的代理服務器地址',
|
||||
westCN: '西部數碼',
|
||||
},
|
||||
php: {
|
||||
short_open_tag: '短標簽支持',
|
||||
|
|
|
|||
|
|
@ -2263,6 +2263,7 @@ const message = {
|
|||
cancelFavorite: '取消收藏',
|
||||
useProxy: '使用代理',
|
||||
useProxyHelper: '使用面板设置中的代理服务器地址',
|
||||
westCN: '西部数码',
|
||||
},
|
||||
php: {
|
||||
short_open_tag: '短标签支持',
|
||||
|
|
|
|||
|
|
@ -14,9 +14,11 @@ import i18n from '@/lang';
|
|||
import { onMounted, ref } from 'vue';
|
||||
import { searchAppInstalled } from '@/api/modules/app';
|
||||
import bus from '@/global/bus';
|
||||
import { GlobalStore } from '@/store';
|
||||
const globalStore = GlobalStore();
|
||||
let showButton = ref(false);
|
||||
|
||||
const buttons = [
|
||||
let buttons = [
|
||||
{
|
||||
label: i18n.global.t('app.all'),
|
||||
path: '/apps/all',
|
||||
|
|
@ -30,6 +32,9 @@ const buttons = [
|
|||
path: '/apps/upgrade',
|
||||
count: 0,
|
||||
},
|
||||
];
|
||||
|
||||
const settingButtons = [
|
||||
{
|
||||
label: i18n.global.t('commons.button.set'),
|
||||
path: '/apps/setting',
|
||||
|
|
@ -51,6 +56,10 @@ const search = () => {
|
|||
};
|
||||
|
||||
onMounted(() => {
|
||||
if (globalStore.isProductPro) {
|
||||
buttons = buttons.concat(settingButtons);
|
||||
}
|
||||
|
||||
search();
|
||||
bus.on('upgrade', () => {
|
||||
showButton.value = false;
|
||||
|
|
|
|||
|
|
@ -112,6 +112,25 @@
|
|||
<el-input v-model.trim="account.authorization['token']"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-if="account.type === 'ClouDNS'">
|
||||
<el-form-item label="Auth ID" prop="authorization.authID">
|
||||
<el-input v-model.trim="account.authorization['authID']"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="Sub Auth ID" prop="authorization.subAuthID">
|
||||
<el-input v-model.trim="account.authorization['subAuthID']"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="Auth Password" prop="authorization.authPassword">
|
||||
<el-input v-model.trim="account.authorization['authPassword']"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-if="account.type === 'WestCN'">
|
||||
<el-form-item label="Username" prop="authorization.username">
|
||||
<el-input v-model.trim="account.authorization['username']"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="Password" prop="authorization.password">
|
||||
<el-input v-model.trim="account.authorization['password']"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue