Улучшен фронт
1. Добавлен функционал в интерфейс по управлению сертификатами и службой редактирования сертификатов. 2. Добавлена кнопка для добавления прокси и экран редактирования прокси.
This commit is contained in:
@@ -295,6 +295,26 @@ func (a *App) DisableProxyService() string {
|
||||
return "Proxy disabled"
|
||||
}
|
||||
|
||||
func (a *App) EnableACMEService() string {
|
||||
config.ConfigData.Soft_Settings.ACME_enabled = true
|
||||
|
||||
// Сохраняем в файл
|
||||
configJSON, _ := json.MarshalIndent(config.ConfigData, "", " ")
|
||||
os.WriteFile(config.ConfigPath, configJSON, 0644)
|
||||
|
||||
return "ACME enabled"
|
||||
}
|
||||
|
||||
func (a *App) DisableACMEService() string {
|
||||
config.ConfigData.Soft_Settings.ACME_enabled = false
|
||||
|
||||
// Сохраняем в файл
|
||||
configJSON, _ := json.MarshalIndent(config.ConfigData, "", " ")
|
||||
os.WriteFile(config.ConfigPath, configJSON, 0644)
|
||||
|
||||
return "ACME disabled"
|
||||
}
|
||||
|
||||
func (a *App) OpenSiteFolder(host string) string {
|
||||
folderPath := "WebServer/www/" + host
|
||||
|
||||
@@ -422,4 +442,26 @@ func (a *App) ObtainAllSSLCertificates() string {
|
||||
}
|
||||
|
||||
return fmt.Sprintf("Completed: %d success, %d errors", successCount, errorCount)
|
||||
}
|
||||
|
||||
// GetCertInfo получает информацию о сертификате для домена
|
||||
func (a *App) GetCertInfo(domain string) acme.CertInfo {
|
||||
return acme.GetCertInfo(domain)
|
||||
}
|
||||
|
||||
// GetAllCertsInfo получает информацию о всех сертификатах
|
||||
func (a *App) GetAllCertsInfo() []acme.CertInfo {
|
||||
return acme.GetAllCertsInfo()
|
||||
}
|
||||
|
||||
// DeleteCertificate удаляет сертификат для домена
|
||||
func (a *App) DeleteCertificate(domain string) string {
|
||||
err := acme.DeleteCertificate(domain)
|
||||
if err != nil {
|
||||
return "Error: " + err.Error()
|
||||
}
|
||||
|
||||
// Перезагружаем сертификаты после удаления
|
||||
webserver.ReloadCertificates()
|
||||
return "Certificate deleted successfully"
|
||||
}
|
||||
@@ -20,6 +20,7 @@ func GetProxyList() []ProxyInfo {
|
||||
LocalPort: proxyConfig.LocalPort,
|
||||
ServiceHTTPSuse: proxyConfig.ServiceHTTPSuse,
|
||||
AutoHTTPS: proxyConfig.AutoHTTPS,
|
||||
AutoCreateSSL: proxyConfig.AutoCreateSSL,
|
||||
Status: status,
|
||||
}
|
||||
proxies = append(proxies, proxyInfo)
|
||||
|
||||
@@ -7,7 +7,7 @@ type ProxyInfo struct {
|
||||
LocalPort string `json:"local_port"`
|
||||
ServiceHTTPSuse bool `json:"service_https_use"`
|
||||
AutoHTTPS bool `json:"auto_https"`
|
||||
AutoCreateSSL bool `json:"AutoCreateSSL"`
|
||||
AutoCreateSSL bool `json:"auto_create_ssl"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ func GetSitesList() []SiteInfo {
|
||||
Status: site.Status,
|
||||
RootFile: site.Root_file,
|
||||
RootFileRouting: site.Root_file_routing,
|
||||
AutoCreateSSL: site.AutoCreateSSL,
|
||||
}
|
||||
sites = append(sites, siteInfo)
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ type SiteInfo struct {
|
||||
Status string `json:"status"`
|
||||
RootFile string `json:"root_file"`
|
||||
RootFileRouting bool `json:"root_file_routing"`
|
||||
AutoCreateSSL bool `json:"AutoCreateSSL"`
|
||||
AutoCreateSSL bool `json:"auto_create_ssl"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user