diff --git a/backend/app/dto/alert.go b/backend/app/dto/alert.go deleted file mode 100644 index 6cf8d7829..000000000 --- a/backend/app/dto/alert.go +++ /dev/null @@ -1,20 +0,0 @@ -package dto - -type CreateOrUpdateAlert struct { - AlertTitle string `json:"alertTitle"` - AlertType string `json:"alertType"` - AlertCount uint `json:"alertCount"` - EntryID uint `json:"entryID"` -} - -type AlertBase struct { - AlertType string `json:"alertType"` - EntryID uint `json:"entryID"` -} - -type PushAlert struct { - TaskName string `json:"taskName"` - AlertType string `json:"alertType"` - EntryID uint `json:"entryID"` - Param string `json:"param"` -} diff --git a/backend/app/dto/clam.go b/backend/app/dto/clam.go index 86c01d643..a73cc8818 100644 --- a/backend/app/dto/clam.go +++ b/backend/app/dto/clam.go @@ -33,7 +33,6 @@ type ClamInfo struct { LastHandleDate string `json:"lastHandleDate"` Spec string `json:"spec"` Description string `json:"description"` - AlertCount uint `json:"alertCount"` } type ClamLogSearch struct { @@ -72,8 +71,6 @@ type ClamCreate struct { InfectedDir string `json:"infectedDir"` Spec string `json:"spec"` Description string `json:"description"` - AlertCount uint `json:"alertCount"` - AlertTitle string `json:"alertTitle"` } type ClamUpdate struct { diff --git a/backend/app/dto/cronjob.go b/backend/app/dto/cronjob.go index 49e7cd5da..9189a7e09 100644 --- a/backend/app/dto/cronjob.go +++ b/backend/app/dto/cronjob.go @@ -31,13 +31,10 @@ type CronjobCreate struct { DefaultDownload string `json:"defaultDownload"` RetainCopies int `json:"retainCopies" validate:"number,min=1"` Secret string `json:"secret"` - AlertCount uint `json:"alertCount"` - AlertTitle string `json:"alertTitle"` } type CronjobUpdate struct { ID uint `json:"id" validate:"required"` - Type string `json:"type" validate:"required"` Name string `json:"name" validate:"required"` Spec string `json:"spec" validate:"required"` @@ -56,8 +53,6 @@ type CronjobUpdate struct { DefaultDownload string `json:"defaultDownload"` RetainCopies int `json:"retainCopies" validate:"number,min=1"` Secret string `json:"secret"` - AlertCount uint `json:"alertCount"` - AlertTitle string `json:"alertTitle"` } type CronjobUpdateStatus struct { @@ -104,7 +99,6 @@ type CronjobInfo struct { LastRecordTime string `json:"lastRecordTime"` Status string `json:"status"` Secret string `json:"secret"` - AlertCount uint `json:"alertCount"` } type SearchRecord struct { diff --git a/backend/app/service/clam.go b/backend/app/service/clam.go index 5abee657a..d96c0dc0b 100644 --- a/backend/app/service/clam.go +++ b/backend/app/service/clam.go @@ -8,7 +8,6 @@ import ( "path" "path/filepath" "sort" - "strconv" "strings" "time" @@ -21,7 +20,6 @@ import ( "github.com/1Panel-dev/1Panel/backend/utils/common" "github.com/1Panel-dev/1Panel/backend/utils/systemctl" "github.com/1Panel-dev/1Panel/backend/utils/xpack" - "github.com/1Panel-dev/1Panel/backend/xpack/utils/alert" "github.com/jinzhu/copier" "github.com/robfig/cron/v3" @@ -156,16 +154,6 @@ func (c *ClamService) SearchWithPage(req dto.SearchClamWithPage) (int64, interfa } datas[i].LastHandleDate = t1.Format(constant.DateTimeLayout) } - alertBase := dto.AlertBase{ - AlertType: "clams", - EntryID: datas[i].ID, - } - alertCount := xpack.GetAlert(alertBase) - if alertCount != 0 { - datas[i].AlertCount = alertCount - } else { - datas[i].AlertCount = 0 - } } return total, datas, err } @@ -192,19 +180,6 @@ func (c *ClamService) Create(req dto.ClamCreate) error { if err := clamRepo.Create(&clam); err != nil { return err } - - if req.AlertCount != 0 { - createAlert := dto.CreateOrUpdateAlert{ - AlertTitle: req.AlertTitle, - AlertCount: req.AlertCount, - AlertType: "clams", - EntryID: clam.ID, - } - err := xpack.CreateAlert(createAlert) - if err != nil { - return err - } - } return nil } @@ -250,16 +225,6 @@ func (c *ClamService) Update(req dto.ClamUpdate) error { if err := clamRepo.Update(req.ID, upMap); err != nil { return err } - updateAlert := dto.CreateOrUpdateAlert{ - AlertTitle: req.AlertTitle, - AlertType: "clams", - AlertCount: req.AlertCount, - EntryID: clam.ID, - } - err := xpack.UpdateAlert(updateAlert) - if err != nil { - return err - } return nil } @@ -300,14 +265,6 @@ func (c *ClamService) Delete(req dto.ClamDelete) error { if err := clamRepo.Delete(commonRepo.WithByID(id)); err != nil { return err } - alertBase := dto.AlertBase{ - AlertType: "clams", - EntryID: clam.ID, - } - err := xpack.DeleteAlert(alertBase) - if err != nil { - return err - } } return nil } @@ -348,7 +305,6 @@ func (c *ClamService) HandleOnce(req dto.OperateByID) error { } global.LOG.Debugf("clamdscan --fdpass %s %s -l %s", strategy, clam.Path, logFile) stdout, err := cmd.Execf("clamdscan --fdpass %s %s -l %s", strategy, clam.Path, logFile) - handleAlert(stdout, clam.Name, clam.ID) if err != nil { global.LOG.Errorf("clamdscan failed, stdout: %v, err: %v", stdout, err) } @@ -629,28 +585,3 @@ func (c *ClamService) loadLogPath(name string) string { return "" } - -func handleAlert(stdout, clamName string, clamId uint) { - if strings.Contains(stdout, "- SCAN SUMMARY -") { - lines := strings.Split(stdout, "\n") - for _, line := range lines { - if strings.HasPrefix(line, "Infected files:") { - var infectedFiles = 0 - infectedFiles, _ = strconv.Atoi(strings.TrimPrefix(line, "Infected files:")) - if infectedFiles > 0 { - pushAlert := dto.PushAlert{ - TaskName: clamName, - AlertType: "clams", - EntryID: clamId, - Param: strconv.Itoa(infectedFiles), - } - err := alert.PushAlert(pushAlert) - if err != nil { - global.LOG.Errorf("clamdscan push failed, err: %v", err) - } - break - } - } - } - } -} diff --git a/backend/app/service/cronjob.go b/backend/app/service/cronjob.go index 81dee96fa..41accecf4 100644 --- a/backend/app/service/cronjob.go +++ b/backend/app/service/cronjob.go @@ -13,7 +13,6 @@ import ( "github.com/1Panel-dev/1Panel/backend/app/model" "github.com/1Panel-dev/1Panel/backend/constant" "github.com/1Panel-dev/1Panel/backend/global" - "github.com/1Panel-dev/1Panel/backend/utils/xpack" "github.com/jinzhu/copier" "github.com/pkg/errors" "github.com/robfig/cron/v3" @@ -54,16 +53,6 @@ func (u *CronjobService) SearchWithPage(search dto.PageCronjob) (int64, interfac } else { item.LastRecordTime = "-" } - alertBase := dto.AlertBase{ - AlertType: cronjob.Type, - EntryID: cronjob.ID, - } - alertCount := xpack.GetAlert(alertBase) - if alertCount != 0 { - item.AlertCount = alertCount - } else { - item.AlertCount = 0 - } dtoCronjobs = append(dtoCronjobs, item) } return total, dtoCronjobs, err @@ -201,18 +190,6 @@ func (u *CronjobService) Create(cronjobDto dto.CronjobCreate) error { if err := cronjobRepo.Create(&cronjob); err != nil { return err } - if cronjobDto.AlertCount != 0 { - createAlert := dto.CreateOrUpdateAlert{ - AlertTitle: cronjobDto.AlertTitle, - AlertCount: cronjobDto.AlertCount, - AlertType: cronjob.Type, - EntryID: cronjob.ID, - } - err := xpack.CreateAlert(createAlert) - if err != nil { - return err - } - } return nil } @@ -255,14 +232,6 @@ func (u *CronjobService) Delete(req dto.CronjobBatchDelete) error { if err := cronjobRepo.Delete(commonRepo.WithByID(id)); err != nil { return err } - alertBase := dto.AlertBase{ - AlertType: cronjob.Type, - EntryID: cronjob.ID, - } - err := xpack.DeleteAlert(alertBase) - if err != nil { - return err - } } return nil @@ -312,21 +281,7 @@ func (u *CronjobService) Update(id uint, req dto.CronjobUpdate) error { upMap["default_download"] = req.DefaultDownload upMap["retain_copies"] = req.RetainCopies upMap["secret"] = req.Secret - err = cronjobRepo.Update(id, upMap) - if err != nil { - return err - } - updateAlert := dto.CreateOrUpdateAlert{ - AlertTitle: req.AlertTitle, - AlertType: cronModel.Type, - AlertCount: req.AlertCount, - EntryID: cronModel.ID, - } - err = xpack.UpdateAlert(updateAlert) - if err != nil { - return err - } - return nil + return cronjobRepo.Update(id, upMap) } func (u *CronjobService) UpdateStatus(id uint, status string) error { @@ -338,7 +293,6 @@ func (u *CronjobService) UpdateStatus(id uint, status string) error { entryIDs string err error ) - if status == constant.StatusEnable { entryIDs, err = u.StartJob(&cronjob, false) if err != nil { diff --git a/backend/app/service/cronjob_helper.go b/backend/app/service/cronjob_helper.go index cf31acfe8..6a4a16f18 100644 --- a/backend/app/service/cronjob_helper.go +++ b/backend/app/service/cronjob_helper.go @@ -12,7 +12,6 @@ import ( "github.com/1Panel-dev/1Panel/backend/buserr" "github.com/1Panel-dev/1Panel/backend/i18n" - "github.com/1Panel-dev/1Panel/backend/app/dto" "github.com/1Panel-dev/1Panel/backend/app/model" "github.com/1Panel-dev/1Panel/backend/app/repo" "github.com/1Panel-dev/1Panel/backend/constant" @@ -21,12 +20,9 @@ import ( "github.com/1Panel-dev/1Panel/backend/utils/cmd" "github.com/1Panel-dev/1Panel/backend/utils/files" "github.com/1Panel-dev/1Panel/backend/utils/ntp" - "github.com/1Panel-dev/1Panel/backend/utils/xpack" "github.com/pkg/errors" ) -var alertTypes = map[string]bool{"app": true, "website": true, "database": true, "directory": true, "log": true, "snapshot": true} - func (u *CronjobService) HandleJob(cronjob *model.Cronjob) { var ( message []byte @@ -94,7 +90,6 @@ func (u *CronjobService) HandleJob(cronjob *model.Cronjob) { record.Records, _ = mkdirAndWriteFile(cronjob, record.StartTime, message) } cronjobRepo.EndRecords(record, constant.StatusFailed, err.Error(), record.Records) - handleCronJobAlert(cronjob) return } if len(message) != 0 { @@ -396,19 +391,3 @@ func (u *CronjobService) generateLogsPath(cronjob model.Cronjob, startTime time. func hasBackup(cronjobType string) bool { return cronjobType == "app" || cronjobType == "database" || cronjobType == "website" || cronjobType == "directory" || cronjobType == "snapshot" || cronjobType == "log" } - -func handleCronJobAlert(cronjob *model.Cronjob) { - if alertTypes[cronjob.Type] { - pushAlert := dto.PushAlert{ - TaskName: cronjob.Name, - AlertType: cronjob.Type, - EntryID: cronjob.ID, - Param: cronjob.Type, - } - err := xpack.PushAlert(pushAlert) - if err != nil { - global.LOG.Errorf("cronjob alert push failed, err: %v", err) - return - } - } -} diff --git a/backend/init/hook/hook.go b/backend/init/hook/hook.go index 407de681e..182540030 100644 --- a/backend/init/hook/hook.go +++ b/backend/init/hook/hook.go @@ -178,6 +178,8 @@ func handleUserInfo(tags string, settingRepo repo.ISettingRepo) { if err := settingRepo.Update("SecurityEntrance", common.RandStrAndNum(10)); err != nil { global.LOG.Fatalf("init entrance before start failed, err: %v", err) } + sudo := cmd.SudoHandleCmd() + _, _ = cmd.Execf("%s sed -i '/CHANGE_USER_INFO=%v/d' /usr/local/bin/1pctl", sudo, global.CONF.System.ChangeUserInfo) return } if strings.Contains(global.CONF.System.ChangeUserInfo, "username") { diff --git a/backend/utils/xpack/xpack.go b/backend/utils/xpack/xpack.go index 29afab3e6..b8161d86a 100644 --- a/backend/utils/xpack/xpack.go +++ b/backend/utils/xpack/xpack.go @@ -8,7 +8,6 @@ import ( "net/http" "time" - "github.com/1Panel-dev/1Panel/backend/app/dto" "github.com/1Panel-dev/1Panel/backend/app/model" "github.com/1Panel-dev/1Panel/backend/buserr" "github.com/1Panel-dev/1Panel/backend/constant" @@ -40,23 +39,3 @@ func LoadXpuInfo() []interface{} { func StartClam(startClam model.Clam, isUpdate bool) (int, error) { return 0, buserr.New(constant.ErrXpackNotFound) } - -func CreateAlert(createAlert dto.CreateOrUpdateAlert) error { - return nil -} - -func UpdateAlert(updateAlert dto.CreateOrUpdateAlert) error { - return nil -} - -func DeleteAlert(alertBase dto.AlertBase) error { - return nil -} - -func GetAlert(alertBase dto.AlertBase) uint { - return 0 -} - -func PushAlert(pushAlert dto.PushAlert) error { - return nil -} diff --git a/cmd/server/conf/app.yaml b/cmd/server/conf/app.yaml index 0da0e5163..adb0851af 100644 --- a/cmd/server/conf/app.yaml +++ b/cmd/server/conf/app.yaml @@ -2,7 +2,7 @@ system: db_file: 1Panel.db base_dir: /opt mode: dev - repo_url: https://resource.fit2cloud.com/1panel/package + repo_url: https://resource.fit2cloud.com/1panel/package/aliyun app_repo: https://apps-assets.fit2cloud.com is_demo: false port: 9999 diff --git a/frontend/src/api/interface/cronjob.ts b/frontend/src/api/interface/cronjob.ts index 0da286476..bcd7c44f7 100644 --- a/frontend/src/api/interface/cronjob.ts +++ b/frontend/src/api/interface/cronjob.ts @@ -30,9 +30,6 @@ export namespace Cronjob { retainCopies: number; status: string; secret: string; - hasAlert: boolean; - alertCount: number; - alertTitle: string; } export interface CronjobCreate { name: string; diff --git a/frontend/src/api/interface/toolbox.ts b/frontend/src/api/interface/toolbox.ts index 3d8535477..dd94a17ba 100644 --- a/frontend/src/api/interface/toolbox.ts +++ b/frontend/src/api/interface/toolbox.ts @@ -139,9 +139,6 @@ export namespace Toolbox { spec: string; specObj: Cronjob.SpecObj; description: string; - hasAlert: boolean; - alertCount: number; - alertTitle: string; } export interface ClamCreate { name: string; diff --git a/frontend/src/components/license-import/index.vue b/frontend/src/components/license-import/index.vue deleted file mode 100644 index bd6212e40..000000000 --- a/frontend/src/components/license-import/index.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - diff --git a/frontend/src/components/system-upgrade/index.vue b/frontend/src/components/system-upgrade/index.vue index cc55c2b7d..e9f0ba806 100644 --- a/frontend/src/components/system-upgrade/index.vue +++ b/frontend/src/components/system-upgrade/index.vue @@ -16,11 +16,6 @@
- - - {{ isProductPro ? $t('license.pro') : $t('license.community') }} - - {{ version }} @@ -126,10 +121,6 @@ const handleClose = () => { drawerVisible.value = false; }; -const toHalo = () => { - window.open('https://www.lxware.cn/1panel' + '', '_blank', 'noopener,noreferrer'); -}; - const toDoc = () => { window.open('https://1panel.cn/docs/', '_blank', 'noopener,noreferrer'); }; diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 0218ef995..202139e50 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1094,7 +1094,6 @@ const message = { clam: { clam: 'Virus Scan', cron: 'Scheduled scan', - cronHelper: 'Professional version supports scheduled scan feature', specErr: 'Execution schedule format error, please check and retry!', disableMsg: 'Stopping scheduled execution will prevent this scan task from running automatically. Do you want to continue?', @@ -1655,49 +1654,6 @@ const message = { compressPassword: 'Compression Password', backupRecoverMessage: 'Please enter the compression or decompression password (leave blank to not set)', }, - license: { - community: 'Community Edition: ', - community2: 'Community Edition', - pro: 'Professional Edition: ', - trial: 'Trial Edition', - office: 'Official Edition', - trialInfo: 'Version', - authorizationId: 'Subscription Authorization ID', - authorizedUser: 'Authorized User', - expiresAt: 'Expiry Date', - productName: 'Product Name', - productStatus: 'Product Status', - Lost01: 'Lost * 1', - Lost02: 'Lost * 2', - Lost03: 'Lost', - Enable: 'Enabled', - Disable: 'Disabled', - lostHelper: - 'The License needs to be periodically synchronized for availability. Please ensure normal external network access. After three losses of connection, the License binding will be released.', - quickUpdate: 'Quick Update', - import: 'Import', - power: 'Authorize', - unbind: 'Unbind License', - unbindHelper: 'All Pro related Settings will be cleared after unbinding. Do you want to continue? ', - importLicense: 'Import License', - importHelper: 'Please click or drag the license file here', - technicalAdvice: 'Technical Advice', - advice: 'Consultation', - indefinitePeriod: 'Indefinite Period', - levelUpPro: 'Upgrade to Professional Edition', - licenseSync: 'License Sync', - knowMorePro: 'Learn More', - closeAlert: 'The current page can be closed in the panel settings', - introduce: 'Feature Introduction', - waf: 'Upgrading to the professional version can provide features such as interception map, logs, block records, geographical location blocking, custom rules, custom interception pages, etc.', - tamper: 'Upgrading to the professional version can protect websites from unauthorized modifications or tampering.', - gpu: 'Upgrading to the professional version can help users visually monitor important parameters of GPU such as workload, temperature, memory usage in real time.', - setting: - 'Upgrading to the professional version allows customization of panel logo, welcome message, and other information.', - monitor: - 'Upgrade to the professional version to view the real-time status of the website, visitor trends, visitor sources, request logs and other information. ', - alert: 'Upgrade to the professional version to receive alarm information via SMS and view alarm logs, fully control various key events, and ensure worry-free system operation', - }, clean: { scan: 'Start Scanning', scanHelper: 'Easily tidy up junk files accumulated during 1Panel runtime', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 9827c26a1..af80c64c4 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -1034,7 +1034,6 @@ const message = { clam: { clam: '病毒掃描', cron: '定時掃描', - cronHelper: '專業版支持定時掃描功能', specErr: '執行周期格式錯誤,請檢查後重試!', disableMsg: '停止定時執行會導致該掃描任務不再自動執行。是否繼續?', enableMsg: '啟用定時執行會讓該掃描任務定期自動執行。是否繼續?', @@ -1308,8 +1307,8 @@ const message = { systemIP: '伺服器地址', proxy: '代理伺服器', proxyHelper: '設置代理伺服器後,將在以下場景中生效:', - proxyHelper1: '應用商店的安裝包下載和同步(專業版功能)', - proxyHelper2: '系統版本升級及獲取更新說明(專業版功能)', + proxyHelper1: '應用商店的安裝包下載和同步', + proxyHelper2: '系統版本升級及獲取更新說明', proxyHelper3: '系統許可證的驗證和同步', proxyType: '代理類型', proxyUrl: '代理地址', @@ -1538,46 +1537,6 @@ const message = { compressPassword: '壓縮密碼', backupRecoverMessage: '請輸入壓縮或解壓縮密碼(留空則不設定)', }, - license: { - community: '社區版:', - community2: '社區版', - pro: '專業版:', - trial: '試用版', - office: '正式版', - trialInfo: '版本', - authorizationId: '訂閱授權 ID', - authorizedUser: '被授權方', - expiresAt: '到期時間', - productName: '產品名稱', - productStatus: '產品狀態', - Lost01: '失聯 * 1', - Lost02: '失聯 * 2', - Lost03: '已失聯', - Enable: '已啟用', - Disable: '未啟用', - lostHelper: '許可證需要定時同步是否可用,請保證正常外網訪問,失聯三次後將解除許可證綁定', - quickUpdate: '快速更新', - import: '導入', - power: '授 權', - unbind: '解除綁定', - unbindHelper: '解除綁定後將清除所有專業版相關設置,是否繼續?', - importLicense: '導入許可證', - importHelper: '請點擊或拖動許可文件到此處', - technicalAdvice: '技術諮詢', - advice: '諮詢', - indefinitePeriod: '無限期', - levelUpPro: '升級專業版', - licenseSync: '許可證同步', - knowMorePro: '了解更多', - closeAlert: '當前頁面可在面板設置中關閉顯示', - introduce: '功能介紹', - waf: '升級專業版可以獲得攔截地圖、日誌、封鎖記錄、地理位置封禁、自定義規則、自定義攔截頁面等功能。', - tamper: '升級專業版可以保護網站免受未經授權的修改或篡改。', - gpu: '升級專業版可以幫助用戶實時直觀查看到 GPU 的工作負載、溫度、顯存等重要參數。', - setting: '升級專業版可以自定義面板 Logo、歡迎簡介等信息。', - monitor: '升級專業版可以查看網站的即時狀態、訪客趨勢、訪客來源、請求日誌等資訊。 ', - alert: '陞級專業版可通過簡訊接收告警資訊,並查看告警日誌,全面掌控各類關鍵事件,確保系統運行無憂。', - }, clean: { scan: '開始掃描', scanHelper: '輕鬆梳理 1Panel 運行期間積累的垃圾文件', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 246ba89fb..acc90d3ba 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1035,7 +1035,6 @@ const message = { clam: { clam: '病毒扫描', cron: '定时扫描', - cronHelper: '专业版支持定时扫描功能 ', specErr: '执行周期格式错误,请检查后重试!', disableMsg: '停止定时执行会导致该扫描任务不再自动执行。是否继续?', enableMsg: '启用定时执行会让该扫描任务定期自动执行。是否继续?', @@ -1310,8 +1309,8 @@ const message = { systemIP: '服务器地址', proxy: '代理服务器', proxyHelper: '设置代理服务器后,将在以下场景中生效:', - proxyHelper1: '应用商店的安装包下载和同步(专业版功能)', - proxyHelper2: '系统版本升级及获取更新说明(专业版功能)', + proxyHelper1: '应用商店的安装包下载和同步', + proxyHelper2: '系统版本升级及获取更新说明', proxyHelper3: '系统许可证的验证和同步', proxyType: '代理类型', proxyUrl: '代理地址', @@ -1540,46 +1539,6 @@ const message = { compressPassword: '压缩密码', backupRecoverMessage: '请输入压缩或解压缩密码(留空则不设置)', }, - license: { - community: '社区版:', - community2: '社区版', - pro: '专业版:', - trial: '试用版', - office: '正式版', - trialInfo: '版本', - authorizationId: '订阅授权 ID', - authorizedUser: '被授权方', - expiresAt: '到期时间', - productName: '产品名称', - productStatus: '产品状态', - Lost01: '失联 * 1', - Lost02: '失联 * 2', - Lost03: '已失联', - Enable: '已激活', - Disable: '未激活', - lostHelper: '许可证需要定时同步是否可用,请保证正常外网访问,失联三次后将解除许可证绑定', - quickUpdate: '快速更新', - import: '导入', - power: '授 权', - unbind: '解除绑定', - unbindHelper: '解除绑定后将清除所有专业版相关设置,是否继续?', - importLicense: '导入许可证', - importHelper: '请点击或拖动许可文件到此处', - technicalAdvice: '技术咨询', - advice: '咨询', - indefinitePeriod: '无限期', - levelUpPro: '升级专业版', - licenseSync: '许可证同步', - knowMorePro: '了解更多', - closeAlert: '当前页面可在面板设置中关闭显示', - introduce: '功能介绍', - waf: '升级专业版可以获得拦截地图、日志、封锁记录、地理位置封禁、自定义规则、自定义拦截页面等功能。', - tamper: '升级专业版可以保护网站免受未经授权的修改或篡改。', - gpu: '升级专业版可以帮助用户实时直观查看到 GPU 的工作负载、温度、显存等重要参数。', - setting: '升级专业版可以自定义面板 Logo、欢迎简介等信息。', - monitor: '升级专业版可以查看网站的实时状态、访客趋势、访客来源、请求日志等信息。', - alert: '升级专业版可通过短信接收告警信息,并查看告警日志,全面掌控各类关键事件,确保系统运行无忧。', - }, clean: { scan: '开始扫描', scanHelper: '轻松梳理 1Panel 运行期间积累的垃圾文件', diff --git a/frontend/src/routers/modules/setting.ts b/frontend/src/routers/modules/setting.ts index 99e6def22..c7cc9ea6e 100644 --- a/frontend/src/routers/modules/setting.ts +++ b/frontend/src/routers/modules/setting.ts @@ -37,16 +37,6 @@ const settingRouter = { activeMenu: 'Setting', }, }, - { - path: 'license', - name: 'License', - component: () => import('@/views/setting/license/index.vue'), - hidden: true, - meta: { - requiresAuth: true, - activeMenu: 'Setting', - }, - }, { path: 'about', name: 'About', diff --git a/frontend/src/styles/reset.scss b/frontend/src/styles/reset.scss index d4c8784ac..4f16b25fc 100644 --- a/frontend/src/styles/reset.scss +++ b/frontend/src/styles/reset.scss @@ -22,9 +22,4 @@ body, .el-switch--small,.is-checked .el-switch__core::after { margin-left: 12px !important; -} - -.el-alert__title { - display: flex; - align-items: center; -} +} \ No newline at end of file diff --git a/frontend/src/views/cronjob/operate/index.vue b/frontend/src/views/cronjob/operate/index.vue index e002a2e3e..59dcdb704 100644 --- a/frontend/src/views/cronjob/operate/index.vue +++ b/frontend/src/views/cronjob/operate/index.vue @@ -336,31 +336,6 @@ - - - {{ $t('alert.cronJobHelper') }} - - - - {{ $t('alert.alertCountHelper') }} - - - {{ $t('alert.licenseHelper') }} - - {{ $t('license.levelUpPro') }} - - - - @@ -408,9 +382,6 @@ import { listContainer } from '@/api/modules/container'; import { Database } from '@/api/interface/database'; import { ListAppInstalled } from '@/api/modules/app'; import { loadDefaultSpec, specOptions, transObjToSpec, transSpecToObj, weekOptions } from './../helper'; -import { storeToRefs } from 'pinia'; -import { GlobalStore } from '@/store'; -import LicenseImport from '@/components/license-import/index.vue'; const router = useRouter(); @@ -426,11 +397,6 @@ const dialogData = ref({ title: '', }); -const globalStore = GlobalStore(); -const licenseRef = ref(); -const { isProductPro } = storeToRefs(globalStore); -const alertTypes = ['app', 'website', 'database', 'directory', 'log', 'snapshot']; - const acceptParams = (params: DialogProps): void => { dialogData.value = params; if (dialogData.value.rowData?.spec) { @@ -457,8 +423,6 @@ const acceptParams = (params: DialogProps): void => { if (dialogData.value.rowData.dbName) { dialogData.value.rowData.dbNameList = dialogData.value.rowData.dbName.split(','); } - dialogData.value.rowData.hasAlert = dialogData.value.rowData!.alertCount > 0; - dialogData.value.rowData!.alertCount = dialogData.value.rowData!.alertCount || 3; dialogData.value.rowData!.command = dialogData.value.rowData!.command || 'sh'; dialogData.value.rowData!.isCustom = dialogData.value.rowData!.command !== 'sh' && @@ -596,18 +560,6 @@ const verifySpec = (rule: any, value: any, callback: any) => { callback(); }; -function checkSendCount(rule: any, value: any, callback: any) { - if (value === '') { - callback(); - } - const regex = /^(?:[1-9]|[12][0-9]|30)$/; - if (!regex.test(value)) { - return callback(new Error(i18n.global.t('commons.rule.numberRange', [1, 30]))); - } - - callback(); -} - const rules = reactive({ name: [Rules.requiredInput, Rules.noSpace], type: [Rules.requiredSelect], @@ -626,7 +578,6 @@ const rules = reactive({ backupAccounts: [Rules.requiredSelect], defaultDownload: [Rules.requiredSelect], retainCopies: [Rules.number], - alertCount: [Rules.integerNumber, { validator: checkSendCount, trigger: 'blur' }], }); type FormInstance = InstanceType; @@ -805,17 +756,6 @@ const onSubmit = async (formEl: FormInstance | undefined) => { if (dialogData.value?.rowData?.exclusionRules) { dialogData.value.rowData.exclusionRules = dialogData.value.rowData.exclusionRules.replaceAll('\n', ','); } - if (alertTypes.includes(dialogData.value.rowData.type)) { - dialogData.value.rowData.alertCount = - dialogData.value.rowData!.hasAlert && isProductPro.value ? dialogData.value.rowData.alertCount : 0; - dialogData.value.rowData.alertTitle = - dialogData.value.rowData!.hasAlert && isProductPro.value - ? i18n.global.t('cronjob.alertTitle', [ - i18n.global.t('cronjob.' + dialogData.value.rowData.type), - dialogData.value.rowData.name, - ]) - : ''; - } if (!dialogData.value.rowData) return; if (dialogData.value.title === 'create') { await addCronjob(dialogData.value.rowData); @@ -830,10 +770,6 @@ const onSubmit = async (formEl: FormInstance | undefined) => { }); }; -const toUpload = () => { - licenseRef.value.acceptParams(); -}; - defineExpose({ acceptParams, }); diff --git a/frontend/src/views/home/index.vue b/frontend/src/views/home/index.vue index 2726f1102..e670fd5c6 100644 --- a/frontend/src/views/home/index.vue +++ b/frontend/src/views/home/index.vue @@ -7,17 +7,7 @@ path: '/', }, ]" - > - - + /> - -
@@ -269,7 +257,6 @@ import { onMounted, onBeforeUnmount, ref, reactive } from 'vue'; import Status from '@/views/home/status/index.vue'; import App from '@/views/home/app/index.vue'; import VCharts from '@/components/v-charts/index.vue'; -import LicenseImport from '@/components/license-import/index.vue'; import CardWithHeader from '@/components/card-with-header/index.vue'; import i18n from '@/lang'; import { Dashboard } from '@/api/interface/dashboard'; @@ -303,9 +290,6 @@ const timeNetDatas = ref>([]); const ioOptions = ref(); const netOptions = ref(); -const licenseRef = ref(); -const isProductPro = ref(); - const searchInfo = reactive({ ioOption: 'all', netOption: 'all', @@ -659,12 +643,7 @@ const onBlur = () => { isActive.value = false; }; -const toUpload = () => { - licenseRef.value.acceptParams(); -}; - onMounted(() => { - isProductPro.value = globalStore.isProductPro; window.addEventListener('focus', onFocus); window.addEventListener('blur', onBlur); loadSafeStatus(); diff --git a/frontend/src/views/setting/index.vue b/frontend/src/views/setting/index.vue index 587d8bf39..e05e46858 100644 --- a/frontend/src/views/setting/index.vue +++ b/frontend/src/views/setting/index.vue @@ -27,10 +27,6 @@ const buttons = [ label: i18n.global.t('setting.snapshot'), path: '/settings/snapshot', }, - { - label: i18n.global.t('setting.license'), - path: '/settings/license', - }, { label: i18n.global.t('setting.about'), path: '/settings/about', diff --git a/frontend/src/views/setting/license/index.vue b/frontend/src/views/setting/license/index.vue deleted file mode 100644 index 944ae9c0e..000000000 --- a/frontend/src/views/setting/license/index.vue +++ /dev/null @@ -1,261 +0,0 @@ - - - - - diff --git a/frontend/src/views/setting/panel/index.vue b/frontend/src/views/setting/panel/index.vue index a4ad8f896..7d5b754b4 100644 --- a/frontend/src/views/setting/panel/index.vue +++ b/frontend/src/views/setting/panel/index.vue @@ -126,21 +126,6 @@ - - - - {{ $t('commons.button.enable') }} - - - {{ $t('commons.button.disable') }} - - - {{ $t('setting.developerModeHelper') }} - - diff --git a/frontend/src/views/toolbox/clam/operate/index.vue b/frontend/src/views/toolbox/clam/operate/index.vue index c27e290f3..9d414515d 100644 --- a/frontend/src/views/toolbox/clam/operate/index.vue +++ b/frontend/src/views/toolbox/clam/operate/index.vue @@ -53,12 +53,6 @@ - - {{ $t('toolbox.clam.cronHelper') }} - - {{ $t('license.levelUpPro') }} - - - - - {{ $t('alert.clamHelper') }} - - - {{ $t('toolbox.clam.alertHelper') }} - - {{ $t('license.levelUpPro') }} - - - - - {{ $t('alert.alertCountHelper') }} - @@ -159,7 +129,6 @@ - @@ -169,7 +138,6 @@ import { Rules } from '@/global/form-rules'; import FileList from '@/components/file-list/index.vue'; import i18n from '@/lang'; import { ElForm } from 'element-plus'; -import LicenseImport from '@/components/license-import/index.vue'; import DrawerHeader from '@/components/drawer-header/index.vue'; import { MsgError, MsgSuccess } from '@/utils/message'; import { Toolbox } from '@/api/interface/toolbox'; @@ -179,7 +147,6 @@ import { storeToRefs } from 'pinia'; import { GlobalStore } from '@/store'; const globalStore = GlobalStore(); -const licenseRef = ref(); const { isProductPro } = storeToRefs(globalStore); interface DialogProps { title: string; @@ -208,8 +175,6 @@ const acceptParams = (params: DialogProps): void => { second: 30, }; } - dialogData.value.rowData.hasAlert = dialogData.value.rowData!.alertCount > 0; - dialogData.value.rowData!.alertCount = dialogData.value.rowData!.alertCount || 3; title.value = i18n.global.t('commons.button.' + dialogData.value.title); drawerVisible.value = true; }; @@ -303,19 +268,6 @@ const verifySpec = (rule: any, value: any, callback: any) => { } callback(); }; - -function checkSendCount(rule: any, value: any, callback: any) { - if (value === '') { - callback(); - } - const regex = /^(?:[1-9]|[12][0-9]|30)$/; - if (!regex.test(value)) { - return callback(new Error(i18n.global.t('commons.rule.numberRange', [1, 30]))); - } - - callback(); -} - const rules = reactive({ name: [Rules.simpleName], path: [Rules.requiredInput, Rules.noSpace], @@ -323,7 +275,6 @@ const rules = reactive({ { validator: verifySpec, trigger: 'blur', required: true }, { validator: verifySpec, trigger: 'change', required: true }, ], - alertCount: [Rules.integerNumber, { validator: checkSendCount, trigger: 'blur' }], }); type FormInstance = InstanceType; @@ -347,10 +298,6 @@ const hasHour = (item: any) => { return item.specType !== 'perHour' && item.specType !== 'perNMinute' && item.specType !== 'perNSecond'; }; -const toUpload = () => { - licenseRef.value.acceptParams(); -}; - const changeSpecType = () => { let item = dialogData.value.rowData!.specObj; switch (item.specType) { @@ -393,16 +340,6 @@ const onSubmit = async (formEl: FormInstance | undefined) => { MsgError(i18n.global.t('cronjob.cronSpecHelper')); return; } - dialogData.value.rowData.alertCount = dialogData.value.rowData!.hasAlert - ? dialogData.value.rowData.alertCount - : 0; - dialogData.value.rowData.alertTitle = i18n.global.t('toolbox.clam.alertTitle', [ - dialogData.value.rowData.name, - ]); - } else { - dialogData.value.rowData.alertTitle = ''; - dialogData.value.rowData.alertCount = 0; - dialogData.value.rowData.hasAlert = false; } dialogData.value.rowData.spec = spec;