From 044c6168c9a391c2f3ff9b46b7c176854f625b82 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Fri, 11 Oct 2024 17:50:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/init/hook/hook.go | 2 + cmd/server/conf/app.yaml | 2 +- .../src/components/license-import/index.vue | 119 -------- .../src/components/system-upgrade/index.vue | 9 - frontend/src/lang/modules/en.ts | 44 --- frontend/src/lang/modules/tw.ts | 45 +-- frontend/src/lang/modules/zh.ts | 45 +-- frontend/src/routers/modules/setting.ts | 10 - frontend/src/views/home/index.vue | 23 +- frontend/src/views/setting/index.vue | 4 - frontend/src/views/setting/license/index.vue | 261 ------------------ frontend/src/views/setting/panel/index.vue | 16 -- .../src/views/setting/panel/proxy/index.vue | 1 - .../src/views/toolbox/clam/operate/index.vue | 13 - 14 files changed, 8 insertions(+), 586 deletions(-) delete mode 100644 frontend/src/components/license-import/index.vue delete mode 100644 frontend/src/views/setting/license/index.vue 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/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/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 f29884fa8..ecebfc6b6 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1093,7 +1093,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?', @@ -1652,49 +1651,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 87823a4b5..61c104cce 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -1033,7 +1033,6 @@ const message = { clam: { clam: '病毒掃描', cron: '定時掃描', - cronHelper: '專業版支持定時掃描功能', specErr: '執行周期格式錯誤,請檢查後重試!', disableMsg: '停止定時執行會導致該掃描任務不再自動執行。是否繼續?', enableMsg: '啟用定時執行會讓該掃描任務定期自動執行。是否繼續?', @@ -1305,8 +1304,8 @@ const message = { systemIP: '伺服器地址', proxy: '代理伺服器', proxyHelper: '設置代理伺服器後,將在以下場景中生效:', - proxyHelper1: '應用商店的安裝包下載和同步(專業版功能)', - proxyHelper2: '系統版本升級及獲取更新說明(專業版功能)', + proxyHelper1: '應用商店的安裝包下載和同步', + proxyHelper2: '系統版本升級及獲取更新說明', proxyHelper3: '系統許可證的驗證和同步', proxyType: '代理類型', proxyUrl: '代理地址', @@ -1535,46 +1534,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 1e6463db3..da6817b9d 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1034,7 +1034,6 @@ const message = { clam: { clam: '病毒扫描', cron: '定时扫描', - cronHelper: '专业版支持定时扫描功能 ', specErr: '执行周期格式错误,请检查后重试!', disableMsg: '停止定时执行会导致该扫描任务不再自动执行。是否继续?', enableMsg: '启用定时执行会让该扫描任务定期自动执行。是否继续?', @@ -1307,8 +1306,8 @@ const message = { systemIP: '服务器地址', proxy: '代理服务器', proxyHelper: '设置代理服务器后,将在以下场景中生效:', - proxyHelper1: '应用商店的安装包下载和同步(专业版功能)', - proxyHelper2: '系统版本升级及获取更新说明(专业版功能)', + proxyHelper1: '应用商店的安装包下载和同步', + proxyHelper2: '系统版本升级及获取更新说明', proxyHelper3: '系统许可证的验证和同步', proxyType: '代理类型', proxyUrl: '代理地址', @@ -1537,46 +1536,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/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 973438959..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') }} - - - @@ -145,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'; @@ -155,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; @@ -307,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) {