代码同步

pull/79/head
zhangchenhao 2025-05-10 16:45:46 +08:00
parent ad6b3cfa64
commit 8a9d766b50
103 changed files with 967 additions and 762 deletions

View File

@ -41,7 +41,7 @@ func UploadCert(c *gin.Context) {
}
form.Key = strings.TrimSpace(form.Key)
form.Cert = strings.TrimSpace(form.Cert)
if form.Key == "" {
public.FailMsg(c, "名称不能为空")
return
@ -50,12 +50,12 @@ func UploadCert(c *gin.Context) {
public.FailMsg(c, "类型不能为空")
return
}
err = cert.UploadCert(form.Key, form.Cert)
sha256, err := cert.UploadCert(form.Key, form.Cert)
if err != nil {
public.FailMsg(c, err.Error())
return
}
public.SuccessMsg(c, "添加成功")
public.SuccessData(c, sha256, 0)
return
}
@ -83,7 +83,7 @@ func DelCert(c *gin.Context) {
func DownloadCert(c *gin.Context) {
ID := c.Query("id")
if ID == "" {
public.FailMsg(c, "ID不能为空")
return
@ -93,11 +93,11 @@ func DownloadCert(c *gin.Context) {
public.FailMsg(c, err.Error())
return
}
// 构建 zip 包(内存中)
buf := new(bytes.Buffer)
zipWriter := zip.NewWriter(buf)
for filename, content := range certData {
if filename == "cert" || filename == "key" {
writer, err := zipWriter.Create(filename + ".pem")
@ -118,10 +118,10 @@ func DownloadCert(c *gin.Context) {
return
}
// 设置响应头
zipName := strings.ReplaceAll(certData["domains"], ".", "_")
zipName = strings.ReplaceAll(zipName, ",", "-")
c.Header("Content-Type", "application/zip")
c.Header("Content-Disposition", "attachment; filename="+zipName+".zip")
c.Data(200, "application/zip", buf.Bytes())

View File

@ -39,18 +39,18 @@ func GetDNSProvider(providerName string, creds map[string]string) (challenge.Pro
config.SecretID = creds["secret_id"]
config.SecretKey = creds["secret_key"]
return tencentcloud.NewDNSProviderConfig(config)
// case "cloudflare":
// config := cloudflare.NewDefaultConfig()
// config.AuthToken = creds["CLOUDFLARE_API_TOKEN"]
// return cloudflare.NewDNSProviderConfig(config)
case "aliyun":
config := alidns.NewDefaultConfig()
config.APIKey = creds["access_key"]
config.SecretKey = creds["access_secret"]
return alidns.NewDNSProviderConfig(config)
default:
return nil, fmt.Errorf("不支持的 DNS Provider: %s", providerName)
}
@ -62,7 +62,7 @@ func Apply(cfg map[string]any, logger *public.Logger) (map[string]any, error) {
return nil, err
}
defer db.Close()
email, ok := cfg["email"].(string)
if !ok {
return nil, fmt.Errorf("参数错误email")
@ -84,7 +84,11 @@ func Apply(cfg map[string]any, logger *public.Logger) (map[string]any, error) {
default:
return nil, fmt.Errorf("参数错误provider_id")
}
domainArr := strings.Split(domains, ",")
for i := range domainArr {
domainArr[i] = strings.TrimSpace(domainArr[i])
}
// 获取上次申请的证书
runId, ok := cfg["_runId"].(string)
if !ok {
@ -114,11 +118,17 @@ func Apply(cfg map[string]any, logger *public.Logger) (map[string]any, error) {
var maxDays float64
var maxItem map[string]any
for i := range certs {
if !public.ContainsAllIgnoreBRepeats(strings.Split(certs[i]["domains"].(string), ","), domainArr) {
continue
}
endTimeStr, ok := certs[i]["end_time"].(string)
if !ok {
continue
}
endTime, _ := time.Parse(layout, endTimeStr)
endTime, err := time.Parse(layout, endTimeStr)
if err != nil {
continue
}
diff := endTime.Sub(time.Now()).Hours() / 24
if diff > maxDays {
maxDays = diff
@ -131,10 +141,10 @@ func Apply(cfg map[string]any, logger *public.Logger) (map[string]any, error) {
if !ok || cfgEnd <= 0 {
cfgEnd = 30
}
if int(maxDays) > cfgEnd {
// 证书未过期,直接返回
logger.Debug(fmt.Sprintf("上次证书申请成功,剩余天数:%d 大于%d天已跳过申请复用此证书", int(maxDays), cfgEnd))
logger.Debug(fmt.Sprintf("上次证书申请成功,域名:%s,剩余天数:%d 大于%d天已跳过申请复用此证书", certObj["domains"], int(maxDays), cfgEnd))
return map[string]any{
"cert": certObj["cert"],
"key": certObj["key"],
@ -145,7 +155,7 @@ func Apply(cfg map[string]any, logger *public.Logger) (map[string]any, error) {
}
}
logger.Debug("正在申请证书,域名: " + domains)
user, err := LoadUserFromDB(db, email)
if err != nil {
logger.Debug("acme账号不存在注册新账号")
@ -154,10 +164,10 @@ func Apply(cfg map[string]any, logger *public.Logger) (map[string]any, error) {
Email: email,
key: privateKey,
}
config := lego.NewConfig(user)
config.Certificate.KeyType = certcrypto.EC384
client, err := lego.NewClient(config)
if err != nil {
return nil, err
@ -168,14 +178,14 @@ func Apply(cfg map[string]any, logger *public.Logger) (map[string]any, error) {
return nil, err
}
user.Registration = reg
err = SaveUserToDB(db, user)
if err != nil {
return nil, err
}
logger.Debug("账号注册并保存成功")
}
// 初始化 ACME 客户端
client, err := lego.NewClient(lego.NewConfig(user))
if err != nil {
@ -196,13 +206,13 @@ func Apply(cfg map[string]any, logger *public.Logger) (map[string]any, error) {
if err != nil {
return nil, err
}
// DNS 验证
provider, err := GetDNSProvider(providerStr, providerConfig)
if err != nil {
return nil, fmt.Errorf("创建 DNS provider 失败: %v", err)
}
err = client.Challenge.SetDNS01Provider(provider,
dns01.WrapPreCheck(func(domain, fqdn, value string, check dns01.PreCheckFunc) (bool, error) {
// 跳过预检查
@ -215,29 +225,29 @@ func Apply(cfg map[string]any, logger *public.Logger) (map[string]any, error) {
if err != nil {
return nil, err
}
// fmt.Println(strings.Split(domains, ","))
request := certificate.ObtainRequest{
Domains: strings.Split(domains, ","),
Domains: domainArr,
Bundle: true,
}
certObj, err := client.Certificate.Obtain(request)
if err != nil {
return nil, err
}
certStr := string(certObj.Certificate)
keyStr := string(certObj.PrivateKey)
issuerCertStr := string(certObj.IssuerCertificate)
// 保存证书和私钥
data := map[string]any{
"cert": certStr,
"key": keyStr,
"issuerCert": issuerCertStr,
}
err = cert.SaveCert("workflow", keyStr, certStr, issuerCertStr, runId)
_, err = cert.SaveCert("workflow", keyStr, certStr, issuerCertStr, runId)
if err != nil {
return nil, err
}

View File

@ -26,7 +26,7 @@ func GetList(search string, p, limit int64) ([]map[string]any, int, error) {
return data, 0, err
}
defer s.Close()
var limits []int64
if p >= 0 && limit >= 0 {
limits = []int64{0, limit}
@ -35,7 +35,7 @@ func GetList(search string, p, limit int64) ([]map[string]any, int, error) {
limits[1] = p * limit
}
}
if search != "" {
count, err = s.Where("domains like ?", []interface{}{"%" + search + "%"}).Count()
data, err = s.Where("domains like ?", []interface{}{"%" + search + "%"}).Limit(limits).Order("create_time", "desc").Select()
@ -80,7 +80,7 @@ func AddCert(source, key, cert, issuer, issuerCert, domains, sha256, historyId,
workflowId = wh[0]["workflow_id"].(string)
}
}
now := time.Now().Format("2006-01-02 15:04:05")
_, err = s.Insert(map[string]any{
"source": source,
@ -104,40 +104,40 @@ func AddCert(source, key, cert, issuer, issuerCert, domains, sha256, historyId,
return nil
}
func SaveCert(source, key, cert, issuerCert, historyId string) error {
func SaveCert(source, key, cert, issuerCert, historyId string) (string, error) {
if err := public.ValidateSSLCertificate(cert, key); err != nil {
return err
return "", err
}
certObj, err := public.ParseCertificate([]byte(cert))
if err != nil {
return fmt.Errorf("解析证书失败: %v", err)
return "", fmt.Errorf("解析证书失败: %v", err)
}
// SHA256
sha256, err := public.GetSHA256(cert)
if err != nil {
return fmt.Errorf("获取 SHA256 失败: %v", err)
return "", fmt.Errorf("获取 SHA256 失败: %v", err)
}
if d, _ := GetCert(sha256); d != nil {
return nil
return sha256, nil
}
domainSet := make(map[string]bool)
if certObj.Subject.CommonName != "" {
domainSet[certObj.Subject.CommonName] = true
}
for _, dns := range certObj.DNSNames {
domainSet[dns] = true
}
// 转成切片并拼接成逗号分隔的字符串
var domains []string
for domain := range domainSet {
domains = append(domains, domain)
}
domainList := strings.Join(domains, ",")
// 提取 CA 名称Issuer 的组织名)
caName := "UNKNOWN"
if len(certObj.Issuer.Organization) > 0 {
@ -149,20 +149,20 @@ func SaveCert(source, key, cert, issuerCert, historyId string) error {
startTime := certObj.NotBefore.Format("2006-01-02 15:04:05")
endTime := certObj.NotAfter.Format("2006-01-02 15:04:05")
endDay := fmt.Sprintf("%d", int(certObj.NotAfter.Sub(time.Now()).Hours()/24))
err = AddCert(source, key, cert, caName, issuerCert, domainList, sha256, historyId, startTime, endTime, endDay)
if err != nil {
return fmt.Errorf("保存证书失败: %v", err)
return "", fmt.Errorf("保存证书失败: %v", err)
}
return nil
return sha256, nil
}
func UploadCert(key, cert string) error {
err := SaveCert("upload", key, cert, "", "")
func UploadCert(key, cert string) (string, error) {
sha256, err := SaveCert("upload", key, cert, "", "")
if err != nil {
return fmt.Errorf("保存证书失败: %v", err)
return sha256, fmt.Errorf("保存证书失败: %v", err)
}
return nil
return sha256, nil
}
func DelCert(id string) error {
@ -171,7 +171,7 @@ func DelCert(id string) error {
return err
}
defer s.Close()
_, err = s.Where("id=?", []interface{}{id}).Delete()
if err != nil {
return err
@ -185,7 +185,7 @@ func GetCert(id string) (map[string]string, error) {
return nil, err
}
defer s.Close()
res, err := s.Where("id=? or sha256=?", []interface{}{id, id}).Select()
if err != nil {
return nil, err
@ -193,13 +193,13 @@ func GetCert(id string) (map[string]string, error) {
if len(res) == 0 {
return nil, fmt.Errorf("证书不存在")
}
data := map[string]string{
"domains": res[0]["domains"].(string),
"cert": res[0]["cert"].(string),
"key": res[0]["key"].(string),
}
return data, nil
}

View File

@ -10,6 +10,7 @@ import (
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"time"
)
@ -50,11 +51,12 @@ func Request1panel(data *map[string]any, method, providerID, requestUrl string)
if err != nil {
return nil, err
}
if providerConfig["url"][len(providerConfig["url"])-1:] != "/" {
providerConfig["url"] += "/"
parsedURL, err := url.Parse(providerConfig["url"])
if err != nil {
return nil, err
}
req, err := http.NewRequest(method, providerConfig["url"]+requestUrl, bytes.NewBuffer(jsonData))
baseURL := fmt.Sprintf("%s://%s/", parsedURL.Scheme, parsedURL.Host)
req, err := http.NewRequest(method, baseURL+requestUrl, bytes.NewBuffer(jsonData))
if err != nil {
// fmt.Println(err)
return nil, err

View File

@ -41,14 +41,17 @@ func RequestBt(data *url.Values, method, providerID, requestUrl string) (map[str
}
timestamp := time.Now().Unix()
token := generateSignature(fmt.Sprintf("%d", timestamp), providerConfig["api_key"])
if providerConfig["url"][len(providerConfig["url"])-1:] != "/" {
providerConfig["url"] += "/"
}
data.Set("request_time", fmt.Sprintf("%d", timestamp))
data.Set("request_token", token)
req, err := http.NewRequest(method, providerConfig["url"]+requestUrl, strings.NewReader(data.Encode()))
parsedURL, err := url.Parse(providerConfig["url"])
if err != nil {
return nil, err
}
baseURL := fmt.Sprintf("%s://%s/", parsedURL.Scheme, parsedURL.Host)
req, err := http.NewRequest(method, baseURL+requestUrl, strings.NewReader(data.Encode()))
if err != nil {
return nil, err
}
@ -112,7 +115,7 @@ func DeployBt(cfg map[string]any) error {
data.Set("cert_type", "1")
data.Set("privateKey", keyPem)
data.Set("certPem", certPem)
_, err := RequestBt(&data, "POST", providerID, "/config?action=SetPanelSSL")
_, err := RequestBt(&data, "POST", providerID, "config?action=SetPanelSSL")
if err != nil {
return fmt.Errorf("证书部署失败: %v", err)
}
@ -150,7 +153,7 @@ func DeployBtSite(cfg map[string]any) error {
data.Set("key", keyPem)
data.Set("csr", certPem)
data.Set("siteName", siteName)
_, err := RequestBt(&data, "POST", providerID, "/site?action=SetSSL")
_, err := RequestBt(&data, "POST", providerID, "site?action=SetSSL")
if err != nil {
return fmt.Errorf("证书部署失败: %v", err)
}

View File

@ -37,8 +37,9 @@ func Deploy(cfg map[string]any, logger *public.Logger) error {
case "aliyun-cdn":
logger.Debug("部署到阿里云CDN...")
return DeployAliCdn(cfg)
// case "aliyun-oss":
case "aliyun-oss":
logger.Debug("部署到阿里云OSS...")
return DeployOss(cfg)
default:
return fmt.Errorf("不支持的部署: %s", providerName)
}

View File

@ -14,7 +14,7 @@ type SSHConfig struct {
Password string // 可选
PrivateKey string // 可选
Host string
Port string
Port float64
}
type RemoteFile struct {
@ -24,7 +24,7 @@ type RemoteFile struct {
func buildAuthMethods(password, privateKey string) ([]ssh.AuthMethod, error) {
var methods []ssh.AuthMethod
if privateKey != "" {
signer, err := ssh.ParsePrivateKey([]byte(privateKey))
if err != nil {
@ -32,71 +32,71 @@ func buildAuthMethods(password, privateKey string) ([]ssh.AuthMethod, error) {
}
methods = append(methods, ssh.PublicKeys(signer))
}
if password != "" {
methods = append(methods, ssh.Password(password))
}
if len(methods) == 0 {
return nil, fmt.Errorf("no authentication methods provided")
}
return methods, nil
}
func writeMultipleFilesViaSSH(config SSHConfig, files []RemoteFile, preCmd, postCmd string) error {
addr := fmt.Sprintf("%s:%s", config.Host, config.Port)
addr := fmt.Sprintf("%s:%d", config.Host, int(config.Port))
authMethods, err := buildAuthMethods(config.Password, config.PrivateKey)
if err != nil {
return err
}
sshConfig := &ssh.ClientConfig{
User: config.User,
Auth: authMethods,
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
}
client, err := ssh.Dial("tcp", addr, sshConfig)
if err != nil {
return fmt.Errorf("failed to dial: %v", err)
}
defer client.Close()
session, err := client.NewSession()
if err != nil {
return fmt.Errorf("会话创建失败: %v", err)
}
defer session.Close()
var script bytes.Buffer
if preCmd != "" {
script.WriteString(preCmd + " && ")
}
for i, file := range files {
if i > 0 {
script.WriteString(" && ")
}
dirCmd := fmt.Sprintf("mkdir -p $(dirname %q)", file.Path)
writeCmd := fmt.Sprintf("printf %%s '%s' > %s", file.Content, file.Path)
script.WriteString(dirCmd + " && " + writeCmd)
}
if postCmd != "" {
script.WriteString(" && " + postCmd)
}
cmd := script.String()
if err := session.Run(cmd); err != nil {
return fmt.Errorf("运行出错: %v", err)
}
return nil
}
@ -127,17 +127,17 @@ func DeploySSH(cfg map[string]any) error {
if !ok {
return fmt.Errorf("参数错误keyPath")
}
certPath, ok := cfg["keyPath"].(string)
certPath, ok := cfg["certPath"].(string)
if !ok {
return fmt.Errorf("参数错误certPath")
}
beforeCmd, ok := cfg["beforeCmd"].(string)
if !ok {
return fmt.Errorf("参数错误beforeCmd")
beforeCmd = ""
}
afterCmd, ok := cfg["afterCmd"].(string)
if !ok {
return fmt.Errorf("参数错误afterCmd")
afterCmd = ""
}
providerData, err := access.GetAccess(providerID)
if err != nil {
@ -155,8 +155,8 @@ func DeploySSH(cfg map[string]any) error {
}
// 自动创建多级目录
files := []RemoteFile{
{Path: keyPath, Content: certPem},
{Path: certPath, Content: keyPem},
{Path: certPath, Content: certPem},
{Path: keyPath, Content: keyPem},
}
err = writeMultipleFilesViaSSH(providerConfig, files, beforeCmd, afterCmd)
if err != nil {

View File

@ -15,7 +15,7 @@ func GetWorkflowCount() (map[string]any, error) {
s.Connect()
defer s.Close()
workflow, err := s.Query(`select count(*) as count,
count(case when active=1 then 1 end ) as active,
count(case when exec_type='auto' then 1 end ) as active,
count(case when last_run_status='fail' then 1 end ) as failure
from workflow
`)
@ -113,9 +113,9 @@ func GetWorkflowHistory() ([]map[string]any, error) {
}
switch v["exec_type"] {
case "manual":
mode = "手动触发"
mode = "手动"
case "auto":
mode = "定时触发"
mode = "自动"
}
wk, err := s.Where("id=?", []interface{}{v["workflow_id"]}).Select()
if err != nil {
@ -126,7 +126,7 @@ func GetWorkflowHistory() ([]map[string]any, error) {
} else {
name = "未知"
}
result = append(result, map[string]any{
"name": name,
"state": state,

View File

@ -1,189 +1,206 @@
package report
import (
"ALLinSSL/backend/public"
"crypto/tls"
"encoding/json"
"fmt"
"github.com/jordan-wright/email"
"net/smtp"
"time"
)
func GetSqlite() (*public.Sqlite, error) {
s, err := public.NewSqlite("data/data.db", "")
if err != nil {
return nil, err
}
s.Connect()
s.TableName = "report"
return s, nil
}
func GetList(search string, p, limit int64) ([]map[string]any, int, error) {
var data []map[string]any
var count int64
s, err := GetSqlite()
if err != nil {
return data, 0, err
}
defer s.Close()
var limits []int64
if p >= 0 && limit >= 0 {
limits = []int64{0, limit}
if p > 1 {
limits[0] = (p - 1) * limit
limits[1] = p * limit
}
}
if search != "" {
count, err = s.Where("name like ?", []interface{}{"%" + search + "%"}).Count()
data, err = s.Where("name like ?", []interface{}{"%" + search + "%"}).Limit(limits).Order("update_time", "desc").Select()
} else {
count, err = s.Count()
data, err = s.Order("update_time", "desc").Limit(limits).Select()
}
if err != nil {
return data, 0, err
}
return data, int(count), nil
}
func GetReport(id string) (map[string]any, error) {
s, err := GetSqlite()
if err != nil {
return nil, err
}
defer s.Close()
data, err := s.Where("id=?", []interface{}{id}).Select()
if err != nil {
return nil, err
}
if len(data) == 0 {
return nil, fmt.Errorf("没有找到此通知配置")
}
return data[0], nil
}
func AddReport(Type, config, name string) error {
s, err := GetSqlite()
if err != nil {
return err
}
defer s.Close()
now := time.Now().Format("2006-01-02 15:04:05")
_, err = s.Insert(map[string]interface{}{
"name": name,
"type": Type,
"config": config,
"create_time": now,
"update_time": now,
})
return err
}
func UpdReport(id, config, name string) error {
s, err := GetSqlite()
if err != nil {
return err
}
defer s.Close()
_, err = s.Where("id=?", []interface{}{id}).Update(map[string]interface{}{
"name": name,
"config": config,
})
return err
}
func DelReport(id string) error {
s, err := GetSqlite()
if err != nil {
return err
}
defer s.Close()
_, err = s.Where("id=?", []interface{}{id}).Delete()
return err
}
func NotifyTest(id string) error {
if id == "" {
return fmt.Errorf("缺少参数")
}
providerData, err := GetReport(id)
if err != nil {
return err
}
params := map[string]any{
"provider_id": id,
"body": "测试消息通道",
"subject": "测试消息通道",
}
switch providerData["type"] {
case "mail":
err = NotifyMail(params)
}
return err
}
func Notify(params map[string]any) error {
if params == nil {
return fmt.Errorf("缺少参数")
}
providerName, ok := params["provider"].(string)
if !ok {
return fmt.Errorf("通知类型错误")
}
switch providerName {
case "mail":
return NotifyMail(params)
// case "btpanel-site":
// return NotifyBt(params)
default:
return fmt.Errorf("不支持的通知类型")
}
}
func NotifyMail(params map[string]any) error {
if params == nil {
return fmt.Errorf("缺少参数")
}
providerID := params["provider_id"].(string)
// fmt.Println(providerID)
providerData, err := GetReport(providerID)
if err != nil {
return err
}
configStr := providerData["config"].(string)
var config map[string]string
err = json.Unmarshal([]byte(configStr), &config)
if err != nil {
return fmt.Errorf("解析配置失败: %v", err)
}
e := email.NewEmail()
e.From = config["sender"]
e.To = []string{config["receiver"]}
e.Subject = params["subject"].(string)
e.Text = []byte(params["body"].(string))
addr := fmt.Sprintf("%s:%s", config["smtpHost"], config["smtpPort"])
auth := smtp.PlainAuth("", config["sender"], config["password"], config["smtpHost"])
// 使用 SSL通常是 465
if config["smtpPort"] == "465" {
tlsConfig := &tls.Config{
InsecureSkipVerify: true, // 开发阶段跳过证书验证,生产建议关闭
ServerName: config["smtpHost"],
}
return e.SendWithTLS(addr, auth, tlsConfig)
}
// 普通明文发送25端口非推荐
return e.Send(addr, auth)
}
package report
import (
"ALLinSSL/backend/public"
"crypto/tls"
"encoding/json"
"fmt"
"github.com/jordan-wright/email"
"net/smtp"
"strings"
"time"
)
func GetSqlite() (*public.Sqlite, error) {
s, err := public.NewSqlite("data/data.db", "")
if err != nil {
return nil, err
}
s.Connect()
s.TableName = "report"
return s, nil
}
func GetList(search string, p, limit int64) ([]map[string]any, int, error) {
var data []map[string]any
var count int64
s, err := GetSqlite()
if err != nil {
return data, 0, err
}
defer s.Close()
var limits []int64
if p >= 0 && limit >= 0 {
limits = []int64{0, limit}
if p > 1 {
limits[0] = (p - 1) * limit
limits[1] = p * limit
}
}
if search != "" {
count, err = s.Where("name like ?", []interface{}{"%" + search + "%"}).Count()
data, err = s.Where("name like ?", []interface{}{"%" + search + "%"}).Limit(limits).Order("update_time", "desc").Select()
} else {
count, err = s.Count()
data, err = s.Order("update_time", "desc").Limit(limits).Select()
}
if err != nil {
return data, 0, err
}
return data, int(count), nil
}
func GetReport(id string) (map[string]any, error) {
s, err := GetSqlite()
if err != nil {
return nil, err
}
defer s.Close()
data, err := s.Where("id=?", []interface{}{id}).Select()
if err != nil {
return nil, err
}
if len(data) == 0 {
return nil, fmt.Errorf("没有找到此通知配置")
}
return data[0], nil
}
func AddReport(Type, config, name string) error {
s, err := GetSqlite()
if err != nil {
return err
}
defer s.Close()
now := time.Now().Format("2006-01-02 15:04:05")
_, err = s.Insert(map[string]interface{}{
"name": name,
"type": Type,
"config": config,
"create_time": now,
"update_time": now,
})
return err
}
func UpdReport(id, config, name string) error {
s, err := GetSqlite()
if err != nil {
return err
}
defer s.Close()
_, err = s.Where("id=?", []interface{}{id}).Update(map[string]interface{}{
"name": name,
"config": config,
})
return err
}
func DelReport(id string) error {
s, err := GetSqlite()
if err != nil {
return err
}
defer s.Close()
_, err = s.Where("id=?", []interface{}{id}).Delete()
return err
}
func NotifyTest(id string) error {
if id == "" {
return fmt.Errorf("缺少参数")
}
providerData, err := GetReport(id)
if err != nil {
return err
}
params := map[string]any{
"provider_id": id,
"body": "测试消息通道",
"subject": "测试消息通道",
}
switch providerData["type"] {
case "mail":
err = NotifyMail(params)
}
return err
}
func Notify(params map[string]any) error {
if params == nil {
return fmt.Errorf("缺少参数")
}
providerName, ok := params["provider"].(string)
if !ok {
return fmt.Errorf("通知类型错误")
}
switch providerName {
case "mail":
return NotifyMail(params)
// case "btpanel-site":
// return NotifyBt(params)
default:
return fmt.Errorf("不支持的通知类型")
}
}
func NotifyMail(params map[string]any) error {
if params == nil {
return fmt.Errorf("缺少参数")
}
providerID := params["provider_id"].(string)
// fmt.Println(providerID)
providerData, err := GetReport(providerID)
if err != nil {
return err
}
configStr := providerData["config"].(string)
var config map[string]string
err = json.Unmarshal([]byte(configStr), &config)
if err != nil {
return fmt.Errorf("解析配置失败: %v", err)
}
e := email.NewEmail()
e.From = config["sender"]
e.To = []string{config["receiver"]}
e.Subject = params["subject"].(string)
e.Text = []byte(params["body"].(string))
addr := fmt.Sprintf("%s:%s", config["smtpHost"], config["smtpPort"])
auth := smtp.PlainAuth("", config["sender"], config["password"], config["smtpHost"])
// 使用 SSL通常是 465
if config["smtpPort"] == "465" {
tlsConfig := &tls.Config{
InsecureSkipVerify: true, // 开发阶段跳过证书验证,生产建议关闭
ServerName: config["smtpHost"],
}
err = e.SendWithTLS(addr, auth, tlsConfig)
if err != nil {
if err.Error() == "EOF" || strings.Contains(err.Error(), "short response") || err.Error() == "server response incomplete" {
// 忽略短响应错误
return nil
}
return err
}
return nil
}
// 普通明文发送25端口非推荐
err = e.Send(addr, auth)
if err != nil {
if err.Error() == "EOF" || strings.Contains(err.Error(), "short response") || err.Error() == "server response incomplete" {
// 忽略短响应错误
return nil
}
return err
}
return nil
}

View File

@ -95,34 +95,37 @@ func Save(setting *Setting) error {
reload = true
}
s.TableName = "settings"
if setting.Timeout != 0 {
if setting.Timeout != 0 && setting.Timeout != public.TimeOut {
s.Where("key = 'timeout'", []interface{}{}).Update(map[string]interface{}{"value": setting.Timeout})
public.TimeOut = setting.Timeout
}
if setting.Secure != "" {
s.Where("key = 'secure'", []interface{}{}).Update(map[string]interface{}{"value": setting.Secure})
public.TimeOut = setting.Timeout
}
if setting.Https == "1" {
if setting.Key == "" || setting.Cert == "" {
return fmt.Errorf("key or cert is empty")
}
// fmt.Println(setting.Key, setting.Cert)
err := public.ValidateSSLCertificate(setting.Cert, setting.Key)
if err != nil {
return err
}
s.Where("key = 'https'", []interface{}{}).Update(map[string]interface{}{"value": setting.Https})
// dir := filepath.Dir("data/https")
if err := os.MkdirAll("data/https", os.ModePerm); err != nil {
panic("创建目录失败: " + err.Error())
}
err = os.WriteFile("data/https/key.pem", []byte(setting.Key), 0644)
// fmt.Println(err)
os.WriteFile("data/https/cert.pem", []byte(setting.Cert), 0644)
restart = true
}
if setting.Secure != "" && setting.Secure != public.Secure {
s.Where("key = 'secure'", []interface{}{}).Update(map[string]interface{}{"value": setting.Secure})
public.TimeOut = setting.Timeout
restart = true
}
if setting.Https != "" && setting.Https != public.GetSettingIgnoreError("https") {
if setting.Https == "1" {
if setting.Key == "" || setting.Cert == "" {
return fmt.Errorf("key or cert is empty")
}
// fmt.Println(setting.Key, setting.Cert)
err := public.ValidateSSLCertificate(setting.Cert, setting.Key)
if err != nil {
return err
}
// dir := filepath.Dir("data/https")
if err := os.MkdirAll("data/https", os.ModePerm); err != nil {
panic("创建目录失败: " + err.Error())
}
err = os.WriteFile("data/https/key.pem", []byte(setting.Key), 0644)
// fmt.Println(err)
os.WriteFile("data/https/cert.pem", []byte(setting.Cert), 0644)
}
s.Where("key = 'https'", []interface{}{}).Update(map[string]interface{}{"value": setting.Https})
restart = true
}
if restart {
Restart()
return nil

View File

@ -8,6 +8,7 @@ import (
"ALLinSSL/backend/public"
"errors"
"fmt"
"strconv"
)
// var executors map[string]func(map[string]any) (any, error)
@ -33,7 +34,7 @@ func Executors(exec string, params map[string]any) (any, error) {
func apply(params map[string]any) (any, error) {
logger := params["logger"].(*public.Logger)
logger.Info("=============申请证书=============")
certificate, err := certApply.Apply(params, logger)
if err != nil {
@ -67,28 +68,57 @@ func deploy(params map[string]any) (any, error) {
func upload(params map[string]any) (any, error) {
logger := params["logger"].(*public.Logger)
logger.Info("=============上传证书=============")
keyStr, ok := params["key"].(string)
if !ok {
logger.Error("上传的密钥有误")
logger.Info("=============上传失败=============")
return nil, errors.New("上传的密钥有误")
// 判断证书id走本地还是走旧上传应在之后的迭代中移除旧代码
if params["cert_id"] == nil {
keyStr, ok := params["key"].(string)
if !ok {
logger.Error("上传的密钥有误")
logger.Info("=============上传失败=============")
return nil, errors.New("上传的密钥有误")
}
certStr, ok := params["cert"].(string)
if !ok {
logger.Error("上传的证书有误")
logger.Info("=============上传失败=============")
return nil, errors.New("上传的证书有误")
}
_, err := cert.UploadCert(keyStr, certStr)
if err != nil {
logger.Error(err.Error())
logger.Info("=============上传失败=============")
return nil, err
}
logger.Info("=============上传成功=============")
return params, nil
} else {
certId := ""
switch v := params["cert_id"].(type) {
case float64:
certId = strconv.Itoa(int(v))
case string:
certId = v
default:
logger.Info("=============上传证书获取失败=============")
return nil, errors.New("证书 ID 类型错误")
}
result := map[string]any{}
certObj, err := cert.GetCert(certId)
if err != nil {
logger.Error(err.Error())
logger.Info("=============上传证书获取失败=============")
return nil, err
}
if certObj == nil {
logger.Error("证书不存在")
logger.Info("=============上传证书获取失败=============")
return nil, errors.New("证书不存在")
}
logger.Debug(fmt.Sprintf("证书 ID: %s", certId))
result["cert"] = certObj["cert"]
result["key"] = certObj["key"]
return result, nil
}
certStr, ok := params["cert"].(string)
if !ok {
logger.Error("上传的证书有误")
logger.Info("=============上传失败=============")
return nil, errors.New("上传的证书有误")
}
err := cert.UploadCert(keyStr, certStr)
if err != nil {
logger.Error(err.Error())
logger.Info("=============上传失败=============")
return nil, err
}
logger.Info("=============上传成功=============")
return params, nil
}
func notify(params map[string]any) (any, error) {

View File

@ -4,7 +4,6 @@ import (
"ALLinSSL/backend/public"
"encoding/json"
"fmt"
"strings"
"sync"
"time"
)
@ -27,7 +26,7 @@ func GetList(search string, p, limit int64) ([]map[string]any, int, error) {
return data, 0, err
}
defer s.Close()
var limits []int64
if p >= 0 && limit >= 0 {
limits = []int64{0, limit}
@ -36,7 +35,7 @@ func GetList(search string, p, limit int64) ([]map[string]any, int, error) {
limits[1] = p * limit
}
}
if search != "" {
count, err = s.Where("name like ?", []interface{}{"%" + search + "%"}).Count()
data, err = s.Where("name like ?", []interface{}{"%" + search + "%"}).Order("update_time", "desc").Limit(limits).Select()
@ -56,7 +55,7 @@ func AddWorkflow(name, content, execType, active, execTime string) error {
if err != nil {
return fmt.Errorf("检测到工作流配置有问题:%v", err)
}
s, err := GetSqlite()
if err != nil {
return err
@ -161,7 +160,7 @@ func ExecuteWorkflow(id string) error {
return fmt.Errorf("工作流正在执行中")
}
content := data[0]["content"].(string)
go func(id, c string) {
// defer wg.Done()
// WorkflowID := strconv.FormatInt(id, 10)
@ -192,13 +191,15 @@ func resolveInputs(inputs []WorkflowNodeParams, ctx *ExecutionContext) map[strin
for _, input := range inputs {
if input.FromNodeID != "" {
if val, ok := ctx.GetOutput(input.FromNodeID); ok {
switch strings.Split(strings.TrimPrefix(input.FromNodeID, "-"), "-")[0] {
case "apply":
input.Name = "certificate"
case "upload":
input.Name = "certificate"
}
resolved[input.Name] = val
// 暂时没有新的类型可以先写死
// switch strings.Split(strings.TrimPrefix(input.FromNodeID, "-"), "-")[0] {
// case "apply":
// input.Name = "certificate"
// case "upload":
// input.Name = "certificate"
// }
// resolved[input.Name] = val
resolved["certificate"] = val
}
}
}
@ -217,10 +218,10 @@ func RunNode(node *WorkflowNode, ctx *ExecutionContext) error {
}
node.Config["_runId"] = ctx.RunID
node.Config["logger"] = ctx.Logger
// 执行当前节点
result, err := Executors(node.Type, node.Config)
var status ExecutionStatus
if err != nil {
status = StatusFailed
@ -230,9 +231,9 @@ func RunNode(node *WorkflowNode, ctx *ExecutionContext) error {
} else {
status = StatusSuccess
}
ctx.SetOutput(node.Id, result, status)
// 普通的并行
if node.Type == "branch" {
if len(node.ConditionNodes) > 0 {
@ -268,7 +269,7 @@ func RunNode(node *WorkflowNode, ctx *ExecutionContext) error {
}
}
}
if node.ChildNode != nil {
return RunNode(node.ChildNode, ctx)
}

View File

@ -1,117 +1,117 @@
package workflow
import (
"ALLinSSL/backend/public"
"os"
"path/filepath"
"time"
)
// GetSqliteObjWH 工作流执行历史记录表对象
func GetSqliteObjWH() (*public.Sqlite, error) {
s, err := public.NewSqlite("data/data.db", "")
if err != nil {
return nil, err
}
s.Connect()
s.TableName = "workflow_history"
return s, nil
}
// GetListWH 获取工作流执行历史记录列表
func GetListWH(id string, p, limit int64) ([]map[string]any, int, error) {
var data []map[string]any
var count int64
s, err := GetSqliteObjWH()
if err != nil {
return data, 0, err
}
defer s.Close()
var limits []int64
if p >= 0 && limit >= 0 {
limits = []int64{0, limit}
if p > 1 {
limits[0] = (p - 1) * limit
limits[1] = p * limit
}
}
if id == "" {
count, err = s.Count()
data, err = s.Limit(limits).Order("create_time", "desc").Select()
} else {
count, err = s.Where("workflow_id=?", []interface{}{id}).Count()
data, err = s.Where("workflow_id=?", []interface{}{id}).Limit(limits).Order("create_time", "desc").Select()
}
if err != nil {
return data, 0, err
}
return data, int(count), nil
}
// 添加工作流执行历史记录
func AddWorkflowHistory(workflowID, execType string) (string, error) {
s, err := GetSqliteObjWH()
if err != nil {
return "", err
}
defer s.Close()
now := time.Now().Format("2006-01-02 15:04:05")
ID := public.GenerateUUID()
_, err = s.Insert(map[string]interface{}{
"id": ID,
"workflow_id": workflowID,
"status": "running",
"exec_type": execType,
"create_time": now,
})
if err != nil {
return "", err
}
_ = UpdDb(workflowID, map[string]interface{}{"last_run_status": "running", "last_run_time": now})
return ID, nil
}
// 工作流执行结束
func UpdateWorkflowHistory(id, status string) error {
s, err := GetSqliteObjWH()
if err != nil {
return err
}
defer s.Close()
now := time.Now().Format("2006-01-02 15:04:05")
_, err = s.Where("id=?", []interface{}{id}).Update(map[string]interface{}{
"status": status,
"end_time": now,
})
if err != nil {
return err
}
return nil
}
func StopWorkflow(id string) error {
s, err := GetSqliteObjWH()
if err != nil {
return err
}
defer s.Close()
data, err := s.Where("id=?", []interface{}{id}).Select()
if err != nil {
return err
}
if len(data) == 0 {
return nil
}
SetWorkflowStatus(data[0]["workflow_id"].(string), id, "fail")
return nil
}
func GetExecLog(id string) (string, error) {
log, err := os.ReadFile(filepath.Join(public.GetSettingIgnoreError("workflow_log_path"), id+".log"))
if err != nil {
return "", err
}
return string(log), nil
}
package workflow
import (
"ALLinSSL/backend/public"
"os"
"path/filepath"
"time"
)
// GetSqliteObjWH 工作流执行历史记录表对象
func GetSqliteObjWH() (*public.Sqlite, error) {
s, err := public.NewSqlite("data/data.db", "")
if err != nil {
return nil, err
}
s.Connect()
s.TableName = "workflow_history"
return s, nil
}
// GetListWH 获取工作流执行历史记录列表
func GetListWH(id string, p, limit int64) ([]map[string]any, int, error) {
var data []map[string]any
var count int64
s, err := GetSqliteObjWH()
if err != nil {
return data, 0, err
}
defer s.Close()
var limits []int64
if p >= 0 && limit >= 0 {
limits = []int64{0, limit}
if p > 1 {
limits[0] = (p - 1) * limit
limits[1] = p * limit
}
}
if id == "" {
count, err = s.Count()
data, err = s.Limit(limits).Order("create_time", "desc").Select()
} else {
count, err = s.Where("workflow_id=?", []interface{}{id}).Count()
data, err = s.Where("workflow_id=?", []interface{}{id}).Limit(limits).Order("create_time", "desc").Select()
}
if err != nil {
return data, 0, err
}
return data, int(count), nil
}
// 添加工作流执行历史记录
func AddWorkflowHistory(workflowID, execType string) (string, error) {
s, err := GetSqliteObjWH()
if err != nil {
return "", err
}
defer s.Close()
now := time.Now().Format("2006-01-02 15:04:05")
ID := public.GenerateUUID()
_, err = s.Insert(map[string]interface{}{
"id": ID,
"workflow_id": workflowID,
"status": "running",
"exec_type": execType,
"create_time": now,
})
if err != nil {
return "", err
}
_ = UpdDb(workflowID, map[string]interface{}{"last_run_status": "running", "last_run_time": now})
return ID, nil
}
// 工作流执行结束
func UpdateWorkflowHistory(id, status string) error {
s, err := GetSqliteObjWH()
if err != nil {
return err
}
defer s.Close()
now := time.Now().Format("2006-01-02 15:04:05")
_, err = s.Where("id=?", []interface{}{id}).Update(map[string]interface{}{
"status": status,
"end_time": now,
})
if err != nil {
return err
}
return nil
}
func StopWorkflow(id string) error {
s, err := GetSqliteObjWH()
if err != nil {
return err
}
defer s.Close()
data, err := s.Where("id=?", []interface{}{id}).Select()
if err != nil {
return err
}
if len(data) == 0 {
return nil
}
SetWorkflowStatus(data[0]["workflow_id"].(string), id, "fail")
return nil
}
func GetExecLog(id string) (string, error) {
log, err := os.ReadFile(filepath.Join(public.GetSettingIgnoreError("workflow_log_path"), id+".log"))
if err != nil {
return "", err
}
return string(log), nil
}

View File

@ -2,10 +2,13 @@ package middleware
import (
"ALLinSSL/backend/public"
"crypto/md5"
"encoding/gob"
"encoding/hex"
"github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin"
"net/http"
"strconv"
"strings"
"time"
)
@ -20,6 +23,10 @@ var Html404 = []byte(`<html>
func SessionAuthMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
if checkApiKey(c) {
return
}
routePath := c.Request.URL.Path
method := c.Request.Method
paths := strings.Split(strings.TrimPrefix(routePath, "/"), "/")
@ -28,12 +35,14 @@ func SessionAuthMiddleware() gin.HandlerFunc {
gob.Register(time.Time{})
last := session.Get("lastRequestTime")
if routePath == public.Secure && session.Get("secure") == nil {
// 访问安全入口,设置 session
session.Set("secure", true)
session.Set("lastRequestTime", now)
// 一定要保存 session BEFORE redirect
session.Save()
if routePath == public.Secure {
if session.Get("secure") == nil {
// 访问安全入口,设置 session
session.Set("secure", true)
session.Set("lastRequestTime", now)
// 一定要保存 session BEFORE redirect
session.Save()
}
// 返回登录页
c.Redirect(http.StatusFound, "/login")
// c.Abort()
@ -73,6 +82,9 @@ func SessionAuthMiddleware() gin.HandlerFunc {
return
}
}
if routePath == "/favicon.ico" {
return
}
// 判断是否为静态文件路径
if method == "GET" {
if len(paths) > 1 && paths[0] == "static" {
@ -86,14 +98,21 @@ func SessionAuthMiddleware() gin.HandlerFunc {
return
} else {
if session.Get("__login_key") != public.GetSettingIgnoreError("login_key") {
session.Clear()
// session.Set("secure", true)
session.Set("login", nil)
session.Save()
c.JSON(http.StatusUnauthorized, gin.H{"message": "登录信息发生变化,请重新登录"})
c.Abort()
// c.JSON(http.StatusUnauthorized, gin.H{"message": "登录信息发生变化,请重新登录"})
c.Redirect(http.StatusFound, "/login")
// c.Abort()
} else {
// 访问正常,更新最后请求时间
session.Set("lastRequestTime", now)
session.Save()
if paths[0] == "login" {
c.Redirect(http.StatusFound, "/")
c.Abort()
return
}
}
}
}
@ -106,3 +125,52 @@ func SessionAuthMiddleware() gin.HandlerFunc {
}
}
}
func checkApiKey(c *gin.Context) bool {
var form struct {
ApiToken string `form:"api_token"`
Timestamp string `form:"timestamp"`
}
err := c.Bind(&form)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid request"})
c.Abort()
return false
}
if form.ApiToken == "" || form.Timestamp == "" {
return false
}
apiKey := public.GetSettingIgnoreError("api_key")
if apiKey == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "未开启api"})
c.Abort()
return false
}
// timestamp := time.Now().Unix()
ApiToken := generateSignature(form.Timestamp, apiKey)
if form.ApiToken != ApiToken {
c.JSON(http.StatusUnauthorized, gin.H{"error": "invalid token"})
c.Abort()
return false
}
// 这里可以添加其他的验证逻辑,比如检查时间戳是否过期等
timestamp, err := strconv.ParseInt(form.Timestamp, 10, 64)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid timestamp"})
return false
}
if time.Now().Unix()-timestamp > 60*5 {
c.JSON(http.StatusUnauthorized, gin.H{"error": "timestamp expired"})
return false
}
return true
}
func generateSignature(timestamp, apiKey string) string {
keyMd5 := md5.Sum([]byte(apiKey))
keyMd5Hex := strings.ToLower(hex.EncodeToString(keyMd5[:]))
signMd5 := md5.Sum([]byte(timestamp + keyMd5Hex))
signMd5Hex := strings.ToLower(hex.EncodeToString(signMd5[:]))
return signMd5Hex
}

View File

@ -4,18 +4,18 @@ import (
"ALLinSSL/backend/public"
"database/sql"
"fmt"
_ "github.com/mattn/go-sqlite3"
_ "modernc.org/sqlite"
"os"
"path/filepath"
)
func init() {
os.MkdirAll("data", os.ModePerm)
dbPath := "data/data.db"
_, _ = filepath.Abs(dbPath)
// fmt.Println("数据库路径:", absPath)
db, err := sql.Open("sqlite3", dbPath)
db, err := sql.Open("sqlite", dbPath)
if err != nil {
// fmt.Println("创建数据库失败:", err)
return
@ -176,15 +176,15 @@ func init() {
INSERT INTO access_type (name, type) VALUES ('ssh', 'host');
INSERT INTO access_type (name, type) VALUES ('btpanel', 'host');
INSERT INTO access_type (name, type) VALUES ('1panel', 'host');`)
uuidStr := public.GenerateUUID()
randomStr := public.RandomString(8)
port, err := public.GetFreePort()
if err != nil {
port = 20773
}
Isql := fmt.Sprintf(
`INSERT INTO settings (key, value, create_time, update_time, active, type) VALUES ('log_path', 'logs/ALLinSSL.log', '2025-04-15 15:58', '2025-04-15 15:58', 1, null);
INSERT INTO settings (key, value, create_time, update_time, active, type) VALUES ( 'workflow_log_path', 'logs/workflows/', '2025-04-15 15:58', '2025-04-15 15:58', 1, null);
@ -194,7 +194,7 @@ INSERT INTO settings (key, value, create_time, update_time, active, type) VALUES
INSERT INTO settings (key, value, create_time, update_time, active, type) VALUES ('session_key', '%s', '2025-04-15 15:58', '2025-04-15 15:58', 1, null);
INSERT INTO settings (key, value, create_time, update_time, active, type) VALUES ('secure', '/%s', '2025-04-15 15:58', '2025-04-15 15:58', 1, null);
INSERT INTO settings (key, value, create_time, update_time, active, type) VALUES ('port', '%d', '2025-04-15 15:58', '2025-04-15 15:58', 1, null);`, uuidStr, uuidStr, randomStr, port)
insertDefaultData(db, "settings", Isql)
}
@ -206,7 +206,7 @@ func insertDefaultData(db *sql.DB, table, insertSQL string) {
// fmt.Println("检查数据行数失败:", err)
return
}
// 如果表为空,则插入默认数据
if count == 0 {
// fmt.Println("表为空,插入默认数据...")

View File

@ -1,181 +1,202 @@
package public
import (
"crypto/rand"
"fmt"
"github.com/google/uuid"
"io"
"math/big"
"net"
"net/http"
"strings"
)
const defaultCharset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
// GetSettingIgnoreError 获取系统配置-忽略错误
func GetSettingIgnoreError(key string) string {
s, err := NewSqlite("data/data.db", "")
if err != nil {
return ""
}
s.Connect()
defer s.Close()
s.TableName = "settings"
res, err := s.Where("key=?", []interface{}{key}).Select()
if err != nil {
return ""
}
if len(res) == 0 {
return ""
}
setting, ok := res[0]["value"].(string)
if !ok {
return ""
}
return setting
}
func UpdateSetting(key, val string) error {
s, err := NewSqlite("data/data.db", "")
if err != nil {
return err
}
s.Connect()
defer s.Close()
s.TableName = "settings"
_, err = s.Where("key=?", []interface{}{key}).Update(map[string]any{"value": val})
if err != nil {
return err
}
return nil
}
func GetSettingsFromType(typ string) ([]map[string]any, error) {
db := "data/data.db"
s, err := NewSqlite(db, "")
if err != nil {
return nil, err
}
s.Connect()
defer s.Close()
s.TableName = "settings"
res, err := s.Where("type=?", []interface{}{typ}).Select()
if err != nil {
return nil, err
}
return res, nil
}
// GetFreePort 获取一个可用的随机端口
func GetFreePort() (int, error) {
// 端口为 0表示让系统自动分配一个可用端口
ln, err := net.Listen("tcp", "localhost:0")
if err != nil {
return 0, err
}
defer ln.Close()
addr := ln.Addr().String()
// 提取端口号
parts := strings.Split(addr, ":")
if len(parts) < 2 {
return 0, fmt.Errorf("invalid address: %s", addr)
}
var port int
fmt.Sscanf(parts[len(parts)-1], "%d", &port)
return port, nil
}
// RandomString 生成指定长度的随机字符串
func RandomString(length int) string {
if str, err := RandomStringWithCharset(length, defaultCharset); err != nil {
return "allinssl"
} else {
return str
}
}
// RandomStringWithCharset 使用指定字符集生成随机字符串
func RandomStringWithCharset(length int, charset string) (string, error) {
result := make([]byte, length)
charsetLen := big.NewInt(int64(len(charset)))
for i := 0; i < length; i++ {
num, err := rand.Int(rand.Reader, charsetLen)
if err != nil {
return "", err
}
result[i] = charset[num.Int64()]
}
return string(result), nil
}
// GenerateUUID 生成 UUID
func GenerateUUID() string {
// 生成一个新的 UUID
uuidStr := strings.ReplaceAll(uuid.New().String(), "-", "")
// 返回 UUID 的字符串表示
return uuidStr
}
func GetLocalIP() (string, error) {
interfaces, err := net.Interfaces()
if err != nil {
return "", err
}
for _, iface := range interfaces {
if iface.Flags&net.FlagUp == 0 {
continue // 接口未启用
}
if iface.Flags&net.FlagLoopback != 0 {
continue // 忽略回环地址
}
addrs, err := iface.Addrs()
if err != nil {
continue
}
for _, addr := range addrs {
var ip net.IP
switch v := addr.(type) {
case *net.IPNet:
ip = v.IP
case *net.IPAddr:
ip = v.IP
}
// 只返回 IPv4 内网地址
if ip != nil && ip.To4() != nil && !ip.IsLoopback() {
return ip.String(), nil
}
}
}
return "", fmt.Errorf("没有找到内网 IP")
}
func GetPublicIP() (string, error) {
resp, err := http.Get("https://www.bt.cn/Api/getIpAddress")
if err != nil {
return "", fmt.Errorf("请求失败: %v", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return "", fmt.Errorf("HTTP状态错误: %v", resp.Status)
}
body, err := io.ReadAll(resp.Body)
if err != nil {
return "", fmt.Errorf("读取响应失败: %v", err)
}
return string(body), nil
}
package public
import (
"crypto/rand"
"fmt"
"github.com/google/uuid"
"io"
"math/big"
"net"
"net/http"
"strings"
)
const defaultCharset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
// GetSettingIgnoreError 获取系统配置-忽略错误
func GetSettingIgnoreError(key string) string {
s, err := NewSqlite("data/data.db", "")
if err != nil {
return ""
}
s.Connect()
defer s.Close()
s.TableName = "settings"
res, err := s.Where("key=?", []interface{}{key}).Select()
if err != nil {
return ""
}
if len(res) == 0 {
return ""
}
setting, ok := res[0]["value"].(string)
if !ok {
return ""
}
return setting
}
func UpdateSetting(key, val string) error {
s, err := NewSqlite("data/data.db", "")
if err != nil {
return err
}
s.Connect()
defer s.Close()
s.TableName = "settings"
_, err = s.Where("key=?", []interface{}{key}).Update(map[string]any{"value": val})
if err != nil {
return err
}
return nil
}
func GetSettingsFromType(typ string) ([]map[string]any, error) {
db := "data/data.db"
s, err := NewSqlite(db, "")
if err != nil {
return nil, err
}
s.Connect()
defer s.Close()
s.TableName = "settings"
res, err := s.Where("type=?", []interface{}{typ}).Select()
if err != nil {
return nil, err
}
return res, nil
}
// GetFreePort 获取一个可用的随机端口
func GetFreePort() (int, error) {
// 端口为 0表示让系统自动分配一个可用端口
ln, err := net.Listen("tcp", "localhost:0")
if err != nil {
return 0, err
}
defer ln.Close()
addr := ln.Addr().String()
// 提取端口号
parts := strings.Split(addr, ":")
if len(parts) < 2 {
return 0, fmt.Errorf("invalid address: %s", addr)
}
var port int
fmt.Sscanf(parts[len(parts)-1], "%d", &port)
return port, nil
}
// RandomString 生成指定长度的随机字符串
func RandomString(length int) string {
if str, err := RandomStringWithCharset(length, defaultCharset); err != nil {
return "allinssl"
} else {
return str
}
}
// RandomStringWithCharset 使用指定字符集生成随机字符串
func RandomStringWithCharset(length int, charset string) (string, error) {
result := make([]byte, length)
charsetLen := big.NewInt(int64(len(charset)))
for i := 0; i < length; i++ {
num, err := rand.Int(rand.Reader, charsetLen)
if err != nil {
return "", err
}
result[i] = charset[num.Int64()]
}
return string(result), nil
}
// GenerateUUID 生成 UUID
func GenerateUUID() string {
// 生成一个新的 UUID
uuidStr := strings.ReplaceAll(uuid.New().String(), "-", "")
// 返回 UUID 的字符串表示
return uuidStr
}
func GetLocalIP() (string, error) {
interfaces, err := net.Interfaces()
if err != nil {
return "", err
}
for _, iface := range interfaces {
if iface.Flags&net.FlagUp == 0 {
continue // 接口未启用
}
if iface.Flags&net.FlagLoopback != 0 {
continue // 忽略回环地址
}
addrs, err := iface.Addrs()
if err != nil {
continue
}
for _, addr := range addrs {
var ip net.IP
switch v := addr.(type) {
case *net.IPNet:
ip = v.IP
case *net.IPAddr:
ip = v.IP
}
// 只返回 IPv4 内网地址
if ip != nil && ip.To4() != nil && !ip.IsLoopback() {
return ip.String(), nil
}
}
}
return "", fmt.Errorf("没有找到内网 IP")
}
func GetPublicIP() (string, error) {
resp, err := http.Get("https://www.bt.cn/Api/getIpAddress")
if err != nil {
return "", fmt.Errorf("请求失败: %v", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return "", fmt.Errorf("HTTP状态错误: %v", resp.Status)
}
body, err := io.ReadAll(resp.Body)
if err != nil {
return "", fmt.Errorf("读取响应失败: %v", err)
}
return string(body), nil
}
func ContainsAllIgnoreBRepeats(a, b []string) bool {
// 构建 A 的集合
setA := make(map[string]struct{})
for _, item := range a {
setA[item] = struct{}{}
}
// 遍历 B 的唯一元素,判断是否在 A 中
seen := make(map[string]struct{})
for _, item := range b {
if _, checked := seen[item]; checked {
continue
}
seen[item] = struct{}{}
if _, ok := setA[item]; !ok {
return false
}
}
return true
}

View File

@ -8,7 +8,7 @@ import (
func Register(r *gin.Engine) {
v1 := r.Group("/v1")
login := v1.Group("/login")
{
login.POST("/sign", api.Sign)
@ -70,11 +70,15 @@ func Register(r *gin.Engine) {
{
overview.POST("/get_overviews", api.GetOverview)
}
// 1. 提供静态文件服务
r.StaticFS("/static", http.Dir("./frontend/static")) // 静态资源路径
r.StaticFS("/auto-deploy/static", http.Dir("./frontend/static")) // 静态资源路径
// 返回 favicon.ico
r.GET("/favicon.ico", func(c *gin.Context) {
c.File("./frontend/favicon.ico")
})
// 3. 前端路由托管:匹配所有其他路由并返回 index.html
r.NoRoute(func(c *gin.Context) {
c.File("./frontend/index.html")

View File

@ -93,37 +93,3 @@ func (s *Scheduler) loop() {
}
}
}
// package scheduler
//
// import (
// "sync"
// "time"
// )
//
// var funcs = []func(){
// SiteMonitor,
// RunWorkflows,
// }
//
// func Scheduler() {
// for {
// start := time.Now()
//
// var wg sync.WaitGroup
// wg.Add(len(funcs))
//
// for _, f := range funcs {
// go func(fn func()) {
// defer wg.Done()
// fn()
// }(f)
// }
// wg.Wait()
// // 保证每轮间隔至少10秒
// elapsed := time.Since(start)
// if elapsed < 10*time.Second {
// time.Sleep(10*time.Second - elapsed)
// }
// }
// }

View File

@ -5,8 +5,8 @@
<link rel="icon" href="./favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ALLinSSL</title>
<script type="module" crossorigin src="./static/js/main-B314ly27.js"></script>
<link rel="stylesheet" crossorigin href="./static/css/style-C77exc-U.css">
<script type="module" crossorigin src="./static/js/main-DgoEun3x.js"></script>
<link rel="stylesheet" crossorigin href="./static/css/style-Bi6Ocdoa.css">
</head>
<body>
<div id="app"></div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{d as e,aO as r,aQ as a,z as l,U as t,A as n,bR as s,aD as i,l as o,aE as f,bS as p,b6 as u}from"./main-B314ly27.js";const c=e({name:"Flex",props:Object.assign(Object.assign({},n.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrap:{type:Boolean,default:!0}}),setup(e){const{mergedClsPrefixRef:r,mergedRtlRef:a}=t(e),l=n("Flex","-flex",void 0,s,e,r);return{rtlEnabled:i("Flex",a,r),mergedClsPrefix:r,margin:o((()=>{const{size:r}=e;if(Array.isArray(r))return{horizontal:r[0],vertical:r[1]};if("number"==typeof r)return{horizontal:r,vertical:r};const{self:{[f("gap",r)]:a}}=l.value,{row:t,col:n}=p(a);return{horizontal:u(n),vertical:u(t)}}))}},render(){const{vertical:e,reverse:t,align:n,inline:s,justify:i,margin:o,wrap:f,mergedClsPrefix:p,rtlEnabled:u}=this,c=r(a(this),!1);return c.length?l("div",{role:"none",class:[`${p}-flex`,u&&`${p}-flex--rtl`],style:{display:s?"inline-flex":"flex",flexDirection:e&&!t?"column":e&&t?"column-reverse":!e&&t?"row-reverse":"row",justifyContent:i,flexWrap:!f||e?"nowrap":"wrap",alignItems:n,gap:`${o.vertical}px ${o.horizontal}px`}},c):null}});export{c as N};
import{d as e,aO as r,aQ as a,z as l,U as t,A as n,bR as s,aD as i,l as o,aE as f,bS as p,b6 as u}from"./main-DgoEun3x.js";const c=e({name:"Flex",props:Object.assign(Object.assign({},n.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrap:{type:Boolean,default:!0}}),setup(e){const{mergedClsPrefixRef:r,mergedRtlRef:a}=t(e),l=n("Flex","-flex",void 0,s,e,r);return{rtlEnabled:i("Flex",a,r),mergedClsPrefix:r,margin:o((()=>{const{size:r}=e;if(Array.isArray(r))return{horizontal:r[0],vertical:r[1]};if("number"==typeof r)return{horizontal:r,vertical:r};const{self:{[f("gap",r)]:a}}=l.value,{row:t,col:n}=p(a);return{horizontal:u(n),vertical:u(t)}}))}},render(){const{vertical:e,reverse:t,align:n,inline:s,justify:i,margin:o,wrap:f,mergedClsPrefix:p,rtlEnabled:u}=this,c=r(a(this),!1);return c.length?l("div",{role:"none",class:[`${p}-flex`,u&&`${p}-flex--rtl`],style:{display:s?"inline-flex":"flex",flexDirection:e&&!t?"column":e&&t?"column-reverse":!e&&t?"row-reverse":"row",justifyContent:i,flexWrap:!f||e?"nowrap":"wrap",alignItems:n,gap:`${o.vertical}px ${o.horizontal}px`}},c):null}});export{c as N};

View File

@ -1 +1 @@
import{d as a,E as l,F as n,G as r}from"./main-B314ly27.js";const t={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 20 20"},o=a({name:"Certificate20Regular",render:function(a,o){return n(),l("svg",t,o[0]||(o[0]=[r("g",{fill:"none"},[r("path",{d:"M2 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3.146a4.508 4.508 0 0 0-1-.678V5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h7.258c.076.113.157.223.242.329V15H4a2 2 0 0 1-2-2V5zm16.5 6.5c0 .954-.381 1.818-1 2.45V18a.5.5 0 0 1-.8.4l-1.4-1.05a.5.5 0 0 0-.6 0l-1.4 1.05a.5.5 0 0 1-.8-.4v-4.05a3.5 3.5 0 1 1 6-2.45zM15 15c-.537 0-1.045-.12-1.5-.337v2.087l1.243-.746a.5.5 0 0 1 .514 0l1.243.746v-2.087A3.486 3.486 0 0 1 15 15zm0-1a2.5 2.5 0 1 0 0-5a2.5 2.5 0 0 0 0 5zM5 6.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm.5 4.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4z",fill:"currentColor"})],-1)]))}}),h={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},w=a({name:"CloudMonitoring",render:function(a,t){return n(),l("svg",h,t[0]||(t[0]=[r("path",{d:"M28 16v6H4V6h7V4H4a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8v4H8v2h16v-2h-4v-4h8a2 2 0 0 0 2-2v-6zM18 28h-4v-4h4z",fill:"currentColor"},null,-1),r("path",{d:"M18 18h-.01a1 1 0 0 1-.951-.725L15.246 11H11V9h5a1 1 0 0 1 .962.725l1.074 3.76l3.009-9.78A1.014 1.014 0 0 1 22 3a.98.98 0 0 1 .949.684L24.72 9H30v2h-6a1 1 0 0 1-.949-.684l-1.013-3.04l-3.082 10.018A1 1 0 0 1 18 18z",fill:"currentColor"},null,-1)]))}}),v={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},e=a({name:"Flow",render:function(a,t){return n(),l("svg",v,t[0]||(t[0]=[r("path",{d:"M27 22.14V17a2 2 0 0 0-2-2h-8V9.86a4 4 0 1 0-2 0V15H7a2 2 0 0 0-2 2v5.14a4 4 0 1 0 2 0V17h18v5.14a4 4 0 1 0 2 0zM8 26a2 2 0 1 1-2-2a2 2 0 0 1 2 2zm6-20a2 2 0 1 1 2 2a2 2 0 0 1-2-2zm12 22a2 2 0 1 1 2-2a2 2 0 0 1-2 2z",fill:"currentColor"},null,-1)]))}});export{o as C,e as F,w as a};
import{d as a,E as l,F as n,G as r}from"./main-DgoEun3x.js";const t={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 20 20"},o=a({name:"Certificate20Regular",render:function(a,o){return n(),l("svg",t,o[0]||(o[0]=[r("g",{fill:"none"},[r("path",{d:"M2 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3.146a4.508 4.508 0 0 0-1-.678V5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h7.258c.076.113.157.223.242.329V15H4a2 2 0 0 1-2-2V5zm16.5 6.5c0 .954-.381 1.818-1 2.45V18a.5.5 0 0 1-.8.4l-1.4-1.05a.5.5 0 0 0-.6 0l-1.4 1.05a.5.5 0 0 1-.8-.4v-4.05a3.5 3.5 0 1 1 6-2.45zM15 15c-.537 0-1.045-.12-1.5-.337v2.087l1.243-.746a.5.5 0 0 1 .514 0l1.243.746v-2.087A3.486 3.486 0 0 1 15 15zm0-1a2.5 2.5 0 1 0 0-5a2.5 2.5 0 0 0 0 5zM5 6.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm.5 4.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4z",fill:"currentColor"})],-1)]))}}),h={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},w=a({name:"CloudMonitoring",render:function(a,t){return n(),l("svg",h,t[0]||(t[0]=[r("path",{d:"M28 16v6H4V6h7V4H4a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8v4H8v2h16v-2h-4v-4h8a2 2 0 0 0 2-2v-6zM18 28h-4v-4h4z",fill:"currentColor"},null,-1),r("path",{d:"M18 18h-.01a1 1 0 0 1-.951-.725L15.246 11H11V9h5a1 1 0 0 1 .962.725l1.074 3.76l3.009-9.78A1.014 1.014 0 0 1 22 3a.98.98 0 0 1 .949.684L24.72 9H30v2h-6a1 1 0 0 1-.949-.684l-1.013-3.04l-3.082 10.018A1 1 0 0 1 18 18z",fill:"currentColor"},null,-1)]))}}),v={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},e=a({name:"Flow",render:function(a,t){return n(),l("svg",v,t[0]||(t[0]=[r("path",{d:"M27 22.14V17a2 2 0 0 0-2-2h-8V9.86a4 4 0 1 0-2 0V15H7a2 2 0 0 0-2 2v5.14a4 4 0 1 0 2 0V17h18v5.14a4 4 0 1 0 2 0zM8 26a2 2 0 1 1-2-2a2 2 0 0 1 2 2zm6-20a2 2 0 1 1 2 2a2 2 0 0 1-2-2zm12 22a2 2 0 1 1 2-2a2 2 0 0 1-2 2z",fill:"currentColor"},null,-1)]))}});export{o as C,e as F,w as a};

View File

@ -1 +1 @@
import{d as c,E as n,F as r,G as t}from"./main-B314ly27.js";const o={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},s=c({name:"LockOutlined",render:function(c,s){return r(),n("svg",o,s[0]||(s[0]=[t("path",{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 1 0-56 0z",fill:"currentColor"},null,-1)]))}});export{s as L};
import{d as c,E as n,F as r,G as t}from"./main-DgoEun3x.js";const o={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},s=c({name:"LockOutlined",render:function(c,s){return r(),n("svg",o,s[0]||(s[0]=[t("path",{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 1 0-56 0z",fill:"currentColor"},null,-1)]))}});export{s as L};

View File

@ -1 +1 @@
import{d as l,E as n,F as r,G as t}from"./main-B314ly27.js";const o={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},s=l({name:"PlusOutlined",render:function(l,s){return r(),n("svg",o,s[0]||(s[0]=[t("defs",null,null,-1),t("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z",fill:"currentColor"},null,-1),t("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z",fill:"currentColor"},null,-1)]))}}),w={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},e=l({name:"Search",render:function(l,o){return r(),n("svg",w,o[0]||(o[0]=[t("path",{d:"M29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29zM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9z",fill:"currentColor"},null,-1)]))}});export{s as P,e as S};
import{d as l,E as n,F as r,G as t}from"./main-DgoEun3x.js";const o={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},s=l({name:"PlusOutlined",render:function(l,s){return r(),n("svg",o,s[0]||(s[0]=[t("defs",null,null,-1),t("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z",fill:"currentColor"},null,-1),t("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z",fill:"currentColor"},null,-1)]))}}),w={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},e=l({name:"Search",render:function(l,o){return r(),n("svg",w,o[0]||(o[0]=[t("path",{d:"M29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29zM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9z",fill:"currentColor"},null,-1)]))}});export{s as P,e as S};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{c as s}from"./index-4UwdEH-y.js";const c=c=>s("/v1/access/get_list",c),a=c=>s("/v1/access/add_access",c),e=c=>s("/v1/access/upd_access",c),d=c=>s("/v1/access/del_access",c),t=c=>s("/v1/access/get_all",c);export{a,t as b,d,c as g,e as u};
import{c as s}from"./index-3CAadC9a.js";const c=c=>s("/v1/access/get_list",c),a=c=>s("/v1/access/add_access",c),e=c=>s("/v1/access/upd_access",c),d=c=>s("/v1/access/del_access",c),t=c=>s("/v1/access/get_all",c);export{a,t as b,d,c as g,e as u};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{bb as $,bm as a,bY as t,bo as n,bv as s,bq as r}from"./main-B314ly27.js";import{d as e,t as o,c as f}from"./test-BoDPkCFc.js";var A=$((function($,n){return a($+1,(function(){var a=arguments[$];if(null!=a&&t(a[n]))return a[n].apply(a,Array.prototype.slice.call(arguments,0,$));throw new TypeError(e(a)+' does not have a method named "'+n+'"')}))}))(1,"split");const p="(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])",z=new RegExp(`^${p}\\.${p}\\.${p}\\.${p}$`),Z="[0-9A-Fa-f]{1,4}",u=new RegExp([`^(${Z}:){7}${Z}$`,`^(${Z}:){1,7}:$`,"^:((:[0-9A-Fa-f]{1,4}){1,7}|:)$",`^(${Z}:){1,6}:${Z}$`,`^(${Z}:){1,5}(:${Z}){1,2}$`,`^(${Z}:){1,4}(:${Z}){1,3}$`,`^(${Z}:){1,3}(:${Z}){1,4}$`,`^(${Z}:){1,2}(:${Z}){1,5}$`,`^${Z}:(:${Z}){1,6}$`,"^fe80:(:[0-9A-Fa-f]{1,4}){0,4}%[0-9A-Za-z]{1,}$",`^::((ffff(:0{1,4})?:)?${p}\\.${p}\\.${p}\\.${p})$`,`^(${Z}:){1,4}:${p}\\.${p}\\.${p}\\.${p}$`].join("|")),d=new RegExp(`^${p}\\.${p}\\.${p}\\.${p}(\\/([1-2][0-9]|3[0-2]|[1-9]))?$`),i=o(/^[^\s@]+@[^\s@]+\.[^\s@]+$/);o(/^1[3-9]\d{9}$/),o(/^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/);const c=o(/^((https|http|ftp|rtsp|mms)?:\/\/)[^\s]+/),m=o(z),l=o(u),b=$=>m($)||l($);o(d);const h=o(/^([1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/);o(/^([0-9A-Fa-f]{2}-){5}[0-9A-Fa-f]{2}$/),o(/^[\u4e00-\u9fa5]+$/);const x=o(/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/),B=o(/^(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)|(?:\*))\.)+(?:[a-zA-Z\u00a1-\uffff]{2,}|xn--[a-zA-Z0-9]+)$/),F=o(/^\*\.(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/),g=($,a=",")=>f(s(!0),r(($=>x($)||F($)||B($)),A(a,$)));n((($,a=2,t=!0,n="")=>{if(0===$)return t?"0 B":"0";const s=["B","KB","MB","GB","TB"],r=($,e)=>{const o=s[e],f=0===e||0===a?Math.round($).toString():$.toFixed(a);return n&&o===n||$<1024||e>=s.length-1?t?`${f} ${o}`:f:r($/1024,e+1)};return r($,0)}));export{h as H,x as N,b as O,c as T,g as W,i as w};
import{bb as $,bm as a,bY as t,bo as n,bv as s,bq as r}from"./main-DgoEun3x.js";import{d as e,t as o,c as f}from"./test-Cmp6LhDc.js";var A=$((function($,n){return a($+1,(function(){var a=arguments[$];if(null!=a&&t(a[n]))return a[n].apply(a,Array.prototype.slice.call(arguments,0,$));throw new TypeError(e(a)+' does not have a method named "'+n+'"')}))}))(1,"split");const p="(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])",z=new RegExp(`^${p}\\.${p}\\.${p}\\.${p}$`),Z="[0-9A-Fa-f]{1,4}",u=new RegExp([`^(${Z}:){7}${Z}$`,`^(${Z}:){1,7}:$`,"^:((:[0-9A-Fa-f]{1,4}){1,7}|:)$",`^(${Z}:){1,6}:${Z}$`,`^(${Z}:){1,5}(:${Z}){1,2}$`,`^(${Z}:){1,4}(:${Z}){1,3}$`,`^(${Z}:){1,3}(:${Z}){1,4}$`,`^(${Z}:){1,2}(:${Z}){1,5}$`,`^${Z}:(:${Z}){1,6}$`,"^fe80:(:[0-9A-Fa-f]{1,4}){0,4}%[0-9A-Za-z]{1,}$",`^::((ffff(:0{1,4})?:)?${p}\\.${p}\\.${p}\\.${p})$`,`^(${Z}:){1,4}:${p}\\.${p}\\.${p}\\.${p}$`].join("|")),d=new RegExp(`^${p}\\.${p}\\.${p}\\.${p}(\\/([1-2][0-9]|3[0-2]|[1-9]))?$`),i=o(/^[^\s@]+@[^\s@]+\.[^\s@]+$/);o(/^1[3-9]\d{9}$/),o(/^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/);const c=o(/^((https|http|ftp|rtsp|mms)?:\/\/)[^\s]+/),m=o(z),l=o(u),b=$=>m($)||l($);o(d);const h=o(/^([1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/);o(/^([0-9A-Fa-f]{2}-){5}[0-9A-Fa-f]{2}$/),o(/^[\u4e00-\u9fa5]+$/);const x=o(/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/),B=o(/^(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)|(?:\*))\.)+(?:[a-zA-Z\u00a1-\uffff]{2,}|xn--[a-zA-Z0-9]+)$/),F=o(/^\*\.(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/),g=($,a=",")=>f(s(!0),r(($=>x($)||F($)||B($)),A(a,$)));n((($,a=2,t=!0,n="")=>{if(0===$)return t?"0 B":"0";const s=["B","KB","MB","GB","TB"],r=($,e)=>{const o=s[e],f=0===e||0===a?Math.round($).toString():$.toFixed(a);return n&&o===n||$<1024||e>=s.length-1?t?`${f} ${o}`:f:r($/1024,e+1)};return r($,0)}));export{h as H,x as N,b as O,c as T,g as W,i as w};

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{d as e,bW as a,m as o,$ as r,x as t,y as s,c as d}from"./main-B314ly27.js";import{u as i}from"./index-BLs5ik22.js";import{u as l}from"./index-4UwdEH-y.js";import{r as n}from"./verify-B9e1eJYi.js";import"./index-BK07zJJ4.js";import"./test-BoDPkCFc.js";import"./useStore--US7DZf4.js";const p=e({name:"UploadNodeDrawer",props:{node:{type:Object,default:()=>({id:"",config:{cert:"",key:""}})}},setup(e){const{updateNodeConfig:p,isRefreshNode:m}=i(),{useFormTextarea:c}=o(),{config:u}=a(e.node),{confirm:f}=s(),{handleError:j}=l(),v=[c(r("t_34_1745735771147"),"cert",{placeholder:r("t_35_1745735781545"),rows:6}),c(r("t_36_1745735769443"),"key",{placeholder:r("t_37_1745735779980"),rows:6})],{component:y,data:_,example:x}=t({defaultValue:u,config:v,rules:n});return f((async a=>{var o;try{await(null==(o=x.value)?void 0:o.validate()),p(e.node.id,_.value),m.value=e.node.id,a()}catch(r){j(r)}})),()=>d("div",{class:"upload-node-drawer"},[d(y,{labelPlacement:"top"},null)])}});export{p as default};

View File

@ -0,0 +1 @@
import{d as e,r as o,m as r,$ as t,c as a,x as i,y as s}from"./main-DgoEun3x.js";import{u as d,k as p}from"./index-s5K8pvah.js";import{u as n}from"./index-3CAadC9a.js";import{N as u}from"./index-adDhPfp5.js";import{r as l}from"./verify-Bueng0xn.js";import"./index-D2WxTH-g.js";import"./test-Cmp6LhDc.js";import"./useStore-Hl7-SEU7.js";import"./useStore-h2Wsbe9z.js";import"./setting-D80_Gwwn.js";import"./index-SPRAkzSU.js";import"./index-DGjzZLqK.js";import"./access-CoJ081t2.js";import"./Flex-CSUicabw.js";import"./text-YkLLgUfR.js";const m=e({name:"NotifyNodeDrawer",props:{node:{type:Object,default:()=>({id:"",config:{provider:"",provider_id:"",subject:"",body:""}})}},setup(e){const{updateNodeConfig:m,isRefreshNode:v}=d(),{useFormInput:c,useFormTextarea:j,useFormCustom:f}=r(),{confirm:x}=s(),{handleError:y}=n(),_=o(p(e.node.config)),b=[c(t("t_0_1745920566646"),"subject",{placeholder:t("t_3_1745887835089"),onInput:e=>_.value.subject=e.trim()}),j(t("t_1_1745920567200"),"body",{placeholder:t("t_4_1745887835265"),rows:4,onInput:e=>_.value.body=e.trim()}),f((()=>a(u,{path:"provider_id",value:_.value.provider_id,isAddMode:!0,"onUpdate:value":e=>{_.value.provider_id=e.value,_.value.provider=e.type}},null)))],{component:h,data:g,example:w}=i({defaultValue:_,config:b,rules:l});return x((async o=>{var r;try{await(null==(r=w.value)?void 0:r.validate()),m(e.node.id,g.value),v.value=e.node.id,o()}catch(t){y(t)}})),()=>a("div",{class:"notify-node-drawer"},[a(h,{labelPlacement:"top"},null)])}});export{m as default};

View File

@ -0,0 +1 @@
import{d as e,r as a,l as t,m as o,$ as r,c as s,bJ as i,p as d,x as l,y as p}from"./main-DgoEun3x.js";import{u as n,k as m}from"./index-s5K8pvah.js";import{r as u}from"./verify-BoGAZfCx.js";import{D as v}from"./index-CHxIB52g.js";import"./index-D2WxTH-g.js";import"./index-3CAadC9a.js";import"./test-Cmp6LhDc.js";import"./useStore-Hl7-SEU7.js";import"./business-tY96d-Pv.js";import"./useStore-h2Wsbe9z.js";import"./setting-D80_Gwwn.js";import"./index-SPRAkzSU.js";import"./index-DGjzZLqK.js";import"./access-CoJ081t2.js";import"./text-YkLLgUfR.js";import"./Flex-CSUicabw.js";const c=e({name:"ApplyNodeDrawer",props:{node:{type:Object,default:()=>({id:"",config:{domains:"",email:"",provider_id:"",provider:"",end_day:30}})}},setup(e){const{updateNodeConfig:c,isRefreshNode:_}=n(),{confirm:j}=p(),{useFormInput:y}=o(),f=a(m(e.node.config)),x=t((()=>[y(r("t_17_1745227838561"),"domains",{placeholder:r("t_0_1745735774005"),onInput:e=>f.value.domains=e.trim()}),y(r("t_1_1745735764953"),"email",{placeholder:r("t_2_1745735773668"),onInput:e=>f.value.email=e.trim()}),{type:"custom",render:()=>s(v,{type:"dns",path:"provider_id",value:f.value.provider_id,"onUpdate:value":e=>{f.value.provider_id=e.value,f.value.provider=e.type}},null)},{type:"custom",render:()=>s(d,{label:r("t_5_1745735769112"),path:"end_day"},{default:()=>[s(i,{value:f.value.end_day,"onUpdate:value":e=>f.value.end_day=e,showButton:!1,min:1,class:"w-[180px]",placeholder:r("t_6_1745735765205")},null),s("span",{class:"text-[1.4rem] ml-[1.2rem]"},[r("t_7_1745735768326")])]})}])),{component:h,data:w,example:b}=l({defaultValue:f,config:x,rules:u});return j((async a=>{var t;try{await(null==(t=b.value)?void 0:t.validate()),c(e.node.id,w.value),_.value=e.node.id,a()}catch(o){}})),()=>s("div",{class:"apply-node-drawer"},[s(h,{labelPlacement:"top"},null)])}});export{c as default};

View File

@ -1 +0,0 @@
import{d as e,r as a,l as t,m as o,$ as s,c as r,bJ as d,p as i,x as l,y as p}from"./main-B314ly27.js";import{u as n}from"./index-BLs5ik22.js";import{r as m}from"./verify-Dn31Klc9.js";import{D as u}from"./index-BXuU4VQs.js";import"./index-BK07zJJ4.js";import"./index-4UwdEH-y.js";import"./test-BoDPkCFc.js";import"./useStore--US7DZf4.js";import"./business-IbhWuk4D.js";import"./useStore-CV1u1a79.js";import"./setting-DTfi4FsX.js";import"./index-D38oPCl9.js";import"./index-CGwbFRdP.js";import"./access-Xfq3ZYcU.js";import"./Flex-DGUi9d1R.js";import"./text-BFHLoHa1.js";const c=e({name:"ApplyNodeDrawer",props:{node:{type:Object,default:()=>({id:"",config:{}})}},setup(e){const{updateNodeConfig:c,isRefreshNode:v}=n(),{confirm:_}=p(),{useFormInput:j}=o(),y=a(Object.keys(e.node.config).length>0?e.node.config:{domains:"",email:"",provider_id:"",provider:"",end_day:30}),f=t((()=>[j(s("t_17_1745227838561"),"domains",{placeholder:s("t_0_1745735774005")}),j(s("t_1_1745735764953"),"email",{placeholder:s("t_2_1745735773668")}),{type:"custom",render:()=>r(u,{type:"dns",path:"provider_id",value:y.value.provider_id,"onUpdate:value":e=>{y.value.provider_id=e.value,y.value.provider=e.type}},null)},{type:"custom",render:()=>r(i,{label:s("t_5_1745735769112"),path:"end_day"},{default:()=>[r(d,{value:y.value.end_day,"onUpdate:value":e=>y.value.end_day=e,showButton:!1,min:1,class:"w-[180px]",placeholder:s("t_6_1745735765205")},null),r("span",{class:"text-[1.4rem] ml-[1.2rem]"},[s("t_7_1745735768326")])]})}])),{component:x,data:h,example:g}=l({defaultValue:y,config:f,rules:m});return _((async a=>{var t;try{await(null==(t=g.value)?void 0:t.validate()),c(e.node.id,h.value),v.value=e.node.id,a()}catch(o){}})),()=>r("div",{class:"apply-node-drawer"},[r(x,{labelPlacement:"top"},null)])}});export{c as default};

View File

@ -0,0 +1 @@
import{d as e,r as a,m as o,$ as r,x as t,y as s,c as d}from"./main-DgoEun3x.js";import{u as n,k as i}from"./index-s5K8pvah.js";import{u as l}from"./index-3CAadC9a.js";import{r as p}from"./verify-B3hYWrZq.js";import"./index-D2WxTH-g.js";import"./test-Cmp6LhDc.js";import"./useStore-Hl7-SEU7.js";const u=e({name:"UploadNodeDrawer",props:{node:{type:Object,default:()=>({id:"",config:{cert:"",key:""}})}},setup(e){const{updateNodeConfig:u,isRefreshNode:m}=n(),{useFormTextarea:c}=o(),f=a(i(e.node.config)),{confirm:v}=s(),{handleError:y}=l(),j=[c(r("t_34_1745735771147"),"cert",{placeholder:r("t_35_1745735781545"),rows:6,onInput:e=>f.value.cert=e.trim()}),c(r("t_36_1745735769443"),"key",{placeholder:r("t_37_1745735779980"),rows:6,onInput:e=>f.value.key=e.trim()})],{component:_,data:x,example:h}=t({defaultValue:f,config:j,rules:p});return v((async a=>{var o;try{await(null==(o=h.value)?void 0:o.validate()),u(e.node.id,x.value),m.value=e.node.id,a()}catch(r){y(r)}})),()=>d("div",{class:"upload-node-drawer"},[d(_,{labelPlacement:"top"},null)])}});export{u as default};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{Q as e,Z as a,d as l,z as t,U as o,A as n,bW as r,l as u,aE as s,X as i,r as d,$ as p,m as v,c as b,q as c,n as m,v as h,x as _,w as f,y,bJ as g,bX as x,i as w}from"./main-DgoEun3x.js";import{u as k,k as z}from"./index-s5K8pvah.js";import{r as j}from"./verify-CYWrSAfB.js";import{u as C}from"./index-3CAadC9a.js";import"./index-D2WxTH-g.js";import"./test-Cmp6LhDc.js";import"./useStore-Hl7-SEU7.js";const R=e("input-group-label","\n position: relative;\n user-select: none;\n -webkit-user-select: none;\n box-sizing: border-box;\n padding: 0 12px;\n display: inline-block;\n border-radius: var(--n-border-radius);\n background-color: var(--n-group-label-color);\n color: var(--n-group-label-text-color);\n font-size: var(--n-font-size);\n line-height: var(--n-height);\n height: var(--n-height);\n flex-shrink: 0;\n white-space: nowrap;\n transition: \n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n",[a("border","\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n border-radius: inherit;\n border: var(--n-group-label-border);\n transition: border-color .3s var(--n-bezier);\n ")]),B=l({name:"InputGroupLabel",props:Object.assign(Object.assign({},n.props),{size:{type:String,default:"medium"},bordered:{type:Boolean,default:void 0}}),setup(e){const{mergedBorderedRef:a,mergedClsPrefixRef:l,inlineThemeDisabled:t}=o(e),d=n("Input","-input-group-label",R,r,e,l),p=u((()=>{const{size:a}=e,{common:{cubicBezierEaseInOut:l},self:{groupLabelColor:t,borderRadius:o,groupLabelTextColor:n,lineHeight:r,groupLabelBorder:u,[s("fontSize",a)]:i,[s("height",a)]:p}}=d.value;return{"--n-bezier":l,"--n-group-label-color":t,"--n-group-label-border":u,"--n-border-radius":o,"--n-group-label-text-color":n,"--n-font-size":i,"--n-line-height":r,"--n-height":p}})),v=t?i("input-group-label",u((()=>e.size[0])),p,e):void 0;return{mergedClsPrefix:l,mergedBordered:a,cssVars:t?void 0:p,themeClass:null==v?void 0:v.themeClass,onRender:null==v?void 0:v.onRender}},render(){var e,a,l;const{mergedClsPrefix:o}=this;return null===(e=this.onRender)||void 0===e||e.call(this),t("div",{class:[`${o}-input-group-label`,this.themeClass],style:this.cssVars},null===(l=(a=this.$slots).default)||void 0===l?void 0:l.call(a),this.mergedBordered?t("div",{class:`${o}-input-group-label__border`}):null)}});function O(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!w(e)}const S=l({name:"StartNodeDrawer",props:{node:{type:Object,default:()=>({id:"",config:{exec_type:"auto"}})}},setup(e){const{updateNodeConfig:a,isRefreshNode:l}=k(),{confirm:t}=y(),{handleError:o}=C(),{useFormRadio:n,useFormCustom:r}=v(),s=d(z(e.node.config)),i=[{label:p("t_2_1744875938555"),value:"day"},{label:p("t_0_1744942117992"),value:"week"},{label:p("t_3_1744875938310"),value:"month"}],w=[{label:p("t_1_1744942116527"),value:1},{label:p("t_2_1744942117890"),value:2},{label:p("t_3_1744942117885"),value:3},{label:p("t_4_1744942117738"),value:4},{label:p("t_5_1744942117167"),value:5},{label:p("t_6_1744942117815"),value:6},{label:p("t_7_1744942117862"),value:0}],R={day:{exec_type:"auto",type:"day",hour:1,minute:0},week:{exec_type:"auto",type:"week",hour:1,minute:0,week:1},month:{exec_type:"auto",type:"month",hour:1,minute:0,month:1}},S=(e,a,l,t)=>b(x,null,{default:()=>[b(g,{value:e,onUpdateValue:e=>{null!==e&&a(e)},max:l,min:0,showButton:!1,class:"w-full"},null),b(B,null,O(t)?t:{default:()=>[t]})]}),V=u((()=>{const e=[];return"auto"===s.value.exec_type&&e.push(r((()=>{let e,a;return b(h,{cols:24,xGap:24},{default:()=>[b(c,{label:p("t_2_1744879616413"),span:8,showRequireMark:!0,path:"type"},{default:()=>[b(m,{class:"w-full",options:i,value:s.value.type,"onUpdate:value":e=>s.value.type=e},null)]}),"day"!==s.value.type&&b(c,{span:5,path:"week"===s.value.type?"week":"month"},{default:()=>["week"===s.value.type?b(m,{value:s.value.week,onUpdateValue:e=>{"number"==typeof e&&(s.value.week=e)},options:w},null):S(s.value.month||0,(e=>s.value.month=e),31,p("t_29_1744958838904"))]}),b(c,{span:"day"===s.value.type?7:5,path:"hour"},O(e=S(s.value.hour||0,(e=>s.value.hour=e),23,p("t_5_1744879615277")))?e:{default:()=>[e]}),b(c,{span:"day"===s.value.type?7:5,path:"minute"},O(a=S(s.value.minute||0,(e=>s.value.minute=e),59,p("t_3_1744879615723")))?a:{default:()=>[a]})]})}))),[n(p("t_30_1745735764748"),"exec_type",[{label:p("t_4_1744875940750"),value:"auto"},{label:p("t_5_1744875940010"),value:"manual"}]),...e]})),{component:L,data:P,example:U}=_({defaultValue:s,config:V,rules:j}),$=e=>{s.value={...e}};return f((()=>s.value.exec_type),(e=>{"auto"===e?$(R.day):"manual"===e&&$({exec_type:"manual"})})),f((()=>s.value.type),(e=>{e&&"auto"===s.value.exec_type&&$(R[e])})),t((async t=>{var n;try{await(null==(n=U.value)?void 0:n.validate()),a(e.node.id,P.value),l.value=e.node.id,t()}catch(r){o(r)}})),()=>b("div",{class:"apply-node-drawer"},[b(L,{labelPlacement:"top"},null)])}});export{S as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{d as e,r as o,m as r,$ as t,c as i,x as s,y as a}from"./main-B314ly27.js";import{u as d}from"./index-BLs5ik22.js";import{u as p}from"./index-4UwdEH-y.js";import{N as n}from"./index-CcyyJ-qU.js";import{r as l}from"./verify-D5iDiGwg.js";import"./index-BK07zJJ4.js";import"./test-BoDPkCFc.js";import"./useStore--US7DZf4.js";import"./useStore-CV1u1a79.js";import"./setting-DTfi4FsX.js";import"./index-D38oPCl9.js";import"./index-CGwbFRdP.js";import"./access-Xfq3ZYcU.js";import"./Flex-DGUi9d1R.js";import"./text-BFHLoHa1.js";const u=e({name:"NotifyNodeDrawer",props:{node:{type:Object,default:()=>({id:"",config:{provider:"",provider_id:"",subject:"",body:""}})}},setup(e){const{updateNodeConfig:u,isRefreshNode:m}=d(),{useFormInput:c,useFormTextarea:v,useFormCustom:j}=r(),{confirm:f}=a(),{handleError:y}=p(),_=o(Object.keys(e.node.config).length>0?e.node.config:{provider:"",provider_id:"",subject:"",body:""}),x=[c(t("t_0_1745920566646"),"subject",{placeholder:t("t_3_1745887835089")}),v(t("t_1_1745920567200"),"body",{placeholder:t("t_4_1745887835265"),rows:4}),j((()=>i(n,{path:"provider_id",value:_.value.provider_id,isAddMode:!0,"onUpdate:value":e=>{_.value.provider_id=e.value,_.value.provider=e.type}},null)))],{component:b,data:g,example:h}=s({defaultValue:_,config:x,rules:l});return f((async o=>{var r;try{await(null==(r=h.value)?void 0:r.validate()),u(e.node.id,g.value),m.value=e.node.id,o()}catch(t){y(t)}})),()=>i("div",{class:"notify-node-drawer"},[i(b,{labelPlacement:"top"},null)])}});export{u as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{S as e}from"./index-BK07zJJ4.js";import{N as n}from"./text-BFHLoHa1.js";import{d as t,l,w as a,c as o,N as i}from"./main-B314ly27.js";const s={ssh:"SSH",aliyun:"阿里云",tencentcloud:"腾讯云",btpanel:"宝塔面板","1panel":"1Panel",mail:"邮件",dingtalk:"钉钉",wecom:"企业微信",feishu:"飞书",webhook:"WebHook","tencentcloud-cdn":"腾讯云CDN","tencentcloud-cos":"腾讯云COS","aliyun-cdn":"阿里云CDN","aliyun-oss":"阿里云OSS","1panel-site":"1Panel网站","btpanel-site":"宝塔面板网站"},c=t({name:"TypeIcon",props:{icon:{type:String,required:!0},type:{type:String,default:"default"},align:{type:String,default:"left"},text:{type:Boolean,default:!0}},setup(t){const c=l((()=>(["mail","dingtalk","wecom","feishu","webhook"].includes(t.icon)?"notify-":"resources-")+({ssh:"ssh",aliyun:"aliyun",tencentcloud:"tencentcloud",btpanel:"btpanel","1panel":"1panel",mail:"mail",dingtalk:"dingtalk",wecom:"wecom",feishu:"feishu",webhook:"webhook","tencentcloud-cdn":"tencentcloud","tencentcloud-cos":"tencentcloud","aliyun-cdn":"aliyun","aliyun-oss":"aliyun","1panel-site":"1panel","btpanel-site":"btpanel"}[t.icon]||"default"))),u=l((()=>s[t.icon]||t.icon));return a((()=>t.icon),(e=>{})),a((()=>t.type),(e=>{})),()=>o(i,{bordered:!1,class:"cursor-pointer",type:t.type},{default:()=>[o(n,{class:"text-[12px]"},{default:()=>[t.text&&o("span",null,[u.value])]})],avatar:()=>o(e,{icon:c.value,size:"1.4rem"},null)})}});export{c as A};

View File

@ -0,0 +1 @@
import{S as e}from"./index-D2WxTH-g.js";import{d as n,l as t,w as l,c as a,N as o}from"./main-DgoEun3x.js";const i={ssh:"SSH",aliyun:"阿里云",tencentcloud:"腾讯云",btpanel:"宝塔面板","1panel":"1Panel",mail:"邮件",dingtalk:"钉钉",wecom:"企业微信",feishu:"飞书",webhook:"WebHook","tencentcloud-cdn":"腾讯云CDN","tencentcloud-cos":"腾讯云COS","aliyun-cdn":"阿里云CDN","aliyun-oss":"阿里云OSS","1panel-site":"1Panel网站","btpanel-site":"宝塔面板网站"},s=n({name:"TypeIcon",props:{icon:{type:String,required:!0},type:{type:String,default:"default"},align:{type:String,default:"left"},text:{type:Boolean,default:!0}},setup(n){const s=t((()=>(["mail","dingtalk","wecom","feishu","webhook"].includes(n.icon)?"notify-":"resources-")+({ssh:"ssh",aliyun:"aliyun",tencentcloud:"tencentcloud",btpanel:"btpanel","1panel":"1panel",mail:"mail",dingtalk:"dingtalk",wecom:"wecom",feishu:"feishu",webhook:"webhook","tencentcloud-cdn":"tencentcloud","tencentcloud-cos":"tencentcloud","aliyun-cdn":"aliyun","aliyun-oss":"aliyun","1panel-site":"1panel","btpanel-site":"btpanel"}[n.icon]||"default"))),c=t((()=>i[n.icon]||n.icon));return l((()=>n.icon),(e=>{})),l((()=>n.type),(e=>{})),()=>a(o,{type:n.type,size:"small"},{default:()=>[a(e,{icon:s.value,size:"1.2rem",class:"mr-[0.4rem]"},null),a("span",{class:"text-[12px]"},[n.text&&a("span",null,[c.value])])]})}});export{s as A};

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{u as e,N as l}from"./index-4UwdEH-y.js";import{d as a,r as t,w as u,c as s,v as d,q as n,$ as o,n as p,B as r,i as v}from"./main-B314ly27.js";import{u as i}from"./useStore-CV1u1a79.js";import{S as y}from"./index-BK07zJJ4.js";import{N as f}from"./Flex-DGUi9d1R.js";import{N as c}from"./text-BFHLoHa1.js";const m=a({name:"DnsProviderSelect",props:{type:{type:String,default:""},path:{type:String,default:""},value:{type:String,default:""},valueType:{type:String,default:"value"},isAddMode:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""}},emits:["update:value"],setup(a,{emit:m}){const{handleError:b}=e(),{fetchDnsProvider:_,dnsProvider:g}=i(),h=t({label:"",value:"",type:""}),x=t([]),j=t(!1),S=t(""),w=()=>{window.open("/auth-api-manage","_blank")},C=({option:e})=>s("div",{class:"flex items-center"},[e.label?s(f,null,{default:()=>[s(y,{icon:`resources-${e.type}`,size:"2rem"},null),s(c,null,{default:()=>[e.label]})]}):s(c,null,{default:()=>["dns"===a.type?o("t_3_1745490735059"):o("t_19_1745735766810")]})]),T=e=>s(f,null,{default:()=>[s(y,{icon:`resources-${e.type}`,size:"2rem"},null),s(c,null,{default:()=>[e.label]})]}),k=async()=>{var e,l,a;const t=g.value.find((e=>e.value===h.value.value));t&&(h.value={label:t.label,value:t.value,type:t.type}),g.value.length>0&&""===h.value.value&&(h.value={label:(null==(e=g.value[0])?void 0:e.label)||"",value:(null==(l=g.value[0])?void 0:l.value)||"",type:(null==(a=g.value[0])?void 0:a.type)||""}),m("update:value",h.value)},A=e=>{h.value.value=e,k()},B=async(e="")=>{j.value=!0,S.value="";try{await _(e)}catch(l){S.value="string"==typeof l?l:o("t_0_1746760933542"),b(l)}finally{j.value=!1}},D=(e,l)=>l.label.toLowerCase().includes(e.toLowerCase());return u((()=>g.value),(e=>{x.value=e.map((e=>({label:e.label,value:"value"===a.valueType?e.value:e.type,type:"value"===a.valueType?e.type:e.value})))||[],k()})),u((()=>a.value),(()=>{B(a.type),A(a.value)}),{immediate:!0}),()=>{let e;return s(l,{show:j.value},{default:()=>[s(d,{cols:24,class:a.customClass},{default:()=>[s(n,{span:a.isAddMode?13:24,label:"dns"===a.type?o("t_3_1745735765112"):o("t_0_1745744902975"),path:a.path},{default:()=>[s(p,{class:"flex-1 w-full",options:x.value,renderLabel:T,renderTag:C,filterable:!0,filter:D,placeholder:"dns"===a.type?o("t_3_1745490735059"):o("t_1_1745744905566"),value:h.value.value,"onUpdate:value":e=>h.value.value=e,onUpdateValue:A,disabled:a.disabled},{empty:()=>s("span",{class:"text-[1.4rem]"},[S.value||("dns"===a.type?o("t_3_1745490735059"):o("t_1_1745744905566"))])})]}),a.isAddMode&&s(n,{span:11},{default:()=>{return[s(r,{class:"mx-[8px]",onClick:w,disabled:a.disabled},{default:()=>["dns"===a.type?o("t_1_1746004861166"):o("t_0_1745748292337")]}),s(r,{onClick:()=>B(a.type),loading:j.value,disabled:a.disabled},(l=e=o("t_0_1746497662220"),"function"==typeof l||"[object Object]"===Object.prototype.toString.call(l)&&!v(l)?e:{default:()=>[e]}))];var l}})]})]})}}});export{m as D};

View File

@ -1 +1 @@
import{d as e,u as t,a as o,c as r,b as l,$ as a,B as s,i as n}from"./main-B314ly27.js";const c=(e=16,t="var(--n-warning-color)")=>r("svg",{width:e,height:e,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:t},[r("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6zM7.9 7.5L10.3 5l.7.7-2.4 2.5 2.4 2.5-.7.7-2.4-2.5-2.4 2.5-.7-.7 2.4-2.5-2.4-2.5.7-.7 2.4 2.5z"},null)]),i=e({setup(){const e=t(),i=o(["cardColor","warningColor","textColorSecondary","textColorDisabled","textColorInverse","warningColorHover"]);return()=>{let t;return r("div",{class:"flex flex-col items-center justify-center min-h-screen",style:i.value},[r("div",{class:"text-center px-8 max-w-[60rem] mx-auto"},[r("div",{class:"text-[8rem] font-bold leading-none mb-4",style:{color:"var(--n-warning-color)",textShadow:"2px 2px 4px rgba(0, 0, 0, 0.1)"}},[l("404")]),r("div",{class:"flex items-center justify-center mb-8"},[c(60)]),r("div",{class:"text-[1.8rem] mb-8",style:{color:"var(--n-text-color-secondary)"}},[a("t_0_1744098811152")]),r(s,{type:"warning",onClick:()=>e.push("/")},(o=t=a("t_1_1744098801860"),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!n(o)?t:{default:()=>[t]})),r("div",{class:"mt-8 text-[1.3rem]",style:{color:"var(--n-text-color-disabled)"}},[a("t_2_1744098804908")])])]);var o}}});export{i as default};
import{d as e,u as t,a as o,c as r,b as l,$ as a,B as s,i as n}from"./main-DgoEun3x.js";const c=(e=16,t="var(--n-warning-color)")=>r("svg",{width:e,height:e,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:t},[r("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6zM7.9 7.5L10.3 5l.7.7-2.4 2.5 2.4 2.5-.7.7-2.4-2.5-2.4 2.5-.7-.7 2.4-2.5-2.4-2.5.7-.7 2.4 2.5z"},null)]),i=e({setup(){const e=t(),i=o(["cardColor","warningColor","textColorSecondary","textColorDisabled","textColorInverse","warningColorHover"]);return()=>{let t;return r("div",{class:"flex flex-col items-center justify-center min-h-screen",style:i.value},[r("div",{class:"text-center px-8 max-w-[60rem] mx-auto"},[r("div",{class:"text-[8rem] font-bold leading-none mb-4",style:{color:"var(--n-warning-color)",textShadow:"2px 2px 4px rgba(0, 0, 0, 0.1)"}},[l("404")]),r("div",{class:"flex items-center justify-center mb-8"},[c(60)]),r("div",{class:"text-[1.8rem] mb-8",style:{color:"var(--n-text-color-secondary)"}},[a("t_0_1744098811152")]),r(s,{type:"warning",onClick:()=>e.push("/")},(o=t=a("t_1_1744098801860"),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!n(o)?t:{default:()=>[t]})),r("div",{class:"mt-8 text-[1.3rem]",style:{color:"var(--n-text-color-disabled)"}},[a("t_2_1744098804908")])])]);var o}}});export{i as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{u as a,a as e}from"./index-BLs5ik22.js";import{r as o}from"./verify-B9e1eJYi.js";import{d as r,a as i,l as s,w as t,aL as d,c as l}from"./main-B314ly27.js";import{u as n}from"./index-CGwbFRdP.js";import"./index-BK07zJJ4.js";import"./index-4UwdEH-y.js";import"./test-BoDPkCFc.js";import"./useStore--US7DZf4.js";const m=r({name:"UploadNode",props:{node:{type:Object,default:()=>({id:"",config:{}})}},setup(r){const{isRefreshNode:m}=a(),{validate:p,validationResult:u,registerCompatValidator:v,unregisterValidator:c}=e(),f=i(["warningColor","primaryColor"]),j=s((()=>u.value.valid?"var(--n-primary-color)":"var(--n-warning-color)")),x=s((()=>u.value.valid?"已配置":"未配置"));return t((()=>m.value),(a=>{n((()=>{v(r.node.id,o,r.node.config),p(r.node.id),m.value=null}),500)}),{immediate:!0}),d((()=>c(r.node.id))),()=>l("div",{style:f.value,class:"text-[12px]"},[l("div",{style:{color:j.value}},[x.value])])}});export{m as default};
import{u as a,a as e}from"./index-s5K8pvah.js";import{r as o}from"./verify-B3hYWrZq.js";import{d as r,a as i,l as s,w as t,aL as d,c as l}from"./main-DgoEun3x.js";import{u as n}from"./index-DGjzZLqK.js";import"./index-D2WxTH-g.js";import"./index-3CAadC9a.js";import"./test-Cmp6LhDc.js";import"./useStore-Hl7-SEU7.js";const m=r({name:"UploadNode",props:{node:{type:Object,default:()=>({id:"",config:{}})}},setup(r){const{isRefreshNode:m}=a(),{validate:p,validationResult:u,registerCompatValidator:v,unregisterValidator:c}=e(),f=i(["warningColor","primaryColor"]),j=s((()=>u.value.valid?"var(--n-primary-color)":"var(--n-warning-color)")),x=s((()=>u.value.valid?"已配置":"未配置"));return t((()=>m.value),(a=>{n((()=>{v(r.node.id,o,r.node.config),p(r.node.id),m.value=null}),500)}),{immediate:!0}),d((()=>c(r.node.id))),()=>l("div",{style:f.value,class:"text-[12px]"},[l("div",{style:{color:j.value}},[x.value])])}});export{m as default};

View File

@ -1 +1 @@
import{u as a,a as o}from"./index-BLs5ik22.js";import{d as e,a as r,l as i,w as s,aL as t,c as n,$ as d}from"./main-B314ly27.js";import{r as l}from"./verify-Dn31Klc9.js";import{u as m}from"./index-CGwbFRdP.js";import"./index-BK07zJJ4.js";import"./index-4UwdEH-y.js";import"./test-BoDPkCFc.js";import"./useStore--US7DZf4.js";import"./business-IbhWuk4D.js";const p=e({name:"ApplyNode",props:{node:{type:Object,default:()=>({id:"",config:{}})}},setup(e){const{isRefreshNode:p}=a(),{registerCompatValidator:u,validate:v,validationResult:c,unregisterValidator:f}=o(),j=r(["warningColor","primaryColor"]),y=i((()=>c.value.valid?"var(--n-primary-color)":"var(--n-warning-color)"));return s((()=>p.value),(a=>{m((()=>{u(e.node.id,l,e.node.config),v(e.node.id),p.value=null}),500)}),{immediate:!0}),t((()=>f(e.node.id))),()=>{var a;return n("div",{style:j.value,class:"text-[12px]"},[n("div",{style:{color:y.value}},[c.value.valid?"域名:"+(null==(a=e.node.config)?void 0:a.domains):d("t_9_1745735765287")])])}}});export{p as default};
import{u as a,a as o}from"./index-s5K8pvah.js";import{d as e,a as r,l as i,w as s,aL as t,c as n,$ as d}from"./main-DgoEun3x.js";import{r as l}from"./verify-BoGAZfCx.js";import{u as m}from"./index-DGjzZLqK.js";import"./index-D2WxTH-g.js";import"./index-3CAadC9a.js";import"./test-Cmp6LhDc.js";import"./useStore-Hl7-SEU7.js";import"./business-tY96d-Pv.js";const p=e({name:"ApplyNode",props:{node:{type:Object,default:()=>({id:"",config:{}})}},setup(e){const{isRefreshNode:p}=a(),{registerCompatValidator:u,validate:v,validationResult:c,unregisterValidator:f}=o(),j=r(["warningColor","primaryColor"]),y=i((()=>c.value.valid?"var(--n-primary-color)":"var(--n-warning-color)"));return s((()=>p.value),(a=>{m((()=>{u(e.node.id,l,e.node.config),v(e.node.id),p.value=null}),500)}),{immediate:!0}),t((()=>f(e.node.id))),()=>{var a;return n("div",{style:j.value,class:"text-[12px]"},[n("div",{style:{color:y.value}},[c.value.valid?"域名:"+(null==(a=e.node.config)?void 0:a.domains):d("t_9_1745735765287")])])}}});export{p as default};

View File

@ -0,0 +1 @@
import{u as e,N as a}from"./index-3CAadC9a.js";import{d as l,r as t,w as u,c as s,v as d,q as o,$ as n,n as v,B as p,i as r}from"./main-DgoEun3x.js";import{u as i}from"./useStore-h2Wsbe9z.js";import{S as y}from"./index-D2WxTH-g.js";import{N as f}from"./text-YkLLgUfR.js";import{N as c}from"./Flex-CSUicabw.js";const m=l({name:"DnsProviderSelect",props:{type:{type:String,default:""},path:{type:String,default:""},value:{type:String,default:""},valueType:{type:String,default:"value"},isAddMode:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""}},emits:["update:value"],setup(l,{emit:m}){const{handleError:b}=e(),{fetchDnsProvider:_,dnsProvider:g}=i(),x=t({label:"",value:"",type:""}),h=t([]),S=t(!1),j=t(""),w=()=>{window.open("/auth-api-manage","_blank")},C=({option:e})=>s("div",{class:"flex items-center"},[e.label?D(e):s(f,{class:"text-[#aaa]"},{default:()=>["dns"===l.type?n("t_3_1745490735059"):n("请选择主机提供商")]})]),D=e=>s(c,null,{default:()=>[s(y,{icon:`resources-${e.type}`,size:"2rem"},null),s(f,null,{default:()=>[e.label]})]}),N=async()=>{var e,a,l;const t=g.value.find((e=>e.value===x.value.value));t&&(x.value={label:t.label,value:t.value,type:t.type}),g.value.length>0&&""===x.value.value&&(x.value={label:(null==(e=g.value[0])?void 0:e.label)||"",value:(null==(a=g.value[0])?void 0:a.value)||"",type:(null==(l=g.value[0])?void 0:l.type)||""}),m("update:value",x.value)},T=e=>{x.value.value=e,N()},k=async(e="")=>{S.value=!0,j.value="";try{await _(e)}catch(a){j.value="string"==typeof a?a:n("t_0_1746760933542"),b(a)}finally{S.value=!1}},A=(e,a)=>a.label.toLowerCase().includes(e.toLowerCase());return u((()=>g.value),(e=>{h.value=e.map((e=>({label:e.label,value:"value"===l.valueType?e.value:e.type,type:"value"===l.valueType?e.type:e.value})))||[],N()})),u((()=>l.value),(()=>{k(l.type),T(l.value)}),{immediate:!0}),()=>{let e;return s(a,{show:S.value},{default:()=>[s(d,{cols:24,class:l.customClass},{default:()=>[s(o,{span:l.isAddMode?13:24,label:"dns"===l.type?n("t_3_1745735765112"):n("主机提供商"),path:l.path},{default:()=>[s(v,{class:"flex-1 w-full",options:h.value,renderLabel:D,renderTag:C,filterable:!0,filter:A,placeholder:"dns"===l.type?n("t_3_1745490735059"):n("请选择主机提供商"),value:x.value.value,"onUpdate:value":e=>x.value.value=e,onUpdateValue:T,disabled:l.disabled},{empty:()=>s("span",{class:"text-[1.4rem]"},[j.value||("dns"===l.type?n("DNS提供商列表为空请添加"):n("主机提供商列表为空,请添加"))])})]}),l.isAddMode&&s(o,{span:11},{default:()=>{return[s(p,{class:"mx-[8px]",onClick:w,disabled:l.disabled},{default:()=>["dns"===l.type?n("t_1_1746004861166"):n("添加主机提供商")]}),s(p,{onClick:()=>k(l.type),loading:S.value,disabled:l.disabled},(a=e=n("t_0_1746497662220"),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!r(a)?e:{default:()=>[e]}))];var a}})]})]})}}});export{m as D};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{d as e,c as s}from"./main-B314ly27.js";const t=e({name:"BaseComponent",setup(e,{slots:t}){const l=t["header-left"]||t.headerLeft,f=t["header-right"]||t.headerRight,r=t.header||t.header,o=t["footer-left"]||t.footerLeft,a=t["footer-right"]||t.footerRight,i=t.footer||t.footer;return()=>s("div",{class:"flex flex-col"},[(l||f)&&s("div",{class:"flex justify-between flex-wrap",style:{rowGap:"0.8rem"}},[s("div",{class:"flex flex-shrink-0"},[l&&l()]),s("div",{class:"flex flex-shrink-0"},[f&&f()])]),r&&s("div",{class:"flex justify-between flex-wrap w-full"},[r&&r()]),s("div",{class:`w-full content ${l||f?"mt-[1.2rem]":""} ${o||a?"mb-[1.2rem]":""}`},[t.content&&t.content()]),(o||a)&&s("div",{class:"flex justify-between"},[s("div",{class:"flex flex-shrink-0"},[o&&o()]),s("div",{class:"flex flex-shrink-0"},[a&&a()])]),i&&s("div",{class:"flex justify-between w-full"},[i()]),t.popup&&t.popup()])}});export{t as B};
import{d as e,c as s}from"./main-DgoEun3x.js";const t=e({name:"BaseComponent",setup(e,{slots:t}){const l=t["header-left"]||t.headerLeft,f=t["header-right"]||t.headerRight,r=t.header||t.header,o=t["footer-left"]||t.footerLeft,a=t["footer-right"]||t.footerRight,i=t.footer||t.footer;return()=>s("div",{class:"flex flex-col"},[(l||f)&&s("div",{class:"flex justify-between flex-wrap",style:{rowGap:"0.8rem"}},[s("div",{class:"flex flex-shrink-0"},[l&&l()]),s("div",{class:"flex flex-shrink-0"},[f&&f()])]),r&&s("div",{class:"flex justify-between flex-wrap w-full"},[r&&r()]),s("div",{class:`w-full content ${l||f?"mt-[1.2rem]":""} ${o||a?"mb-[1.2rem]":""}`},[t.content&&t.content()]),(o||a)&&s("div",{class:"flex justify-between"},[s("div",{class:"flex flex-shrink-0"},[o&&o()]),s("div",{class:"flex flex-shrink-0"},[a&&a()])]),i&&s("div",{class:"flex justify-between w-full"},[i()]),t.popup&&t.popup()])}});export{t as B};

View File

@ -1 +0,0 @@
import{d as o,a as e,l as i,c as r,$ as a,w as s,aL as t}from"./main-B314ly27.js";import{u as d,a as n}from"./index-BLs5ik22.js";import{r as l}from"./verify-D5iDiGwg.js";import{A as p}from"./index-BBXf7Mq_.js";import{u as m}from"./index-CGwbFRdP.js";import"./index-BK07zJJ4.js";import"./index-4UwdEH-y.js";import"./test-BoDPkCFc.js";import"./useStore--US7DZf4.js";import"./text-BFHLoHa1.js";const u=o({name:"NotifyNode",props:{node:{type:Object,default:()=>({id:"",config:{}})}},setup(o){const{isRefreshNode:u}=d(),{validate:v,validationResult:c,registerCompatValidator:f,unregisterValidator:j}=n(),g=e(["warningColor","primaryColor"]),x=i((()=>c.value.valid&&o.node.config.provider?"var(--n-primary-color)":"var(--n-warning-color)")),y=i((()=>c.value.valid&&o.node.config.provider?r(p,{icon:o.node.config.provider,type:"success"},null):a("t_9_1745735765287")));return s((()=>u.value),(e=>{m((()=>{f(o.node.id,l,o.node.config),v(o.node.id),u.value=null}),500)}),{immediate:!0}),t((()=>j(o.node.id))),()=>r("div",{style:g.value,class:"text-[12px]"},[r("div",{style:{color:x.value}},[y.value])])}});export{u as default};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{d as o,a as e,l as i,c as r,$ as a,w as s,aL as t}from"./main-DgoEun3x.js";import{u as d,a as n}from"./index-s5K8pvah.js";import{r as l}from"./verify-Bueng0xn.js";import{A as p}from"./index-BCEaQdDs.js";import{u as m}from"./index-DGjzZLqK.js";import"./index-D2WxTH-g.js";import"./index-3CAadC9a.js";import"./test-Cmp6LhDc.js";import"./useStore-Hl7-SEU7.js";const u=o({name:"NotifyNode",props:{node:{type:Object,default:()=>({id:"",config:{}})}},setup(o){const{isRefreshNode:u}=d(),{validate:v,validationResult:c,registerCompatValidator:f,unregisterValidator:j}=n(),g=e(["warningColor","primaryColor"]),y=i((()=>c.value.valid&&o.node.config.provider?"var(--n-primary-color)":"var(--n-warning-color)")),x=i((()=>c.value.valid&&o.node.config.provider?r(p,{icon:o.node.config.provider,type:"success"},null):a("t_9_1745735765287")));return s((()=>u.value),(e=>{m((()=>{f(o.node.id,l,o.node.config),v(o.node.id),u.value=null}),500)}),{immediate:!0}),t((()=>j(o.node.id))),()=>r("div",{style:g.value,class:"text-[12px]"},[r("div",{style:{color:y.value}},[x.value])])}});export{u as default};

View File

@ -1 +1 @@
import{d as e,l as i,c as r}from"./main-B314ly27.js";const t=e({name:"SvgIcon",props:{icon:{type:String,required:!0},color:{type:String,default:""},size:{type:String,default:"1.8rem"}},setup(e){const t=i((()=>`#icon-${e.icon}`));return()=>r("svg",{class:"relative inline-block align-[-0.2rem]",style:{width:e.size,height:e.size},"aria-hidden":"true"},[r("use",{"xlink:href":t.value,fill:e.color},null)])}});export{t as S};
import{d as e,l as i,c as r}from"./main-DgoEun3x.js";const t=e({name:"SvgIcon",props:{icon:{type:String,required:!0},color:{type:String,default:""},size:{type:String,default:"1.8rem"}},setup(e){const t=i((()=>`#icon-${e.icon}`));return()=>r("svg",{class:"relative inline-block align-[-0.2rem]",style:{width:e.size,height:e.size},"aria-hidden":"true"},[r("use",{"xlink:href":t.value,fill:e.color},null)])}});export{t as S};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{bs as t,bZ as e,b_ as n,bT as i,b$ as a,aH as o,o as s,as as r,w as u,a5 as c,r as l,c0 as f,bG as m}from"./main-B314ly27.js";function v(t){return!!a()&&(o(t),!0)}const p="undefined"!=typeof window&&"undefined"!=typeof document;"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope);const d=Object.prototype.toString,b=t=>"[object Object]"===d.call(t),w=()=>{};function y(t,e){return function(...n){return new Promise(((i,a)=>{Promise.resolve(t((()=>e.apply(this,n)),{fn:e,thisArg:this,args:n})).then(i).catch(a)}))}}const g=t=>t();function h(t=g,n={}){const{initialState:i="active"}=n,a=function(...t){if(1!==t.length)return c(...t);const n=t[0];return"function"==typeof n?e(f((()=>({get:n,set:w})))):l(n)}("active"===i);return{isActive:e(a),pause:function(){a.value=!1},resume:function(){a.value=!0},eventFilter:(...e)=>{a.value&&t(...e)}}}function T(t){return Array.isArray(t)?t:[t]}function j(t,e=200,a=!1,o=!0,s=!1){return y(function(...t){let e,a,o,s,r,u,c=0,l=!0,f=w;n(t[0])||"object"!=typeof t[0]?[o,s=!0,r=!0,u=!1]=t:({delay:o,trailing:s=!0,leading:r=!0,rejectOnCancel:u=!1}=t[0]);const m=()=>{e&&(clearTimeout(e),e=void 0,f(),f=w)};return t=>{const n=i(o),v=Date.now()-c,p=()=>a=t();return m(),n<=0?(c=Date.now(),p()):(v>n&&(r||!l)?(c=Date.now(),p()):s&&(a=new Promise(((t,i)=>{f=u?i:t,e=setTimeout((()=>{c=Date.now(),l=!0,t(p()),m()}),Math.max(0,n-v))}))),r||e||(e=setTimeout((()=>l=!0),n)),l=!1,a)}}(e,a,o,s),t)}function A(t,e,n={}){const{eventFilter:i,initialState:a="active",...o}=n,{eventFilter:s,pause:r,resume:c,isActive:l}=h(i,{initialState:a}),f=function(t,e,n={}){const{eventFilter:i=g,...a}=n;return u(t,y(i,e),a)}(t,e,{...o,eventFilter:s});return{stop:f,pause:r,resume:c,isActive:l}}function S(t,e=!0,n){m()?s(t,n):e?t():r(t)}function F(n,a,o={}){const{immediate:s=!0,immediateCallback:r=!1}=o,u=t(!1);let c=null;function l(){c&&(clearTimeout(c),c=null)}function f(){u.value=!1,l()}function m(...t){r&&n(),l(),u.value=!0,c=setTimeout((()=>{u.value=!1,c=null,n(...t)}),i(a))}return s&&(u.value=!0,p&&m()),v(f),{isPending:e(u),start:m,stop:f}}function D(t,e,n){return u(t,e,{...n,immediate:!0})}export{j as a,T as b,D as c,v as d,b as e,p as i,S as t,F as u,A as w};
import{bs as t,bZ as e,b_ as n,bU as i,b$ as a,aH as o,o as s,as as r,w as u,a5 as c,r as l,c0 as f,bG as m}from"./main-DgoEun3x.js";function v(t){return!!a()&&(o(t),!0)}const p="undefined"!=typeof window&&"undefined"!=typeof document;"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope);const d=Object.prototype.toString,b=t=>"[object Object]"===d.call(t),w=()=>{};function y(t,e){return function(...n){return new Promise(((i,a)=>{Promise.resolve(t((()=>e.apply(this,n)),{fn:e,thisArg:this,args:n})).then(i).catch(a)}))}}const g=t=>t();function h(t=g,n={}){const{initialState:i="active"}=n,a=function(...t){if(1!==t.length)return c(...t);const n=t[0];return"function"==typeof n?e(f((()=>({get:n,set:w})))):l(n)}("active"===i);return{isActive:e(a),pause:function(){a.value=!1},resume:function(){a.value=!0},eventFilter:(...e)=>{a.value&&t(...e)}}}function j(t){return Array.isArray(t)?t:[t]}function A(t,e=200,a=!1,o=!0,s=!1){return y(function(...t){let e,a,o,s,r,u,c=0,l=!0,f=w;n(t[0])||"object"!=typeof t[0]?[o,s=!0,r=!0,u=!1]=t:({delay:o,trailing:s=!0,leading:r=!0,rejectOnCancel:u=!1}=t[0]);const m=()=>{e&&(clearTimeout(e),e=void 0,f(),f=w)};return t=>{const n=i(o),v=Date.now()-c,p=()=>a=t();return m(),n<=0?(c=Date.now(),p()):(v>n&&(r||!l)?(c=Date.now(),p()):s&&(a=new Promise(((t,i)=>{f=u?i:t,e=setTimeout((()=>{c=Date.now(),l=!0,t(p()),m()}),Math.max(0,n-v))}))),r||e||(e=setTimeout((()=>l=!0),n)),l=!1,a)}}(e,a,o,s),t)}function S(t,e,n={}){const{eventFilter:i,initialState:a="active",...o}=n,{eventFilter:s,pause:r,resume:c,isActive:l}=h(i,{initialState:a}),f=function(t,e,n={}){const{eventFilter:i=g,...a}=n;return u(t,y(i,e),a)}(t,e,{...o,eventFilter:s});return{stop:f,pause:r,resume:c,isActive:l}}function T(t,e=!0,n){m()?s(t,n):e?t():r(t)}function F(n,a,o={}){const{immediate:s=!0,immediateCallback:r=!1}=o,u=t(!1);let c=null;function l(){c&&(clearTimeout(c),c=null)}function f(){u.value=!1,l()}function m(...t){r&&n(),l(),u.value=!0,c=setTimeout((()=>{u.value=!1,c=null,n(...t)}),i(a))}return s&&(u.value=!0,p&&m()),v(f),{isPending:e(u),start:m,stop:f}}function D(t,e,n){return u(t,e,{...n,immediate:!0})}export{A as a,j as b,D as c,v as d,b as e,p as i,T as t,F as u,S as w};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{u as e,a as o}from"./index-BLs5ik22.js";import{d as i,a as s,l as a,c as r,$ as t,w as n,aL as d}from"./main-B314ly27.js";import{A as l}from"./index-BBXf7Mq_.js";import{r as p}from"./verify-KyRPu5mD.js";import{u as m}from"./index-CGwbFRdP.js";import"./index-BK07zJJ4.js";import"./index-4UwdEH-y.js";import"./test-BoDPkCFc.js";import"./useStore--US7DZf4.js";import"./text-BFHLoHa1.js";import"./business-IbhWuk4D.js";const u=i({name:"DeployNode",props:{node:{type:Object,default:()=>({id:"",inputs:{},config:{}})}},setup(i){const{isRefreshNode:u}=e(),{registerCompatValidator:v,validate:c,validationResult:f,unregisterValidator:j}=o(),x=s(["warningColor","primaryColor"]),y=a((()=>f.value.valid?"var(--n-primary-color)":"var(--n-warning-color)")),g=a((()=>f.value.valid?r(l,{icon:i.node.config.provider,type:"success"},null):t("t_9_1745735765287")));return n((()=>u.value),(e=>{m((()=>{v(i.node.id,p,i.node.config),c(i.node.id),u.value=null}),500)}),{immediate:!0}),d((()=>j(i.node.id))),()=>r("div",{style:x.value,class:"text-[12px]"},[r("div",{style:{color:y.value}},[g.value])])}});export{u as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{u as e,a as o}from"./index-s5K8pvah.js";import{d as a,a as i,l as s,c as r,$ as t,w as n,aL as d}from"./main-DgoEun3x.js";import{A as l}from"./index-BCEaQdDs.js";import{r as p}from"./verify-CHX8spPZ.js";import{u as m}from"./index-DGjzZLqK.js";import"./index-D2WxTH-g.js";import"./index-3CAadC9a.js";import"./test-Cmp6LhDc.js";import"./useStore-Hl7-SEU7.js";import"./business-tY96d-Pv.js";const u=a({name:"DeployNode",props:{node:{type:Object,default:()=>({id:"",inputs:{},config:{}})}},setup(a){const{isRefreshNode:u}=e(),{registerCompatValidator:v,validate:c,validationResult:f,unregisterValidator:j}=o(),y=i(["warningColor","primaryColor"]),x=s((()=>f.value.valid?"var(--n-primary-color)":"var(--n-warning-color)")),g=s((()=>f.value.valid?r(l,{icon:a.node.config.provider,type:"success"},null):t("t_9_1745735765287")));return n((()=>u.value),(e=>{m((()=>{v(a.node.id,p,a.node.config),c(a.node.id),u.value=null}),500)}),{immediate:!0}),d((()=>j(a.node.id))),()=>r("div",{style:y.value,class:"text-[12px]"},[r("div",{style:{color:x.value}},[g.value])])}});export{u as default};

View File

@ -1 +1 @@
import{u as a,a as e}from"./index-BLs5ik22.js";import{d as o,a as r,l as i,$ as t,w as s,aL as d,c as l}from"./main-B314ly27.js";import{r as n}from"./verify-CrOns3QW.js";import{u as m}from"./index-CGwbFRdP.js";import"./index-BK07zJJ4.js";import"./index-4UwdEH-y.js";import"./test-BoDPkCFc.js";import"./useStore--US7DZf4.js";const p=o({name:"StartNode",props:{node:{type:Object,default:()=>({id:"",config:{}})}},setup(o){const{isRefreshNode:p}=a(),{validate:u,validationResult:v,registerCompatValidator:c,unregisterValidator:f}=e(),j=r(["warningColor","primaryColor"]),x=i((()=>v.value.valid?"var(--n-primary-color)":"var(--n-warning-color)")),y=i((()=>v.value.valid?"auto"===o.node.config.exec_type?t("t_4_1744875940750"):t("t_5_1744875940010"):"未配置"));return s((()=>p.value),(a=>{m((()=>{c(o.node.id,n,o.node.config),u(o.node.id),p.value=null}),500)}),{immediate:!0}),d((()=>f(o.node.id))),()=>l("div",{style:j.value,class:"text-[12px]"},[l("div",{style:{color:x.value}},[y.value])])}});export{p as default};
import{u as a,a as e}from"./index-s5K8pvah.js";import{d as o,a as r,l as i,$ as t,w as s,aL as d,c as l}from"./main-DgoEun3x.js";import{r as n}from"./verify-CYWrSAfB.js";import{u as m}from"./index-DGjzZLqK.js";import"./index-D2WxTH-g.js";import"./index-3CAadC9a.js";import"./test-Cmp6LhDc.js";import"./useStore-Hl7-SEU7.js";const p=o({name:"StartNode",props:{node:{type:Object,default:()=>({id:"",config:{}})}},setup(o){const{isRefreshNode:p}=a(),{validate:u,validationResult:v,registerCompatValidator:c,unregisterValidator:f}=e(),j=r(["warningColor","primaryColor"]),x=i((()=>v.value.valid?"var(--n-primary-color)":"var(--n-warning-color)")),y=i((()=>v.value.valid?"auto"===o.node.config.exec_type?t("t_4_1744875940750"):t("t_5_1744875940010"):"未配置"));return s((()=>p.value),(a=>{m((()=>{c(o.node.id,n,o.node.config),u(o.node.id),p.value=null}),500)}),{immediate:!0}),d((()=>f(o.node.id))),()=>l("div",{style:j.value,class:"text-[12px]"},[l("div",{style:{color:x.value}},[y.value])])}});export{p as default};

View File

@ -1 +1 @@
import{i as e,w as t,t as n,b as r,c as a,d as o,e as l}from"./index-CGwbFRdP.js";import{bs as i,r as s,l as u,bT as f,w as c,as as d,bU as v}from"./main-B314ly27.js";const g=e?window:void 0;function p(...e){const t=[],n=()=>{t.forEach((e=>e())),t.length=0},i=u((()=>{const t=r(f(e[0])).filter((e=>null!=e));return t.every((e=>"string"!=typeof e))?t:void 0})),s=a((()=>{var t,n;return[null!=(n=null==(t=i.value)?void 0:t.map((e=>function(e){var t;const n=f(e);return null!=(t=null==n?void 0:n.$el)?t:n}(e))))?n:[g].filter((e=>null!=e)),r(f(i.value?e[1]:e[0])),r(v(i.value?e[2]:e[1])),f(i.value?e[3]:e[2])]}),(([e,r,a,o])=>{if(n(),!(null==e?void 0:e.length)||!(null==r?void 0:r.length)||!(null==a?void 0:a.length))return;const i=l(o)?{...o}:o;t.push(...e.flatMap((e=>r.flatMap((t=>a.map((n=>((e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)))(e,t,n,i))))))))}),{flush:"post"});return o(n),()=>{s(),n()}}const w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},y="__vueuse_ssr_handlers__",m=S();function S(){return y in w||(w[y]=w[y]||{}),w[y]}const b={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},h="vueuse-storage";function N(e,r,a,o={}){var l;const{flush:v="pre",deep:w=!0,listenToStorageChanges:y=!0,writeDefaults:S=!0,mergeDefaults:N=!1,shallow:O,window:E=g,eventFilter:j,onError:A=e=>{},initOnMounted:I}=o,J=(O?i:s)("function"==typeof r?r():r),_=u((()=>f(e)));if(!a)try{a=function(e,t){return m[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=g)?void 0:e.localStorage}))()}catch(L){A(L)}if(!a)return J;const D=f(r),M=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e?"object":Number.isNaN(e)?"any":"number"}(D),T=null!=(l=o.serializer)?l:b[M],{pause:V,resume:k}=t(J,(()=>function(e){try{const t=a.getItem(_.value);if(null==e)F(t,null),a.removeItem(_.value);else{const n=T.write(e);t!==n&&(a.setItem(_.value,n),F(t,n))}}catch(L){A(L)}}(J.value)),{flush:v,deep:w,eventFilter:j});function F(e,t){if(E){const n={key:_.value,oldValue:e,newValue:t,storageArea:a};E.dispatchEvent(a instanceof Storage?new StorageEvent("storage",n):new CustomEvent(h,{detail:n}))}}function x(e){if(!e||e.storageArea===a)if(e&&null==e.key)J.value=D;else if(!e||e.key===_.value){V();try{(null==e?void 0:e.newValue)!==T.write(J.value)&&(J.value=function(e){const t=e?e.newValue:a.getItem(_.value);if(null==t)return S&&null!=D&&a.setItem(_.value,T.write(D)),D;if(!e&&N){const e=T.read(t);return"function"==typeof N?N(e,D):"object"!==M||Array.isArray(e)?e:{...D,...e}}return"string"!=typeof t?t:T.read(t)}(e))}catch(L){A(L)}finally{e?d(k):k()}}}function C(e){x(e.detail)}return c(_,(()=>x()),{flush:v}),E&&y&&n((()=>{a instanceof Storage?p(E,"storage",x,{passive:!0}):p(E,h,C),I&&x()})),I||x(),J}function O(e,t,n={}){const{window:r=g}=n;return N(e,t,null==r?void 0:r.localStorage,n)}export{O as u};
import{i as e,w as t,t as n,b as r,c as a,d as o,e as l}from"./index-DGjzZLqK.js";import{bs as i,r as s,l as u,bU as f,w as c,as as d,bV as v}from"./main-DgoEun3x.js";const g=e?window:void 0;function w(...e){const t=[],n=()=>{t.forEach((e=>e())),t.length=0},i=u((()=>{const t=r(f(e[0])).filter((e=>null!=e));return t.every((e=>"string"!=typeof e))?t:void 0})),s=a((()=>{var t,n;return[null!=(n=null==(t=i.value)?void 0:t.map((e=>function(e){var t;const n=f(e);return null!=(t=null==n?void 0:n.$el)?t:n}(e))))?n:[g].filter((e=>null!=e)),r(f(i.value?e[1]:e[0])),r(v(i.value?e[2]:e[1])),f(i.value?e[3]:e[2])]}),(([e,r,a,o])=>{if(n(),!(null==e?void 0:e.length)||!(null==r?void 0:r.length)||!(null==a?void 0:a.length))return;const i=l(o)?{...o}:o;t.push(...e.flatMap((e=>r.flatMap((t=>a.map((n=>((e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)))(e,t,n,i))))))))}),{flush:"post"});return o(n),()=>{s(),n()}}const p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},y="__vueuse_ssr_handlers__",m=S();function S(){return y in p||(p[y]=p[y]||{}),p[y]}const b={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},h="vueuse-storage";function N(e,r,a,o={}){var l;const{flush:v="pre",deep:p=!0,listenToStorageChanges:y=!0,writeDefaults:S=!0,mergeDefaults:N=!1,shallow:O,window:E=g,eventFilter:j,onError:A=e=>{},initOnMounted:I}=o,J=(O?i:s)("function"==typeof r?r():r),_=u((()=>f(e)));if(!a)try{a=function(e,t){return m[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=g)?void 0:e.localStorage}))()}catch(L){A(L)}if(!a)return J;const D=f(r),M=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e?"object":Number.isNaN(e)?"any":"number"}(D),V=null!=(l=o.serializer)?l:b[M],{pause:k,resume:F}=t(J,(()=>function(e){try{const t=a.getItem(_.value);if(null==e)T(t,null),a.removeItem(_.value);else{const n=V.write(e);t!==n&&(a.setItem(_.value,n),T(t,n))}}catch(L){A(L)}}(J.value)),{flush:v,deep:p,eventFilter:j});function T(e,t){if(E){const n={key:_.value,oldValue:e,newValue:t,storageArea:a};E.dispatchEvent(a instanceof Storage?new StorageEvent("storage",n):new CustomEvent(h,{detail:n}))}}function x(e){if(!e||e.storageArea===a)if(e&&null==e.key)J.value=D;else if(!e||e.key===_.value){k();try{(null==e?void 0:e.newValue)!==V.write(J.value)&&(J.value=function(e){const t=e?e.newValue:a.getItem(_.value);if(null==t)return S&&null!=D&&a.setItem(_.value,V.write(D)),D;if(!e&&N){const e=V.read(t);return"function"==typeof N?N(e,D):"object"!==M||Array.isArray(e)?e:{...D,...e}}return"string"!=typeof t?t:V.read(t)}(e))}catch(L){A(L)}finally{e?d(F):F()}}}function C(e){x(e.detail)}return c(_,(()=>x()),{flush:v}),E&&y&&n((()=>{a instanceof Storage?w(E,"storage",x,{passive:!0}):w(E,h,C),I&&x()})),I||x(),J}function O(e,t,n={}){const{window:r=g}=n;return N(e,t,null==r?void 0:r.localStorage,n)}function E(e,t,n={}){const{window:r=g}=n;return N(e,t,null==r?void 0:r.sessionStorage,n)}export{E as a,O as u};

View File

@ -1 +1 @@
import{d as e,r as l,w as a,c as t,v as u,q as n,$ as o,n as i,B as s,i as p}from"./main-B314ly27.js";import{u as r}from"./useStore-CV1u1a79.js";import{S as v}from"./index-BK07zJJ4.js";import{N as d}from"./Flex-DGUi9d1R.js";import{N as f}from"./text-BFHLoHa1.js";function y(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!p(e)}const c=e({name:"NotifyProviderSelect",props:{path:{type:String,default:""},value:{type:String,default:""},valueType:{type:String,default:"value"},isAddMode:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{emit:p}){const{fetchNotifyProvider:c,notifyProvider:m}=r(),b=l({label:"",value:"",type:""}),_=l([]),x=()=>{window.open("/settings?tab=notification","_blank")},j=({option:l})=>{let a;return t("div",{class:"flex items-center"},[l.label?t(d,null,{default:()=>[t(v,{icon:`notify-${"value"===e.valueType?l.type:l.value}`,size:"2rem"},null),t(f,null,{default:()=>[l.label]})]}):t(f,null,y(a=o("t_0_1745887835267"))?a:{default:()=>[a]})])},S=l=>t(d,null,{default:()=>[t(v,{icon:`notify-${"value"===e.valueType?l.type:l.value}`,size:"2rem"},null),t(f,null,{default:()=>[l.label]})]}),g=e=>{if(!e)return;const l=_.value.find((l=>l.value===e));b.value={label:(null==l?void 0:l.label)||"",value:(null==l?void 0:l.value)||"",type:(null==l?void 0:l.type)||""}},T=e=>{g(e),p("update:value",b.value)};return a((()=>e.value),(e=>{c(),g(e)}),{immediate:!0}),a((()=>m.value),(l=>{_.value=l.map((l=>({label:l.label,value:"value"===e.valueType?l.value:l.type,type:"value"===e.valueType?l.type:l.value})))||[],g(e.value)})),()=>{let l,a;return t(u,{cols:24},{default:()=>[t(n,{span:e.isAddMode?13:24,label:o("t_1_1745887832941"),path:e.path},{default:()=>[t(i,{class:"flex-1 w-full ",options:_.value,renderLabel:S,renderTag:j,filterable:!0,placeholder:o("t_0_1745887835267"),value:b.value.value,"onUpdate:value":e=>b.value.value=e,onUpdateValue:T},{empty:()=>t("span",{class:"text-[1.4rem]"},[o("t_0_1745887835267")])})]}),e.isAddMode&&t(n,{span:11},{default:()=>[t(s,{class:"mx-[8px]",onClick:x},y(l=o("t_2_1745887834248"))?l:{default:()=>[l]}),t(s,{onClick:c},y(a=o("t_0_1746497662220"))?a:{default:()=>[a]})]})]})}}});export{c as N};
import{d as e,r as l,w as a,c as t,v as u,q as n,$ as o,n as i,B as s,i as p}from"./main-DgoEun3x.js";import{u as r}from"./useStore-h2Wsbe9z.js";import{S as v}from"./index-D2WxTH-g.js";import{N as d}from"./Flex-CSUicabw.js";import{N as f}from"./text-YkLLgUfR.js";function y(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!p(e)}const c=e({name:"NotifyProviderSelect",props:{path:{type:String,default:""},value:{type:String,default:""},valueType:{type:String,default:"value"},isAddMode:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{emit:p}){const{fetchNotifyProvider:c,notifyProvider:m}=r(),b=l({label:"",value:"",type:""}),_=l([]),x=()=>{window.open("/settings?tab=notification","_blank")},j=({option:l})=>{let a;return t("div",{class:"flex items-center"},[l.label?t(d,null,{default:()=>[t(v,{icon:`notify-${"value"===e.valueType?l.type:l.value}`,size:"2rem"},null),t(f,null,{default:()=>[l.label]})]}):t(f,null,y(a=o("t_0_1745887835267"))?a:{default:()=>[a]})])},S=l=>t(d,null,{default:()=>[t(v,{icon:`notify-${"value"===e.valueType?l.type:l.value}`,size:"2rem"},null),t(f,null,{default:()=>[l.label]})]}),g=e=>{if(!e)return;const l=_.value.find((l=>l.value===e));b.value={label:(null==l?void 0:l.label)||"",value:(null==l?void 0:l.value)||"",type:(null==l?void 0:l.type)||""}},T=e=>{g(e),p("update:value",b.value)};return a((()=>e.value),(e=>{c(),g(e)}),{immediate:!0}),a((()=>m.value),(l=>{_.value=l.map((l=>({label:l.label,value:"value"===e.valueType?l.value:l.type,type:"value"===e.valueType?l.type:l.value})))||[],g(e.value)})),()=>{let l,a;return t(u,{cols:24},{default:()=>[t(n,{span:e.isAddMode?13:24,label:o("t_1_1745887832941"),path:e.path},{default:()=>[t(i,{class:"flex-1 w-full ",options:_.value,renderLabel:S,renderTag:j,filterable:!0,placeholder:o("t_0_1745887835267"),value:b.value.value,"onUpdate:value":e=>b.value.value=e,onUpdateValue:T},{empty:()=>t("span",{class:"text-[1.4rem]"},[o("t_0_1745887835267")])})]}),e.isAddMode&&t(n,{span:11},{default:()=>[t(s,{class:"mx-[8px]",onClick:x},y(l=o("t_2_1745887834248"))?l:{default:()=>[l]}),t(s,{onClick:c},y(a=o("t_0_1746497662220"))?a:{default:()=>[a]})]})]})}}});export{c as N};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{c as o,d as s}from"./index-4UwdEH-y.js";const e=s=>o("/v1/login/sign",s),g=()=>s.get("/v1/login/get_code"),i=()=>o("/v1/login/sign-out"),v=s=>o("/v1/overview/get_overviews",s);export{g as a,v as g,e as l,i as s};
import{c as o,d as s}from"./index-3CAadC9a.js";const e=s=>o("/v1/login/sign",s),g=()=>s.get("/v1/login/get_code"),i=()=>o("/v1/login/sign-out"),v=s=>o("/v1/overview/get_overviews",s);export{g as a,v as g,e as l,i as s};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{c as t}from"./index-4UwdEH-y.js";const e=e=>t("/v1/setting/get_setting",e),r=e=>t("/v1/setting/save_setting",e),s=e=>t("/v1/report/add_report",e),o=e=>t("/v1/report/upd_report",e),a=e=>t("/v1/report/del_report",e),p=e=>t("/v1/report/notify_test",e),i=e=>t("/v1/report/get_list",e);export{i as a,s as b,a as d,e as g,r as s,p as t,o as u};
import{c as t}from"./index-3CAadC9a.js";const e=e=>t("/v1/setting/get_setting",e),r=e=>t("/v1/setting/save_setting",e),s=e=>t("/v1/report/add_report",e),o=e=>t("/v1/report/upd_report",e),a=e=>t("/v1/report/del_report",e),p=e=>t("/v1/report/notify_test",e),i=e=>t("/v1/report/get_list",e);export{i as a,s as b,a as d,e as g,r as s,p as t,o as u};

View File

@ -1 +1 @@
import{bi as t,bb as e,bl as r,bv as n,bw as u,bx as o,bp as i,by as c,bh as a}from"./main-B314ly27.js";function s(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var f=function(){function e(t,e){this.xf=e,this.f=t,this.all=!0}return e.prototype["@@transducer/init"]=t.init,e.prototype["@@transducer/result"]=function(t){return this.all&&(t=this.xf["@@transducer/step"](t,!0)),this.xf["@@transducer/result"](t)},e.prototype["@@transducer/step"]=function(t,e){return this.f(e)||(this.all=!1,t=s(this.xf["@@transducer/step"](t,!1))),t},e}();function l(t){return function(e){return new f(t,e)}}var p=e(r(["all"],l,(function(t,e){for(var r=0;r<e.length;){if(!t(e[r]))return!1;r+=1}return!0})));function g(t,e){return function(t,e,r){var u,o;if("function"==typeof t.indexOf)switch(typeof e){case"number":if(0===e){for(u=1/e;r<t.length;){if(0===(o=t[r])&&1/o===u)return r;r+=1}return-1}if(e!=e){for(;r<t.length;){if("number"==typeof(o=t[r])&&o!=o)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(null===e)return t.indexOf(e,r)}for(;r<t.length;){if(n(t[r],e))return r;r+=1}return-1}(e,t,0)>=0}function b(t){return'"'+t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var d=function(t){return(t<10?"0":"")+t},y="function"==typeof Date.prototype.toISOString?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+d(t.getUTCMonth()+1)+"-"+d(t.getUTCDate())+"T"+d(t.getUTCHours())+":"+d(t.getUTCMinutes())+":"+d(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};var h=function(){function e(t,e){this.xf=e,this.f=t}return e.prototype["@@transducer/init"]=t.init,e.prototype["@@transducer/result"]=t.result,e.prototype["@@transducer/step"]=function(t,e){return this.f(e)?this.xf["@@transducer/step"](t,e):t},e}();function v(t){return function(e){return new h(t,e)}}var j=e(r(["fantasy-land/filter","filter"],v,(function(t,e){return o(e)?u((function(r,n){return t(e[n])&&(r[n]=e[n]),r}),{},i(e)):function(t,e){for(var r=0,n=e.length,u=[];r<n;)t(e[r])&&(u[u.length]=e[r]),r+=1;return u}(t,e)}))),x=e((function(t,e){return j((r=t,function(){return!r.apply(this,arguments)}),e);var r}));function S(t,e){var r=function(r){var n=e.concat([t]);return g(r,n)?"<Circular>":S(r,n)},n=function(t,e){return c((function(e){return b(e)+": "+r(t[e])}),e.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+c(r,t).join(", ")+"))";case"[object Array]":return"["+c(r,t).concat(n(t,x((function(t){return/^\d+$/.test(t)}),i(t)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof t?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):b(y(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof t?"new Number("+r(t.valueOf())+")":1/t==-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return"object"==typeof t?"new String("+r(t.valueOf())+")":b(t);case"[object Undefined]":return"undefined";default:if("function"==typeof t.toString){var u=t.toString();if("[object Object]"!==u)return u}return"{"+n(t,i(t)).join(", ")+"}"}}var m=a((function(t){return S(t,[])}));function w(t){return new RegExp(t.source,t.flags?t.flags:(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":"")+(t.dotAll?"s":""))}var O=e((function(t,e){if(r=t,"[object RegExp]"!==Object.prototype.toString.call(r))throw new TypeError("test requires a value of type RegExp as its first argument; received "+m(t));var r;return w(t).test(e)}));export{w as _,s as a,g as b,p as c,m as d,O as t};
import{bi as t,bb as e,bl as r,bv as n,bw as u,bx as o,bp as i,by as c,bh as a}from"./main-DgoEun3x.js";function s(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var f=function(){function e(t,e){this.xf=e,this.f=t,this.all=!0}return e.prototype["@@transducer/init"]=t.init,e.prototype["@@transducer/result"]=function(t){return this.all&&(t=this.xf["@@transducer/step"](t,!0)),this.xf["@@transducer/result"](t)},e.prototype["@@transducer/step"]=function(t,e){return this.f(e)||(this.all=!1,t=s(this.xf["@@transducer/step"](t,!1))),t},e}();function l(t){return function(e){return new f(t,e)}}var p=e(r(["all"],l,(function(t,e){for(var r=0;r<e.length;){if(!t(e[r]))return!1;r+=1}return!0})));function g(t,e){return function(t,e,r){var u,o;if("function"==typeof t.indexOf)switch(typeof e){case"number":if(0===e){for(u=1/e;r<t.length;){if(0===(o=t[r])&&1/o===u)return r;r+=1}return-1}if(e!=e){for(;r<t.length;){if("number"==typeof(o=t[r])&&o!=o)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(null===e)return t.indexOf(e,r)}for(;r<t.length;){if(n(t[r],e))return r;r+=1}return-1}(e,t,0)>=0}function b(t){return'"'+t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var d=function(t){return(t<10?"0":"")+t},y="function"==typeof Date.prototype.toISOString?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+d(t.getUTCMonth()+1)+"-"+d(t.getUTCDate())+"T"+d(t.getUTCHours())+":"+d(t.getUTCMinutes())+":"+d(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};var h=function(){function e(t,e){this.xf=e,this.f=t}return e.prototype["@@transducer/init"]=t.init,e.prototype["@@transducer/result"]=t.result,e.prototype["@@transducer/step"]=function(t,e){return this.f(e)?this.xf["@@transducer/step"](t,e):t},e}();function v(t){return function(e){return new h(t,e)}}var j=e(r(["fantasy-land/filter","filter"],v,(function(t,e){return o(e)?u((function(r,n){return t(e[n])&&(r[n]=e[n]),r}),{},i(e)):function(t,e){for(var r=0,n=e.length,u=[];r<n;)t(e[r])&&(u[u.length]=e[r]),r+=1;return u}(t,e)}))),x=e((function(t,e){return j((r=t,function(){return!r.apply(this,arguments)}),e);var r}));function S(t,e){var r=function(r){var n=e.concat([t]);return g(r,n)?"<Circular>":S(r,n)},n=function(t,e){return c((function(e){return b(e)+": "+r(t[e])}),e.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+c(r,t).join(", ")+"))";case"[object Array]":return"["+c(r,t).concat(n(t,x((function(t){return/^\d+$/.test(t)}),i(t)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof t?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):b(y(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof t?"new Number("+r(t.valueOf())+")":1/t==-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return"object"==typeof t?"new String("+r(t.valueOf())+")":b(t);case"[object Undefined]":return"undefined";default:if("function"==typeof t.toString){var u=t.toString();if("[object Object]"!==u)return u}return"{"+n(t,i(t)).join(", ")+"}"}}var m=a((function(t){return S(t,[])}));function w(t){return new RegExp(t.source,t.flags?t.flags:(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":"")+(t.dotAll?"s":""))}var O=e((function(t,e){if(r=t,"[object RegExp]"!==Object.prototype.toString.call(r))throw new TypeError("test requires a value of type RegExp as its first argument; received "+m(t));var r;return w(t).test(e)}));export{w as _,s as a,g as b,p as c,m as d,O as t};

View File

@ -1 +1 @@
import{Q as e,T as o,d as t,z as n,U as r,A as s,c1 as i,l,aE as a,X as d,al as c}from"./main-B314ly27.js";const h=e("text","\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n",[o("strong","\n font-weight: var(--n-font-weight-strong);\n "),o("italic",{fontStyle:"italic"}),o("underline",{textDecoration:"underline"}),o("code","\n line-height: 1.4;\n display: inline-block;\n font-family: var(--n-font-famliy-mono);\n transition: \n color .3s var(--n-bezier),\n border-color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n box-sizing: border-box;\n padding: .05em .35em 0 .35em;\n border-radius: var(--n-code-border-radius);\n font-size: .9em;\n color: var(--n-code-text-color);\n background-color: var(--n-code-color);\n border: var(--n-code-border);\n ")]),g=t({name:"Text",props:Object.assign(Object.assign({},s.props),{code:Boolean,type:{type:String,default:"default"},delete:Boolean,strong:Boolean,italic:Boolean,underline:Boolean,depth:[String,Number],tag:String,as:{type:String,validator:()=>!0,default:void 0}}),setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=r(e),n=s("Typography","-text",h,i,e,o),g=l((()=>{const{depth:o,type:t}=e,r="default"===t?void 0===o?"textColor":`textColor${o}Depth`:a("textColor",t),{common:{fontWeightStrong:s,fontFamilyMono:i,cubicBezierEaseInOut:l},self:{codeTextColor:d,codeBorderRadius:c,codeColor:h,codeBorder:g,[r]:u}}=n.value;return{"--n-bezier":l,"--n-text-color":u,"--n-font-weight-strong":s,"--n-font-famliy-mono":i,"--n-code-border-radius":c,"--n-code-text-color":d,"--n-code-color":h,"--n-code-border":g}})),u=t?d("text",l((()=>`${e.type[0]}${e.depth||""}`)),g,e):void 0;return{mergedClsPrefix:o,compitableTag:c(e,["as","tag"]),cssVars:t?void 0:g,themeClass:null==u?void 0:u.themeClass,onRender:null==u?void 0:u.onRender}},render(){var e,o,t;const{mergedClsPrefix:r}=this;null===(e=this.onRender)||void 0===e||e.call(this);const s=[`${r}-text`,this.themeClass,{[`${r}-text--code`]:this.code,[`${r}-text--delete`]:this.delete,[`${r}-text--strong`]:this.strong,[`${r}-text--italic`]:this.italic,[`${r}-text--underline`]:this.underline}],i=null===(t=(o=this.$slots).default)||void 0===t?void 0:t.call(o);return this.code?n("code",{class:s,style:this.cssVars},this.delete?n("del",null,i):i):this.delete?n("del",{class:s,style:this.cssVars},i):n(this.compitableTag||"span",{class:s,style:this.cssVars},i)}});export{g as N};
import{Q as e,T as o,d as t,z as n,U as r,A as s,bT as i,l,aE as a,X as d,al as c}from"./main-DgoEun3x.js";const h=e("text","\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n",[o("strong","\n font-weight: var(--n-font-weight-strong);\n "),o("italic",{fontStyle:"italic"}),o("underline",{textDecoration:"underline"}),o("code","\n line-height: 1.4;\n display: inline-block;\n font-family: var(--n-font-famliy-mono);\n transition: \n color .3s var(--n-bezier),\n border-color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n box-sizing: border-box;\n padding: .05em .35em 0 .35em;\n border-radius: var(--n-code-border-radius);\n font-size: .9em;\n color: var(--n-code-text-color);\n background-color: var(--n-code-color);\n border: var(--n-code-border);\n ")]),g=t({name:"Text",props:Object.assign(Object.assign({},s.props),{code:Boolean,type:{type:String,default:"default"},delete:Boolean,strong:Boolean,italic:Boolean,underline:Boolean,depth:[String,Number],tag:String,as:{type:String,validator:()=>!0,default:void 0}}),setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=r(e),n=s("Typography","-text",h,i,e,o),g=l((()=>{const{depth:o,type:t}=e,r="default"===t?void 0===o?"textColor":`textColor${o}Depth`:a("textColor",t),{common:{fontWeightStrong:s,fontFamilyMono:i,cubicBezierEaseInOut:l},self:{codeTextColor:d,codeBorderRadius:c,codeColor:h,codeBorder:g,[r]:u}}=n.value;return{"--n-bezier":l,"--n-text-color":u,"--n-font-weight-strong":s,"--n-font-famliy-mono":i,"--n-code-border-radius":c,"--n-code-text-color":d,"--n-code-color":h,"--n-code-border":g}})),u=t?d("text",l((()=>`${e.type[0]}${e.depth||""}`)),g,e):void 0;return{mergedClsPrefix:o,compitableTag:c(e,["as","tag"]),cssVars:t?void 0:g,themeClass:null==u?void 0:u.themeClass,onRender:null==u?void 0:u.onRender}},render(){var e,o,t;const{mergedClsPrefix:r}=this;null===(e=this.onRender)||void 0===e||e.call(this);const s=[`${r}-text`,this.themeClass,{[`${r}-text--code`]:this.code,[`${r}-text--delete`]:this.delete,[`${r}-text--strong`]:this.strong,[`${r}-text--italic`]:this.italic,[`${r}-text--underline`]:this.underline}],i=null===(t=(o=this.$slots).default)||void 0===t?void 0:t.call(o);return this.code?n("code",{class:s,style:this.cssVars},this.delete?n("del",null,i):i):this.delete?n("del",{class:s,style:this.cssVars},i):n(this.compitableTag||"span",{class:s,style:this.cssVars},i)}});export{g as N};

View File

@ -1 +0,0 @@
import{u as e}from"./index-4UwdEH-y.js";import{a}from"./setting-DTfi4FsX.js";import{e as t,s as o,r as l,l as r}from"./main-B314ly27.js";import{u as s}from"./index-D38oPCl9.js";import{b as n}from"./access-Xfq3ZYcU.js";const i=t("layout-store",(()=>{const{handleError:t}=e(),o=s("layout-collapsed",!1),i=l([]),u=l([]),c=s("menu-active","home"),v=r((()=>"home"!==c.value?"var(--n-content-padding)":"0"));return{locales:s("locales-active","zhCN"),notifyProvider:i,dnsProvider:u,isCollapsed:o,layoutPadding:v,menuActive:c,resetDataInfo:()=>{c.value="home",localStorage.removeItem("menu-active")},updateMenuActive:e=>{"logout"!==e&&(c.value=e)},toggleCollapse:()=>{o.value=!o.value},handleCollapse:()=>{o.value=!0},handleExpand:()=>{o.value=!1},fetchNotifyProvider:async()=>{try{i.value=[];const{data:e}=await a({p:1,search:"",limit:1e3}).fetch();i.value=null==e?void 0:e.map((e=>({label:e.name,value:e.id.toString(),type:e.type})))}catch(e){t(e)}},fetchDnsProvider:async(e="")=>{try{u.value=[];const{data:a}=await n({type:e}).fetch();u.value=(null==a?void 0:a.map((e=>({label:e.name,value:e.id.toString(),type:e.type}))))||[]}catch(a){t(a)}}}})),u=()=>{const e=i();return{...e,...o(e)}};export{u};

View File

@ -1 +1 @@
import{c as e,u as a}from"./index-4UwdEH-y.js";import{e as o,s as t,r as l,$ as r}from"./main-B314ly27.js";const w=a=>e("/v1/workflow/get_list",a),s=a=>e("/v1/workflow/del_workflow",a),c=a=>e("/v1/workflow/get_workflow_history",a),n=a=>e("/v1/workflow/get_exec_log",a),d=a=>e("/v1/workflow/execute_workflow",a),f=a=>e("/v1/workflow/exec_type",a),i=a=>e("/v1/workflow/active",a),u=o("work-edit-view-store",(()=>{const{handleError:o}=a(),t=l(!1),w=l(!1),s=l({id:"",name:"",content:"",active:"1",exec_type:"manual"}),c=l("quick"),n=l({id:"",name:"",childNode:{id:"start-1",name:"开始",type:"start",config:{exec_type:"manual"},childNode:null}});return{isEdit:t,detectionRefresh:w,workflowData:s,workflowType:c,workDefalutNodeData:n,resetWorkflowData:()=>{s.value={id:"",name:"",content:"",active:"1",exec_type:"manual"},n.value={id:"",name:"",childNode:{id:"start-1",name:"开始",type:"start",config:{exec_type:"manual"},childNode:null}},c.value="quick",t.value=!1},addNewWorkflow:async a=>{try{const{message:o,fetch:t}=(a=>e("/v1/workflow/add_workflow",a))(a);o.value=!0,await t()}catch(t){o(t).default(r("t_10_1745457486451"))}},updateWorkflowData:async a=>{try{const{message:o,fetch:t}=e("/v1/workflow/upd_workflow",a);o.value=!0,await t()}catch(t){o(t).default(r("t_11_1745457488256"))}}}})),k=()=>{const e=u();return{...e,...t(e)}};export{c as a,d as b,n as c,s as d,i as e,k as f,w as g,f as u};
import{c as e,u as a}from"./index-3CAadC9a.js";import{e as o,s as t,r as l,$ as r}from"./main-DgoEun3x.js";const w=a=>e("/v1/workflow/get_list",a),s=a=>e("/v1/workflow/del_workflow",a),c=a=>e("/v1/workflow/get_workflow_history",a),n=a=>e("/v1/workflow/get_exec_log",a),d=a=>e("/v1/workflow/execute_workflow",a),f=a=>e("/v1/workflow/exec_type",a),i=a=>e("/v1/workflow/active",a),u=o("work-edit-view-store",(()=>{const{handleError:o}=a(),t=l(!1),w=l(!1),s=l({id:"",name:"",content:"",active:"1",exec_type:"manual"}),c=l("quick"),n=l({id:"",name:"",childNode:{id:"start-1",name:"开始",type:"start",config:{exec_type:"manual"},childNode:null}});return{isEdit:t,detectionRefresh:w,workflowData:s,workflowType:c,workDefalutNodeData:n,resetWorkflowData:()=>{s.value={id:"",name:"",content:"",active:"1",exec_type:"manual"},n.value={id:"",name:"",childNode:{id:"start-1",name:"开始",type:"start",config:{exec_type:"manual"},childNode:null}},c.value="quick",t.value=!1},addNewWorkflow:async a=>{try{const{message:o,fetch:t}=(a=>e("/v1/workflow/add_workflow",a))(a);o.value=!0,await t()}catch(t){o(t).default(r("t_10_1745457486451"))}},updateWorkflowData:async a=>{try{const{message:o,fetch:t}=e("/v1/workflow/upd_workflow",a);o.value=!0,await t()}catch(t){o(t).default(r("t_11_1745457488256"))}}}})),k=()=>{const e=u();return{...e,...t(e)}};export{c as a,d as b,n as c,s as d,i as e,k as f,w as g,f as u};

View File

@ -0,0 +1 @@
import{u as e}from"./index-3CAadC9a.js";import{a}from"./setting-D80_Gwwn.js";import{e as t,s as o,r as l,l as s}from"./main-DgoEun3x.js";import{u as n,a as r}from"./index-SPRAkzSU.js";import{b as i}from"./access-CoJ081t2.js";const u=t("layout-store",(()=>{const{handleError:t}=e(),o=n("layout-collapsed",!1),u=l([]),c=l([]),v=r("menu-active","home"),d=s((()=>"home"!==v.value?"var(--n-content-padding)":"0"));return{locales:n("locales-active","zhCN"),notifyProvider:u,dnsProvider:c,isCollapsed:o,layoutPadding:d,menuActive:v,resetDataInfo:()=>{v.value="home",sessionStorage.removeItem("menu-active")},updateMenuActive:e=>{"logout"!==e&&(v.value=e)},toggleCollapse:()=>{o.value=!o.value},handleCollapse:()=>{o.value=!0},handleExpand:()=>{o.value=!1},fetchNotifyProvider:async()=>{try{u.value=[];const{data:e}=await a({p:1,search:"",limit:1e3}).fetch();u.value=null==e?void 0:e.map((e=>({label:e.name,value:e.id.toString(),type:e.type})))}catch(e){t(e)}},fetchDnsProvider:async(e="")=>{try{c.value=[];const{data:a}=await i({type:e}).fetch();c.value=(null==a?void 0:a.map((e=>({label:e.name,value:e.id.toString(),type:e.type}))))||[]}catch(a){t(a)}}}})),c=()=>{const e=u();return{...e,...o(e)}};export{c as u};

View File

@ -1 +1 @@
import{$ as r}from"./main-B314ly27.js";const e={key:{required:!0,trigger:"input",validator:(e,i)=>new Promise(((e,t)=>{i?e():t(new Error(r("t_38_1745735769521")))}))},cert:{required:!0,trigger:"input",validator:(e,i)=>new Promise(((e,t)=>{i?e():t(new Error(r("t_40_1745735815317")))}))}};export{e as r};
import{$ as r}from"./main-DgoEun3x.js";const e={key:{required:!0,trigger:"input",validator:(e,i)=>new Promise(((e,t)=>{i?e():t(new Error(r("t_38_1745735769521")))}))},cert:{required:!0,trigger:"input",validator:(e,i)=>new Promise(((e,t)=>{i?e():t(new Error(r("t_40_1745735815317")))}))}};export{e as r};

View File

@ -1 +1 @@
import{w as r,W as e}from"./business-IbhWuk4D.js";import{$ as i}from"./main-B314ly27.js";const o={domains:{required:!0,trigger:"input",validator:(r,o)=>new Promise(((r,t)=>{e(o)?o?r():t(new Error(i("t_0_1746697487119"))):t(new Error(i("t_0_1745553910661")))}))},email:{required:!0,trigger:"input",validator:(e,o)=>new Promise(((e,t)=>{r(o)?o?e():t(new Error(i("t_1_1746697485188"))):t(new Error(i("t_1_1745553909483")))}))},provider_id:{required:!0,trigger:"change",validator:(r,e)=>new Promise(((r,o)=>{e?r():o(new Error(i("t_3_1745490735059")))}))},end_day:{required:!0,trigger:"input",validator:(r,e)=>new Promise(((r,o)=>{e?r():o(new Error(i("t_2_1745553907423")))}))}};export{o as r};
import{w as r,W as e}from"./business-tY96d-Pv.js";import{$ as i}from"./main-DgoEun3x.js";const o={domains:{required:!0,trigger:"input",validator:(r,o)=>new Promise(((r,t)=>{e(o)?o?r():t(new Error(i("t_0_1746697487119"))):t(new Error(i("t_0_1745553910661")))}))},email:{required:!0,trigger:"input",validator:(e,o)=>new Promise(((e,t)=>{r(o)?o?e():t(new Error(i("t_1_1746697485188"))):t(new Error(i("t_1_1745553909483")))}))},provider_id:{required:!0,trigger:"change",validator:(r,e)=>new Promise(((r,o)=>{e?r():o(new Error(i("t_3_1745490735059")))}))},end_day:{required:!0,trigger:"input",validator:(r,e)=>new Promise(((r,o)=>{e?r():o(new Error(i("t_2_1745553907423")))}))}};export{o as r};

View File

@ -1 +1 @@
import{$ as r}from"./main-B314ly27.js";const e={subject:{trigger:"input",validator:(e,t)=>new Promise(((e,o)=>{t?t.length>100?o(new Error(r("t_3_1745887835089")+"长度不能超过100个字符")):e():o(new Error(r("t_3_1745887835089")))}))},body:{trigger:"input",validator:(e,t)=>new Promise(((e,o)=>{t?t.length>1e3?o(new Error(r("t_4_1745887835265")+"长度不能超过1000个字符")):e():o(new Error(r("t_4_1745887835265")))}))},provider_id:{trigger:"change",type:"string",validator:(e,t)=>new Promise(((e,o)=>{t?e():o(new Error(r("t_0_1745887835267")))}))}};export{e as r};
import{$ as r}from"./main-DgoEun3x.js";const e={subject:{trigger:"input",validator:(e,t)=>new Promise(((e,o)=>{t?t.length>100?o(new Error(r("t_3_1745887835089")+"长度不能超过100个字符")):e():o(new Error(r("t_3_1745887835089")))}))},body:{trigger:"input",validator:(e,t)=>new Promise(((e,o)=>{t?t.length>1e3?o(new Error(r("t_4_1745887835265")+"长度不能超过1000个字符")):e():o(new Error(r("t_4_1745887835265")))}))},provider_id:{trigger:"change",type:"string",validator:(e,t)=>new Promise(((e,o)=>{t?e():o(new Error(r("t_0_1745887835267")))}))}};export{e as r};

View File

@ -0,0 +1 @@
import{$ as e}from"./main-DgoEun3x.js";import{N as r}from"./business-tY96d-Pv.js";const i={provider:{required:!0,message:e("请选择主机提供商"),type:"string",trigger:"change"},provider_id:{required:!0,trigger:"change",type:"string",validator:(r,i)=>{if(!i)return new Error(e("请选择主机提供商"))}},"inputs.fromNodeId":{required:!0,message:e("t_3_1745748298161"),trigger:"change"},certPath:{required:!0,message:e("t_30_1746667591892"),trigger:"input"},keyPath:{required:!0,message:e("t_31_1746667593074"),trigger:"input"},siteName:{required:!0,message:e("t_23_1745735766455"),trigger:"input"},site_id:{required:!0,message:e("t_24_1745735766826"),trigger:"input"},domain:{required:!0,trigger:"input",validator:(i,t)=>{if(!r(t))return new Error(e("t_0_1744958839535"))}},region:{required:!0,message:e("t_25_1745735766651"),trigger:"input"},bucket:{required:!0,message:e("t_26_1745735767144"),trigger:"input"}};export{i as r};

View File

@ -1 +1 @@
import{$ as e}from"./main-B314ly27.js";const r={exec_type:{required:!0,message:e("t_31_1745735767891"),trigger:"change"},type:{required:!0,message:e("t_32_1745735767156"),trigger:"change"},week:{required:!0,message:e("t_33_1745735766532"),trigger:"input",type:"number"},month:{required:!0,message:e("t_33_1745735766532"),trigger:"input",type:"number"},hour:{required:!0,message:e("t_33_1745735766532"),trigger:"input",type:"number"},minute:{required:!0,message:e("t_33_1745735766532"),trigger:"input",type:"number"}};export{r};
import{$ as e}from"./main-DgoEun3x.js";const r={exec_type:{required:!0,message:e("t_31_1745735767891"),trigger:"change"},type:{required:!0,message:e("t_32_1745735767156"),trigger:"change"},week:{required:!0,message:e("t_33_1745735766532"),trigger:"input",type:"number"},month:{required:!0,message:e("t_33_1745735766532"),trigger:"input",type:"number"},hour:{required:!0,message:e("t_33_1745735766532"),trigger:"input",type:"number"},minute:{required:!0,message:e("t_33_1745735766532"),trigger:"input",type:"number"}};export{r};

View File

@ -1 +0,0 @@
import{$ as e}from"./main-B314ly27.js";import{N as r}from"./business-IbhWuk4D.js";const i={provider:{required:!0,message:e("t_19_1745735766810"),type:"string",trigger:"change"},provider_id:{required:!0,trigger:"change",type:"string",validator:(r,i)=>{if(!i)return new Error(e("t_1_1745744905566"))}},"inputs.fromNodeId":{required:!0,message:e("t_3_1745748298161"),trigger:"change"},certPath:{required:!0,message:e("t_30_1746667591892"),trigger:"input"},keyPath:{required:!0,message:e("t_31_1746667593074"),trigger:"input"},siteName:{required:!0,message:e("t_23_1745735766455"),trigger:"input"},site_id:{required:!0,message:e("t_24_1745735766826"),trigger:"input"},domain:{required:!0,trigger:"input",validator:(i,t)=>{if(!r(t))return new Error(e("t_0_1744958839535"))}},region:{required:!0,message:e("t_25_1745735766651"),trigger:"input"},bucket:{required:!0,message:e("t_26_1745735767144"),trigger:"input"}};export{i as r};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -85,6 +85,10 @@ func main() {
if secure[0] != '/' {
secure = "/" + secure
}
if secure == "/login" {
fmt.Println("安全入口不能是/login")
return
}
err := public.UpdateSetting("secure", secure)
if err != nil {
fmt.Println("Error updating setting:", err)

Some files were not shown because too many files have changed in this diff Show More