Compare commits

...
Author SHA1 Message Date
王贺 2b13352004 chore: Add Indonesian language (#7445) 2024-12-19 23:20:48 +08:00
maninhill 94e5d7e642 chore: Update README.md 2024-12-19 22:42:35 +08:00
maninhill 001b4dbada docs: Create README.id.md 2024-12-19 22:41:22 +08:00
BugKing 1192dec689 docs: Add Product Hunt badge (#7434) 2024-12-19 11:55:18 +08:00
蘭 956d47f9da refactor: Demo server, prohibit operation (#7433) 2024-12-19 02:06:19 +00:00
John Niang 063a071228 Fix invalid postion of before content in home page in Firefox Linux (#7429) 2024-12-18 18:33:59 +08:00
Ryan Wang c54a7de827 docs: add Korean README documentation (#7427)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2024-12-18 17:15:10 +08:00
老广 0410e48aad docs: Add README.pt-br.md (#7425) 2024-12-18 16:29:44 +08:00
liuchang_cloud a4d95737d3 docs: Update README.md (#7424) 2024-12-18 16:16:14 +08:00
jianneng-fit2cloud bc64d83ab2 style: Container style (#7422) 2024-12-18 15:32:30 +08:00
蘭 87616e388b style: Optimize style (#7414)
Refs #7419
2024-12-18 06:44:14 +00:00
taojinlongandtaojinlong 3f35f90fc2 fix: fix typos (#7413)
Co-authored-by: taojinlong <jinlong@fit2cloud.com>
2024-12-18 14:06:00 +08:00
王嘉豪 c3ba69814c Update fa.yaml (#7411) 2024-12-18 14:05:46 +08:00
wisonic-s 66a517e58d fix: fix typos (#7407) 2024-12-18 14:05:24 +08:00
Bryan 3108c927af fix: typos (#7405) 2024-12-18 14:04:51 +08:00
Junjun 5738cceac9 fix typos (#7404) 2024-12-18 14:04:17 +08:00
dataeaseShu db2f648bce fix: fix typos (#7403) 2024-12-18 14:04:06 +08:00
fit2cloud-chenyw 6012a6cf9f fix: datas should be dataList (#7402) 2024-12-18 14:03:56 +08:00
ulleo a4dcbc90e6 fix: fix typos (#7401) 2024-12-18 14:03:40 +08:00
BugKing 955ecce952 docs: Update README.md (#7416) 2024-12-18 13:34:56 +08:00
maninhill 91fba21ed3 chore: Update README.md 2024-12-18 11:55:20 +08:00
wanghe-fit2cloud 490e2934b8 chore: Optimize the README file 2024-12-18 11:54:06 +08:00
wanghe-fit2cloud cb6d3d4fc3 chore: Optimize the README file 2024-12-18 11:52:05 +08:00
xuwei-fit2cloud 7f2a09eab3 fix: fix typos 2024-12-18 10:25:43 +08:00
John Niang c522a308b9 Refine English translation and UI style (#7399) 2024-12-18 10:24:00 +08:00
ssongliu dde686d55f style: Increase the height of the script input box (#7398) 2024-12-18 02:12:14 +00:00
maninhill 2f0b4888de chore: Update README_EN.md 2024-12-18 09:37:56 +08:00
ssongliu 35e7b11709 style: Increase the height of the script input box (#7396) 2024-12-17 15:42:11 +00:00
ssongliu 6cf3f158c7 fix: Improve cache cleaning for internationalization (#7395) 2024-12-17 15:10:11 +00:00
蘭 4944e705dc fix: Fix the issue of clearing cache title judgment (#7394) 2024-12-17 15:02:11 +00:00
蘭 3b38b9d86b feat: Optimize style and description (#7393) 2024-12-17 12:46:11 +00:00
zhengkunwang 6275eec918 style: change some label (#7392) 2024-12-17 12:44:11 +00:00
zhengkunwang ad652ca6f5 style: change some label (#7387) 2024-12-17 08:50:09 +00:00
zhengkunwang 7029d985c6 style: change some column width (#7385) 2024-12-17 06:44:08 +00:00
ssongliu 9539fd40eb fix: Fix the issue of compose name validation errors (#7382)
Refs #7380
2024-12-17 04:16:12 +00:00
蘭 4c03a482bd feat: Modify document address (#7381) 2024-12-17 02:28:12 +00:00
蘭 f58ed5614e feat: Optimize style and description (#7378) 2024-12-16 14:16:10 +00:00
zhengkunwang 198e78e0b4 feat: change default language (#7377) 2024-12-16 11:04:10 +00:00
wanghe-fit2cloud 1f16e09daa chore: Optimize the prompt messages on some pages 2024-12-16 18:27:15 +08:00
蘭 16f47f8664 fix: Fix the issue of incorrect display of prompts on the English language login page (#7376) 2024-12-16 09:40:10 +00:00
蘭 40604c7880 feat: Optimize international document addresses (#7372) 2024-12-16 09:38:09 +00:00
ssongliu fa86c4f39a fix: Fixed an issue where the language pack initialization download f… (#7375) 2024-12-16 09:00:10 +00:00
zhengkunwang 7f3cc784cd feat: Fix Application Store Style Issue Under Poor Network Conditions (#7374)
Refs https://github.com/1Panel-dev/1Panel/issues/7370
2024-12-16 08:58:09 +00:00
zhengkunwang 836f6c3520 feat: Fix Translation Issue in Input Field Placeholder on First Login (#7369) 2024-12-16 05:46:09 +00:00
蘭 2ff1e3a245 style: Optimize international style layout (#7368) 2024-12-16 05:44:08 +00:00
wanghe-fit2cloud f7078a6140 chore: Update the overview image 2024-12-16 11:42:49 +08:00
ssongliu 141786e4e9 fix: FIx the issue of container editing not opening successfully (#7360) 2024-12-13 14:35:56 +00:00
蘭 2d098f8078 style: Optimize layout style (#7359) 2024-12-13 14:33:56 +00:00
John Niang 229254e3d3 Replace whitelist and blacklist with allowlist and blocklist (#7358) 2024-12-13 22:33:07 +08:00
刘瑞斌 96329967ba feat: CornJob shell script syntax highlighting (#7357) 2024-12-13 21:31:58 +08:00
ssongliu 0d988bbd6a pref(system): Optimize and upgrade related internationalization translations. (#7356) 2024-12-12 15:57:50 +00:00
蘭 1ff4f33ceb style: Optimize layout style (#7354) 2024-12-12 22:20:21 +08:00
John Niang c95d61397d Refine English translation again and again (#7353) 2024-12-12 18:46:01 +08:00
蘭 590238dc13 style: Optimize layout style (#7352) 2024-12-12 10:19:50 +00:00
蘭 ed1b2613f2 style: Code Style Format (#7351) 2024-12-12 09:33:49 +00:00
蘭 c0e0db670c feat: Adjust the empty status prompt layout (#7350) 2024-12-12 09:03:50 +00:00
蘭 9132a2c4a9 fix: Fixed the bug of displaying prompt information for first-time login (#7348) 2024-12-12 09:01:51 +00:00
蘭 5e880ba25e feat: Language pack content adjustment (#7349) 2024-12-12 08:59:50 +00:00
蘭 5a1928bee6 feat: Optimize English description and layout (#7346) 2024-12-12 07:23:49 +00:00
ssongliu 82e9e72c70 feat: Fix the initialization errors of GeoIP (#7345) 2024-12-12 06:55:49 +00:00
ssongliu c35f55f70c pref: Optimize the button style for database connection information (#7342) 2024-12-12 03:53:48 +00:00
ssongliu 0542b39373 pref: Optimize the button style for database connection information (#7341) 2024-12-12 02:37:49 +00:00
igophper 013cf21863 fix: fixed the issue of abnormal log request (#7338)
Refs #7339
2024-12-12 10:36:41 +08:00
dependabot[bot] c648f9b14a build(deps): bump golang.org/x/crypto from 0.28.0 to 0.31.0 (#7340)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.28.0 to 0.31.0.
- [Commits](https://github.com/golang/crypto/compare/v0.28.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-12 10:36:01 +08:00
igophper d9407c425f fix: correct typos in typescript interface names (#7337) 2024-12-12 09:51:21 +08:00
igophper 2c8dad980b refactor(init): run docker network creation and firewall setup in a goroutine (#7336) 2024-12-11 22:33:37 +08:00
zhengkunwang 75d94f5b89 feat: Fix 500 Error After Setting Authorized IP (#7334) 2024-12-11 10:47:45 +00:00
蘭 4d760d3019 feat: Some adjustments to internationalization (#7332) 2024-12-11 10:45:45 +00:00
ssongliu 20c9230291 feat(init): Add support for geo ip pack initialization (#7333) 2024-12-11 18:44:18 +08:00
liqiang-fit2cloud 02c3a34f13 build: try another LLM for code review. 2024-12-11 17:27:52 +08:00
Meng Zhuo c2dadc2b92 fix: typo in makefile (#7327) 2024-12-11 16:07:26 +08:00
ssongliu f5de005ad7 feat: Add YAML format to CodeMirror (#7326)
Refs #7274
2024-12-11 07:47:43 +00:00
zhengkunwang 335a82332f feat: Handle HTTP 444 Status Code (#7325) 2024-12-11 06:57:43 +00:00
wanghe-fit2cloud a81cb5c1ab chore: Remove some unused variables 2024-12-11 14:31:59 +08:00
ssongliu aaf1d86a55 fix(database-pg): Fixed the issue of PostgreSQL not being able to back up. (#7324) 2024-12-11 06:25:43 +00:00
蘭 cbad4dd172 style: Optimize the layout of app operation buttons (#7322) 2024-12-11 06:23:43 +00:00
蘭 932da58759 fix: i18n file enhancement (#7321) 2024-12-11 06:21:43 +00:00
John Niang 01defdf0f6 Refine pluralization of some English words (#7318)
* Refine plural translation of English words

* Remove useless i18n modifier
2024-12-11 09:23:37 +08:00
王贺 b33cce3059 chore: Include the GeoIP.mmdb file when building the installation package (#7317) 2024-12-10 19:04:08 +08:00
ssongliu 17ef66aa49 feat(init): add support for international language pack initialization (#7315) 2024-12-10 18:36:53 +08:00
zhengkunwang f01d770fec feat: Fix Missing CPU and Memory Limit Warnings When Editing Installe… (#7313) 2024-12-10 09:55:39 +00:00
wanghe-fit2cloud 06cc7fcc02 chore: Include language packs when building the installation package 2024-12-10 17:50:49 +08:00
zhengkunwang 4635047004 feat: Remove Unused Components (#7311) 2024-12-10 08:21:38 +00:00
蘭 88b70eba53 style: Improve password action buttons styling in database connection info (#7309)
Refs #7284
2024-12-10 07:59:38 +00:00
蘭 6ad48250f8 style: Optimize input to disable background color (#7308) 2024-12-10 07:57:38 +00:00
ssongliu 9ac9f76a1d fix(container): Fix the issue of container command parsing failure (#7307) 2024-12-10 07:55:39 +00:00
igophper b7702daea3 fix: 解决控制台报错问题 (#7299) 2024-12-10 15:08:58 +08:00
zhengkunwang db7180a761 feat: Add Return Pages for Unauthorized Domains and IPs (#7306) 2024-12-10 11:58:32 +08:00
蘭 dbe62082ff style: Adjusted some English layouts (#7305) 2024-12-10 03:49:37 +00:00
蘭 06bf2bbc2f fix: Fix alert setting issue (#7304) 2024-12-10 03:17:38 +00:00
zhengkunwang 162a0c543c feat: Fix Issue with DNS Account Deletion After Certificate Update Ap… (#7303)
Refs https://github.com/1Panel-dev/1Panel/issues/7300
2024-12-10 03:15:38 +00:00
蘭 2bc07c91df pref: Improve Swagger authentication (#7298) 2024-12-09 09:57:34 +00:00
蘭 3d84a5589f fix: Dealing with API interface issues (#7295) 2024-12-09 07:29:33 +00:00
BugKing b88438a0a3 chore: refile English translation (#7283) 2024-12-06 18:53:52 +08:00
王贺 b73dcc9388 Modify the issues-translate-action token (#7281) 2024-12-06 17:21:01 +08:00
Ryan Wang 12ad08a619 chore: fix phantom dependency issue (#7279)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2024-12-06 17:16:19 +08:00
王贺 0c000a4994 fix: Modify the default open source license in Swagger (#7277)
Refs #7275
2024-12-06 08:57:20 +00:00
蘭 d2da7e2ea5 pref: Improve the API interface process (#7272) 2024-12-06 08:19:19 +00:00
蘭 873bba92db Fix: Postgres fails to connect when using special characters (#7269) 2024-12-06 10:19:41 +08:00
zhengkunwang 3e14186d3d feat: Add .NET Runtime Environment for Websites (#7266) 2024-12-05 10:05:14 +00:00
Cookie 5be325405d Fix: Postgres fails to connect when using special characters (#7262)
* Update client.go

* Update remote.go

* Update client.go
2024-12-05 16:00:52 +08:00
ssongliu 5b92b75090 feat(cmd): Add internationalization for the output of the 1pctl version (#7263) 2024-12-05 07:43:14 +00:00
ssongliu 7202de6f4c feat: Add pt-BR support for i18n (#7261) 2024-12-05 06:43:15 +00:00
zhengkunwang e6a772ebfd feat: Add System Version Restrictions for Applications (#7260) 2024-12-05 06:41:14 +00:00
John Niang f320492164 Refine English translation (#7247) 2024-12-04 21:32:59 +08:00
zhengkunwang d8fd430856 fix: Fix Issue with Podman Unable to Create PHP Runtime Website (#7253) 2024-12-03 11:01:05 +00:00
zhengkunwang 8e3a06b07f feat: Internationalize Certain Files (#7252) 2024-12-03 10:17:05 +00:00
maninhill b6f65f278d chore: Create README_CN.md 2024-12-03 18:04:15 +08:00
maninhill 3e8dfb6841 chore: Update README.md 2024-12-03 17:44:40 +08:00
maninhill ffeb47eaac chore: Update README_EN.md 2024-12-03 17:37:36 +08:00
maninhill 4cffe1d6bc chore: Update README_EN.md 2024-12-03 17:35:53 +08:00
wanghe-fit2cloud 49b3b6ded5 feat: Improve system language translations 2024-12-03 15:31:27 +08:00
BugKing f294130746 chore: fix typo for CloudDNS (#7243) 2024-12-03 15:28:29 +08:00
wanghe-fit2cloud 1910f1b78a feat: 1pctl command supports more languages 2024-12-03 15:27:34 +08:00
wanghe-fit2cloud cc1d2f1eae chore: Update app.yaml 2024-12-03 13:51:06 +08:00
wanghe-fit2cloud 048121a936 chore: Update workflows 2024-12-02 14:24:01 +08:00
John Niang e41e74d730 Refine English translation (#7232) 2024-12-01 22:14:44 +08:00
蘭 0ef1a26e95 pref: Remove Swagger description information (#7214) 2024-11-30 11:44:50 +00:00
zhengkunwang 00701a3999 feat(website): Translate Chinese Parts of Website Default Files (#7213) 2024-11-30 11:42:51 +00:00
wanghe-fit2cloud 8453e60609 chore: Streamline some issue templates 2024-11-29 22:51:42 +08:00
wanghe-fit2cloud d139073948 chore: Update workflows 2024-11-29 22:21:35 +08:00
王贺 f6e6f9cbfb chore: Create issue-translator.yml 2024-11-29 19:51:11 +08:00
wanghe-fit2cloud 66e4af2be5 chore: Update Security policy 2024-11-29 15:30:41 +08:00
wanghe-fit2cloud 7327ee3ff8 feat: Optimize the CI script 2024-11-29 15:11:13 +08:00
zhengkunwang 23087bdb6f feat(logs): Change IP Database to Support Internationalization (#7212)
change ip database from qqwry to geoip
2024-11-29 03:46:44 +00:00
zhengkunwang 5e9a69d8f3 Update README_EN.md (#7210) 2024-11-29 10:09:07 +08:00
zhengkunwang 3e96e83c3c feat(appstore): Handle Requests After Application Installation (#7206) 2024-11-28 10:42:40 +00:00
蘭 83ce744fb2 feat: Adapt to internationalization (#7205) 2024-11-28 10:40:39 +00:00
zhengkunwang ae03b85a97 fix(website): Fix Issue with Switching PHP Runtime Environment (#7203)
Refs https://github.com/1Panel-dev/1Panel/issues/7097
2024-11-28 07:26:38 +00:00
ssongliu 53e91a87b0 fix(container-command): Fix the issue of container command parsing failure. (#7200) 2024-11-27 17:27:50 +08:00
ssongliu 519c6bca66 feat(cmd): Add support for internationalization of 1Panel commands (#7192) 2024-11-27 08:02:35 +00:00
John Niang f7dcacab92 Fix lint error when building frontend (#7198) 2024-11-27 16:00:43 +08:00
蘭 00c6466423 feat(alert): Add alert settings (#7196)
Refs #6357
Refs #7005
2024-11-27 07:14:33 +00:00
zhengkunwang b8d8867ebb feat(appstore): Restrict application updates based on the app's suppo… (#7174) 2024-11-25 08:18:24 +00:00
zhengkunwang 7b1d746ce7 feat(website): Optimize website error_log configuration (#7173)
Refs **https://github.com/1Panel-dev/1Panel/issues/7161**
2024-11-25 08:16:25 +00:00
igophper 7dc0a2f664 fix: 解决更新端口不更新防火墙规则的问题 (#7169) 2024-11-25 16:12:52 +08:00
zhengkunwang 52f7df0350 feat(runtime): correct typo in variable name (#7172) 2024-11-25 12:05:42 +08:00
zhengkunwang 38d1cac5d9 feat(runtime): Add .NET runtime (#7155) 2024-11-24 09:11:23 +08:00
zhengkunwang c3565f72c4 feat(system-security): Support Hot Reloading of System Certificates (#7152)
Refs https://github.com/1Panel-dev/1Panel/issues/7129
2024-11-22 09:48:13 +00:00
ssongliu 7fdb0a5078 fix: Fixed the fault in determining the firewall port forwarding version (#7150) 2024-11-22 02:16:14 +00:00
liqiang-fit2cloud ce30a7d5cd Update llm-code-review.yml 2024-11-22 10:11:16 +08:00
蘭 28597721f2 feat: Add API interface authentication function (#7146) 2024-11-21 22:09:00 +08:00
zhengkunwang c2fd02ac48 feat(system-security): Added 444 and 500 responses for unauthenticated settings (#7143) 2024-11-21 17:46:13 +08:00
ssongliu a8aa1f87f2 fix: Fixed the fault in determining the firewall port forwarding version (#7141) 2024-11-21 09:30:10 +00:00
zhengkunwang 2ba17d89ef feat(system-security): Optimized unauthenticated settings to enhance system security (#7142) 2024-11-21 16:31:07 +08:00
wanghe-fit2cloud aaae8a5d3b fix: Remove the build cache 2024-11-20 12:08:35 +08:00
wanghe-fit2cloud 5ca91157ca chore: modify question templates. 2024-11-19 18:12:11 +08:00
wanghe-fit2cloud bad1b0b105 perf: Update related workflows 2024-11-19 18:08:58 +08:00
wanghe-fit2cloud d14a149c57 Remove .vscode folder from the repository 2024-11-19 18:06:57 +08:00
吴小白 9c6c77615e build(deps): bump goreleaser from v2.4.5 to latest (#7122)
#### What this PR does / why we need it?
- https://github.com/goreleaser/goreleaser/issues/5292
- https://github.com/goreleaser/goreleaser/commit/700889269f740f659c9f3867f2b79fed677b74b0

#### Summary of your change

#### Please indicate you've done the following:

- [ ] Made sure tests are passing and test coverage is added if needed.
- [ ] Made sure commit message follow the rule of [Conventional Commits specification](https://www.conventionalcommits.org/).
- [ ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.
2024-11-19 03:56:05 +00:00
吴小白 913e64bb75 perf: remove go cache (#7114)
#### What this PR does / why we need it?

#### Summary of your change

#### Please indicate you've done the following:

- [ ] Made sure tests are passing and test coverage is added if needed.
- [ ] Made sure commit message follow the rule of [Conventional Commits specification](https://www.conventionalcommits.org/).
- [ ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.
2024-11-18 08:02:03 +00:00
蘭 fd8ef545e8 style: 主题样式优化 (#7113) 2024-11-18 07:42:03 +00:00
ssongliu d068cc40f0 fix: 修改未激活状态下信息内容 (#7112) 2024-11-18 06:58:03 +00:00
ssongliu ee0e17a496 fix: 解决数据库切换版本不正确的问题 (#7111) 2024-11-18 06:16:04 +00:00
吴小白 f1afc0f4d9 build(deps): bump goreleaser from v2 to v2.4.5 (#7110)
#### What this PR does / why we need it?

#### Summary of your change

#### Please indicate you've done the following:

- [ ] Made sure tests are passing and test coverage is added if needed.
- [ ] Made sure commit message follow the rule of [Conventional Commits specification](https://www.conventionalcommits.org/).
- [ ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.
2024-11-18 06:14:03 +00:00
吴小白 ea1afe7610 build(deps): bump golang from 1.22 to 1.23 (#7109) 2024-11-18 11:33:25 +08:00
ssongliu 4ade175a3d fix: 统一 xpack 失联接口返回内容 (#7106) 2024-11-18 02:30:03 +00:00
igophper c6ea06153a fix: 解决编辑端口规则不能保存的问题 (#7100) 2024-11-17 22:52:02 +08:00
ssongliu eb36a0f8cb fix: 优化许可证错误信息 (#7094) 2024-11-16 13:00:02 +00:00
ssongliu 3087c1a6e8 fix: 完善 license 同步失联逻辑 (#7090) 2024-11-15 15:22:01 +00:00
蘭 e5b0a1c591 feat: Echarts 组件适配主题颜色 (#7087) 2024-11-15 20:14:34 +08:00
igophper af41e8e429 feat: 增加DNS服务商CloudDNS (#7081)
Refs #7038
2024-11-15 16:46:45 +08:00
蘭 7e677ee9fa fix: 获取告警短信使用量 (#7077) 2024-11-15 08:06:02 +00:00
蘭 eea4cf68ad fix: 修复许可证失效主题切换错误问题 (#7075) 2024-11-15 07:24:01 +00:00
刘瑞斌 3a400dd15a feat: 增加火山引擎DNS (#7006) 2024-11-15 11:27:41 +08:00
maninhill fbbbd52d72 chore: Update README_EN.md 2024-11-15 06:58:19 +08:00
maninhill 27664c7dce chore: Update README.md 2024-11-14 22:56:36 +08:00
蘭 e1bdd215b1 fix: 编辑计划任务和病毒扫描告警问题处理 (#7058) 2024-11-14 21:52:37 +08:00
蘭 d04a35565e feat: 主题样式优化 (#7053) 2024-11-14 09:32:01 +00:00
蘭 7aad2cf4af fix: 客户端缓存导致界面设置 Logo 不能正常显示 (#7048)
Refs #7020
2024-11-14 08:18:02 +00:00
蘭 bfa667584a fix: 编辑计划任务和病毒扫描告警问题处理 (#7047)
Refs #7039
2024-11-14 16:15:47 +08:00
ssongliu 1858cb4df8 fix: 导入恢复限制文件数量 (#7045) 2024-11-14 06:20:01 +00:00
ssongliu dc30a3d1c3 fix: 解决 vue 组件未兼容繁体的问题 (#7044)
Refs #7033
2024-11-14 06:18:02 +00:00
蘭 6e690cc6f2 style: 主题样式优化 (#7037) 2024-11-13 14:16:01 +00:00
蘭 911b4076f5 feat: 主题色保存/恢复增加确认提示 (#7036) 2024-11-13 14:14:01 +00:00
蘭 4c01b1e542 fix: 删除目录校验 (#7035) 2024-11-13 14:12:01 +00:00
蘭 ec372dbb98 fix: 删除目录校验是否为禁止删除的目录 (#7031) 2024-11-13 07:10:00 +00:00
蘭 0b87025c52 feat: 面板目录禁止删除 (#7029)
Refs #7008
2024-11-13 06:52:02 +00:00
蘭 7d4230ecfb fix: 关闭代理同时更新 Docker 代理 (#7028) 2024-11-13 06:50:00 +00:00
ssongliu d06583773a fix: 优化概览页磁盘显示 (#7023) 2024-11-13 06:46:01 +00:00
ssongliu 67c1fbd07a fix: 优化登陆页面特征信息 (#7027)
Refs #7000
2024-11-13 06:44:00 +00:00
蘭 5c7fab8f01 style: 面板样式优化 (#7026) 2024-11-13 06:30:00 +00:00
ssongliu 06554375cb fix: 修改面板证书显示域名信息 (#7019) 2024-11-12 23:04:00 +08:00
蘭 e65329e7b3 perf: 优化 docker 代理 (#7016) 2024-11-12 11:18:00 +00:00
蘭 f5435c581b perf: 优化主题色及样式 (#7015) 2024-11-12 10:32:00 +00:00
ssongliu 5e8b23db6a fix: 快照恢复忽略应用恢复失败问题 (#7012) 2024-11-12 17:34:23 +08:00
蘭 f2849aa6ec perf: 优化主题色及样式 (#7009) 2024-11-12 13:48:49 +08:00
Xiao TanandBH1XAQ ee947b6468 fix: 修复 pure-ftpd 上传缓慢问题 (#6994)
* fix: 修复 pure-ftpd 上传缓慢问题

* fix: 修复 pure-ftpd 修改密码用户名的判断依据

---------

Co-authored-by: BH1XAQ <tanxiao@16iot.cn>
2024-11-12 09:27:21 +08:00
蘭 49c072b40d perf: 优化主题色及样式 (#7002) 2024-11-11 22:46:27 +08:00
蘭 204f9f1fbc feat: 面板代理服务器提供 docker 代理 (#6986) 2024-11-08 18:19:48 +08:00
zhengkunwang cccbaafd1b feat: 修改应用安装超时时间 (#6983) 2024-11-08 06:55:21 +00:00
BugKing 7bc06bb6b1 docs: Update README.md 2024-11-08 09:25:05 +08:00
BugKing c16d5190c6 docs: Update README.md
增加专业版简要说明。
2024-11-08 09:25:05 +08:00
蘭 ffdd9b9d79 feat: 增加自定义主题颜色,调整默认暗色主题配色 (#6964) 2024-11-06 09:39:20 +00:00
ssongliu 8d35c54672 fix: 优化防火墙端口转发错误信息 (#6967) 2024-11-06 08:31:19 +00:00
ssongliu eb0164907c fix: 解决面板证书信息获取失败的问题 (#6962)
Refs #6863
2024-11-06 06:37:19 +00:00
wanghe 478d44885c Update OWNERS (#6963) 2024-11-06 14:33:34 +08:00
dependabot[bot] 541bc456be build(deps): bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 (#6959)
Bumps [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](https://github.com/golang-jwt/jwt/compare/v4.5.0...v4.5.1)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-06 10:22:52 +08:00
liqiang-fit2cloud 5ce75992a3 Update llm-code-review.yml 2024-11-05 14:57:12 +08:00
蘭 c8b3ba7f6c style: 组件样式调整 (#6943) 2024-11-04 10:50:53 +00:00
liqiang-fit2cloud d92ce86bb8 build: add code review action. 2024-11-04 17:59:28 +08:00
ssongliu f7b4c8cd28 fix: 优化容器创建提示信息 (#6925) 2024-11-01 14:27:10 +00:00
YaKun9 24c063b106 feat: 概览-状态,磁盘数量多过时默认收起 (#6918)
Refs https://github.com/1Panel-dev/1Panel/issues/6917
feat: 概览-状态,磁盘数量多过时默认收起
2024-11-01 14:25:10 +00:00
igophper e478d2e624 fix: 解决清空网站日志时的闪烁问题 (#6905)
Refs #6904
2024-10-31 10:19:36 +08:00
ssongliu dc0f726029 fix: 解决操作日志打印错误的问题 (#6899) 2024-10-30 17:02:19 +08:00
ssongliu 784b8da7af fix: 解决远程数据库无法切换的问题 (#6893)
Refs #6883
2024-10-30 08:14:41 +00:00
ssongliu 79e9dc9914 fix: 解决全屏切换直接关闭后菜单不显示的问题 (#6894)
Refs #6889
2024-10-30 08:12:39 +00:00
wanghe 4849c6b42d Update README.md 2024-10-30 13:51:35 +08:00
wanghe 024d142c8d Update README.md 2024-10-28 15:58:12 +08:00
ssongliu 126aea931c fix: 解决容器编排路径为空时无法删除的问题 (#6862) 2024-10-27 15:18:02 +00:00
ssongliu 2372281d5e fix: 解决容器镜像仓库编辑失败的问题 (#6845)
Refs #6839
2024-10-25 14:11:55 +00:00
ssongliu 376d6609f2 fix: 补全进程守护 watch 引用 (#6836) 2024-10-24 15:00:18 +08:00
ssongliu 96ab4c53af fix: 解决计划任务告警误报的问题 (#6825) 2024-10-23 14:08:19 +00:00
ssongliu 96cf46d834 fix: 解决低版本 dockerd 命令不兼容的问题 (#6824) 2024-10-23 10:34:19 +00:00
ssongliu 208414704d style: 容器样式调整 (#6822)
Refs #6819
2024-10-23 09:32:19 +00:00
zhengkunwang 7f453aa145 feat: 启动运行环境增加默认网络检测 (#6820) 2024-10-23 09:08:20 +00:00
蘭 123997fa13 feat: 面板重启导致计划任务失败时进行短信告警 (#6817) 2024-10-23 03:46:19 +00:00
zhengkunwang 7faef2f8a7 feat: 创建运行环境网站增加 Python 选项 (#6815) 2024-10-23 02:52:16 +00:00
ssongliu f93cf3b996 fix: 解决快照列表排序的问题 (#6816)
Refs #6810
2024-10-23 02:46:17 +00:00
zhengkunwang df5b69756c feat: 创建运行环境网站增加默认网络创建 (#6807) 2024-10-22 11:24:34 +00:00
蘭 745bb98abe fix: 完善短信告警国际化 (#6806) 2024-10-22 11:20:32 +00:00
ssongliu cf1d02771f fix: 解决 Docker 重启失败的问题 (#6805) 2024-10-22 09:42:28 +00:00
zhengkunwang 52377b0042 fix: 解决 Python 运行环境编辑报错的问题 (#6801) 2024-10-22 08:10:28 +00:00
蘭 270501a237 fix: 文件夹选择控件,选择文件时不默认选择当前目录 (#6799)
Refs #6012
2024-10-22 07:40:29 +00:00
zhengkunwang 2e5283b8d3 fix: 解决 Mysql 特定版本忽略升级失效的问题 (#6800)
Refs https://github.com/1Panel-dev/1Panel/issues/6796
2024-10-22 07:34:29 +00:00
ssongliu 8cad47b29e feat: 修改容器操作超时时间 (#6798)
Refs #6747
2024-10-22 07:20:28 +00:00
Ludovic Fernandez 2458d60d80 fix: otel dependencies (#6793) 2024-10-22 07:39:07 +08:00
ssongliu 9a79dc4cdd feat: SSL 配置增加重启选项 (#6792) 2024-10-21 22:47:14 +08:00
Ludovic Fernandez e531b509d6 fix: huawei cloud (#6791) 2024-10-21 22:15:32 +08:00
蘭 d287fc1186 fix: 解析病毒扫描内容格式处理 (#6790) 2024-10-21 14:06:20 +00:00
zhengkunwang f47f7c7361 fix: 解决创建运行环境报名称存在的问题 (#6785) 2024-10-21 08:50:22 +00:00
zhengkunwang 7a6c99d57d fix: 解决证书自动续签日志报错的问题 (#6784) 2024-10-21 07:10:20 +00:00
zhengkunwang 5105114321 fix: 解决网站开启 HTTPS 之后 404 配置丢失的问题 (#6775) 2024-10-18 09:17:38 +00:00
zhengkunwang 60beebcb4c style: 日志样式调整 (#6774) 2024-10-18 08:55:38 +00:00
ssongliu fa03b4226a fix: 解决容器编排跳转路径错误的问题 (#6773) 2024-10-18 08:43:37 +00:00
蘭 b047a053c5 fix: 解决移动端主机文件批量删除错误 (#6765) 2024-10-18 03:29:36 +00:00
ssongliu 42907cd228 feat: postgresql 远程数据库支持 17.x 版本 (#6759) 2024-10-17 13:37:32 +00:00
蘭 425892cfc4 refactor: 调整包引用 (#6758) 2024-10-17 13:35:32 +00:00
ssongliu 16fd804e93 feat: 优化数据库切换效果 (#6757)
Refs #6755
2024-10-17 10:05:32 +00:00
John Bro 2f147dde13 fix: 容器部分操作动态修改执行命令 (#6750)
Refs #3242
2024-10-17 10:03:31 +00:00
蘭 0d04f07f2a fix: Switch 组件 small 尺寸样式修复 (#6752) 2024-10-17 07:31:30 +00:00
蘭 96485218b7 feat: 病毒扫描定时扫描和短信告警合并提示许可证绑定 (#6751) 2024-10-17 07:29:31 +00:00
蘭 227cc57426 feat: 计划任务失败告警支持全类型告警 (#6749) 2024-10-17 07:27:31 +00:00
zhengkunwang b99061777a feat: PHP 镜像 build 增加超时时间 (#6744) 2024-10-17 04:13:30 +00:00
zhengkunwang 8749dc649a style: 优化一些样式 (#6740) 2024-10-16 09:37:27 +00:00
zhengkunwang 65da51a478 style: 优化应用升级文件对比样式 (#6733) 2024-10-16 04:07:26 +00:00
蘭 0c31ba1c5f feat: 文件夹选择控件,默认选中当前目录 (#6720)
Refs #6012
2024-10-15 10:21:22 +00:00
蘭 acf94b052b feat: 增加病毒扫描和计划任务告警 (#6709) 2024-10-14 09:51:17 +00:00
蘭 556441d811 style: 解决 Alert 提示组件标题存在链接时文字错位问题 (#6711) 2024-10-14 09:41:17 +00:00
zhengkunwang efcf17e47c style: 优化登录页软件许可协议提示语样式 (#6712) 2024-10-14 09:31:18 +00:00
zhengkunwang 02b7744995 pref: 优化网站日志读取 (#6710)
Refs https://github.com/1Panel-dev/1Panel/issues/6642
2024-10-14 09:29:17 +00:00
ssongliu c86947b69c style: 修改按钮组边框宽度不一致的问题 (#6706)
Refs #6704
2024-10-14 06:41:16 +00:00
ssongliu 839b8c2844 feat: 修改容器列表应用商店容器默认显示 (#6705) 2024-10-14 06:29:16 +00:00
John Bro e4a634e6e8 fix: 容器重启前增加校验操作 (#6696) 2024-10-14 10:36:55 +08:00
wild_pointer eb99c10ad0 fix: 修复“修改文件权限时,文件所属用户和用户组不显示”问题 (#6698) 2024-10-14 10:24:48 +08:00
zzzandzengzz01 175b7b89e4 feat:firewalld和ufw同时存在时,不进行操作 (#6688)
Co-authored-by: zengzz01 <zengzz01@mingyuanyun.com>
2024-10-11 18:03:33 +08:00
zhengkunwang 5374afb226 feat: 增加华为云申请证书 (#6687)
Refs https://github.com/1Panel-dev/1Panel/issues/6047
2024-10-11 06:41:05 +00:00
John Bro 1a44f48fad fix: 日志查看统一改成网页全屏以及样式调整 (#6682)
Refs #5873
2024-10-10 10:55:02 +00:00
zhengkunwang 50dbe7cfc0 feat: 增加 Python 运行环境 (#6681) 2024-10-10 18:49:13 +08:00
ssongliu c7e576c879 fix: 概览页磁盘显示排除 overlay 类型 (#6672)
Refs #6637
2024-10-10 03:07:00 +00:00
ssongliu a3e4847744 feat: 快照列表改为异步获取大小 (#6670)
Refs #6540
2024-10-10 03:05:00 +00:00
ssongliu 903f8ed5a7 feat: 容器列表缓存是否显示应用商店容器 (#6667)
Refs #5885
2024-10-10 02:38:59 +00:00
zhengkunwang b091c7f364 feat: 反向代理文本替换增加 sub_filter_types 参数 (#6661)
Refs https://github.com/1Panel-dev/1Panel/issues/6490
2024-10-09 07:02:56 +00:00
zhengkunwang e069db3c45 feat: 反代回源 SNI 支持设置 proxy_ssl_name (#6659)
Refs https://github.com/1Panel-dev/1Panel/issues/5960
2024-10-09 06:42:56 +00:00
see-more 047264dbbc chore;删除error_code组件的body标签 (#6656) 2024-10-09 10:24:47 +08:00
ssongliu 0c216ba87a feat: 支持离线版许可证 (#6651) 2024-10-08 13:56:55 +00:00
ssongliu 31cdc28143 fix: 修改上传恢复提示信息 (#6647) 2024-10-08 02:58:52 +00:00
zhengkunwang e03b728240 feat: 自签证书支持 ipv6 (#6627)
Refs https://github.com/1Panel-dev/1Panel/issues/6623
2024-09-29 10:25:47 +00:00
ssongliu 4c275ba52f style: 修改许可证即将过期样式 (#6616) 2024-09-29 06:37:45 +00:00
ssongliu 2ac9a888a8 feat: 移除编排删除后跳转 (#6613) 2024-09-29 02:15:45 +00:00
Anye f9bdcf8938 feat: 新增 BookStack 的 PHP 扩展模板 (#6611) 2024-09-29 10:01:55 +08:00
ssongliu c3bef26ae6 feat: 调整编排删除逻辑 (#6610) 2024-09-28 22:29:08 +08:00
ssongliu 634849c347 feat: Compose 环境变量编辑增加是否 1Panel 创建校验 (#6605) 2024-09-28 01:37:40 +00:00
John Bro c557b737f6 fix: 重构容器编排环境变量设置逻辑 (#6600) 2024-09-27 14:25:37 +00:00
zhengkunwang 1d326afa93 feat: 优化日志加载 (#6593) 2024-09-26 14:37:32 +00:00
wanghe-fit2cloud cb6c58cb5d Revert "style:优化概览界面的布局 (#6491)"
This reverts commit 7f06c7e92e.
2024-09-25 10:24:33 +08:00
John Bro ec4d708569 feat: 容器编排列表增加编排目录并支持跳转 (#6565)
Refs #3579
2024-09-24 14:25:23 +00:00
John Bro 05b19cefa5 feat: 容器日志下载只支持全量下载 (#6559)
Refs #2399
2024-09-24 14:23:24 +00:00
John Broandzhoujunhong fdd57d0801 feat: 容器编排及模板列表支持排序 (#6566)
Co-authored-by: zhoujunhong <1298308460@qq.com>
2024-09-24 22:21:28 +08:00
Kataick c16d6d1644 flx: 修复会默认出现水平滚动条的问题 (#6564) 2024-09-24 16:01:05 +08:00
John Bro 656b39c880 fix: 添加国际化及样式修改 (#6555) 2024-09-23 10:11:14 +00:00
John Bro 753c996291 fix: 编排模板列表日期格式化 (#6551) 2024-09-23 06:33:15 +00:00
ssongliu dcdd0cc2bb fix: 解决服务包含 .socket 时起停失败的问题 (#6553)
Refs #6524
2024-09-23 06:31:14 +00:00
ssongliu 2f32df16d9 fix: 解决部分浏览器无法打开文件菜单的问题 (#6537) 2024-09-19 10:56:55 +00:00
John Bro 9caa9c47b4 feat: 容器编排显示容器状态,编排模板样式优化 (#6534)
Refs #4404
2024-09-19 10:54:56 +00:00
蘭 55bec8a911 fix: 解决图片/视频预览时,重命名文件名导致浏览器缓存文件内容问题 (#6533)
Refs #6505
2024-09-19 06:00:54 +00:00
John Bro 43f95fd40e fix: 创建和编辑 compose 文件支持设置环境变量 (#6503) 2024-09-18 06:00:49 +00:00
Anye 641812e7c1 fix: 调整Logo长宽比,防止显示被拉伸 (#6510)
* fix: 调整Logo长宽比,防止显示被拉伸
2024-09-17 12:52:58 +08:00
zhengkunwang 95d3e75425 feat: demo 环境增加首页状态接口过滤 (#6498) 2024-09-14 10:12:32 +00:00
see-more 7f06c7e92e style:优化概览界面的布局 (#6491)
* fix: <body> cannot be child of <div>

* style:优化概览界面的布局
2024-09-14 13:43:52 +08:00
ssongliu 0e6fdffeec feat: S3 备份账号支持 Path Style (#6489)
Refs #4553
2024-09-13 10:42:27 +00:00
endymx f77681b9c9 feat(ssl证书): 实现华为云dns (#6407) 2024-09-13 10:53:06 +08:00
John Bro 535d4bbe1b fix: 删除容器后 compose 记录保存以便后续处理 (#6447)
Refs https://github.com/1Panel-dev/1Panel/issues/5099
2024-09-12 10:06:22 +00:00
zhengkunwang 1dfbca3d5b feat: 删除多余代码 (#6463) 2024-09-11 23:10:15 +08:00
zhengkunwang d2ca265cc2 perf: 优化首页加载速度 (#6461) 2024-09-11 14:12:16 +00:00
ssongliu fc70345fcd fix: 优化移动端运行时样式 (#6460) 2024-09-11 22:02:11 +08:00
ssongliu 6ae9b982a9 fix: 优化移动端样式 (#6455) 2024-09-11 10:22:15 +00:00
蘭 0122b4c6ce fix: 解决主机文件压缩解压特殊字符问题 (#6451) 2024-09-11 08:20:15 +00:00
ssongliu 08c0faa20e feat: 优化概览页内存单位 (#6450) 2024-09-11 07:38:15 +00:00
ssongliu ab7efea8c5 style: 优化移动端样式 (#6448) 2024-09-11 07:24:15 +00:00
zhengkunwang f4623664d5 feat: 日志页面增加加载状态 (#6446) 2024-09-11 03:48:14 +00:00
ssongliu df147435c5 fix: 移除重复样式 (#6445) 2024-09-11 03:16:14 +00:00
see-more 71c1c5ae83 style:优化设置移动端界面 (#6443)
* style:优化设置移动端界面

* style:设置-安全界面样式

* style:修复设置-备份账号服务器磁盘移动端无法剧中

* style:优化移动端设置界面
2024-09-11 10:30:46 +08:00
see-more 0ea142d6db style:优化日志审计页面样式 (#6441) 2024-09-11 10:16:02 +08:00
ssongliu f88a3059be fix: 修改移动端样式 (#6440) 2024-09-10 14:04:12 +00:00
蘭 48281ddf86 fix: 主机文件解压文件 mimetype 类型增加 (#6437) 2024-09-10 14:02:11 +00:00
zhengkunwang 7cdcf9b757 feat: 增加 Intel Arc 显卡 适配 (#6435) 2024-09-10 18:55:29 +08:00
ssongliu ef0bb12fbd fix: 处理代码格式问题 (#6433) 2024-09-10 07:40:09 +00:00
蘭 a0857f86b2 fix: 主机文件打开软链接优化 (#6432) 2024-09-10 07:26:10 +00:00
wangdan-fit2cloud 2219b3f47b perf: 优化工具栏样式 (#6431)
#### What this PR does / why we need it?

#### Summary of your change

#### Please indicate you've done the following:

- [ ] Made sure tests are passing and test coverage is added if needed.
- [ ] Made sure commit message follow the rule of [Conventional Commits specification](https://www.conventionalcommits.org/).
- [ ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.
2024-09-10 07:18:10 +00:00
蘭 b6c873f22d fix: 主机文件的路径栏路径 Bug 解决 (#6428)
Refs #6310
2024-09-10 03:46:08 +00:00
蘭 64bc92a7fd fix: 限制二进制文件解压的类型 (#6425)
Refs #6113
2024-09-10 02:14:08 +00:00
ssongliu 6c4c0f7595 fix: 解决服务器重启按钮被遮住的样式问题 (#6424) 2024-09-09 22:56:14 +08:00
蘭 2d9c977805 fix: 解决文件编辑器行号问题 (#6423)
Refs #5918

升级了编辑器版本,调整了编辑器的主题,需要整体测试一下编辑器的样式!
2024-09-09 10:08:04 +00:00
ssongliu dff0375848 fix: 解决容器端口的显示问题 (#6417) 2024-09-09 07:26:04 +00:00
ssongliu ab825a1a70 feat: 防火墙操作支持 ipv6 网段 (#6415) 2024-09-09 11:19:29 +08:00
Anye 466617847f fix: 创建CA机构生成的应为证书而非证书签名请求 (#6404) 2024-09-07 21:56:38 +08:00
蘭 a53fff2416 fix: 解决软连接被识别为文件问题 (#6400)
Refs #5879
2024-09-06 09:37:52 +00:00
zhengkunwang dd1430dbbf feat: 反向代理配置文件统一 (#6396)
Refs https://github.com/1Panel-dev/1Panel/issues/6395
2024-09-06 06:33:50 +00:00
蘭 5aad16968b perf: 优化文件管理器终端命令 (#6393)
Refs #5891
2024-09-06 03:51:50 +00:00
see-more f2d3acb650 style:更新所有移动端container路径下样式 (#6387)
* style:更新所有移动端container路径下样式

* style:修复el-button的默认margin
2024-09-06 10:00:53 +08:00
see-more 666f8c813d style:移动端文件页面样式和防火墙页面样式 (#6386)
* style:移动端端文件页面样式

* style:修改防火墙页面样式

* style:手机端ssl界面和数据库界面调整
2024-09-06 10:00:39 +08:00
ssongliu e87fb7b50e fix: 备份账号 bucket 支持手动输入 (#6381)
Refs #6378
2024-09-05 13:53:48 +00:00
蘭 75612879c7 fix: 解决部分情况下缓存目录导致启动失败的问题 (#6382) 2024-09-05 09:23:47 +00:00
蘭 94e0c80d47 refactor: 调整主机监控任务时间为整分钟执行 (#6379) 2024-09-05 08:41:48 +00:00
蘭 feb6f4cbe0 fix: 概览页获取 CPU 精度问题 (#6380)
Refs #6309
2024-09-05 08:39:48 +00:00
ssongliu 1173bbf628 fix: 解决备份恢复弹窗打开后无法关闭的问题 (#6376)
Refs #6355
2024-09-05 07:11:48 +00:00
ssongliu 1cdc2e93ad fix: 解决 FreshClam 操作失败的问题 (#6374)
Refs #6372
2024-09-05 07:09:46 +00:00
see-more 3356bd8825 fix:移动端网站页面和数据库页面样式 (#6360)
* fix:移动端网站页面和数据库页面样式

* style:修改database页面样式

* style:修改databse页面手机端搜索框与按钮间距
2024-09-05 11:46:57 +08:00
ssongliu decc7a4a1e fix: 解决停止状态容器端口获取不正确的问题 (#6370)
Refs #6333
2024-09-05 03:45:46 +00:00
zhengkunwang a397cab61c fix: 解决部分情况下缓存目录导致启动失败的问题 (#6364)
Refs https://github.com/1Panel-dev/1Panel/issues/6362
2024-09-04 09:21:43 +00:00
trom 228e3d9ae3 style:优化container界面的布局 (#6348) 2024-09-03 13:46:37 +08:00
zhengkunwang 051f670453 fix: 修复域名删除导致网站访问被 WAF 拦截的问题 (#6337)
Refs https://github.com/1Panel-dev/1Panel/issues/6336
2024-09-02 10:23:37 +00:00
trom cf8aa86a67 fix:修复文件路径bug (#6313)
* fix:修复文件路径bug

* fix:修改文件路径逻辑
2024-09-02 10:35:32 +08:00
ssongliu 5b00286e65 fix: 修改 PostgreSQL 容器内部端口 (#6275)
Refs #6274
2024-08-28 08:45:22 +00:00
ssongliu 6597caaf05 fix: 解决快照套接字忽略失败的问题 (#6273) 2024-08-28 06:41:22 +00:00
ssongliu 5851124dee fix: 解决备份套接字忽略不完的问题 (#6272) 2024-08-28 05:45:22 +00:00
trom b18689a0d6 feat:显示当前ip,系统网络代理地址 (#6251) 2024-08-27 13:39:36 +08:00
蘭 a5e7f78a1f pref: 完善告警通知任务 (#6263) 2024-08-27 13:39:18 +08:00
ssongliu a1d394fbc2 fix: 解决容器端口范围太大时,编辑打开失败的问题 (#6249)
Refs #6245
2024-08-26 08:07:13 +00:00
wanghe-fit2cloud 5e82bda666 Revert commit 3d5580a: feat:显示当前ip,系统网络代理地址 2024-08-26 15:55:07 +08:00
trom 3d5580ad9d feat:显示当前ip,系统网络代理地址 (#6235) 2024-08-26 11:25:03 +08:00
ssongliu c83cfbe8b0 fix: 解决备份导入失败的问题 (#6228) 2024-08-23 14:58:59 +00:00
蘭 00cc1b62ef pref: 完善告警通知 (#6227) 2024-08-23 13:53:00 +00:00
ssongliu e782f75863 fix: 解决容器配置修改后未重启的问题 (#6225)
Refs #6226
2024-08-23 10:24:58 +00:00
zhengkunwang f5f379465f feat: 创建运行环境网站,校验 PHP 镜像是否存在 (#6220) 2024-08-23 09:37:00 +00:00
ssongliu 70a8fda449 feat: 优化数据库备份页面样式 (#6221) 2024-08-23 17:36:21 +08:00
ssongliu ca14302191 fix: 优化部分频繁打印的日志操作 (#6219) 2024-08-23 06:40:58 +00:00
ssongliu 7297c2626f fix: 优化防火墙启动时自动添加端口功能 (#6216)
Refs #6215
2024-08-23 03:54:57 +00:00
蘭 92a3982f21 feat: 告警通知功能完善 (#6211) 2024-08-22 14:22:56 +00:00
蘭 626f5efdcd style: 优化 switch 组件 small 尺寸样式 (#6210) 2024-08-22 14:20:55 +00:00
ssongliu 24e780b984 fix: 压缩增加 *.socket 排除规则 (#6196) 2024-08-21 07:12:50 +00:00
zhengkunwang 596d4aceb6 fix: 解决删除 PHP 运行环境之后,删除其他网站提示错误的问题 (#6192) 2024-08-21 02:50:50 +00:00
蘭 e770254b65 feat: 增加短信告警功能 (#6184) 2024-08-20 22:11:13 +08:00
wanghe-fit2cloud 7901c26d32 feat: 修改 snapshot 参数 2024-08-20 18:47:49 +08:00
zhengkunwang fc65f8f689 feat: 修复代码警告 (#6190) 2024-08-20 10:36:47 +00:00
zhengkunwang e0a5e14978 feat: 修改非 PHP 运行环境网站的删除提示 (#6189) 2024-08-20 09:42:47 +00:00
zhengkunwang 07562c203a feat: 优化已安装应用的参数显示 (#6188) 2024-08-20 09:40:48 +00:00
ssongliu 8187a19e6e fix: 修改版本号复制方式 (#6187) 2024-08-20 09:38:47 +00:00
zhengkunwang 32cd684307 fix: 解决路由菜单文字丢失的问题 (#6185) 2024-08-20 06:46:46 +00:00
ssongliu 3a72fc95d9 style: 处理代码警告 (#6183) 2024-08-20 03:38:47 +00:00
ssongliu 64405fba3d fix: 统一时区获取方法 (#6175) 2024-08-19 10:30:42 +00:00
zhengkunwang cc7981229c fix: 解决 redis 没有密码情况下安装应用没有关联的问题 (#6173)
Refs #6174
2024-08-19 10:06:42 +00:00
zhengkunwang 3ec208dc85 perf: 优化运行环境日志卡顿情况 (#6172) 2024-08-19 10:04:43 +00:00
ssongliu 1b92b6cbfa fix: mysql 绑定用户增加输入校验 (#6149) 2024-08-16 06:00:31 +00:00
trom 779addfcb4 fix:mysql升级到8.4后查询会出错,容器的command回显使用 text area (#6147)
* style:容器的command参数回显应该使用 text area而不是text input,且不应该过滤'\n'

* chore:prettier格式化

* fix:mysql升级到8.4后,数据库管理 - 当前状态 查询会出错

* chore:修改逻辑判断
2024-08-16 11:23:44 +08:00
ssongliu 7da5f7a884 fix: 修改镜像拉取校验规则 (#6145)
Refs #5740
2024-08-15 15:18:32 +00:00
ssongliu 34e14636d4 fix: 解决 ClamAV 卸载后定时任务无法停止的问题 (#6143)
Refs #6100
2024-08-15 15:16:30 +00:00
ssongliu aa222aac31 fix: 解决计划任务备份内容允许为空的校验问题 (#6142)
Refs #6099
2024-08-15 09:42:28 +00:00
zhengkunwang 5134caa103 fix: 解决部分应用参数数据库显示错误的问题 (#6136) 2024-08-15 07:12:28 +00:00
zhengkunwang dca3c92d72 fix: 解决 PHP 运行环境版本过期之后下载安装包失败的问题 (#6125) 2024-08-14 10:29:59 +00:00
zhengkunwang a85d5bad46 feat: 优化 mysql 版本升级 (#6119) 2024-08-13 10:48:56 +00:00
zhengkunwang 716613a4db feat: 应用升级备份保留 3 份 (#6116)
Refs https://github.com/1Panel-dev/1Panel/issues/6107
2024-08-13 07:28:55 +00:00
zhengkunwang 12eaa66bc5 style: 去掉应用列表中的更新应用列表按钮 (#6105) 2024-08-12 18:40:10 +08:00
zhengkunwang a6af97e3c1 style: 优化文件属性页面显示 (#6104)
Refs https://github.com/1Panel-dev/1Panel/issues/5855
2024-08-12 10:02:53 +00:00
zhengkunwang d561c86c68 feat: 优化网站日志在每行数据量大情况下的读取 (#6103)
Refs https://github.com/1Panel-dev/1Panel/issues/6102
2024-08-12 09:58:52 +00:00
dependabot[bot] f243d1c9b4 chore(deps): bump github.com/docker/docker (#6093) 2024-08-12 13:43:47 +08:00
trom 1cc2cc6400 feat:更新应用列表上移 #6035 (#6084) 2024-08-12 10:26:16 +08:00
trom 15f4c05772 chore:点击复制版本号(#5894) (#6077) 2024-08-09 18:25:53 +08:00
trom c9a204b7a7 fix: 搜索框加长(#6063) 回收站时间排序(#5957) hoer状态撑高界面(#5929) (#6070) 2024-08-09 10:22:29 +08:00
trom 3d0018c0bd chore:新建文件夹支持添加空格,登录页鼠标悬浮样式 (#6058) 2024-08-08 10:27:06 +08:00
zhengkunwang d639e46bc7 fix: 解决 PHP 运行环境网站删除之后没有删除应用的问题 (#6036) 2024-08-06 03:34:29 +00:00
dependabot[bot] fa633bf419 chore(deps): bump github.com/docker/docker (#5989)
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 26.0.2+incompatible to 26.1.4+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v26.0.2...v26.1.4)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-31 19:05:05 +08:00
zhengkunwang 40f7ef90b3 feat: 修改反向代理默认 Connection 请求头 (#5951)
Refs https://github.com/1Panel-dev/1Panel/issues/5937
2024-07-26 07:01:40 +00:00
zhengkunwang 50efe607d4 feat: 优化泛域名申请证书手动解析值 (#5950)
Refs https://github.com/1Panel-dev/1Panel/issues/4609
2024-07-26 06:59:40 +00:00
igophper 3b057f2c27 feat: 2FA支持前一个验证码 (#5942)
Refs #5940
2024-07-26 11:15:53 +08:00
maninhill d3d018bd44 chore: Update README.md 2024-07-24 17:01:38 +08:00
maninhill 1378609aa2 chore: Update README.md 2024-07-24 16:58:59 +08:00
zhengkunwang 001c896eed fix: 解决上传文件夹权限没改的问题 (#5919) 2024-07-23 17:52:30 +08:00
ssongliu 1cf3a0143c fix: 解决系统日志解析错误的问题 (#5917) 2024-07-23 07:57:32 +00:00
zhengkunwang f04be521e5 feat: 回滚代码 (#5914) 2024-07-23 14:42:06 +08:00
ssongliu 2873632a40 pref: 移除部分废弃代码 (#5910) 2024-07-23 02:31:32 +00:00
zhengkunwang 075879b5b5 fix: 解决应用商店 Go 和 Java 安装跳转错误的问题 (#5909)
Refs https://github.com/1Panel-dev/1Panel/issues/5900
2024-07-23 02:29:32 +00:00
zhengkunwang 9b12930376 fix: 解决安装 gitea 跳转到 postgres 报错的问题 (#5908)
Refs https://github.com/1Panel-dev/1Panel/issues/5902
2024-07-23 02:27:31 +00:00
zhengkunwang 3339ba9bad fix: 解决潜在的 SQL 注入漏洞 (#5906)
影响范围:操作日志
2024-07-22 14:41:31 +00:00
zhengkunwang 68922676fc fix: 解决从网站上传的证书状态显示异常的问题 (#5869)
Refs https://github.com/1Panel-dev/1Panel/issues/5867
2024-07-19 07:41:28 +00:00
zhengkunwang dcf2afb4a6 feat: 上传文件使用父目录用户和用户组 (#5868)
Refs https://github.com/1Panel-dev/1Panel/issues/5866
2024-07-19 07:33:28 +00:00
ssongliu 16a35141dd fix: 解决病毒定时扫描校验国际化的问题 (#5856) 2024-07-18 03:27:28 +00:00
John Bro f6c334bdad feat: 计划任务备份应用/网站/数据库支持多选 (#5849) 2024-07-17 13:35:27 +00:00
蘭 cbb119117b fix: 多个文件同时计算大小,计算状态独自显示 (#5851) 2024-07-17 11:09:30 +00:00
ssongliu cae0a6118f pref: 优化远程数据库解绑提示信息 (#5850) 2024-07-17 09:53:28 +00:00
ssongliu 3c0dc7459c feat: 工具箱病毒扫描支持定时扫描 (#5847) 2024-07-17 08:55:28 +00:00
zhengkunwang ca0c96cb12 fix: 解决网站按过期时间排序之后导致的日期控件错误问题 (#5846) 2024-07-17 06:57:29 +00:00
蘭 ed599265e4 fix: 查看文件/文件夹属性详情 (#5844)
Refs #5842

查看文件/文件夹属性详情,不再获取文件内容。
2024-07-17 06:43:27 +00:00
wanghe-fit2cloud 864bff574a chore: 删除 FUNDING.yml 2024-07-17 12:10:43 +08:00
蘭 3b1df05ae0 fix: 关闭 pdf 预览 (#5838)
pdfjs 安全漏洞,后续版本增加预览 pdf
2024-07-16 11:17:27 +00:00
蘭 464392f7e1 fix: 文本管理计算文件夹大小请求超时 (#5836)
文本管理计算文件夹大小调整为局部加载,增加请求时长
2024-07-16 07:05:27 +00:00
zhengkunwang b562d9f8e8 feat: 网站过期时间增加排序 (#5833) 2024-07-16 04:03:28 +00:00
ssongliu 74bd997f07 pref: 优化远程数据库删除提示信息 (#5824)
Refs #5819 #5818
2024-07-15 10:43:27 +00:00
ssongliu 12c6fe6331 feat: 病毒扫描增加状态判断 (#5817)
Refs #5769
2024-07-15 04:05:26 +00:00
maoball eb4d550305 fix: 修复变量名拼错 (#5792)
* fix: 修复变量名拼错

* fix: 修复变量名拼错

* fix: 修复变量名拼错

* fix: 修复变量名拼错

* fix: 修复变量名拼错
2024-07-13 21:58:02 +08:00
zhengkunwang 9a635e99b2 feat: 增加 clamdscan 服务检测 (#5784) 2024-07-12 06:11:25 +00:00
蘭 03b04eea6b feat: 文本编辑器新增右侧缩略图开关 (#5781) 2024-07-12 02:19:25 +00:00
蘭 d2740308a1 fix: 关闭抽屉同时销毁全部子元素 (#5776) 2024-07-11 13:59:24 +00:00
Anye 6f86dda1aa Add port to vscodeUrl in SSH remote connection (#5775)
修改了 vscodeUrl 模板以在主机和路径之间包含来自 addForm.port 的端口,确保正确设置 SSH 远程连接。
2024-07-11 18:45:52 +08:00
zhengkunwang 0194362a35 feat: 增加 Go 运行环境跳转 (#5764) 2024-07-11 08:21:25 +00:00
John Bro a5bf435d2c fix: 字符校验修正 (#5761) 2024-07-11 06:41:24 +00:00
蘭 bcfbbb656a feat: 文本编辑器全屏高度处理 (#5760) 2024-07-11 13:04:54 +08:00
zhengkunwang c0b6a06fb7 feat: 删除无用代码 (#5757) 2024-07-11 03:41:24 +00:00
zhengkunwang 89628fbbcc fix: 解决安装 mailserver 失败的问题 (#5756) 2024-07-11 03:19:24 +00:00
John Bro e670e1f2e7 fix: 前端优化 (#5755) 2024-07-11 03:09:24 +00:00
John Bro b3759cebd8 fix: 前端优化 (#5754) 2024-07-11 02:59:25 +00:00
zhengkunwang e427b2a219 fix: 解决网站运行目录显示错误的问题 (#5753) 2024-07-11 02:49:26 +00:00
ssongliu b1ec7d9f04 fix: 解决 ftp 创建用户失败的问题 (#5751) 2024-07-10 10:39:24 +00:00
zhengkunwang 0ccfeed10d feat: 网站配置 HTTPS 证书时增加组织显示 (#5749)
Refs https://github.com/1Panel-dev/1Panel/issues/3523
2024-07-10 10:25:24 +00:00
John Bro afd4c8486a feat: 七牛云备份账号支持设置超时时间 (#5745)
Refs #4330
2024-07-10 10:07:26 +00:00
蘭 730a25fcd2 refactor: 文本编辑器全屏按钮样式处理 (#5748) 2024-07-10 10:05:24 +00:00
蘭 9fa191ad69 fix: VS Code 打开文件可以再次编辑配置 (#5744) 2024-07-10 08:15:25 +00:00
maninhill 756dbe08eb chore: Update README.md (#5743) 2024-07-10 15:17:29 +08:00
ssongliu 5f2cfe6e20 fix: 解决快照恢复失败的问题 (#5739) 2024-07-10 04:09:24 +00:00
zhengkunwang af9aef4d34 fix: 解决运行环境显示容器名称错误的问题 (#5733) 2024-07-09 09:41:24 +00:00
蘭 16d26077be fix: 监听编辑器内容变化事件调整 (#5732)
调整监听编辑器内容变化事件到初始化编辑器之后,避免编辑器初始化时导致默认内容被视为用户编辑行为。
2024-07-09 08:49:27 +00:00
ssongliu aef163df29 pref: 优化代理提示信息 (#5731) 2024-07-09 08:47:23 +00:00
蘭 f449557281 fix: 判断文件是否为二进制文件,忽略文本类型文件 (#5730)
Fixes #5722
2024-07-09 08:41:24 +00:00
ssongliu d01e34aa40 fix: 解决 UFW 防火墙列表解析错误的问题 (#5724) 2024-07-09 03:35:23 +00:00
zhengkunwang 02e7c2e974 fix: 解决 Go 运行环境无法保存的问题 (#5721) 2024-07-09 02:21:23 +00:00
ssongliu 047d49e0eb fix: 调整病毒扫描设置界面样式 (#5713) 2024-07-08 10:21:23 +00:00
ssongliu 1c167e828a fix: 端口转发增加 ipv4 限制 (#5712) 2024-07-08 08:11:23 +00:00
ssongliu 8d1322af37 fix: 修改端口转发校验规则 (#5711) 2024-07-08 07:49:25 +00:00
ssongliu 577dfadb9a feat: 病毒扫描增加病毒库刷新状态 (#5710) 2024-07-08 07:47:23 +00:00
ssongliu 0c2653d270 fix: 解决病毒扫描病毒策略更新失败的问题 (#5709) 2024-07-08 10:32:24 +08:00
蘭 0d3e834b37 feat: 查看文件详情解除二进制文件限制 (#5696) 2024-07-05 10:13:08 +00:00
ssongliu 2e8403347a fix: 解决社区版刷新时网站标题显示问题 (#5695) 2024-07-05 16:54:50 +08:00
ssongliu 0105da02af pref: 优化 ClamAV 提示信息 (#5693) 2024-07-05 08:52:39 +00:00
zhengkunwang 40d9dea96c feat: 暂时删除 SSL 证书 OCSP 校验 (#5692)
Refs https://github.com/1Panel-dev/1Panel/issues/5688
2024-07-05 08:50:39 +00:00
蘭 f0fbb02495 feat: 文件编辑器侧边栏指上和选中文件样式调整 (#5689) 2024-07-05 08:48:38 +00:00
ssongliu 9ca69732ca fix: 解决 Firewalld 防火墙列表显示不全的问题 (#5684) 2024-07-04 14:32:34 +00:00
蘭 966b10fbb5 feat: 文件列表组件新增创建文件夹以及文件功能 (#5680) 2024-07-04 14:30:33 +00:00
ssongliu 9e103baf94 fix: 解决概览页磁盘挂载点路径带空格无法正常显示的问题 (#5678) 2024-07-04 09:54:32 +00:00
ssongliu 9a38dcd2a7 fix: 解决防火墙筛选失效的问题 (#5677) 2024-07-04 08:04:33 +00:00
zhengkunwang 08125b150a feat: 机构证书增加下载功能 (#5676)
Refs #4911
2024-07-04 08:02:34 +00:00
ssongliu f370f7eacf fix: 优化病毒扫描报告界面 (#5675) 2024-07-04 08:00:32 +00:00
zhengkunwang a4accc071d feat: 反向代理支持设置回源 SNI (#5674)
Refs https://github.com/1Panel-dev/1Panel/issues/3461
2024-07-04 07:58:32 +00:00
John Bro fd0260f43a feat: 文本编辑器支持更多语言 vue 补充 (#5666) 2024-07-03 11:07:29 +00:00
John Bro 8301382770 feat: 容器仓库配置地址,增加有效性校 (#5664)
Refs #4542
2024-07-03 10:05:29 +00:00
zhengkunwang 0872374fe4 feat: 优化英文翻译 (#5662) 2024-07-03 10:03:31 +00:00
ssongliu 80f78548fd fix: 修改 OneDrive token 刷新 (#5659) 2024-07-03 10:01:30 +00:00
John Bro 1e553fc14e feat: 屏蔽选择网站运行目录中,辅助开发包目录 (#5657)
Refs #4242
2024-07-03 07:05:29 +00:00
蘭 5426c4ea68 chore: 编辑器统一代码风格和 prettier 风格保持一致 (#5656) 2024-07-03 07:03:29 +00:00
蘭 a8842c806c fix: 解决文件上传拖拽栏上传多文件失败问题 (#5655)
Refs #4746
2024-07-03 07:01:28 +00:00
刘瑞斌 8888c9f4ee chore: use unseq list (#5652) 2024-07-03 13:37:28 +08:00
蘭 9da5e67183 feat: 文件列表组件新增创建文件夹功能 (#5647) 2024-07-02 14:43:24 +00:00
maninhill 2a1ec4db75 chore: Update CONTRIBUTING.md (#5646) 2024-07-02 18:16:18 +08:00
John Bro ca803ab26a fix: 升级的时候忽略升级置灰 (#5644)
Refs #5593
2024-07-02 09:43:23 +00:00
蘭 7f77a13b0c feat: 文件管理文本编辑后退出前保存提示 (#5636)
#### What this PR does / why we need it?
Refs #5356
#### Summary of your change
检测文本是否编辑,退出/切换文件作出提示,可以重置当前修改!
#### Please indicate you've done the following:

- [ ] Made sure tests are passing and test coverage is added if needed.
- [ ] Made sure commit message follow the rule of [Conventional Commits specification](https://www.conventionalcommits.org/).
- [ ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.
2024-07-02 09:27:24 +00:00
ssongliu f131aae344 feat: ClamAV 增加病毒文件处理策略 (#5635) 2024-07-02 09:25:25 +00:00
John Broandzhoujunhong d71514885d fix: docker 镜像加速地址支持添加带端口 (#5638)
Co-authored-by: zhoujunhong <1298308460@qq.com>
2024-07-02 17:25:19 +08:00
zhengkunwang 433055b851 feat: 增加 Go 运行环境 (#5632) 2024-07-01 18:35:15 +08:00
John Bro 32e2e493cc fix: 字体样式调整 (#5631)
Refs #4562
2024-07-01 10:33:17 +00:00
蘭 b5b710f8b2 feat: 文件管理支持预览常见文件格式 (#5629)
#### What this PR does / why we need it?
 Refs #5431
#### Summary of your change
支持预览 pdf/word/excel/image/video/audio
#### Please indicate you've done the following:

- [ ] Made sure tests are passing and test coverage is added if needed.
- [ ] Made sure commit message follow the rule of [Conventional Commits specification](https://www.conventionalcommits.org/).
- [ ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.
2024-07-01 08:11:17 +00:00
Anye 6fd9dc53e2 Update v_1_9.go (#5609)
为 WordPress 模版添加 gd 扩展
2024-06-28 16:08:06 +08:00
maninhill 7f80d1455d chore: Update README.md 2024-06-28 15:54:25 +08:00
半岛的蒟蒻bddjr b3605f54d6 移除前端打包时生成的gzip文件 #5599 (#5606) 2024-06-28 15:44:27 +08:00
ssongliu 98e73395fc fix: 解决 MariaDB 数据库同步失败的问题 (#5605)
Refs #5591
2024-06-28 07:30:59 +00:00
ssongliu 65fb2bd401 fix: 补全依赖 (#5604) 2024-06-28 14:56:58 +08:00
maninhill ebcfcf87c8 chore: Update README.md 2024-06-28 14:53:36 +08:00
John Bro be469333d1 feat: 文本编辑器支持更多语言 (#5602)
Refs #5169
2024-06-28 06:48:58 +00:00
蘭 9cc4ec49ef feat: 文件管理编辑文件增加左侧目录树 (#5594)
Refs: #3624

#### What this PR does / why we need it?

#### Summary of your change

#### Please indicate you've done the following:

- [ ] Made sure tests are passing and test coverage is added if needed.
- [ ] Made sure commit message follow the rule of [Conventional Commits specification](https://www.conventionalcommits.org/).
- [ ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.
2024-06-28 06:16:57 +00:00
yonwoo9 3adf1aebb8 style:fit some code style (#5601) 2024-06-28 14:04:08 +08:00
John Bro 4504a8b188 fit: 修复概览数据库数量显示错误问题 (#5598)
Refs #5280
2024-06-28 05:44:58 +00:00
wanghe-fit2cloud e3d87c542d chore: Update README.md 2024-06-28 11:01:19 +08:00
yonwoo9 a6367fd96b fit:replace ctx err equal check as error.is (#5588) 2024-06-27 17:47:10 +08:00
wanghe 070484772b Update README.md (#5589) 2024-06-27 17:38:44 +08:00
John Bro d00fb2163a fit: 文件显示大小值问题修复 (#5583) 2024-06-27 06:00:53 +00:00
ssongliu 7c7d30376f fix: 解决加密压缩文件解压失败的问题 (#5580) 2024-06-27 04:14:52 +00:00
zhengkunwang 90886bda7e feat: 升级 golang.org/x/image (#5581) 2024-06-27 04:08:53 +00:00
igophper 2e61af2c83 fix: 解决备份密码特殊字符问题 (#5578)
Refs #5573
2024-06-27 11:09:55 +08:00
BugKing 4482bc0b1d feat: 文件管理增加使用 VS Code 打开 (#5572) 2024-06-27 10:49:47 +08:00
ssongliu 2fafe3dcb5 fix: 优化病毒扫描样式 (#5577) 2024-06-26 14:40:52 +00:00
zhengkunwang eded682ecc feat: 增加 java 运行环境 (#5576) 2024-06-26 22:39:25 +08:00
John Bro 151f9d58d3 fit: 文件属性显示大小值调整 (#5575)
Refs #3934
2024-06-26 14:38:50 +00:00
ssongliu 18719f9112 fix: 镜像拉取同步系统认证信息 (#5571)
Refs #5537
2024-06-26 06:28:49 +00:00
John Broandzhoujunhong 0886bcd310 feat: 容器日志下载优化 (#5557)
* feat: 容器日志下载优化

Co-authored-by: zhoujunhong <1298308460@qq.com>
2024-06-25 18:17:15 +08:00
ssongliu 8fedb04c95 feat: 防火墙允许操作 ipv6 (#5564)
Refs #2409
2024-06-25 10:16:45 +00:00
zhengkunwang 15a43ef81b feat: 升级 lego 依赖 (#5563) 2024-06-25 05:48:45 +00:00
zhengkunwang 9121d57e7e feat: 优化应用升级逻辑,拉取镜像失败无需回滚 (#5561) 2024-06-25 03:44:45 +00:00
ssongliu f6cc0b272c fix: 增加系统主题变化监听事件 (#5555) 2024-06-24 09:02:43 +00:00
ssongliu 6e191fc342 pref: 优化容器编排编辑逻辑 (#5556) 2024-06-24 09:00:43 +00:00
ssongliu 6da38ee166 pref: 优化容器编排创建、镜像拉取等前端逻辑 (#5553)
Refs #5523
2024-06-24 08:58:43 +00:00
ShuBo6 064fddb2ee fix: 一些被忽略的句柄关闭问题 (#5552) 2024-06-24 15:29:19 +08:00
maninhill 32e0c6fb3e chore: Update README.md 2024-06-24 14:00:24 +08:00
ssongliu 419343364d fix: 解决面板主题跟随系统失效的问题 (#5547)
Refs #5527
2024-06-24 05:54:43 +00:00
ssongliu 97b790a092 feat: 增加病毒扫描工具 (#5546) 2024-06-24 05:52:42 +00:00
wanghe a08ce58563 Update README.md (#5548) 2024-06-24 11:40:30 +08:00
zhengkunwang f2350d0a65 feat: 优化应用升级逻辑,避免镜像拉取成功之前容器被删除 (#5525) 2024-06-21 06:30:10 +00:00
zhengkunwang ee0aa532d7 feat: 申请证书成功之后支持执行脚本 (#5517)
Refs https://github.com/1Panel-dev/1Panel/issues/3197
2024-06-20 14:18:07 +00:00
zhengkunwang 9f3181b8f3 feat: 优化文件解压,保留文件更新时间 (#5509)
Refs https://github.com/1Panel-dev/1Panel/issues/5474
2024-06-19 14:30:59 +00:00
zhengkunwang 003c87bf00 feat: 优化文件上传逻辑,减少临时空间占用 (#5508)
Refs https://github.com/1Panel-dev/1Panel/issues/5184
2024-06-19 09:54:58 +00:00
zhengkunwang 1577581257 feat: 优化网站 WAF 配置文件生成 (#5504) 2024-06-19 09:42:57 +00:00
maninhill b6d916de6a chore: Update README.md 2024-06-19 17:23:04 +08:00
BugKing 534bbb0211 docs: 修改预览图片地址 2024-06-19 17:21:16 +08:00
BugKing f3f08ce2d3 docs: 去掉原有的 UI 展示部分 2024-06-19 17:21:16 +08:00
BugKing 7f19532051 docs: readme 中增加视频图片 2024-06-19 17:21:16 +08:00
zhengkunwang 0bdeba7288 feat: 证书推送自动创建文件夹 (#5501)
Refs https://github.com/1Panel-dev/1Panel/issues/3523
2024-06-19 08:48:58 +00:00
zhengkunwang 4460329d2d style: 优化申请证书 acme 账户显示 (#5500)
Refs https://github.com/1Panel-dev/1Panel/issues/3580
2024-06-19 08:46:58 +00:00
zhengkunwang f59bea27e8 feat: 创建静态、PHP 网站默认增加 404 页面 (#5498) 2024-06-19 06:08:58 +00:00
John Bro 4c59090180 feat: 回收站文件支持批量还原 (#5497)
Refs #5148
2024-06-19 06:06:57 +00:00
endymx f17db1d6d5 fix: 端口转发功能在ufw下重启面板导致Docker自带规则被清除 (#5490)
* refactor: iptables重载逻辑

* fix: 去除debug代码
2024-06-19 10:26:16 +08:00
zhengkunwang 39a5767319 feat: 增加修改网站默认页面功能 (#5491) 2024-06-19 10:17:36 +08:00
ssongliu 7e182d32a6 pref: 快照增加恢复前资源检查 (#5489) 2024-06-18 10:08:54 +00:00
zhengkunwang e32104581b feat: 网站列表增加证书过期时间显示 (#5488)
Refs https://github.com/1Panel-dev/1Panel/issues/4271
2024-06-18 10:06:54 +00:00
John Bro c30ea553bd feat: 文件编辑器支持网页全屏 (#5486)
Refs #5357
2024-06-18 10:04:53 +00:00
zhengkunwang 345dbda400 feat: 优化日志读取 (#5485)
Refs https://github.com/1Panel-dev/1Panel/issues/3690
2024-06-17 14:24:50 +00:00
ssongliu f4103e285d fix: 解决升级导致的计划任务未执行问题 (#5483)
Refs #5414
2024-06-17 14:18:50 +00:00
John Bro dca47af92a feat: 进程守护日志支持全屏 (#5482)
Refs #4136
2024-06-17 14:16:49 +00:00
endymx af0ecce25b feat: 端口转发功能 (#5439) 2024-06-15 22:28:03 +08:00
zhengkunwang b36e2c5676 feat:网站 HTTPS 增加 HSTS 配置 (#5463)
Refs https://github.com/1Panel-dev/1Panel/issues/3906
2024-06-14 10:22:39 +00:00
zhengkunwang b428d818e7 feat: 更新 SSL 证书的加密算法 (#5460)
Refs https://github.com/1Panel-dev/1Panel/issues/4835
2024-06-14 08:22:39 +00:00
zhengkunwang 25b0725570 feat: 续签证书不重置私钥 (#5458)
Refs https://github.com/1Panel-dev/1Panel/issues/5314
2024-06-14 08:20:39 +00:00
John Bro 2513c10d22 feat: 容器操作增加制作容器镜像功能 (#5447) 2024-06-14 08:18:39 +00:00
ssongliu 584234c4f1 fix: 解决界面设置主题色不统一的问题 (#5449) 2024-06-13 14:18:37 +00:00
zhengkunwang 8a1b0d6913 feat: 网站列表按照名称排序 (#5448)
Refs https://github.com/1Panel-dev/1Panel/issues/5437
2024-06-13 14:16:37 +00:00
zhengkunwang 68ac4341ac feat: demo 环境适配网站监控 (#5446) 2024-06-13 08:22:36 +00:00
zhengkunwang 4209452e0b fix: 解决应用安装 services 为空报系统错误的问题 (#5445) 2024-06-13 08:20:36 +00:00
zhengkunwang 3b7f8c2724 feat: 优化非80端口网站开启 https 端口配置 (#5443)
Refs https://github.com/1Panel-dev/1Panel/issues/5364
2024-06-13 08:14:37 +00:00
ssongliu 01588ed9b5 fix: 修改终端全屏按钮样式 (#5442)
Refs #5435
2024-06-13 08:12:36 +00:00
zhengkunwang 99fc39d401 perf: 优化前端打包速度 (#5440) 2024-06-13 05:54:36 +00:00
ssongliu b6f2497346 fix: 解决浏览器切换时部分设置未同步的问题 (#5436)
Refs #5422
2024-06-13 03:52:35 +00:00
zhengkunwang 09dc15a940 fix: 解决部分情况下打开文件中文乱码的问题 (#5425)
Refs https://github.com/1Panel-dev/1Panel/issues/5374
2024-06-12 06:32:37 +00:00
zhengkunwang 9bd9700bac fix: 解决升级页面 链接点击不跳转的问题 (#5413)
Refs https://github.com/1Panel-dev/1Panel/issues/5371
2024-06-11 10:10:35 +00:00
ssongliu 05e62a6f94 fix: 解决计划任务执行周期错误的问题 (#5412)
Refs #5404
2024-06-11 10:08:34 +00:00
ssongliu ff549a4793 fix: 解决 gorm 的 sql 注入问题 (#5409) 2024-06-11 10:06:34 +00:00
Frost-ZX 0341587716 fix: 修正未认证设置表单初始值 (#5383) 2024-06-11 11:33:46 +08:00
ssongliu e2316369a7 fix: 解决深色模式下版本显示问题 (#5402)
Refs #5370
2024-06-11 02:56:32 +00:00
zhengkunwang 4285fedc5d style: 黑金主题样式优化 (#5360) 2024-06-08 04:20:25 +00:00
ssongliu 05c8370f0d pref: 优化暗黑主题样式 (#5355) 2024-06-07 16:24:24 +00:00
Anye b866816800 添加Flarum的PHP扩展模板 (#5354) 2024-06-07 23:56:46 +08:00
ssongliu e0f8cd96f8 fix: 修复应用升级文件对比显示问题 (#5352) 2024-06-07 15:02:23 +00:00
ssongliu c81f8c1bc4 fix: 解决登录跳概览页时样式错误的问题 (#5351) 2024-06-07 14:48:23 +00:00
ssongliu 45d628838f fix: 解决获取 SSL 信息错误的问题 (#5347)
Refs #5339
2024-06-07 14:38:24 +00:00
ssongliu f433895c97 fix: 修改部分黑金样式 (#5345) 2024-06-07 14:36:22 +00:00
zhengkunwang 1fcfbaf0a9 style: 黑金主题样式优化 (#5337) 2024-06-07 07:44:22 +00:00
zhengkunwang 63305e7316 fix: 解决自签证书开启自动续签报错的问题 (#5335) 2024-06-07 11:02:03 +08:00
ssongliu c394efa2ec fix: 解决 PostgreSQL 页面切换的样式问题 (#5332) 2024-06-06 14:41:38 +00:00
zhengkunwang 859ace71df fix: 解决限制应用安装之后安装按钮还能点的问题 (#5331) 2024-06-06 14:15:38 +00:00
zhengkunwang a7cf69e5a2 fix: 解决应用已安装时间显示错误的问题 (#5327) 2024-06-06 11:01:38 +00:00
John Bro d0105c7863 fix: 快照恢复弹框增加压缩密码输入框 (#5326) 2024-06-06 10:49:38 +00:00
ssongliu e18102dfc9 pref: 加密备份代码优化 (#5325) 2024-06-06 10:43:38 +00:00
ssongliu 135ac91160 fix: 增加系统请求超时时间 (#5324) 2024-06-06 09:37:38 +00:00
ssongliu f670095c08 fix: 修改登录页弹框判断 (#5323) 2024-06-06 08:29:37 +00:00
ssongliu ac384628c9 fix: 解决压缩备份恢复失败的问题 (#5322) 2024-06-06 08:03:39 +00:00
John Bro 60df7786d8 fix: 文件返回前进功能优化 (#5320) 2024-06-06 07:13:37 +00:00
ssongliu 0e74acbec0 fix: 解决应用安装失败的问题 (#5319) 2024-06-06 06:16:14 +00:00
ssongliu 37de6aae66 fix: 调整 Redis 空状态样式 (#5315) 2024-06-06 03:18:12 +00:00
John Bro f03051ce43 fix: 备份恢复弹框中增加输入压缩密码输入框 (#5305) 2024-06-05 15:54:10 +00:00
ssongliu d83402b819 fix: 解决 HTTP 类型代理失败的问题 (#5306) 2024-06-05 15:46:11 +00:00
ssongliu 97e800ee15 fix: 解决删除网站没删除备份文件的问题 (#5309) 2024-06-05 23:45:24 +08:00
zhengkunwang 7f583e5678 feat: 限制 PHP 运行环境制作镜像中被删除 (#5304) 2024-06-05 10:08:09 +00:00
吴小白 80b7bb44f7 fix: 修正 goreleaser v2 参数 (#5303)
#### What this PR does / why we need it?

DEPRECATED: --skip-publish was deprecated in favor of --skip=publish, check https://goreleaser.com/deprecations#-skip for more details

#### Summary of your change

#### Please indicate you've done the following:

- [ ] Made sure tests are passing and test coverage is added if needed.
- [ ] Made sure commit message follow the rule of [Conventional Commits specification](https://www.conventionalcommits.org/).
- [ ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.
2024-06-05 08:58:09 +00:00
ssongliu 752e2ec17e fix: 面板代理地址自动增加 http 或者 https (#5302) 2024-06-05 08:52:09 +00:00
zhengkunwang 0118fbb944 fix: 修复编辑证书,秘钥算法没有回显的问题 (#5301)
Refs https://github.com/1Panel-dev/1Panel/issues/5299
2024-06-05 08:48:10 +00:00
ssongliu dba5302d68 fix: 解决代理选项为空的问题 (#5300) 2024-06-05 08:18:09 +00:00
ssongliu 546bc53f28 fix: 解决开启代理时同步应用失败的问题 (#5298) 2024-06-05 08:04:10 +00:00
zhengkunwang 4883c9dd49 feat: 升级增加 docker-compose 文件对比功能 (#5297) 2024-06-05 07:54:09 +00:00
ssongliuandssonglius11 428743d600 fix: 解决不带密码压缩文件失败的问题 (#5296)
Co-authored-by: ssonglius11 <ssonglius11@163.com>
2024-06-05 14:31:26 +08:00
zhengkunwang 33c4b8bba9 fix: 解决某些情况下安装应用错误没有正确显示的问题 (#5295)
Refs https://github.com/1Panel-dev/1Panel/issues/5289
2024-06-05 06:18:08 +00:00
ssongliu 296ae1c2e1 fix: 解决主题色切换报错的问题 (#5287) 2024-06-05 02:29:08 +00:00
ssongliu 7fb41f43cc fix: 解决登录页跳转空白的问题 (#5285) 2024-06-04 14:29:05 +00:00
ssongliu 0afc6242a2 fix: 优化 FTP 列表分页样式 (#5283) 2024-06-04 14:03:06 +00:00
zhengkunwang 62beecf337 fix: 解决自签证书关闭页面之后没有刷新的问题 (#5282) 2024-06-04 14:01:06 +00:00
zhengkunwang b08c7ff89d style: 统一修改名称样式 (#5281) 2024-06-04 13:59:05 +00:00
zhengkunwang daab425c78 fix: 解决打包报错问题 (#5278) 2024-06-04 09:02:31 +00:00
ssongliu 8ec9f727bd fix: 解决表格超出隐藏显示不正确的问题 (#5277) 2024-06-04 08:52:32 +00:00
zhengkunwang 8b781d466a feat: 应用升级支持对比 docker-compose 文件 (#5274)
Refs https://github.com/1Panel-dev/1Panel/issues/2826
2024-06-04 08:50:31 +00:00
John Bro 0182586869 feat: 压缩和解压缩 tar.gz 文件时支持设置压缩密码 (#5258) 2024-06-04 08:48:31 +00:00
John Bro dab5434125 fix: 容器垃圾清理不展示细节下拉清除 (#5271) 2024-06-04 06:38:48 +00:00
ssongliu e638a416ff fix: 修改面板设置证书时间显示不一致的问题 (#5267) 2024-06-04 03:41:50 +00:00
zhengkunwang ceca7fade0 fix: 解决部分情况下升级版本不显示的问题 (#5261)
Refs https://github.com/1Panel-dev/1Panel/issues/5256
2024-06-03 09:55:46 +00:00
zhengkunwang bdf8ba45ac fix: 解决应用安装升级状态错误的问题 (#5260) 2024-06-03 07:41:45 +00:00
ssongliu e45f43da9a pref: 优化登录页确认框样式 (#5259) 2024-06-03 15:41:35 +08:00
ssongliu 32fb7feb44 fix: 修改远程数据库排序问题 (#5257) 2024-06-03 06:07:44 +00:00
zhengkunwang caee2159a8 feat: 网站 access_log 使用主配置文件参数 (#5255) 2024-06-03 03:23:43 +00:00
zhengkunwang 6011f35f59 style: 增加 Chrome OS 图标 (#5243) 2024-05-31 10:27:19 +00:00
ssongliu 869d0c73bd fix: 服务器代理修改默认值 (#5242) 2024-05-31 10:07:19 +00:00
zhengkunwang 9af00cc80c perf: 优化应用同步查询接口 (#5241) 2024-05-31 09:57:20 +00:00
ssongliu 400dd79b9f fix: Redis 数据库连接信息移除密码限制 (#5239) 2024-05-31 09:35:20 +00:00
zhengkunwang 8c929004e9 feat: 修改 xpack 加载顺序 (#5238) 2024-05-31 09:33:21 +00:00
ssongliu e044d92075 fix: 快照删除增加备份文件删除选项 (#5237)
Refs #4962
2024-05-31 09:31:19 +00:00
ssongliu a02f160adf fix: demo 环境禁用终端工具 (#5235) 2024-05-31 06:51:18 +00:00
ssongliu ac33f5461d fix: 优化 Redis 数据库样式 (#5229) 2024-05-31 14:12:42 +08:00
ssongliu bf7a4f3254 fix: 解决计划任务时区显示不一致的问题 (#5230)
Refs  #5211
2024-05-31 05:47:19 +00:00
zhengkunwang ea40e32991 feat: 删除无用依赖 (#5227) 2024-05-30 11:01:15 +00:00
zhengkunwang d38d2c617d feat: 增加定时清理缓存 (#5226) 2024-05-30 10:09:15 +00:00
zhengkunwang 90bcf464d3 feat: Node.js 增加 pnpm 支持 (#5225) 2024-05-30 09:39:15 +00:00
ssongliu bd91c88357 fix: 解决 FTP 状态同步失败的问题 (#5224) 2024-05-30 09:11:16 +00:00
ssongliu 60dbd75ce2 fix: 远程数据库增加名称校验 (#5222) 2024-05-30 09:09:15 +00:00
ssongliu d5abd7ec3f fix: 解决远程数据库备份失败的问题 (#5221)
Refs #5166
2024-05-30 07:25:15 +00:00
ssongliu c133f39b5e fix: 解决主题颜色切换失败的问题 (#5218) 2024-05-30 07:17:15 +00:00
zhengkunwang 9df8f13fa7 feat: 升级 lego 版本 (#5216) 2024-05-30 07:15:14 +00:00
ssongliu e5bcb07cf6 fix: 处理数据库遮罩问题 (#5215) 2024-05-30 15:13:21 +08:00
ssongliu c62232e648 fix: 修复 Redis 数据库快速命令部分问题 (#5206) 2024-05-29 14:13:11 +00:00
zhengkunwang a4a66e1e18 fix: 解决应用安装切换版本校验条件没变的问题 (#5205) 2024-05-29 10:49:11 +00:00
zhengkunwang 86d021cbfc fix: 解决打开非文本文件报错的问题 (#5203) 2024-05-29 10:43:13 +00:00
zhengkunwang 9f3573bcb8 perf: 优化应用查询接口的执行速度 (#5202)
Refs https://github.com/1Panel-dev/1Panel/issues/5008
2024-05-29 10:41:13 +00:00
ssongliu 28f2dddcf6 fix: 解决黑金模式下概览页异常闪动的问题 (#5201) 2024-05-29 10:39:12 +00:00
zhengkunwang 3aa62f91bf fix: 解决使用本地 PHP 环境停止启动网站之后配置错误的问题 (#5198)
Refs https://github.com/1Panel-dev/1Panel/issues/5163
2024-05-29 07:49:10 +00:00
ssongliu fe00cb8015 style: 固定登录页样式 (#5197) 2024-05-29 07:15:10 +00:00
ssongliu 312c19e3cc fix: 概览页磁盘显示过滤 /snap (#5196) 2024-05-29 06:27:11 +00:00
Takagi 409e90d2c5 fix: the issue where the auto theme is invalid due to an incorrect class setting (#5194) 2024-05-29 14:26:20 +08:00
ssongliu 8fc708be97 feat: 增加服务器代理设置 (#5189) 2024-05-29 03:05:09 +00:00
ssongliu 2c7dcbfe17 fix: 解决概览页磁盘显示不全的问题 (#5190)
Refs #5174
2024-05-29 02:39:09 +00:00
zhengkunwang c189c48d51 fix: 解决清空伪静态配置报错的问题 (#5179)
Refs https://github.com/1Panel-dev/1Panel/issues/5086
2024-05-28 08:49:06 +00:00
wanghe a08612e0a0 docs: 增加安装包安装说明 2024-05-28 15:42:20 +08:00
ssongliu acda63d2f7 fix: 登录页跳转增加 404 (#5164) 2024-05-27 10:42:56 +00:00
ssongliu c39f029808 feat: 修改安全入口页特征样式 (#5159) 2024-05-27 03:32:54 +00:00
zhengkunwang 41bc8b634b feat: 增加华为 Icon (#5143) 2024-05-24 23:11:25 +08:00
Node b80b67b060 feat: 提升分段上传文件的体验 (#5123)
* feat: 提升分段上传文件的体验

* 原新建文件 mode 为755,修正为644
2024-05-24 11:15:24 +08:00
ssongliu 9c357f1ea4 fix: 解决升级过程中备份错误问题 (#5120)
Refs #5103
2024-05-23 15:16:50 +00:00
ssongliu 99ed9be1dd fix: 解决计划任务执行周期解析错误的问题 (#5119) 2024-05-23 09:50:49 +00:00
Node 3df8863904 fix: 修复分块上传文件资源未释放问题 (#5109) 2024-05-23 16:41:19 +08:00
Node f211b6b5ae fix: 修复几处日志文件未释放问题 (#5110) 2024-05-23 16:41:05 +08:00
ssongliu b59c9ee9ad fix: 解决升级过程中备份问题 (#5107) 2024-05-23 03:26:49 +00:00
ssongliu 8798babe07 pref: 1pctl 引用路径使用源文件代替软链地址 (#5105)
Refs #4930
2024-05-23 02:14:49 +00:00
Takagi 63c330054e refactor: refactor theme and logo switching functionality (#5015) 2024-05-22 18:38:03 +08:00
zhengkunwang f30b05a495 feat: 增加一些 icon (#5098) 2024-05-22 10:36:47 +00:00
zhengkunwang 260fbb6e19 feat: 文件夹名称增加完整路径展示 (#5097)
Refs https://github.com/1Panel-dev/1Panel/issues/5094
2024-05-22 10:34:47 +00:00
ssongliu 5cd59c7f39 fix: 解决在线文本编辑器打开 GBK 编码文件乱码问题 (#5096)
Refs #3804
2024-05-22 10:32:47 +00:00
zhengkunwang ede664be18 feat: 文件列表行内权限支持修改用户和用户组 (#5093)
Refs https://github.com/1Panel-dev/1Panel/issues/4981
2024-05-22 06:30:46 +00:00
zhengkunwang 0a7144f625 fix: 解决网站排序错误的问题 (#5092)
Refs https://github.com/1Panel-dev/1Panel/issues/5021
2024-05-22 06:26:47 +00:00
ssongliu 4dc722b83c feat: 进程守护增加运行目录跳转 (#5088)
Refs #4953
2024-05-22 03:10:45 +00:00
ssongliu 6131a99db0 fix: 解决部分 ssh 登录日志解析失败的问题 (#5081) 2024-05-21 08:44:45 +00:00
ssongliu d9f9f9a629 feat: 网站创建增加 FTP 选项 (#5076) 2024-05-21 08:42:46 +00:00
zhengkunwang 5e951f028e fix: 解决部分应用图标不显示的问题 (#5080) 2024-05-21 08:40:45 +00:00
ssongliu 65f92bf0c3 feat: FTP 增加状态及日志 (#5065) 2024-05-20 10:48:42 +00:00
zhengkunwang 201600ea06 feat: 增加网站监控的说明 (#5053) 2024-05-20 09:54:41 +00:00
ssongliu 64ed07e4fa feat: 工具箱支持 FTP (#5039) 2024-05-17 14:36:38 +00:00
zhengkunwang 35c4f4edfd feat: 增加网站监控页面 (#5038) 2024-05-17 09:54:38 +00:00
John Bro c31b3e9ddc feat: 工具箱的缓存清理添加容器垃圾清理功能 (#5024) 2024-05-17 06:02:37 +00:00
zhengkunwang 2e47afef3b feat: 优化网站目录跳转 (#5025) 2024-05-17 04:12:37 +00:00
ssongliu 54e81b2de5 fix: 修改数据库状态异常样式 (#5020) 2024-05-15 15:04:35 +00:00
ssongliu 8870b92ceb feat: Redis 数据库支持快速命令 (#5018)
Refs #3220
2024-05-15 15:02:35 +00:00
Anye cce60f4712 添加WordPress的PHP扩展模板 (#5016) 2024-05-15 13:48:49 +08:00
ssongliu 94cebfd8cc feat: Redis 支持远程数据库 (#5014) 2024-05-15 11:56:40 +08:00
ssongliu c56435970a feat: 数据库支持多 Redis 切换 (#5001)
Refs #3927
2024-05-13 14:40:31 +00:00
Zolo 188d9dd4c7 feat: 首页监控中上下行流量数据单位自动格式化 (#4207) (#4989) 2024-05-13 22:37:52 +08:00
zhengkunwang 8b9d1d9052 fix: 解决上传证书状态异常的问题 (#4999)
Refs https://github.com/1Panel-dev/1Panel/issues/4976
2024-05-13 05:54:30 +00:00
zhengkunwang 5a8869e832 feat: 优化网站域名跳转 (#4998)
Refs https://github.com/1Panel-dev/1Panel/issues/4964
2024-05-13 05:52:29 +00:00
lewisay 81835ef9a7 fix: 解决编辑证书时,其他域名格式不正确问题 (#4991)
#### What this PR does / why we need it?

#### Summary of your change

#### Please indicate you've done the following:

- [ ] Made sure tests are passing and test coverage is added if needed.
- [ ] Made sure commit message follow the rule of [Conventional Commits specification](https://www.conventionalcommits.org/).
- [ ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.
2024-05-13 03:52:30 +00:00
zhengkunwang b3ce35d516 fix: 解决进程守护命令不能输入空格的问题 (#4997) 2024-05-13 03:34:30 +00:00
ssongliu 5979e8b5d4 feat: 存储卷清理增加清除所有标签 (#4994) 2024-05-13 03:32:29 +00:00
zhengkunwang 79c2ba2125 fix: 解决应用名称存在大写导致无法升级的问题 (#4987)
Refs https://github.com/1Panel-dev/1Panel/issues/4986
2024-05-12 14:16:28 +00:00
ssongliu 95bbf4ee52 feat: 右侧抽屉取消 esc 关闭 (#4979) 2024-05-11 09:52:28 +00:00
John Broandzhoujunhong d43df6941b feat: 运行环境及容器菜单增加清理构建缓存功能 (#4978)
Co-authored-by: zhoujunhong <1298308460@qq.com>
2024-05-11 17:50:24 +08:00
711 changed files with 39074 additions and 10920 deletions
-1
View File
@@ -1 +0,0 @@
custom: ["https://afdian.net/a/1Panel"]
+50
View File
@@ -0,0 +1,50 @@
name: 'Bug Report'
description: 'Report an Bug'
title: '[Bug] '
assignees: wanghe-fit2cloud
body:
- type: markdown
attributes:
value: "## Contact Information"
- type: input
validations:
required: false
attributes:
label: "Contact Information"
description: "The ways to quickly contact you: WeChat group number and nickname, email, etc."
- type: markdown
attributes:
value: "## Environment Information"
- type: input
validations:
required: true
attributes:
label: "1Panel Version"
description: "Log in to the 1Panel Web console and check the current version at the bottom right of the page."
- type: markdown
attributes:
value: "## Detailed information"
- type: textarea
attributes:
label: "Problem Description"
description: "Briefly describe the issue you’ve encountered."
validations:
required: true
- type: textarea
attributes:
label: "Steps to Reproduce"
description: "How can this issue be reproduced."
validations:
required: true
- type: textarea
attributes:
label: "The expected correct result"
- type: textarea
attributes:
label: "Related log output"
description: "Please paste any relevant log output here. It will automatically be formatted as code, so no backticks are necessary."
render: shell
- type: textarea
attributes:
label: "Additional Information"
description: "If you have any additional information to provide, you can include it here (screenshots, videos, etc., are welcome)."
@@ -0,0 +1,29 @@
name: 'Feature Request'
description: 'Suggest an idea'
title: '[Feature] '
assignees: wanghe-fit2cloud
body:
- type: markdown
attributes:
value: "## Environment Information"
- type: input
validations:
required: true
attributes:
label: "1Panel Version"
description: "Log in to the 1Panel Web console and check the current version at the bottom right of the page."
- type: markdown
attributes:
value: "## Detailed information"
- type: textarea
attributes:
label: "Please describe your needs or suggestions for improvements"
validations:
required: true
- type: textarea
attributes:
label: "Please describe the solution you suggest"
- type: textarea
attributes:
label: "Additional Information"
description: "If you have any additional information to provide, you can include it here (screenshots, videos, etc., are welcome)."
-61
View File
@@ -1,61 +0,0 @@
name: BUG 提交
description: 提交产品缺陷帮助我们更好的改进
title: "[BUG]"
labels: "类型: 缺陷"
assignees: wanghe-fit2cloud
body:
- type: markdown
id: contacts_title
attributes:
value: "## 联系方式"
- type: input
id: contacts
validations:
required: false
attributes:
label: "联系方式"
description: "可以快速联系到您的方式:交流群号及昵称、邮箱等"
- type: markdown
id: environment
attributes:
value: "## 环境信息"
- type: input
id: version
validations:
required: true
attributes:
label: "1Panel 版本"
description: "登录 1Panel Web 控制台,在页面右下角查看当前版本。"
- type: markdown
id: details
attributes:
value: "## 详细信息"
- type: textarea
id: what-happened
attributes:
label: "问题描述"
description: "简要描述您碰到的问题"
validations:
required: true
- type: textarea
id: how-happened
attributes:
label: "重现步骤"
description: "如果操作可以重现该问题"
validations:
required: true
- type: textarea
id: expect
attributes:
label: "期待的正确结果"
- type: textarea
id: logs
attributes:
label: "相关日志输出"
description: "请复制并粘贴任何相关的日志输出。 这将自动格式化为代码,因此无需反引号。"
render: shell
- type: textarea
id: additional-information
attributes:
label: "附加信息"
description: "如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。"
+2 -5
View File
@@ -1,8 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 问题与讨论 / Questions & Discussions
- name: Questions & Discussions
url: https://github.com/1Panel-dev/1Panel/discussions
about: 提出针对本项目安装部署、使用及其他方面的相关问题 / Raise questions about the installation, deployment, use and other aspects of the project.
- name: 对 1Panel 项目有其他问题
url: https://bbs.fit2cloud.com/c/1p/7
about: 如果你对 1Panel 有其他想要提问的,我们欢迎到我们的官方社区进行提问。
about: Raise questions about the installation, deployment, use and other aspects of the project.
-36
View File
@@ -1,36 +0,0 @@
name: 需求建议
description: 提出针对本项目的想法和建议
title: "[FEATURE]"
labels: enhancement
assignees: wanghe-fit2cloud
body:
- type: markdown
id: environment
attributes:
value: "## 环境信息"
- type: input
id: version
validations:
required: true
attributes:
label: "1Panel 版本"
description: "登录 1Panel Web 控制台,在页面右下角查看当前版本。"
- type: markdown
id: details
attributes:
value: "## 详细信息"
- type: textarea
id: description
attributes:
label: "请描述您的需求或者改进建议"
validations:
required: true
- type: textarea
id: solution
attributes:
label: "请描述你建议的实现方案"
- type: textarea
id: additional-information
attributes:
label: "附加信息"
description: "如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。"
+2 -5
View File
@@ -1,13 +1,10 @@
name: General PR Handling for 1Panel
on: pull_request
name: 1Panel 通用 PR 处理
permissions:
pull-requests: write
jobs:
generic_handler:
name: 为 PR 添加标签
name: Add Labels to PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -0,0 +1,47 @@
name: Create Release And Upload assets
on:
push:
tags:
- 'v*'
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.2'
- name: Build Web
run: |
cd frontend && npm install && npm run build:pro
env:
NODE_OPTIONS: --max-old-space-size=8192
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build Release
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --skip=publish --clean
- name: Upload Assets
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
dist/*.tar.gz
dist/checksums.txt
- name: Setup OSSUTIL
uses: yizhoumo/setup-ossutil@v2
with:
endpoint: ${{ secrets.OSS_ENDPOINT }}
access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }}
access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
ossutil-version: '1.7.18'
- name: Upload Assets to OSS
run: ossutil cp -r dist/ oss://resource-fit2cloud-com/1panel/package/stable/${{ github.ref_name }}/release/ --include "*.tar.gz" --include "checksums.txt" --only-current-dir --force
+45
View File
@@ -0,0 +1,45 @@
name: Create Release And Upload Cloudflare R2
on:
push:
tags:
- 'v*'
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.2'
- name: Build Web
run: |
cd frontend && npm install && npm run build:pro
env:
NODE_OPTIONS: --max-old-space-size=8192
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build Release
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --skip=publish --clean
- name: Upload Assets
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
dist/*.tar.gz
dist/checksums.txt
- name: Setup Rclone
uses: AnimMouse/setup-rclone@v1
with:
rclone_config: ${{ secrets.RCLONE_CONFIG }}
- name: Upload to Cloudflare R2
run: |
rclone copy dist/ cloudflare_r2:package/stable/${{ github.ref_name }}/release/ --include "*.tar.gz" --include "checksums.txt" --progress
-34
View File
@@ -1,34 +0,0 @@
on:
pull_request:
branches:
- dev
push:
branches:
- dev
name: Build Test
jobs:
build-linux-binary:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.14'
- name: Build Web
id: build_frontend
run: |
cd frontend && npm install && npm run build:pro
env:
NODE_OPTIONS: --max-old-space-size=8192
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20.x'
- name: Build Server
uses: goreleaser/goreleaser-action@v4
with:
args: release --snapshot --clean
-17
View File
@@ -1,17 +0,0 @@
on:
schedule:
- cron: "0 1 * * *"
name: Check recent handle issues
jobs:
check-recent-issues-not-handle:
runs-on: ubuntu-latest
steps:
- name: Check recent issues and send msg
uses: jumpserver/action-issues-alert@master
with:
hook: ${{ secrets.WECHAT_GROUP_WEB_HOOK }}
type: recent
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+14
View File
@@ -0,0 +1,14 @@
name: Issue Translator
on:
issue_comment:
types: [created]
issues:
types: [opened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: usthe/issues-translate-action@v2.7
with:
IS_MODIFY_TITLE: true
BOT_GITHUB_TOKEN: ${{ secrets.ISSUE_TRANSLATOR_TOKEN }}
@@ -1,17 +0,0 @@
on:
schedule:
- cron: "0 9 * * 1-5"
name: Check untimely handle issues
jobs:
check-untimely-handle-issues:
runs-on: ubuntu-latest
steps:
- name: Check untimely issues and send msg
uses: jumpserver/action-issues-alert@master
with:
hook: ${{ secrets.WECHAT_GROUP_WEB_HOOK }}
type: untimely
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+25
View File
@@ -0,0 +1,25 @@
name: LLM Code Review
permissions:
contents: read
pull-requests: write
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
llm-code-review:
runs-on: ubuntu-latest
steps:
- uses: fit2cloud/LLM-CodeReview-Action@main
env:
GITHUB_TOKEN: ${{ secrets.FIT2CLOUDRD_LLM_CODE_REVIEW_TOKEN }}
OPENAI_API_KEY: ${{ secrets.ALIYUN_LLM_API_KEY }}
LANGUAGE: English
OPENAI_API_ENDPOINT: https://dashscope.aliyuncs.com/compatible-mode/v1
MODEL: qwen2.5-coder-3b-instruct
PROMPT: "Please check the following code differences for any irregularities, potential issues, or optimization suggestions, and provide your answers in English."
top_p: 1
temperature: 1
# max_tokens: 10000
MAX_PATCH_LENGTH: 10000
IGNORE_PATTERNS: "/node_modules,*.md,/dist,/.github"
FILE_PATTERNS: "*.java,*.go,*.py,*.vue,*.ts,*.js,*.css,*.scss,*.html"
-66
View File
@@ -1,66 +0,0 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release And Upload assets
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '20.2'
- name: Build Web
run: |
cd frontend && npm install && npm run build:pro
env:
NODE_OPTIONS: --max-old-space-size=8192
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
- name: Build Release
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --skip-publish --clean
- name: Upload Assets
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
body: |
# 一、安装和升级
## 1.1 一键安装
```sh
curl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && sudo bash quick_start.sh
```
## 1.2 在线升级
登录 1Panel Web 控制台,在页面右下角点击 **【检查更新】** 进行在线升级。
>更多信息请查阅在线文档:https://1panel.cn/docs/
# 二、更新日志
files: |
dist/*.tar.gz
dist/checksums.txt
- name: Setup OSSUTIL
uses: yizhoumo/setup-ossutil@v1
with:
endpoint: ${{ secrets.OSS_ENDPOINT }}
access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }}
access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
ossutil-version: '1.7.14'
- name: Upload Assets to OSS
run: ossutil cp -r dist/ oss://resource-fit2cloud-com/1panel/package/stable/${{ github.ref_name }}/release/ --include "*.tar.gz" --include "checksums.txt" --only-current-dir --force
@@ -1,4 +1,4 @@
name: Build
name: SonarCloud Scan
on:
push:
branches:
@@ -17,4 +17,4 @@ jobs:
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+1 -2
View File
@@ -1,6 +1,5 @@
name: sync2gitee
name: Synchronize to Gitee
on: [push]
jobs:
repo-sync:
runs-on: ubuntu-latest
-2
View File
@@ -1,6 +1,5 @@
name: Typos Check
on: pull_request
jobs:
run:
name: Spell Check with Typos
@@ -8,6 +7,5 @@ jobs:
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v2
- name: Check spelling
uses: crate-ci/typos@master
+1 -5
View File
@@ -22,7 +22,6 @@ build/1panel
*.iml
*.ipr
# Test binary, built with `go test -c`
*.test
@@ -40,10 +39,7 @@ frontend/auto-imports.d.ts
frontend/components.d.ts
frontend/src/xpack
backend/xpack
backend/router/entry_xpack.go
backend/server/init_xpack.go
backend/utils/xpack/xpack_xpack.go
*_xpack.go
.history/
dist/
1pctl
+15 -20
View File
@@ -1,11 +1,13 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=jcroql
version: 2
before:
hooks:
# - export NODE_OPTIONS="--max-old-space-size=8192"
# - make build_web
- chmod +x ./script.sh
- ./script.sh
- chmod +x ./ci/script.sh
- ./ci/script.sh
- sed -i 's@ORIGINAL_VERSION=.*@ORIGINAL_VERSION=v{{ .Version }}@g' 1pctl
- go mod tidy
@@ -38,22 +40,15 @@ archives:
- 1pctl
- 1panel.service
- install.sh
- README.md
- LICENSE
- GeoIP.mmdb
- lang/*
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
release:
draft: true
mode: append
extra_files:
- glob: dist/*.tar.gz
- glob: dist/checksums.txt
name_template: "Release {{.Tag}}"
# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

-3
View File
@@ -1,3 +0,0 @@
{
"ansible.python.interpreterPath": "/opt/homebrew/bin/python3"
}
+1 -1
View File
@@ -125,4 +125,4 @@ enforcement ladder](https://github.com/mozilla/diversity).
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
https://www.contributor-covenant.org/translations.
+6 -1
View File
@@ -1,11 +1,16 @@
# Contributing
As a contributor, you should agree that:
- The producer can adjust the open-source agreement to be more strict or relaxed as deemed necessary.
- Your contributed code may be used for commercial purposes, including but not limited to its cloud business operations.
## Create pull request
PR are always welcome, even if they only contain small fixes like typos or a few lines of code. If there will be a significant effort, please document it as an issue and get a discussion going before starting to work on it.
Please submit a PR broken down into small changes bit by bit. A PR consisting of a lot of features and code changes may be hard to review. It is recommended to submit PRs in an incremental fashion.
This [development guideline](https://1panel.cn/docs/dev_manual/dev_manual/) contains information about repository structure, how to set up development environment, how to run it, and more.
This [development guideline](https://docs.1panel.hk/dev_manual/dev_manual/) contains information about repository structure, how to set up development environment, how to run it, and more.
Note: If you split your pull request to small changes, please make sure any of the changes goes to master will not break anything. Otherwise, it can not be merged until this feature complete.
+7 -7
View File
@@ -2,15 +2,15 @@ GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOARCH=$(shell go env GOARCH)
GOOS=$(shell go env GOOS )
GOOS=$(shell go env GOOS)
BASE_PAH := $(shell pwd)
BUILD_PATH = $(BASE_PAH)/build
WEB_PATH=$(BASE_PAH)/frontend
SERVER_PATH=$(BASE_PAH)/backend
MAIN= $(BASE_PAH)/cmd/server/main.go
BASE_PATH := $(shell pwd)
BUILD_PATH = $(BASE_PATH)/build
WEB_PATH=$(BASE_PATH)/frontend
SERVER_PATH=$(BASE_PATH)/backend
MAIN= $(BASE_PATH)/cmd/server/main.go
APP_NAME=1panel
ASSERT_PATH= $(BASE_PAH)/cmd/server/web/assets
ASSERT_PATH= $(BASE_PATH)/cmd/server/web/assets
clean_assets:
rm -rf $(ASSERT_PATH)
+2 -4
View File
@@ -1,11 +1,9 @@
reviewers:
- wanghe-fit2cloud
- zhengkunwang223
- ssongliu
- wanghe-fit2cloud
- wangdan-fit2cloud
approvers:
- wanghe-fit2cloud
- zhengkunwang223
- ssongliu
- wanghe-fit2cloud
- wangdan-fit2cloud
+23 -34
View File
@@ -1,62 +1,51 @@
<p align="center"><a href="https://1panel.cn"><img src="http://1panel.oss-cn-hangzhou.aliyuncs.com/img/1panel-logo.png" alt="1Panel" width="300" /></a></p>
<p align="center"><b>现代化、开源的 Linux 服务器运维管理面板</b></p>
<p align="center"><a href="https://1panel.hk"><img src="https://resource.1panel.hk/img/1panel-logo.png" alt="1Panel" width="300" /></a></p>
<p align="center"><b>Top-Rated Web-based Linux Server Management Tool</b></p>
<p align="center">
<a href="https://trendshift.io/repositories/2462" target="_blank"><img src="https://trendshift.io/api/badge/repositories/2462" alt="1Panel-dev%2F1Panel | Trendshift" style="width: 180px; height: auto;" /></a>
<a href="https://www.producthunt.com/posts/1panel?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-1panel" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=639696&theme=light" alt="1Panel - Top&#0045;Rated&#0032;web&#0045;based&#0032;Linux&#0032;server&#0032;management&#0032;tool | Product Hunt" style="width: 180px; height: auto;" /></a>
</p>
<p align="center">
<a href="https://www.gnu.org/licenses/gpl-3.0.html"><img src="https://shields.io/github/license/1Panel-dev/1Panel?color=%231890FF" alt="License: GPL v3"></a>
<a href="https://app.codacy.com/gh/1Panel-dev/1Panel?utm_source=github.com&utm_medium=referral&utm_content=1Panel-dev/1Panel&utm_campaign=Badge_Grade_Dashboard"><img src="https://app.codacy.com/project/badge/Grade/da67574fd82b473992781d1386b937ef" alt="Codacy"></a>
<a href="https://github.com/1Panel-dev/1Panel/releases"><img src="https://img.shields.io/github/v/release/1Panel-dev/1Panel" alt="GitHub release"></a>
<a href="https://github.com/1Panel-dev/1Panel"><img src="https://img.shields.io/github/stars/1Panel-dev/1Panel?color=%231890FF&style=flat-square" alt="Stars"></a>
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2F1Panel-dev%2F1Panel?ref=badge_shield"><img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2F1Panel-dev%2F1Panel.svg?type=shield" alt="FOSSA Status"></a><br>
[<a href="docs/README_TW.md">中文(繁體)</a>] | [<a href="docs/README_EN.md">English</a>] | [<a href="docs/README_JP.md">日本語</a>]
<a href="https://github.com/1Panel-dev/1Panel"><img src="https://img.shields.io/github/stars/1Panel-dev/1Panel?color=%231890FF&style=flat-square" alt="Stars"></a><br>
[<a href="/README.md">English</a>] | [<a href="/docs/README.zh-Hans.md">中文(简体)</a>] | [<a href="/docs/README.zh-Hant.md">中文(繁體)</a>] | [<a href="/docs/README.ja.md">日本語</a>] | [<a href="/docs/README.pt-br.md">Português (Brasil)</a>] | [<a href="/docs/README.ko.md">한국어</a>]| [<a href="/docs/README.id.md">Bahasa Indonesia</a>]
</p>
------------------------------
1Panel 是新一代的 Linux 服务器运维管理面板。
1Panel is an open-source, modern web-based control panel for Linux server management.
- **高效管理**:用户可以通过 Web 图形界面轻松管理 Linux 服务器,实现主机监控、文件管理、数据库管理、容器管理等功能;
- **快速建站**:深度集成开源建站软件 WordPress 和 [Halo](https://github.com/halo-dev/halo/),域名绑定、SSL 证书配置等操作一键搞定;
- **应用商店**:精选上架各类高质量的开源工具和应用软件,协助用户轻松安装并升级;
- **安全可靠**:基于容器管理并部署应用,实现最小的漏洞暴露面,同时提供防火墙和日志审计等功能;
- **一键备份**:支持一键备份和恢复,用户可以将数据备份到各类云端存储介质,永不丢失。
- **Efficient Management**: Through a user-friendly web graphical interface, 1Panel enables users to effortlessly manage their Linux servers. Key features include host monitoring, file management, database administration, and container management.
- **Rapid Website Deployment**: With deep integration of the popular open-source website building software WordPress, 1Panel streamlines the process of domain binding and SSL certificate configuration, all achievable with just one click.
- **Application Store**: 1Panel curates a wide range of high-quality open-source tools and applications, facilitating easy installation and updates for its users.
- **Security and Reliability**: By leveraging containerization and secure application deployment practices, 1Panel minimizes vulnerability exposure. It further enhances security through integrated firewall management and log auditing capabilities.
- **One-Click Backup & Restore**: Data protection is made simple with 1Panel's one-click backup and restore functionality, supporting various cloud storage solutions to ensure data integrity and availability.
1Panel 三分钟速览:https://www.bilibili.com/video/BV1Mt421n7LZ/
## Quick Start
## 快速开始
Execute the script below and follow the prompts to install 1Panel:
**一键安装**
执行如下命令一键安装 1Panel:
```sh
curl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && sudo bash quick_start.sh
```bash
curl -sSL https://resource.1panel.hk/quick_start.sh -o quick_start.sh && bash quick_start.sh
```
**学习资料**
Please refer to our [documentation](https://docs.1panel.hk/quick_start/) for more details.
- [在线文档](https://1panel.cn/docs/)
- [社区论坛](https://bbs.fit2cloud.com/c/1p/7)
- [如何加入微信交流群?](https://bbs.fit2cloud.com/t/topic/2147)
## Screenshot
## UI 展示
![UI展示](https://resource.fit2cloud.com/1panel/img/overview.png)
![UI Display](https://resource.1panel.hk/img/1panel.png)
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=1Panel-dev/1Panel&type=Date)](https://star-history.com/#1Panel-dev/1Panel&Date)
## 我们的其他明星项目
## Security Information
- [MaxKB](https://github.com/1Panel-dev/MaxKB/) - 基于 LLM 大语言模型的开源知识库问答系统
- [JumpServer](https://github.com/jumpserver/jumpserver/) - 广受欢迎的开源堡垒机
- [Halo](https://github.com/halo-dev/halo/) - 强大易用的开源建站工具
- [DataEase](https://github.com/dataease/dataease/) - 人人可用的开源数据可视化分析工具
- [MeterSphere](https://github.com/metersphere/metersphere/) - 开源自动化测试平台
If you discover any security issues, please contact us through: wanghe@fit2cloud.com.
## License
Copyright (c) 2014-2024 [FIT2CLOUD 飞致云](https://fit2cloud.com/), All rights reserved.
Licensed under The GNU General Public License version 3 (GPLv3) (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
<https://www.gnu.org/licenses/gpl-3.0.html>
+8 -10
View File
@@ -1,15 +1,13 @@
# 安全说明
# Security policy
如果您发现安全问题,请直接联系我们:
## Supported versions
- wanghe@fit2cloud.com
| Version | Supported |
| ------- | ------------------ |
| v1.x | :white_check_mark: |
感谢您的支持!
## Reporting a vulnerability
# Security Policy
We first appreciate and are very thankful that you've found a vulnerability issue in 1Panel! By disclosing such issue to 1Panel development team you are helping 1Panel to become a much more safer project than before! ;)
All security bugs should be reported to the contact as below:
- wanghe@fit2cloud.com
Thanks for your support!
To protect the existing users of 1Panel, we kindly ask you to not disclose the vulnerability to anyone except the 1Panel development team before a fix has been rolled out. Send an email to `wanghe@fit2cloud.com` instead.
+11 -11
View File
@@ -11,11 +11,11 @@ import (
// @Tags App
// @Summary List apps
// @Description 获取应用列表
// @Accept json
// @Param request body request.AppSearch true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/search [post]
func (b *BaseApi) SearchApp(c *gin.Context) {
var req request.AppSearch
@@ -32,9 +32,9 @@ func (b *BaseApi) SearchApp(c *gin.Context) {
// @Tags App
// @Summary Sync app list
// @Description 同步应用列表
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/sync [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"应用商店同步","formatEN":"App store synchronization"}
func (b *BaseApi) SyncApp(c *gin.Context) {
@@ -63,11 +63,11 @@ func (b *BaseApi) SyncApp(c *gin.Context) {
// @Tags App
// @Summary Search app by key
// @Description 通过 key 获取应用信息
// @Accept json
// @Param key path string true "app key"
// @Success 200 {object} response.AppDTO
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/:key [get]
func (b *BaseApi) GetApp(c *gin.Context) {
appKey, err := helper.GetStrParamByKey(c, "key")
@@ -85,13 +85,13 @@ func (b *BaseApi) GetApp(c *gin.Context) {
// @Tags App
// @Summary Search app detail by appid
// @Description 通过 appid 获取应用详情
// @Accept json
// @Param appId path integer true "app id"
// @Param version path string true "app 版本"
// @Param version path string true "app 类型"
// @Param version path string true "app version"
// @Param version path string true "app type"
// @Success 200 {object} response.AppDetailDTO
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/detail/:appId/:version/:type [get]
func (b *BaseApi) GetAppDetail(c *gin.Context) {
appID, err := helper.GetIntParamByKey(c, "appId")
@@ -111,11 +111,11 @@ func (b *BaseApi) GetAppDetail(c *gin.Context) {
// @Tags App
// @Summary Get app detail by id
// @Description 通过 id 获取应用详情
// @Accept json
// @Param appId path integer true "id"
// @Success 200 {object} response.AppDetailDTO
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/details/:id [get]
func (b *BaseApi) GetAppDetailByID(c *gin.Context) {
appDetailID, err := helper.GetIntParamByKey(c, "id")
@@ -133,10 +133,10 @@ func (b *BaseApi) GetAppDetailByID(c *gin.Context) {
// @Tags App
// @Summary Get Ignore App
// @Description 获取忽略的应用版本
// @Accept json
// @Success 200 {object} response.IgnoredApp
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/ignored [get]
func (b *BaseApi) GetIgnoredApp(c *gin.Context) {
res, err := appService.GetIgnoredApp()
@@ -149,13 +149,13 @@ func (b *BaseApi) GetIgnoredApp(c *gin.Context) {
// @Tags App
// @Summary Install app
// @Description 安装应用
// @Accept json
// @Param request body request.AppInstallCreate true "request"
// @Success 200 {object} model.AppInstall
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/install [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[{"input_column":"name","input_value":"name","isList":false,"db":"app_installs","output_column":"app_id","output_value":"appId"},{"info":"appId","isList":false,"db":"apps","output_column":"key","output_value":"appKey"}],"formatZH":"安装应用 [appKey]-[name]","formatEN":"Install app [appKey]-[name]"}
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"安装应用 [name]","formatEN":"Install app [name]"}
func (b *BaseApi) InstallApp(c *gin.Context) {
var req request.AppInstallCreate
if err := helper.CheckBindAndValidate(&req, c); err != nil {
@@ -183,9 +183,9 @@ func (b *BaseApi) GetAppTags(c *gin.Context) {
// @Tags App
// @Summary Get app list update
// @Description 获取应用更新版本
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/checkupdate [get]
func (b *BaseApi) GetAppListUpdate(c *gin.Context) {
res, err := appService.GetAppUpdate()
+19 -20
View File
@@ -11,11 +11,11 @@ import (
// @Tags App
// @Summary Page app installed
// @Description 分页获取已安装应用列表
// @Accept json
// @Param request body request.AppInstalledSearch true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/search [post]
func (b *BaseApi) SearchAppInstalled(c *gin.Context) {
var req request.AppInstalledSearch
@@ -44,10 +44,10 @@ func (b *BaseApi) SearchAppInstalled(c *gin.Context) {
// @Tags App
// @Summary List app installed
// @Description 获取已安装应用列表
// @Accept json
// @Success 200 array dto.AppInstallInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/list [get]
func (b *BaseApi) ListAppInstalled(c *gin.Context) {
list, err := appInstallService.GetInstallList()
@@ -60,11 +60,11 @@ func (b *BaseApi) ListAppInstalled(c *gin.Context) {
// @Tags App
// @Summary Check app installed
// @Description 检查应用安装情况
// @Accept json
// @Param request body request.AppInstalledInfo true "request"
// @Success 200 {object} response.AppInstalledCheck
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/check [post]
func (b *BaseApi) CheckAppInstalled(c *gin.Context) {
var req request.AppInstalledInfo
@@ -81,11 +81,11 @@ func (b *BaseApi) CheckAppInstalled(c *gin.Context) {
// @Tags App
// @Summary Search app port by key
// @Description 获取应用端口
// @Accept json
// @Param request body dto.OperationWithNameAndType true "request"
// @Success 200 {integer} port
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/loadport [post]
func (b *BaseApi) LoadPort(c *gin.Context) {
var req dto.OperationWithNameAndType
@@ -102,11 +102,11 @@ func (b *BaseApi) LoadPort(c *gin.Context) {
// @Tags App
// @Summary Search app password by key
// @Description 获取应用连接信息
// @Accept json
// @Param request body dto.OperationWithNameAndType true "request"
// @Success 200 {string} response.DatabaseConn
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/conninfo/:key [get]
func (b *BaseApi) LoadConnInfo(c *gin.Context) {
var req dto.OperationWithNameAndType
@@ -123,11 +123,11 @@ func (b *BaseApi) LoadConnInfo(c *gin.Context) {
// @Tags App
// @Summary Check before delete
// @Description 删除前检查
// @Accept json
// @Param appInstallId path integer true "App install id"
// @Success 200 {array} dto.AppResource
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/delete/check/:appInstallId [get]
func (b *BaseApi) DeleteCheck(c *gin.Context) {
appInstallId, err := helper.GetIntParamByKey(c, "appInstallId")
@@ -146,9 +146,9 @@ func (b *BaseApi) DeleteCheck(c *gin.Context) {
// Sync app installed
// @Tags App
// @Summary Sync app installed
// @Description 同步已安装应用列表
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/sync [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"同步已安装应用列表","formatEN":"Sync the list of installed apps"}
func (b *BaseApi) SyncInstalled(c *gin.Context) {
@@ -161,11 +161,11 @@ func (b *BaseApi) SyncInstalled(c *gin.Context) {
// @Tags App
// @Summary Operate installed app
// @Description 操作已安装应用
// @Accept json
// @Param request body request.AppInstalledOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/op [post]
// @x-panel-log {"bodyKeys":["installId","operate"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"installId","isList":false,"db":"app_installs","output_column":"app_id","output_value":"appId"},{"input_column":"id","input_value":"installId","isList":false,"db":"app_installs","output_column":"name","output_value":"appName"},{"input_column":"id","input_value":"appId","isList":false,"db":"apps","output_column":"key","output_value":"appKey"}],"formatZH":"[operate] 应用 [appKey][appName]","formatEN":"[operate] App [appKey][appName]"}
func (b *BaseApi) OperateInstalled(c *gin.Context) {
@@ -182,11 +182,11 @@ func (b *BaseApi) OperateInstalled(c *gin.Context) {
// @Tags App
// @Summary Search app service by key
// @Description 通过 key 获取应用 service
// @Accept json
// @Param key path string true "request"
// @Success 200 {array} response.AppService
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/services/:key [get]
func (b *BaseApi) GetServices(c *gin.Context) {
key := c.Param("key")
@@ -200,19 +200,18 @@ func (b *BaseApi) GetServices(c *gin.Context) {
// @Tags App
// @Summary Search app update version by install id
// @Description 通过 install id 获取应用更新版本
// @Accept json
// @Param appInstallId path integer true "request"
// @Success 200 {array} dto.AppVersion
// @Security ApiKeyAuth
// @Router /apps/installed/:appInstallId/versions [get]
// @Security Timestamp
// @Router /apps/installed/update/versions [post]
func (b *BaseApi) GetUpdateVersions(c *gin.Context) {
appInstallId, err := helper.GetIntParamByKey(c, "appInstallId")
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInternalServer, nil)
var req request.AppUpdateVersion
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
versions, err := appInstallService.GetUpdateVersions(appInstallId)
versions, err := appInstallService.GetUpdateVersions(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
@@ -222,11 +221,11 @@ func (b *BaseApi) GetUpdateVersions(c *gin.Context) {
// @Tags App
// @Summary Change app port
// @Description 修改应用端口
// @Accept json
// @Param request body request.PortUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/port/change [post]
// @x-panel-log {"bodyKeys":["key","name","port"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"应用端口修改 [key]-[name] => [port]","formatEN":"Application port update [key]-[name] => [port]"}
func (b *BaseApi) ChangeAppPort(c *gin.Context) {
@@ -243,11 +242,11 @@ func (b *BaseApi) ChangeAppPort(c *gin.Context) {
// @Tags App
// @Summary Search default config by key
// @Description 通过 key 获取应用默认配置
// @Accept json
// @Param request body dto.OperationWithNameAndType true "request"
// @Success 200 {string} content
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/conf [post]
func (b *BaseApi) GetDefaultConfig(c *gin.Context) {
var req dto.OperationWithNameAndType
@@ -265,11 +264,11 @@ func (b *BaseApi) GetDefaultConfig(c *gin.Context) {
// @Tags App
// @Summary Search params by appInstallId
// @Description 通过 install id 获取应用参数
// @Accept json
// @Param appInstallId path string true "request"
// @Success 200 {object} response.AppParam
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/params/:appInstallId [get]
func (b *BaseApi) GetParams(c *gin.Context) {
appInstallId, err := helper.GetIntParamByKey(c, "appInstallId")
@@ -287,11 +286,11 @@ func (b *BaseApi) GetParams(c *gin.Context) {
// @Tags App
// @Summary Change app params
// @Description 修改应用参数
// @Accept json
// @Param request body request.AppInstalledUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/params/update [post]
// @x-panel-log {"bodyKeys":["installId"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"应用参数修改 [installId]","formatEN":"Application param update [installId]"}
func (b *BaseApi) UpdateInstalled(c *gin.Context) {
@@ -308,11 +307,11 @@ func (b *BaseApi) UpdateInstalled(c *gin.Context) {
// @Tags App
// @Summary ignore App Update
// @Description 忽略应用升级版本
// @Accept json
// @Param request body request.AppInstalledIgnoreUpgrade true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /apps/installed/ignore [post]
// @x-panel-log {"bodyKeys":["installId"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"忽略应用 [installId] 版本升级","formatEN":"Application param update [installId]"}
func (b *BaseApi) IgnoreUpgrade(c *gin.Context) {
+23 -29
View File
@@ -2,14 +2,14 @@ package v1
import (
"encoding/base64"
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
"github.com/1Panel-dev/1Panel/backend/app/dto"
"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/captcha"
"github.com/1Panel-dev/1Panel/backend/utils/qqwry"
"github.com/1Panel-dev/1Panel/backend/utils/common"
"github.com/1Panel-dev/1Panel/backend/utils/geo"
"github.com/gin-gonic/gin"
)
@@ -17,9 +17,8 @@ type BaseApi struct{}
// @Tags Auth
// @Summary User login
// @Description 用户登录
// @Accept json
// @Param EntranceCode header string true "安全入口 base64 加密串"
// @Param EntranceCode header string true "Secure entrance base64 encrypted string"
// @Param request body dto.Login true "request"
// @Success 200 {object} dto.UserLoginInfo
// @Router /auth/login [post]
@@ -35,11 +34,18 @@ func (b *BaseApi) Login(c *gin.Context) {
return
}
}
entranceItem := c.Request.Header.Get("EntranceCode")
var entrance []byte
if len(entranceItem) != 0 {
entrance, _ = base64.StdEncoding.DecodeString(entranceItem)
}
if len(entrance) == 0 {
cookieValue, err := c.Cookie("SecurityEntrance")
if err == nil {
entrance, _ = base64.StdEncoding.DecodeString(cookieValue)
}
}
user, err := authService.Login(c, req, string(entrance))
go saveLoginLogs(c, err)
@@ -52,12 +58,11 @@ func (b *BaseApi) Login(c *gin.Context) {
// @Tags Auth
// @Summary User login with mfa
// @Description 用户 mfa 登录
// @Accept json
// @Param request body dto.MFALogin true "request"
// @Success 200 {object} dto.UserLoginInfo
// @Router /auth/mfalogin [post]
// @Header 200 {string} EntranceCode "安全入口"
// @Header 200 {string} EntranceCode
func (b *BaseApi) MFALogin(c *gin.Context) {
var req dto.MFALogin
if err := helper.CheckBindAndValidate(&req, c); err != nil {
@@ -80,9 +85,9 @@ func (b *BaseApi) MFALogin(c *gin.Context) {
// @Tags Auth
// @Summary User logout
// @Description 用户登出
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /auth/logout [post]
func (b *BaseApi) LogOut(c *gin.Context) {
if err := authService.LogOut(c); err != nil {
@@ -94,7 +99,6 @@ func (b *BaseApi) LogOut(c *gin.Context) {
// @Tags Auth
// @Summary Load captcha
// @Description 加载验证码
// @Success 200 {object} dto.CaptchaResponse
// @Router /auth/captcha [get]
func (b *BaseApi) Captcha(c *gin.Context) {
@@ -106,21 +110,6 @@ func (b *BaseApi) Captcha(c *gin.Context) {
helper.SuccessWithData(c, captcha)
}
// @Tags Auth
// @Summary Load safety status
// @Description 获取系统安全登录状态
// @Success 200
// @Router /auth/issafety [get]
func (b *BaseApi) CheckIsSafety(c *gin.Context) {
code := c.DefaultQuery("code", "")
status, err := authService.CheckIsSafety(code)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, status)
}
func (b *BaseApi) GetResponsePage(c *gin.Context) {
pageCode, err := authService.GetResponsePage()
if err != nil {
@@ -132,16 +121,22 @@ func (b *BaseApi) GetResponsePage(c *gin.Context) {
// @Tags Auth
// @Summary Check System isDemo
// @Description 判断是否为demo环境
// @Success 200
// @Router /auth/demo [get]
func (b *BaseApi) CheckIsDemo(c *gin.Context) {
helper.SuccessWithData(c, global.CONF.System.IsDemo)
}
// @Tags Auth
// @Summary Check System isIntl
// @Success 200
// @Router /auth/intl [get]
func (b *BaseApi) CheckIsIntl(c *gin.Context) {
helper.SuccessWithData(c, global.CONF.System.IsIntl)
}
// @Tags Auth
// @Summary Load System Language
// @Description 获取系统语言设置
// @Success 200
// @Router /auth/language [get]
func (b *BaseApi) GetLanguage(c *gin.Context) {
@@ -162,12 +157,11 @@ func saveLoginLogs(c *gin.Context, err error) {
logs.Status = constant.StatusSuccess
}
logs.IP = c.ClientIP()
qqWry, err := qqwry.NewQQwry()
address, err := geo.GetIPLocation(logs.IP, common.GetLang(c))
if err != nil {
global.LOG.Errorf("load qqwry datas failed: %s", err)
global.LOG.Errorf("get ip location failed: %s", err)
}
res := qqWry.Find(logs.IP)
logs.Agent = c.GetHeader("User-Agent")
logs.Address = res.Area
logs.Address = address
_ = logService.CreateLoginLog(logs)
}
+18 -18
View File
@@ -13,11 +13,11 @@ import (
// @Tags Backup Account
// @Summary Create backup account
// @Description 创建备份账号
// @Accept json
// @Param request body dto.BackupOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup [post]
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建备份账号 [type]","formatEN":"create backup account [type]"}
func (b *BaseApi) CreateBackup(c *gin.Context) {
@@ -51,9 +51,9 @@ func (b *BaseApi) CreateBackup(c *gin.Context) {
// @Tags Backup Account
// @Summary Refresh OneDrive token
// @Description 刷新 OneDrive token
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/refresh/onedrive [post]
func (b *BaseApi) RefreshOneDriveToken(c *gin.Context) {
backupService.Run()
@@ -62,11 +62,11 @@ func (b *BaseApi) RefreshOneDriveToken(c *gin.Context) {
// @Tags Backup Account
// @Summary List buckets
// @Description 获取 bucket 列表
// @Accept json
// @Param request body dto.ForBuckets true "request"
// @Success 200 {array} string
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/search [post]
func (b *BaseApi) ListBuckets(c *gin.Context) {
var req dto.ForBuckets
@@ -100,10 +100,10 @@ func (b *BaseApi) ListBuckets(c *gin.Context) {
// @Tags Backup Account
// @Summary Load OneDrive info
// @Description 获取 OneDrive 信息
// @Accept json
// @Success 200 {object} dto.OneDriveInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/onedrive [get]
func (b *BaseApi) LoadOneDriveInfo(c *gin.Context) {
data, err := backupService.LoadOneDriveInfo()
@@ -116,13 +116,13 @@ func (b *BaseApi) LoadOneDriveInfo(c *gin.Context) {
// @Tags Backup Account
// @Summary Delete backup account
// @Description 删除备份账号
// @Accept json
// @Param request body dto.BatchDeleteReq true "request"
// @Param request body dto.OperateByID true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/del [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":true,"db":"backup_accounts","output_column":"type","output_value":"types"}],"formatZH":"删除备份账号 [types]","formatEN":"delete backup account [types]"}
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"backup_accounts","output_column":"type","output_value":"types"}],"formatZH":"删除备份账号 [types]","formatEN":"delete backup account [types]"}
func (b *BaseApi) DeleteBackup(c *gin.Context) {
var req dto.OperateByID
if err := helper.CheckBindAndValidate(&req, c); err != nil {
@@ -138,11 +138,11 @@ func (b *BaseApi) DeleteBackup(c *gin.Context) {
// @Tags Backup Account
// @Summary Page backup records
// @Description 获取备份记录列表分页
// @Accept json
// @Param request body dto.RecordSearch true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/record/search [post]
func (b *BaseApi) SearchBackupRecords(c *gin.Context) {
var req dto.RecordSearch
@@ -164,11 +164,11 @@ func (b *BaseApi) SearchBackupRecords(c *gin.Context) {
// @Tags Backup Account
// @Summary Page backup records by cronjob
// @Description 通过计划任务获取备份记录列表分页
// @Accept json
// @Param request body dto.RecordSearchByCronjob true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/record/search/bycronjob [post]
func (b *BaseApi) SearchBackupRecordsByCronjob(c *gin.Context) {
var req dto.RecordSearchByCronjob
@@ -190,11 +190,11 @@ func (b *BaseApi) SearchBackupRecordsByCronjob(c *gin.Context) {
// @Tags Backup Account
// @Summary Download backup record
// @Description 下载备份记录
// @Accept json
// @Param request body dto.DownloadRecord true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/record/download [post]
// @x-panel-log {"bodyKeys":["source","fileName"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"下载备份记录 [source][fileName]","formatEN":"download backup records [source][fileName]"}
func (b *BaseApi) DownloadRecord(c *gin.Context) {
@@ -213,11 +213,11 @@ func (b *BaseApi) DownloadRecord(c *gin.Context) {
// @Tags Backup Account
// @Summary Delete backup record
// @Description 删除备份记录
// @Accept json
// @Param request body dto.BatchDeleteReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/record/del [post]
// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ids","isList":true,"db":"backup_records","output_column":"file_name","output_value":"files"}],"formatZH":"删除备份记录 [files]","formatEN":"delete backup records [files]"}
func (b *BaseApi) DeleteBackupRecord(c *gin.Context) {
@@ -235,11 +235,11 @@ func (b *BaseApi) DeleteBackupRecord(c *gin.Context) {
// @Tags Backup Account
// @Summary Update backup account
// @Description 更新备份账号信息
// @Accept json
// @Param request body dto.BackupOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/update [post]
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新备份账号 [types]","formatEN":"update backup account [types]"}
func (b *BaseApi) UpdateBackup(c *gin.Context) {
@@ -274,9 +274,9 @@ func (b *BaseApi) UpdateBackup(c *gin.Context) {
// @Tags Backup Account
// @Summary List backup accounts
// @Description 获取备份账号列表
// @Success 200 {array} dto.BackupInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/search [get]
func (b *BaseApi) ListBackup(c *gin.Context) {
data, err := backupService.List()
@@ -290,11 +290,11 @@ func (b *BaseApi) ListBackup(c *gin.Context) {
// @Tags Backup Account
// @Summary List files from backup accounts
// @Description 获取备份账号内文件列表
// @Accept json
// @Param request body dto.BackupSearchFile true "request"
// @Success 200 {array} string
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/search/files [post]
func (b *BaseApi) LoadFilesFromBackup(c *gin.Context) {
var req dto.BackupSearchFile
@@ -308,11 +308,11 @@ func (b *BaseApi) LoadFilesFromBackup(c *gin.Context) {
// @Tags Backup Account
// @Summary Backup system data
// @Description 备份系统数据
// @Accept json
// @Param request body dto.CommonBackup true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/backup [post]
// @x-panel-log {"bodyKeys":["type","name","detailName"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"备份 [type] 数据 [name][detailName]","formatEN":"backup [type] data [name][detailName]"}
func (b *BaseApi) Backup(c *gin.Context) {
@@ -343,7 +343,7 @@ func (b *BaseApi) Backup(c *gin.Context) {
return
}
case "redis":
if err := backupService.RedisBackup(); err != nil {
if err := backupService.RedisBackup(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
@@ -353,11 +353,11 @@ func (b *BaseApi) Backup(c *gin.Context) {
// @Tags Backup Account
// @Summary Recover system data
// @Description 恢复系统数据
// @Accept json
// @Param request body dto.CommonRecover true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/recover [post]
// @x-panel-log {"bodyKeys":["type","name","detailName","file"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"从 [file] 恢复 [type] 数据 [name][detailName]","formatEN":"recover [type] data [name][detailName] from [file]"}
func (b *BaseApi) Recover(c *gin.Context) {
@@ -404,11 +404,11 @@ func (b *BaseApi) Recover(c *gin.Context) {
// @Tags Backup Account
// @Summary Recover system data by upload
// @Description 从上传恢复系统数据
// @Accept json
// @Param request body dto.CommonRecover true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/recover/byupload [post]
// @x-panel-log {"bodyKeys":["type","name","detailName","file"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"从 [file] 恢复 [type] 数据 [name][detailName]","formatEN":"recover [type] data [name][detailName] from [file]"}
func (b *BaseApi) RecoverByUpload(c *gin.Context) {
+296
View File
@@ -0,0 +1,296 @@
package v1
import (
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
"github.com/1Panel-dev/1Panel/backend/app/dto"
"github.com/1Panel-dev/1Panel/backend/constant"
"github.com/gin-gonic/gin"
)
// @Tags Clam
// @Summary Create clam
// @Accept json
// @Param request body dto.ClamCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clam [post]
// @x-panel-log {"bodyKeys":["name","path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建扫描规则 [name][path]","formatEN":"create clam [name][path]"}
func (b *BaseApi) CreateClam(c *gin.Context) {
var req dto.ClamCreate
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := clamService.Create(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
// @Tags Clam
// @Summary Update clam
// @Accept json
// @Param request body dto.ClamUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clam/update [post]
// @x-panel-log {"bodyKeys":["name","path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改扫描规则 [name][path]","formatEN":"update clam [name][path]"}
func (b *BaseApi) UpdateClam(c *gin.Context) {
var req dto.ClamUpdate
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := clamService.Update(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
// @Tags Clam
// @Summary Update clam status
// @Accept json
// @Param request body dto.ClamUpdateStatus true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clam/status/update [post]
// @x-panel-log {"bodyKeys":["id","status"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"clams","output_column":"name","output_value":"name"}],"formatZH":"修改扫描规则 [name] 状态为 [status]","formatEN":"change the status of clam [name] to [status]."}
func (b *BaseApi) UpdateClamStatus(c *gin.Context) {
var req dto.ClamUpdateStatus
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := clamService.UpdateStatus(req.ID, req.Status); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
// @Tags Clam
// @Summary Page clam
// @Accept json
// @Param request body dto.SearchClamWithPage true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clam/search [post]
func (b *BaseApi) SearchClam(c *gin.Context) {
var req dto.SearchClamWithPage
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
total, list, err := clamService.SearchWithPage(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, dto.PageResult{
Items: list,
Total: total,
})
}
// @Tags Clam
// @Summary Load clam base info
// @Accept json
// @Success 200 {object} dto.ClamBaseInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clam/base [get]
func (b *BaseApi) LoadClamBaseInfo(c *gin.Context) {
info, err := clamService.LoadBaseInfo()
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, info)
}
// @Tags Clam
// @Summary Operate Clam
// @Accept json
// @Param request body dto.Operate true "request"
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clam/operate [post]
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] Clam","formatEN":"[operation] FTP"}
func (b *BaseApi) OperateClam(c *gin.Context) {
var req dto.Operate
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := clamService.Operate(req.Operation); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
// @Tags Clam
// @Summary Clean clam record
// @Accept json
// @Param request body dto.OperateByID true "request"
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clam/record/clean [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":true,"db":"clams","output_column":"name","output_value":"name"}],"formatZH":"清空扫描报告 [name]","formatEN":"clean clam record [name]"}
func (b *BaseApi) CleanClamRecord(c *gin.Context) {
var req dto.OperateByID
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := clamService.CleanRecord(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
// @Tags Clam
// @Summary Page clam record
// @Accept json
// @Param request body dto.ClamLogSearch true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clam/record/search [post]
func (b *BaseApi) SearchClamRecord(c *gin.Context) {
var req dto.ClamLogSearch
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
total, list, err := clamService.LoadRecords(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, dto.PageResult{
Items: list,
Total: total,
})
}
// @Tags Clam
// @Summary Load clam record detail
// @Accept json
// @Param request body dto.ClamLogReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clam/record/log [post]
func (b *BaseApi) LoadClamRecordLog(c *gin.Context) {
var req dto.ClamLogReq
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
content, err := clamService.LoadRecordLog(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, content)
}
// @Tags Clam
// @Summary Load clam file
// @Accept json
// @Param request body dto.ClamFileReq true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clam/file/search [post]
func (b *BaseApi) SearchClamFile(c *gin.Context) {
var req dto.ClamFileReq
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
content, err := clamService.LoadFile(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, content)
}
// @Tags Clam
// @Summary Update clam file
// @Accept json
// @Param request body dto.UpdateByNameAndFile true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clam/file/update [post]
func (b *BaseApi) UpdateFile(c *gin.Context) {
var req dto.UpdateByNameAndFile
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := clamService.UpdateFile(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithOutData(c)
}
// @Tags Clam
// @Summary Delete clam
// @Accept json
// @Param request body dto.ClamDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clam/del [post]
// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ids","isList":true,"db":"clams","output_column":"name","output_value":"names"}],"formatZH":"删除扫描规则 [names]","formatEN":"delete clam [names]"}
func (b *BaseApi) DeleteClam(c *gin.Context) {
var req dto.ClamDelete
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := clamService.Delete(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
// @Tags Clam
// @Summary Handle clam scan
// @Accept json
// @Param request body dto.OperateByID true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clam/handle [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":true,"db":"clams","output_column":"name","output_value":"name"}],"formatZH":"执行病毒扫描 [name]","formatEN":"handle clam scan [name]"}
func (b *BaseApi) HandleClamScan(c *gin.Context) {
var req dto.OperateByID
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := clamService.HandleOnce(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
+92 -6
View File
@@ -9,11 +9,11 @@ import (
// @Tags Command
// @Summary Create command
// @Description 创建快速命令
// @Accept json
// @Param request body dto.CommandOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/command [post]
// @x-panel-log {"bodyKeys":["name","command"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建快捷命令 [name][command]","formatEN":"create quick command [name][command]"}
func (b *BaseApi) CreateCommand(c *gin.Context) {
@@ -29,13 +29,35 @@ func (b *BaseApi) CreateCommand(c *gin.Context) {
helper.SuccessWithData(c, nil)
}
// @Tags Redis Command
// @Summary Save redis command
// @Accept json
// @Param request body dto.RedisCommand true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/command/redis [post]
// @x-panel-log {"bodyKeys":["name","command"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"保存 redis 快捷命令 [name][command]","formatEN":"save quick command for redis [name][command]"}
func (b *BaseApi) SaveRedisCommand(c *gin.Context) {
var req dto.RedisCommand
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := commandService.SaveRedisCommand(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
// @Tags Command
// @Summary Page commands
// @Description 获取快速命令列表分页
// @Accept json
// @Param request body dto.SearchWithPage true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/command/search [post]
func (b *BaseApi) SearchCommand(c *gin.Context) {
var req dto.SearchCommandWithPage
@@ -55,12 +77,38 @@ func (b *BaseApi) SearchCommand(c *gin.Context) {
})
}
// @Tags Redis Command
// @Summary Page redis commands
// @Accept json
// @Param request body dto.SearchWithPage true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/command/redis/search [post]
func (b *BaseApi) SearchRedisCommand(c *gin.Context) {
var req dto.SearchWithPage
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
total, list, err := commandService.SearchRedisCommandWithPage(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, dto.PageResult{
Items: list,
Total: total,
})
}
// @Tags Command
// @Summary Tree commands
// @Description 获取快速命令树
// @Accept json
// @Success 200 {Array} dto.CommandTree
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/command/tree [get]
func (b *BaseApi) SearchCommandTree(c *gin.Context) {
list, err := commandService.SearchForTree()
@@ -72,11 +120,27 @@ func (b *BaseApi) SearchCommandTree(c *gin.Context) {
helper.SuccessWithData(c, list)
}
// @Tags Redis Command
// @Summary List redis commands
// @Success 200 {Array} dto.RedisCommand
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/command/redis [get]
func (b *BaseApi) ListRedisCommand(c *gin.Context) {
list, err := commandService.ListRedisCommand()
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, list)
}
// @Tags Command
// @Summary List commands
// @Description 获取快速命令列表
// @Success 200 {object} dto.CommandInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/command [get]
func (b *BaseApi) ListCommand(c *gin.Context) {
list, err := commandService.List()
@@ -90,11 +154,11 @@ func (b *BaseApi) ListCommand(c *gin.Context) {
// @Tags Command
// @Summary Delete command
// @Description 删除快速命令
// @Accept json
// @Param request body dto.BatchDeleteReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/command/del [post]
// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ids","isList":true,"db":"commands","output_column":"name","output_value":"names"}],"formatZH":"删除快捷命令 [names]","formatEN":"delete quick command [names]"}
func (b *BaseApi) DeleteCommand(c *gin.Context) {
@@ -110,13 +174,35 @@ func (b *BaseApi) DeleteCommand(c *gin.Context) {
helper.SuccessWithData(c, nil)
}
// @Tags Redis Command
// @Summary Delete redis command
// @Accept json
// @Param request body dto.BatchDeleteReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/command/redis/del [post]
// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ids","isList":true,"db":"redis_commands","output_column":"name","output_value":"names"}],"formatZH":"删除 redis 快捷命令 [names]","formatEN":"delete quick command of redis [names]"}
func (b *BaseApi) DeleteRedisCommand(c *gin.Context) {
var req dto.BatchDeleteReq
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := commandService.DeleteRedisCommand(req.Ids); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
// @Tags Command
// @Summary Update command
// @Description 更新快速命令
// @Accept json
// @Param request body dto.CommandOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/command/update [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新快捷命令 [name]","formatEN":"update quick command [name]"}
func (b *BaseApi) UpdateCommand(c *gin.Context) {
+5 -5
View File
@@ -9,11 +9,11 @@ import (
// @Tags Container Compose-template
// @Summary Create compose template
// @Description 创建容器编排模版
// @Accept json
// @Param request body dto.ComposeTemplateCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/template [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 compose 模版 [name]","formatEN":"create compose template [name]"}
func (b *BaseApi) CreateComposeTemplate(c *gin.Context) {
@@ -31,12 +31,12 @@ func (b *BaseApi) CreateComposeTemplate(c *gin.Context) {
// @Tags Container Compose-template
// @Summary Page compose templates
// @Description 获取容器编排模版列表分页
// @Accept json
// @Param request body dto.SearchWithPage true "request"
// @Produce json
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/template/search [post]
func (b *BaseApi) SearchComposeTemplate(c *gin.Context) {
var req dto.SearchWithPage
@@ -58,10 +58,10 @@ func (b *BaseApi) SearchComposeTemplate(c *gin.Context) {
// @Tags Container Compose-template
// @Summary List compose templates
// @Description 获取容器编排模版列表
// @Produce json
// @Success 200 {array} dto.ComposeTemplateInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/template [get]
func (b *BaseApi) ListComposeTemplate(c *gin.Context) {
list, err := composeTemplateService.List()
@@ -75,11 +75,11 @@ func (b *BaseApi) ListComposeTemplate(c *gin.Context) {
// @Tags Container Compose-template
// @Summary Delete compose template
// @Description 删除容器编排模版
// @Accept json
// @Param request body dto.BatchDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/template/del [post]
// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ids","isList":true,"db":"compose_templates","output_column":"name","output_value":"names"}],"formatZH":"删除 compose 模版 [names]","formatEN":"delete compose template [names]"}
func (b *BaseApi) DeleteComposeTemplate(c *gin.Context) {
@@ -97,11 +97,11 @@ func (b *BaseApi) DeleteComposeTemplate(c *gin.Context) {
// @Tags Container Compose-template
// @Summary Update compose template
// @Description 更新容器编排模版
// @Accept json
// @Param request body dto.ComposeTemplateUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/template/update [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"compose_templates","output_column":"name","output_value":"name"}],"formatZH":"更新 compose 模版 [name]","formatEN":"update compose template information [name]"}
func (b *BaseApi) UpdateComposeTemplate(c *gin.Context) {
+82 -44
View File
@@ -7,16 +7,17 @@ import (
"github.com/1Panel-dev/1Panel/backend/global"
"github.com/gin-gonic/gin"
"github.com/pkg/errors"
"strconv"
)
// @Tags Container
// @Summary Page containers
// @Description 获取容器列表分页
// @Accept json
// @Param request body dto.PageContainer true "request"
// @Produce json
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/search [post]
func (b *BaseApi) SearchContainer(c *gin.Context) {
var req dto.PageContainer
@@ -37,11 +38,11 @@ func (b *BaseApi) SearchContainer(c *gin.Context) {
// @Tags Container
// @Summary List containers
// @Description 获取容器名称
// @Accept json
// @Produce json
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/list [post]
func (b *BaseApi) ListContainer(c *gin.Context) {
list, err := containerService.List()
@@ -54,11 +55,11 @@ func (b *BaseApi) ListContainer(c *gin.Context) {
// @Tags Container Compose
// @Summary Page composes
// @Description 获取编排列表分页
// @Accept json
// @Param request body dto.SearchWithPage true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/compose/search [post]
func (b *BaseApi) SearchCompose(c *gin.Context) {
var req dto.SearchWithPage
@@ -79,11 +80,11 @@ func (b *BaseApi) SearchCompose(c *gin.Context) {
// @Tags Container Compose
// @Summary Test compose
// @Description 测试 compose 是否可用
// @Accept json
// @Param request body dto.ComposeCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/compose/test [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"检测 compose [name] 格式","formatEN":"check compose [name]"}
func (b *BaseApi) TestCompose(c *gin.Context) {
@@ -102,11 +103,11 @@ func (b *BaseApi) TestCompose(c *gin.Context) {
// @Tags Container Compose
// @Summary Create compose
// @Description 创建容器编排
// @Accept json
// @Param request body dto.ComposeCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/compose [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 compose [name]","formatEN":"create compose [name]"}
func (b *BaseApi) CreateCompose(c *gin.Context) {
@@ -125,11 +126,11 @@ func (b *BaseApi) CreateCompose(c *gin.Context) {
// @Tags Container Compose
// @Summary Operate compose
// @Description 容器编排操作
// @Accept json
// @Param request body dto.ComposeOperation true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/compose/operate [post]
// @x-panel-log {"bodyKeys":["name","operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"compose [operation] [name]","formatEN":"compose [operation] [name]"}
func (b *BaseApi) OperatorCompose(c *gin.Context) {
@@ -147,11 +148,11 @@ func (b *BaseApi) OperatorCompose(c *gin.Context) {
// @Tags Container
// @Summary Update container
// @Description 更新容器
// @Accept json
// @Param request body dto.ContainerOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/update [post]
// @x-panel-log {"bodyKeys":["name","image"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新容器 [name][image]","formatEN":"update container [name][image]"}
func (b *BaseApi) ContainerUpdate(c *gin.Context) {
@@ -169,11 +170,11 @@ func (b *BaseApi) ContainerUpdate(c *gin.Context) {
// @Tags Container
// @Summary Load container info
// @Description 获取容器表单信息
// @Accept json
// @Param request body dto.OperationWithName true "request"
// @Success 200 {object} dto.ContainerOperate
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/info [post]
func (b *BaseApi) ContainerInfo(c *gin.Context) {
var req dto.OperationWithName
@@ -190,9 +191,9 @@ func (b *BaseApi) ContainerInfo(c *gin.Context) {
}
// @Summary Load container limits
// @Description 获取容器限制
// @Success 200 {object} dto.ResourceLimit
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/limit [get]
func (b *BaseApi) LoadResourceLimit(c *gin.Context) {
data, err := containerService.LoadResourceLimit()
@@ -204,9 +205,9 @@ func (b *BaseApi) LoadResourceLimit(c *gin.Context) {
}
// @Summary Load container stats
// @Description 获取容器列表资源占用
// @Success 200 {array} dto.ContainerListStats
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/list/stats [get]
func (b *BaseApi) ContainerListStats(c *gin.Context) {
data, err := containerService.ContainerListStats()
@@ -219,11 +220,11 @@ func (b *BaseApi) ContainerListStats(c *gin.Context) {
// @Tags Container
// @Summary Create container
// @Description 创建容器
// @Accept json
// @Param request body dto.ContainerOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers [post]
// @x-panel-log {"bodyKeys":["name","image"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建容器 [name][image]","formatEN":"create container [name][image]"}
func (b *BaseApi) ContainerCreate(c *gin.Context) {
@@ -241,11 +242,11 @@ func (b *BaseApi) ContainerCreate(c *gin.Context) {
// @Tags Container
// @Summary Upgrade container
// @Description 更新容器镜像
// @Accept json
// @Param request body dto.ContainerUpgrade true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/upgrade [post]
// @x-panel-log {"bodyKeys":["name","image"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新容器镜像 [name][image]","formatEN":"upgrade container image [name][image]"}
func (b *BaseApi) ContainerUpgrade(c *gin.Context) {
@@ -263,11 +264,11 @@ func (b *BaseApi) ContainerUpgrade(c *gin.Context) {
// @Tags Container
// @Summary Clean container
// @Description 容器清理
// @Accept json
// @Param request body dto.ContainerPrune true "request"
// @Success 200 {object} dto.ContainerPruneReport
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/prune [post]
// @x-panel-log {"bodyKeys":["pruneType"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清理容器 [pruneType]","formatEN":"clean container [pruneType]"}
func (b *BaseApi) ContainerPrune(c *gin.Context) {
@@ -286,11 +287,11 @@ func (b *BaseApi) ContainerPrune(c *gin.Context) {
// @Tags Container
// @Summary Clean container log
// @Description 清理容器日志
// @Accept json
// @Param request body dto.OperationWithName true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/clean/log [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清理容器 [name] 日志","formatEN":"clean container [name] logs"}
func (b *BaseApi) CleanContainerLog(c *gin.Context) {
@@ -308,11 +309,11 @@ func (b *BaseApi) CleanContainerLog(c *gin.Context) {
// @Tags Container
// @Summary Load container log
// @Description 获取容器操作日志
// @Accept json
// @Param request body dto.OperationWithNameAndType true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/load/log [post]
func (b *BaseApi) LoadContainerLog(c *gin.Context) {
var req dto.OperationWithNameAndType
@@ -326,11 +327,11 @@ func (b *BaseApi) LoadContainerLog(c *gin.Context) {
// @Tags Container
// @Summary Rename Container
// @Description 容器重命名
// @Accept json
// @Param request body dto.ContainerRename true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/rename [post]
// @x-panel-log {"bodyKeys":["name","newName"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"容器重命名 [name] => [newName]","formatEN":"rename container [name] => [newName]"}
func (b *BaseApi) ContainerRename(c *gin.Context) {
@@ -346,13 +347,32 @@ func (b *BaseApi) ContainerRename(c *gin.Context) {
helper.SuccessWithData(c, nil)
}
// @Tags Container
// @Summary Commit Container
// @Accept json
// @Param request body dto.ContainerCommit true "request"
// @Success 200
// @Router /containers/commit [post]
func (b *BaseApi) ContainerCommit(c *gin.Context) {
var req dto.ContainerCommit
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := containerService.ContainerCommit(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
// @Tags Container
// @Summary Operate Container
// @Description 容器操作
// @Accept json
// @Param request body dto.ContainerOperation true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/operate [post]
// @x-panel-log {"bodyKeys":["names","operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"容器 [names] 执行 [operation]","formatEN":"container [operation] [names]"}
func (b *BaseApi) ContainerOperation(c *gin.Context) {
@@ -370,10 +390,10 @@ func (b *BaseApi) ContainerOperation(c *gin.Context) {
// @Tags Container
// @Summary Container stats
// @Description 容器监控信息
// @Param id path integer true "容器id"
// @Param id path integer true "container id"
// @Success 200 {object} dto.ContainerStats
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/stats/:id [get]
func (b *BaseApi) ContainerStats(c *gin.Context) {
containerID, ok := c.Params.Get("id")
@@ -392,11 +412,11 @@ func (b *BaseApi) ContainerStats(c *gin.Context) {
// @Tags Container
// @Summary Container inspect
// @Description 容器详情
// @Accept json
// @Param request body dto.InspectReq true "request"
// @Success 200 {string} result
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/inspect [post]
func (b *BaseApi) Inspect(c *gin.Context) {
var req dto.InspectReq
@@ -414,12 +434,12 @@ func (b *BaseApi) Inspect(c *gin.Context) {
// @Tags Container
// @Summary Container logs
// @Description 容器日志
// @Param container query string false "容器名称"
// @Param since query string false "时间筛选"
// @Param follow query string false "是否追踪"
// @Param tail query string false "显示行号"
// @Param container query string false "container name"
// @Param since query string false "since"
// @Param follow query string false "follow"
// @Param tail query string false "tail"
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/search/log [post]
func (b *BaseApi) ContainerLogs(c *gin.Context) {
wsConn, err := upGrader.Upgrade(c.Writer, c.Request, nil)
@@ -440,14 +460,32 @@ func (b *BaseApi) ContainerLogs(c *gin.Context) {
}
}
// @Tags Container
// @Summary Download Container logs
// @Accept json
// @Param request body dto.ContainerLog true "request"
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/download/log [post]
func (b *BaseApi) DownloadContainerLogs(c *gin.Context) {
var req dto.ContainerLog
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
err := containerService.DownloadContainerLogs(req.ContainerType, req.Container, req.Since, strconv.Itoa(int(req.Tail)), c)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
}
}
// @Tags Container Network
// @Summary Page networks
// @Description 获取容器网络列表分页
// @Accept json
// @Param request body dto.SearchWithPage true "request"
// @Produce json
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/network/search [post]
func (b *BaseApi) SearchNetwork(c *gin.Context) {
var req dto.SearchWithPage
@@ -468,11 +506,11 @@ func (b *BaseApi) SearchNetwork(c *gin.Context) {
// @Tags Container Network
// @Summary List networks
// @Description 获取容器网络列表
// @Accept json
// @Produce json
// @Success 200 {array} dto.Options
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/network [get]
func (b *BaseApi) ListNetwork(c *gin.Context) {
list, err := containerService.ListNetwork()
@@ -485,11 +523,11 @@ func (b *BaseApi) ListNetwork(c *gin.Context) {
// @Tags Container Network
// @Summary Delete network
// @Description 删除容器网络
// @Accept json
// @Param request body dto.BatchDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/network/del [post]
// @x-panel-log {"bodyKeys":["names"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"删除容器网络 [names]","formatEN":"delete container network [names]"}
func (b *BaseApi) DeleteNetwork(c *gin.Context) {
@@ -507,11 +545,11 @@ func (b *BaseApi) DeleteNetwork(c *gin.Context) {
// @Tags Container Network
// @Summary Create network
// @Description 创建容器网络
// @Accept json
// @Param request body dto.NetworkCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/network [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建容器网络 name","formatEN":"create container network [name]"}
func (b *BaseApi) CreateNetwork(c *gin.Context) {
@@ -528,13 +566,13 @@ func (b *BaseApi) CreateNetwork(c *gin.Context) {
}
// @Tags Container Volume
// @Summary Page volumes
// @Description 获取容器存储卷分页
// @Summary Page Container Volumes
// @Accept json
// @Param request body dto.SearchWithPage true "request"
// @Produce json
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/volume/search [post]
func (b *BaseApi) SearchVolume(c *gin.Context) {
var req dto.SearchWithPage
@@ -554,12 +592,12 @@ func (b *BaseApi) SearchVolume(c *gin.Context) {
}
// @Tags Container Volume
// @Summary List volumes
// @Description 获取容器存储卷列表
// @Summary List Container Volumes
// @Accept json
// @Produce json
// @Success 200 {array} dto.Options
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/volume [get]
func (b *BaseApi) ListVolume(c *gin.Context) {
list, err := containerService.ListVolume()
@@ -571,12 +609,12 @@ func (b *BaseApi) ListVolume(c *gin.Context) {
}
// @Tags Container Volume
// @Summary Delete volume
// @Description 删除容器存储卷
// @Summary Delete Container Volume
// @Accept json
// @Param request body dto.BatchDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/volume/del [post]
// @x-panel-log {"bodyKeys":["names"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"删除容器存储卷 [names]","formatEN":"delete container volume [names]"}
func (b *BaseApi) DeleteVolume(c *gin.Context) {
@@ -593,12 +631,12 @@ func (b *BaseApi) DeleteVolume(c *gin.Context) {
}
// @Tags Container Volume
// @Summary Create volume
// @Description 创建容器存储卷
// @Summary Create Container Volume
// @Accept json
// @Param request body dto.VolumeCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/volume [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建容器存储卷 [name]","formatEN":"create container volume [name]"}
func (b *BaseApi) CreateVolume(c *gin.Context) {
@@ -615,12 +653,12 @@ func (b *BaseApi) CreateVolume(c *gin.Context) {
}
// @Tags Container Compose
// @Summary Update compose
// @Description 更新容器编排
// @Summary Update Container Compose
// @Accept json
// @Param request body dto.ComposeUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/compose/update [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 compose [name]","formatEN":"update compose information [name]"}
func (b *BaseApi) ComposeUpdate(c *gin.Context) {
@@ -638,12 +676,12 @@ func (b *BaseApi) ComposeUpdate(c *gin.Context) {
// @Tags Container Compose
// @Summary Container Compose logs
// @Description docker-compose 日志
// @Param compose query string false "compose 文件地址"
// @Param since query string false "时间筛选"
// @Param follow query string false "是否追踪"
// @Param tail query string false "显示行号"
// @Param compose query string false "compose file address"
// @Param since query string false "date"
// @Param follow query string false "follow"
// @Param tail query string false "tail"
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/compose/search/log [get]
func (b *BaseApi) ComposeLogs(c *gin.Context) {
wsConn, err := upGrader.Upgrade(c.Writer, c.Request, nil)
+13 -13
View File
@@ -12,11 +12,11 @@ import (
// @Tags Cronjob
// @Summary Create cronjob
// @Description 创建计划任务
// @Accept json
// @Param request body dto.CronjobCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /cronjobs [post]
// @x-panel-log {"bodyKeys":["type","name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建计划任务 [type][name]","formatEN":"create cronjob [type][name]"}
func (b *BaseApi) CreateCronjob(c *gin.Context) {
@@ -34,14 +34,14 @@ func (b *BaseApi) CreateCronjob(c *gin.Context) {
// @Tags Cronjob
// @Summary Page cronjobs
// @Description 获取计划任务分页
// @Accept json
// @Param request body dto.SearchWithPage true "request"
// @Param request body dto.PageCronjob true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /cronjobs/search [post]
func (b *BaseApi) SearchCronjob(c *gin.Context) {
var req dto.SearchWithPage
var req dto.PageCronjob
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
@@ -60,11 +60,11 @@ func (b *BaseApi) SearchCronjob(c *gin.Context) {
// @Tags Cronjob
// @Summary Page job records
// @Description 获取计划任务记录
// @Accept json
// @Param request body dto.SearchRecord true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /cronjobs/search/records [post]
func (b *BaseApi) SearchJobRecords(c *gin.Context) {
var req dto.SearchRecord
@@ -72,7 +72,7 @@ func (b *BaseApi) SearchJobRecords(c *gin.Context) {
return
}
loc, _ := time.LoadLocation(common.LoadTimeZone())
loc, _ := time.LoadLocation(common.LoadTimeZoneByCmd())
req.StartTime = req.StartTime.In(loc)
req.EndTime = req.EndTime.In(loc)
@@ -90,11 +90,11 @@ func (b *BaseApi) SearchJobRecords(c *gin.Context) {
// @Tags Cronjob
// @Summary Load Cronjob record log
// @Description 获取计划任务记录日志
// @Accept json
// @Param request body dto.OperateByID true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /cronjobs/records/log [post]
func (b *BaseApi) LoadRecordLog(c *gin.Context) {
var req dto.OperateByID
@@ -107,11 +107,11 @@ func (b *BaseApi) LoadRecordLog(c *gin.Context) {
// @Tags Cronjob
// @Summary Clean job records
// @Description 清空计划任务记录
// @Accept json
// @Param request body dto.CronjobClean true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /cronjobs/records/clean [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"cronjobs","output_column":"name","output_value":"name"}],"formatZH":"清空计划任务记录 [name]","formatEN":"clean cronjob [name] records"}
func (b *BaseApi) CleanRecord(c *gin.Context) {
@@ -130,11 +130,11 @@ func (b *BaseApi) CleanRecord(c *gin.Context) {
// @Tags Cronjob
// @Summary Delete cronjob
// @Description 删除计划任务
// @Accept json
// @Param request body dto.CronjobBatchDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /cronjobs/del [post]
// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ids","isList":true,"db":"cronjobs","output_column":"name","output_value":"names"}],"formatZH":"删除计划任务 [names]","formatEN":"delete cronjob [names]"}
func (b *BaseApi) DeleteCronjob(c *gin.Context) {
@@ -152,11 +152,11 @@ func (b *BaseApi) DeleteCronjob(c *gin.Context) {
// @Tags Cronjob
// @Summary Update cronjob
// @Description 更新计划任务
// @Accept json
// @Param request body dto.CronjobUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /cronjobs/update [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"cronjobs","output_column":"name","output_value":"name"}],"formatZH":"更新计划任务 [name]","formatEN":"update cronjob [name]"}
func (b *BaseApi) UpdateCronjob(c *gin.Context) {
@@ -174,11 +174,11 @@ func (b *BaseApi) UpdateCronjob(c *gin.Context) {
// @Tags Cronjob
// @Summary Update cronjob status
// @Description 更新计划任务状态
// @Accept json
// @Param request body dto.CronjobUpdateStatus true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /cronjobs/status [post]
// @x-panel-log {"bodyKeys":["id","status"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"cronjobs","output_column":"name","output_value":"name"}],"formatZH":"修改计划任务 [name] 状态为 [status]","formatEN":"change the status of cronjob [name] to [status]."}
func (b *BaseApi) UpdateCronjobStatus(c *gin.Context) {
@@ -196,11 +196,11 @@ func (b *BaseApi) UpdateCronjobStatus(c *gin.Context) {
// @Tags Cronjob
// @Summary Download cronjob records
// @Description 下载计划任务记录
// @Accept json
// @Param request body dto.CronjobDownload true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /cronjobs/download [post]
// @x-panel-log {"bodyKeys":["recordID"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"recordID","isList":false,"db":"job_records","output_column":"file","output_value":"file"}],"formatZH":"下载计划任务记录 [file]","formatEN":"download the cronjob record [file]"}
func (b *BaseApi) TargetDownload(c *gin.Context) {
@@ -220,11 +220,11 @@ func (b *BaseApi) TargetDownload(c *gin.Context) {
// @Tags Cronjob
// @Summary Handle cronjob once
// @Description 手动执行计划任务
// @Accept json
// @Param request body dto.OperateByID true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /cronjobs/handle [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"cronjobs","output_column":"name","output_value":"name"}],"formatZH":"手动执行计划任务 [name]","formatEN":"manually execute the cronjob [name]"}
func (b *BaseApi) HandleOnce(c *gin.Context) {
+12 -18
View File
@@ -3,6 +3,8 @@ package v1
import (
"errors"
"github.com/1Panel-dev/1Panel/backend/app/dto"
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
"github.com/1Panel-dev/1Panel/backend/constant"
"github.com/gin-gonic/gin"
@@ -10,10 +12,10 @@ import (
// @Tags Dashboard
// @Summary Load os info
// @Description 获取服务器基础数据
// @Accept json
// @Success 200 {object} dto.OsInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /dashboard/base/os [get]
func (b *BaseApi) LoadDashboardOsInfo(c *gin.Context) {
data, err := dashboardService.LoadOsInfo()
@@ -26,12 +28,12 @@ func (b *BaseApi) LoadDashboardOsInfo(c *gin.Context) {
// @Tags Dashboard
// @Summary Load dashboard base info
// @Description 获取首页基础数据
// @Accept json
// @Param ioOption path string true "request"
// @Param netOption path string true "request"
// @Success 200 {object} dto.DashboardBase
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /dashboard/base/:ioOption/:netOption [get]
func (b *BaseApi) LoadDashboardBaseInfo(c *gin.Context) {
ioOption, ok := c.Params.Get("ioOption")
@@ -54,36 +56,28 @@ func (b *BaseApi) LoadDashboardBaseInfo(c *gin.Context) {
// @Tags Dashboard
// @Summary Load dashboard current info
// @Description 获取首页实时数据
// @Accept json
// @Param ioOption path string true "request"
// @Param netOption path string true "request"
// @Param request body dto.DashboardReq true "request"
// @Success 200 {object} dto.DashboardCurrent
// @Security ApiKeyAuth
// @Router /dashboard/current/:ioOption/:netOption [get]
// @Security Timestamp
// @Router /dashboard/current [post]
func (b *BaseApi) LoadDashboardCurrentInfo(c *gin.Context) {
ioOption, ok := c.Params.Get("ioOption")
if !ok {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, errors.New("error ioOption in path"))
var req dto.DashboardReq
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
netOption, ok := c.Params.Get("netOption")
if !ok {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, errors.New("error netOption in path"))
return
}
data := dashboardService.LoadCurrentInfo(ioOption, netOption)
data := dashboardService.LoadCurrentInfo(req)
helper.SuccessWithData(c, data)
}
// @Tags Dashboard
// @Summary System restart
// @Description 重启服务器/面板
// @Summary System restart panel
// @Accept json
// @Param operation path string true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /dashboard/system/restart/:operation [post]
func (b *BaseApi) SystemRestart(c *gin.Context) {
operation, ok := c.Params.Get("operation")
+10 -10
View File
@@ -11,11 +11,11 @@ import (
// @Tags Database
// @Summary Create database
// @Description 创建远程数据库
// @Accept json
// @Param request body dto.DatabaseCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/db [post]
// @x-panel-log {"bodyKeys":["name", "type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建远程数据库 [name][type]","formatEN":"create database [name][type]"}
func (b *BaseApi) CreateDatabase(c *gin.Context) {
@@ -41,11 +41,11 @@ func (b *BaseApi) CreateDatabase(c *gin.Context) {
// @Tags Database
// @Summary Check database
// @Description 检测远程数据库连接性
// @Accept json
// @Param request body dto.DatabaseCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/db/check [post]
// @x-panel-log {"bodyKeys":["name", "type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"检测远程数据库 [name][type] 连接性","formatEN":"check if database [name][type] is connectable"}
func (b *BaseApi) CheckDatabase(c *gin.Context) {
@@ -67,11 +67,11 @@ func (b *BaseApi) CheckDatabase(c *gin.Context) {
// @Tags Database
// @Summary Page databases
// @Description 获取远程数据库列表分页
// @Accept json
// @Param request body dto.DatabaseSearch true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/db/search [post]
func (b *BaseApi) SearchDatabase(c *gin.Context) {
var req dto.DatabaseSearch
@@ -93,9 +93,9 @@ func (b *BaseApi) SearchDatabase(c *gin.Context) {
// @Tags Database
// @Summary List databases
// @Description 获取远程数据库列表
// @Success 200 {array} dto.DatabaseOption
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/db/list/:type [get]
func (b *BaseApi) ListDatabase(c *gin.Context) {
dbType, err := helper.GetStrParamByKey(c, "type")
@@ -113,10 +113,10 @@ func (b *BaseApi) ListDatabase(c *gin.Context) {
}
// @Tags Database
// @Summary List databases
// @Description 获取数据库列表
// @Summary Retrieve database list based on type
// @Success 200 {array} dto.DatabaseItem
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/db/item/:type [get]
func (b *BaseApi) LoadDatabaseItems(c *gin.Context) {
dbType, err := helper.GetStrParamByKey(c, "type")
@@ -135,9 +135,9 @@ func (b *BaseApi) LoadDatabaseItems(c *gin.Context) {
// @Tags Database
// @Summary Get databases
// @Description 获取远程数据库
// @Success 200 {object} dto.DatabaseInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/db/:name [get]
func (b *BaseApi) GetDatabase(c *gin.Context) {
name, err := helper.GetStrParamByKey(c, "name")
@@ -156,11 +156,11 @@ func (b *BaseApi) GetDatabase(c *gin.Context) {
// @Tags Database
// @Summary Check before delete remote database
// @Description Mysql 远程数据库删除前检查
// @Accept json
// @Param request body dto.OperateByID true "request"
// @Success 200 {array} string
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /db/remote/del/check [post]
func (b *BaseApi) DeleteCheckDatabase(c *gin.Context) {
var req dto.OperateByID
@@ -178,11 +178,11 @@ func (b *BaseApi) DeleteCheckDatabase(c *gin.Context) {
// @Tags Database
// @Summary Delete database
// @Description 删除远程数据库
// @Accept json
// @Param request body dto.DatabaseDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/db/del [post]
// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ids","isList":true,"db":"databases","output_column":"name","output_value":"names"}],"formatZH":"删除远程数据库 [names]","formatEN":"delete database [names]"}
func (b *BaseApi) DeleteDatabase(c *gin.Context) {
@@ -200,11 +200,11 @@ func (b *BaseApi) DeleteDatabase(c *gin.Context) {
// @Tags Database
// @Summary Update database
// @Description 更新远程数据库
// @Accept json
// @Param request body dto.DatabaseUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/db/update [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新远程数据库 [name]","formatEN":"update database [name]"}
func (b *BaseApi) UpdateDatabase(c *gin.Context) {
+3 -3
View File
@@ -9,11 +9,11 @@ import (
// @Tags Database Common
// @Summary Load base info
// @Description 获取数据库基础信息
// @Accept json
// @Param request body dto.OperationWithNameAndType true "request"
// @Success 200 {object} dto.DBBaseInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/common/info [post]
func (b *BaseApi) LoadDBBaseInfo(c *gin.Context) {
var req dto.OperationWithNameAndType
@@ -32,11 +32,11 @@ func (b *BaseApi) LoadDBBaseInfo(c *gin.Context) {
// @Tags Database Common
// @Summary Load Database conf
// @Description 获取数据库配置文件
// @Accept json
// @Param request body dto.OperationWithNameAndType true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/common/load/file [post]
func (b *BaseApi) LoadDBFile(c *gin.Context) {
var req dto.OperationWithNameAndType
@@ -53,11 +53,11 @@ func (b *BaseApi) LoadDBFile(c *gin.Context) {
// @Tags Database Common
// @Summary Update conf by upload file
// @Description 上传替换配置文件
// @Accept json
// @Param request body dto.DBConfUpdateByFile true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/common/update/conf [post]
// @x-panel-log {"bodyKeys":["type","database"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 [type] 数据库 [database] 配置信息","formatEN":"update the [type] [database] database configuration information"}
func (b *BaseApi) UpdateDBConfByFile(c *gin.Context) {
+14 -14
View File
@@ -12,11 +12,11 @@ import (
// @Tags Database Mysql
// @Summary Create mysql database
// @Description 创建 mysql 数据库
// @Accept json
// @Param request body dto.MysqlDBCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 mysql 数据库 [name]","formatEN":"create mysql database [name]"}
func (b *BaseApi) CreateMysql(c *gin.Context) {
@@ -43,11 +43,11 @@ func (b *BaseApi) CreateMysql(c *gin.Context) {
// @Tags Database Mysql
// @Summary Bind user of mysql database
// @Description 绑定 mysql 数据库用户
// @Accept json
// @Param request body dto.BindUser true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/bind [post]
// @x-panel-log {"bodyKeys":["database", "username"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"绑定 mysql 数据库名 [database] [username]","formatEN":"bind mysql database [database] [username]"}
func (b *BaseApi) BindUser(c *gin.Context) {
@@ -74,11 +74,11 @@ func (b *BaseApi) BindUser(c *gin.Context) {
// @Tags Database Mysql
// @Summary Update mysql database description
// @Description 更新 mysql 数据库库描述信息
// @Accept json
// @Param request body dto.UpdateDescription true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/description/update [post]
// @x-panel-log {"bodyKeys":["id","description"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"database_mysqls","output_column":"name","output_value":"name"}],"formatZH":"mysql 数据库 [name] 描述信息修改 [description]","formatEN":"The description of the mysql database [name] is modified => [description]"}
func (b *BaseApi) UpdateMysqlDescription(c *gin.Context) {
@@ -96,11 +96,11 @@ func (b *BaseApi) UpdateMysqlDescription(c *gin.Context) {
// @Tags Database Mysql
// @Summary Change mysql password
// @Description 修改 mysql 密码
// @Accept json
// @Param request body dto.ChangeDBInfo true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/change/password [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"database_mysqls","output_column":"name","output_value":"name"}],"formatZH":"更新数据库 [name] 密码","formatEN":"Update database [name] password"}
func (b *BaseApi) ChangeMysqlPassword(c *gin.Context) {
@@ -127,11 +127,11 @@ func (b *BaseApi) ChangeMysqlPassword(c *gin.Context) {
// @Tags Database Mysql
// @Summary Change mysql access
// @Description 修改 mysql 访问权限
// @Accept json
// @Param request body dto.ChangeDBInfo true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/change/access [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"database_mysqls","output_column":"name","output_value":"name"}],"formatZH":"更新数据库 [name] 访问权限","formatEN":"Update database [name] access"}
func (b *BaseApi) ChangeMysqlAccess(c *gin.Context) {
@@ -149,11 +149,11 @@ func (b *BaseApi) ChangeMysqlAccess(c *gin.Context) {
// @Tags Database Mysql
// @Summary Update mysql variables
// @Description mysql 性能调优
// @Accept json
// @Param request body dto.MysqlVariablesUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/variables/update [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"调整 mysql 数据库性能参数","formatEN":"adjust mysql database performance parameters"}
func (b *BaseApi) UpdateMysqlVariables(c *gin.Context) {
@@ -171,11 +171,11 @@ func (b *BaseApi) UpdateMysqlVariables(c *gin.Context) {
// @Tags Database Mysql
// @Summary Page mysql databases
// @Description 获取 mysql 数据库列表分页
// @Accept json
// @Param request body dto.MysqlDBSearch true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/search [post]
func (b *BaseApi) SearchMysql(c *gin.Context) {
var req dto.MysqlDBSearch
@@ -197,11 +197,11 @@ func (b *BaseApi) SearchMysql(c *gin.Context) {
// @Tags Database Mysql
// @Summary List mysql database names
// @Description 获取 mysql 数据库列表
// @Accept json
// @Param request body dto.PageInfo true "request"
// @Success 200 {array} dto.MysqlOption
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/options [get]
func (b *BaseApi) ListDBName(c *gin.Context) {
list, err := mysqlService.ListDBOption()
@@ -215,10 +215,10 @@ func (b *BaseApi) ListDBName(c *gin.Context) {
// @Tags Database Mysql
// @Summary Load mysql database from remote
// @Description 从服务器获取
// @Accept json
// @Param request body dto.MysqlLoadDB true "request"
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/load [post]
func (b *BaseApi) LoadDBFromRemote(c *gin.Context) {
var req dto.MysqlLoadDB
@@ -236,11 +236,11 @@ func (b *BaseApi) LoadDBFromRemote(c *gin.Context) {
// @Tags Database Mysql
// @Summary Check before delete mysql database
// @Description Mysql 数据库删除前检查
// @Accept json
// @Param request body dto.MysqlDBDeleteCheck true "request"
// @Success 200 {array} string
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/del/check [post]
func (b *BaseApi) DeleteCheckMysql(c *gin.Context) {
var req dto.MysqlDBDeleteCheck
@@ -258,11 +258,11 @@ func (b *BaseApi) DeleteCheckMysql(c *gin.Context) {
// @Tags Database Mysql
// @Summary Delete mysql database
// @Description 删除 mysql 数据库
// @Accept json
// @Param request body dto.MysqlDBDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/del [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"database_mysqls","output_column":"name","output_value":"name"}],"formatZH":"删除 mysql 数据库 [name]","formatEN":"delete mysql database [name]"}
func (b *BaseApi) DeleteMysql(c *gin.Context) {
@@ -283,11 +283,11 @@ func (b *BaseApi) DeleteMysql(c *gin.Context) {
// @Tags Database Mysql
// @Summary Load mysql remote access
// @Description 获取 mysql 远程访问权限
// @Accept json
// @Param request body dto.OperationWithNameAndType true "request"
// @Success 200 {boolean} isRemote
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/remote [post]
func (b *BaseApi) LoadRemoteAccess(c *gin.Context) {
var req dto.OperationWithNameAndType
@@ -305,11 +305,11 @@ func (b *BaseApi) LoadRemoteAccess(c *gin.Context) {
// @Tags Database Mysql
// @Summary Load mysql status info
// @Description 获取 mysql 状态信息
// @Accept json
// @Param request body dto.OperationWithNameAndType true "request"
// @Success 200 {object} dto.MysqlStatus
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/status [post]
func (b *BaseApi) LoadStatus(c *gin.Context) {
var req dto.OperationWithNameAndType
@@ -328,11 +328,11 @@ func (b *BaseApi) LoadStatus(c *gin.Context) {
// @Tags Database Mysql
// @Summary Load mysql variables info
// @Description 获取 mysql 性能参数信息
// @Accept json
// @Param request body dto.OperationWithNameAndType true "request"
// @Success 200 {object} dto.MysqlVariables
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/variables [post]
func (b *BaseApi) LoadVariables(c *gin.Context) {
var req dto.OperationWithNameAndType
+9 -9
View File
@@ -12,11 +12,11 @@ import (
// @Tags Database Postgresql
// @Summary Create postgresql database
// @Description 创建 postgresql 数据库
// @Accept json
// @Param request body dto.PostgresqlDBCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/pg [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 postgresql 数据库 [name]","formatEN":"create postgresql database [name]"}
func (b *BaseApi) CreatePostgresql(c *gin.Context) {
@@ -43,11 +43,11 @@ func (b *BaseApi) CreatePostgresql(c *gin.Context) {
// @Tags Database Postgresql
// @Summary Bind postgresql user
// @Description 绑定 postgresql 数据库用户
// @Accept json
// @Param request body dto.PostgresqlBindUser true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/pg/bind [post]
// @x-panel-log {"bodyKeys":["name", "username"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"绑定 postgresql 数据库 [name] 用户 [username]","formatEN":"bind postgresql database [name] user [username]"}
func (b *BaseApi) BindPostgresqlUser(c *gin.Context) {
@@ -65,11 +65,11 @@ func (b *BaseApi) BindPostgresqlUser(c *gin.Context) {
// @Tags Database Postgresql
// @Summary Update postgresql database description
// @Description 更新 postgresql 数据库库描述信息
// @Accept json
// @Param request body dto.UpdateDescription true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/pg/description [post]
// @x-panel-log {"bodyKeys":["id","description"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"database_postgresqls","output_column":"name","output_value":"name"}],"formatZH":"postgresql 数据库 [name] 描述信息修改 [description]","formatEN":"The description of the postgresql database [name] is modified => [description]"}
func (b *BaseApi) UpdatePostgresqlDescription(c *gin.Context) {
@@ -87,11 +87,11 @@ func (b *BaseApi) UpdatePostgresqlDescription(c *gin.Context) {
// @Tags Database Postgresql
// @Summary Change postgresql privileges
// @Description 修改 postgresql 用户权限
// @Accept json
// @Param request body dto.ChangeDBInfo true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/pg/privileges [post]
// @x-panel-log {"bodyKeys":["database", "username"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新数据库 [database] 用户 [username] 权限","formatEN":"Update [user] privileges of database [database]"}
func (b *BaseApi) ChangePostgresqlPrivileges(c *gin.Context) {
@@ -109,11 +109,11 @@ func (b *BaseApi) ChangePostgresqlPrivileges(c *gin.Context) {
// @Tags Database Postgresql
// @Summary Change postgresql password
// @Description 修改 postgresql 密码
// @Accept json
// @Param request body dto.ChangeDBInfo true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/pg/password [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"database_postgresqls","output_column":"name","output_value":"name"}],"formatZH":"更新数据库 [name] 密码","formatEN":"Update database [name] password"}
func (b *BaseApi) ChangePostgresqlPassword(c *gin.Context) {
@@ -140,11 +140,11 @@ func (b *BaseApi) ChangePostgresqlPassword(c *gin.Context) {
// @Tags Database Postgresql
// @Summary Page postgresql databases
// @Description 获取 postgresql 数据库列表分页
// @Accept json
// @Param request body dto.PostgresqlDBSearch true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/pg/search [post]
func (b *BaseApi) SearchPostgresql(c *gin.Context) {
var req dto.PostgresqlDBSearch
@@ -166,10 +166,10 @@ func (b *BaseApi) SearchPostgresql(c *gin.Context) {
// @Tags Database Postgresql
// @Summary Load postgresql database from remote
// @Description 从服务器获取
// @Accept json
// @Param request body dto.PostgresqlLoadDB true "request"
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/pg/:database/load [post]
func (b *BaseApi) LoadPostgresqlDBFromRemote(c *gin.Context) {
database, err := helper.GetStrParamByKey(c, "database")
@@ -188,11 +188,11 @@ func (b *BaseApi) LoadPostgresqlDBFromRemote(c *gin.Context) {
// @Tags Database Postgresql
// @Summary Check before delete postgresql database
// @Description Postgresql 数据库删除前检查
// @Accept json
// @Param request body dto.PostgresqlDBDeleteCheck true "request"
// @Success 200 {array} string
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/pg/del/check [post]
func (b *BaseApi) DeleteCheckPostgresql(c *gin.Context) {
var req dto.PostgresqlDBDeleteCheck
@@ -210,11 +210,11 @@ func (b *BaseApi) DeleteCheckPostgresql(c *gin.Context) {
// @Tags Database Postgresql
// @Summary Delete postgresql database
// @Description 删除 postgresql 数据库
// @Accept json
// @Param request body dto.PostgresqlDBDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/pg/del [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"database_postgresqls","output_column":"name","output_value":"name"}],"formatZH":"删除 postgresql 数据库 [name]","formatEN":"delete postgresql database [name]"}
func (b *BaseApi) DeletePostgresql(c *gin.Context) {
+49 -38
View File
@@ -11,12 +11,18 @@ import (
// @Tags Database Redis
// @Summary Load redis status info
// @Description 获取 redis 状态信息
// @Accept json
// @Param request body dto.OperationWithName true "request"
// @Success 200 {object} dto.RedisStatus
// @Security ApiKeyAuth
// @Router /databases/redis/status [get]
// @Security Timestamp
// @Router /databases/redis/status [post]
func (b *BaseApi) LoadRedisStatus(c *gin.Context) {
data, err := redisService.LoadStatus()
var req dto.OperationWithName
if err := helper.CheckBind(&req, c); err != nil {
return
}
data, err := redisService.LoadStatus(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
@@ -27,12 +33,18 @@ func (b *BaseApi) LoadRedisStatus(c *gin.Context) {
// @Tags Database Redis
// @Summary Load redis conf
// @Description 获取 redis 配置信息
// @Accept json
// @Param request body dto.OperationWithName true "request"
// @Success 200 {object} dto.RedisConf
// @Security ApiKeyAuth
// @Router /databases/redis/conf [get]
// @Security Timestamp
// @Router /databases/redis/conf [post]
func (b *BaseApi) LoadRedisConf(c *gin.Context) {
data, err := redisService.LoadConf()
var req dto.OperationWithName
if err := helper.CheckBind(&req, c); err != nil {
return
}
data, err := redisService.LoadConf(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
@@ -43,12 +55,18 @@ func (b *BaseApi) LoadRedisConf(c *gin.Context) {
// @Tags Database Redis
// @Summary Load redis persistence conf
// @Description 获取 redis 持久化配置
// @Accept json
// @Param request body dto.OperationWithName true "request"
// @Success 200 {object} dto.RedisPersistence
// @Security ApiKeyAuth
// @Router /databases/redis/persistence/conf [get]
// @Security Timestamp
// @Router /databases/redis/persistence/conf [post]
func (b *BaseApi) LoadPersistenceConf(c *gin.Context) {
data, err := redisService.LoadPersistenceConf()
var req dto.OperationWithName
if err := helper.CheckBind(&req, c); err != nil {
return
}
data, err := redisService.LoadPersistenceConf(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
@@ -57,13 +75,32 @@ func (b *BaseApi) LoadPersistenceConf(c *gin.Context) {
helper.SuccessWithData(c, data)
}
func (b *BaseApi) CheckHasCli(c *gin.Context) {
helper.SuccessWithData(c, redisService.CheckHasCli())
}
// @Tags Database Redis
// @Summary Install redis-cli
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/redis/install/cli [post]
func (b *BaseApi) InstallCli(c *gin.Context) {
if err := redisService.InstallCli(); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithOutData(c)
}
// @Tags Database Redis
// @Summary Update redis conf
// @Description 更新 redis 配置信息
// @Accept json
// @Param request body dto.RedisConfUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/redis/conf/update [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 redis 数据库配置信息","formatEN":"update the redis database configuration information"}
func (b *BaseApi) UpdateRedisConf(c *gin.Context) {
@@ -81,11 +118,11 @@ func (b *BaseApi) UpdateRedisConf(c *gin.Context) {
// @Tags Database Redis
// @Summary Change redis password
// @Description 更新 redis 密码
// @Accept json
// @Param request body dto.ChangeRedisPass true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/redis/password [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 redis 数据库密码","formatEN":"change the password of the redis database"}
func (b *BaseApi) ChangeRedisPassword(c *gin.Context) {
@@ -112,11 +149,11 @@ func (b *BaseApi) ChangeRedisPassword(c *gin.Context) {
// @Tags Database Redis
// @Summary Update redis persistence conf
// @Description 更新 redis 持久化配置
// @Accept json
// @Param request body dto.RedisConfPersistenceUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /databases/redis/persistence/update [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"redis 数据库持久化配置更新","formatEN":"redis database persistence configuration update"}
func (b *BaseApi) UpdateRedisPersistenceConf(c *gin.Context) {
@@ -131,29 +168,3 @@ func (b *BaseApi) UpdateRedisPersistenceConf(c *gin.Context) {
}
helper.SuccessWithData(c, nil)
}
// @Tags Database Redis
// @Summary Page redis backups
// @Description 获取 redis 备份记录分页
// @Accept json
// @Param request body dto.PageInfo true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Router /databases/redis/backup/search [post]
func (b *BaseApi) RedisBackupList(c *gin.Context) {
var req dto.PageInfo
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
total, list, err := redisService.SearchBackupListWithPage(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, dto.PageResult{
Items: list,
Total: total,
})
}
+11 -11
View File
@@ -11,9 +11,9 @@ import (
// @Tags Device
// @Summary Load device base info
// @Description 获取设备基础信息
// @Success 200 {object} dto.DeviceBaseInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/device/base [post]
func (b *BaseApi) LoadDeviceBaseInfo(c *gin.Context) {
data, err := deviceService.LoadBaseInfo()
@@ -27,10 +27,10 @@ func (b *BaseApi) LoadDeviceBaseInfo(c *gin.Context) {
// @Tags Device
// @Summary list time zone options
// @Description 获取系统可用时区选项
// @Accept json
// @Success 200 {Array} string
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/device/zone/options [get]
func (b *BaseApi) LoadTimeOption(c *gin.Context) {
list, err := deviceService.LoadTimeZone()
@@ -44,11 +44,11 @@ func (b *BaseApi) LoadTimeOption(c *gin.Context) {
// @Tags Device
// @Summary load conf
// @Description 获取系统配置文件
// @Accept json
// @Param request body dto.OperationWithName true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/device/conf [post]
func (b *BaseApi) LoadDeviceConf(c *gin.Context) {
var req dto.OperationWithName
@@ -67,11 +67,11 @@ func (b *BaseApi) LoadDeviceConf(c *gin.Context) {
// @Tags Device
// @Summary Update device conf by file
// @Description 通过文件修改配置
// @Accept json
// @Param request body dto.UpdateByNameAndFile true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/device/update/byconf [post]
func (b *BaseApi) UpdateDeviceByFile(c *gin.Context) {
var req dto.UpdateByNameAndFile
@@ -88,11 +88,11 @@ func (b *BaseApi) UpdateDeviceByFile(c *gin.Context) {
// @Tags Device
// @Summary Update device
// @Description 修改系统参数
// @Accept json
// @Param request body dto.SettingUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/device/update/conf [post]
// @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改主机参数 [key] => [value]","formatEN":"update device conf [key] => [value]"}
func (b *BaseApi) UpdateDeviceConf(c *gin.Context) {
@@ -111,9 +111,9 @@ func (b *BaseApi) UpdateDeviceConf(c *gin.Context) {
// @Tags Device
// @Summary Update device hosts
// @Description 修改系统 hosts
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/device/update/host [post]
// @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改主机 Host [key] => [value]","formatEN":"update device host [key] => [value]"}
func (b *BaseApi) UpdateDeviceHost(c *gin.Context) {
@@ -132,11 +132,11 @@ func (b *BaseApi) UpdateDeviceHost(c *gin.Context) {
// @Tags Device
// @Summary Update device passwd
// @Description 修改系统密码
// @Accept json
// @Param request body dto.ChangePasswd true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/device/update/passwd [post]
func (b *BaseApi) UpdateDevicePasswd(c *gin.Context) {
var req dto.ChangePasswd
@@ -161,11 +161,11 @@ func (b *BaseApi) UpdateDevicePasswd(c *gin.Context) {
// @Tags Device
// @Summary Update device swap
// @Description 修改系统 Swap
// @Accept json
// @Param request body dto.SwapHelper true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/device/update/swap [post]
// @x-panel-log {"bodyKeys":["operate","path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] 主机 swap [path]","formatEN":"[operate] device swap [path]"}
func (b *BaseApi) UpdateDeviceSwap(c *gin.Context) {
@@ -183,11 +183,11 @@ func (b *BaseApi) UpdateDeviceSwap(c *gin.Context) {
// @Tags Device
// @Summary Check device DNS conf
// @Description 检查系统 DNS 配置可用性
// @Accept json
// @Param request body dto.SettingUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/device/check/dns [post]
func (b *BaseApi) CheckDNS(c *gin.Context) {
var req dto.SettingUpdate
@@ -206,9 +206,9 @@ func (b *BaseApi) CheckDNS(c *gin.Context) {
// @Tags Device
// @Summary Scan system
// @Description 扫描系统垃圾文件
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/scan [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"扫描系统垃圾文件","formatEN":"scan System Junk Files"}
func (b *BaseApi) ScanSystem(c *gin.Context) {
@@ -217,11 +217,11 @@ func (b *BaseApi) ScanSystem(c *gin.Context) {
// @Tags Device
// @Summary Clean system
// @Description 清理系统垃圾文件
// @Accept json
// @Param request body []dto.Clean true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/clean [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清理系统垃圾文件","formatEN":"Clean system junk files"}
func (b *BaseApi) SystemClean(c *gin.Context) {
+8 -8
View File
@@ -11,10 +11,10 @@ import (
// @Tags Container Docker
// @Summary Load docker status
// @Description 获取 docker 服务状态
// @Produce json
// @Success 200 {string} status
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/docker/status [get]
func (b *BaseApi) LoadDockerStatus(c *gin.Context) {
status := dockerService.LoadDockerStatus()
@@ -23,10 +23,10 @@ func (b *BaseApi) LoadDockerStatus(c *gin.Context) {
// @Tags Container Docker
// @Summary Load docker daemon.json
// @Description 获取 docker 配置信息(表单)
// @Produce json
// @Success 200 {object} string
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/daemonjson/file [get]
func (b *BaseApi) LoadDaemonJsonFile(c *gin.Context) {
if _, err := os.Stat(constant.DaemonJsonPath); err != nil {
@@ -43,10 +43,10 @@ func (b *BaseApi) LoadDaemonJsonFile(c *gin.Context) {
// @Tags Container Docker
// @Summary Load docker daemon.json
// @Description 获取 docker 配置信息
// @Produce json
// @Success 200 {object} dto.DaemonJsonConf
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/daemonjson [get]
func (b *BaseApi) LoadDaemonJson(c *gin.Context) {
conf := dockerService.LoadDockerConf()
@@ -55,11 +55,11 @@ func (b *BaseApi) LoadDaemonJson(c *gin.Context) {
// @Tags Container Docker
// @Summary Update docker daemon.json
// @Description 修改 docker 配置信息
// @Accept json
// @Param request body dto.SettingUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/daemonjson/update [post]
// @x-panel-log {"bodyKeys":["key", "value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新配置 [key]","formatEN":"Updated configuration [key]"}
func (b *BaseApi) UpdateDaemonJson(c *gin.Context) {
@@ -78,11 +78,11 @@ func (b *BaseApi) UpdateDaemonJson(c *gin.Context) {
// @Tags Container Docker
// @Summary Update docker daemon.json log option
// @Description 修改 docker 日志配置
// @Accept json
// @Param request body dto.LogOption true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/logoption/update [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新日志配置","formatEN":"Updated the log option"}
func (b *BaseApi) UpdateLogOption(c *gin.Context) {
@@ -101,11 +101,11 @@ func (b *BaseApi) UpdateLogOption(c *gin.Context) {
// @Tags Container Docker
// @Summary Update docker daemon.json ipv6 option
// @Description 修改 docker ipv6 配置
// @Accept json
// @Param request body dto.LogOption true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/ipv6option/update [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 ipv6 配置","formatEN":"Updated the ipv6 option"}
func (b *BaseApi) UpdateIpv6Option(c *gin.Context) {
@@ -124,11 +124,11 @@ func (b *BaseApi) UpdateIpv6Option(c *gin.Context) {
// @Tags Container Docker
// @Summary Update docker daemon.json by upload file
// @Description 上传替换 docker 配置文件
// @Accept json
// @Param request body dto.DaemonJsonUpdateByFile true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/daemonjson/update/byfile [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新配置文件","formatEN":"Updated configuration file"}
func (b *BaseApi) UpdateDaemonJsonByFile(c *gin.Context) {
@@ -147,11 +147,11 @@ func (b *BaseApi) UpdateDaemonJsonByFile(c *gin.Context) {
// @Tags Container Docker
// @Summary Operate docker
// @Description Docker 操作
// @Accept json
// @Param request body dto.DockerOperation true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/docker/operate [post]
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"docker 服务 [operation]","formatEN":"[operation] docker service"}
func (b *BaseApi) OperateDocker(c *gin.Context) {
+2
View File
@@ -37,6 +37,8 @@ var (
deviceService = service.NewIDeviceService()
fail2banService = service.NewIFail2BanService()
ftpService = service.NewIFtpService()
clamService = service.NewIClamService()
settingService = service.NewISettingService()
backupService = service.NewIBackupService()
+7 -7
View File
@@ -11,9 +11,9 @@ import (
// @Tags Fail2ban
// @Summary Load fail2ban base info
// @Description 获取 Fail2ban 基础信息
// @Success 200 {object} dto.Fail2BanBaseInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/fail2ban/base [get]
func (b *BaseApi) LoadFail2BanBaseInfo(c *gin.Context) {
data, err := fail2banService.LoadBaseInfo()
@@ -27,11 +27,11 @@ func (b *BaseApi) LoadFail2BanBaseInfo(c *gin.Context) {
// @Tags Fail2ban
// @Summary Page fail2ban ip list
// @Description 获取 Fail2ban ip
// @Accept json
// @Param request body dto.Fail2BanSearch true "request"
// @Success 200 {Array} string
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/fail2ban/search [post]
func (b *BaseApi) SearchFail2Ban(c *gin.Context) {
var req dto.Fail2BanSearch
@@ -50,10 +50,10 @@ func (b *BaseApi) SearchFail2Ban(c *gin.Context) {
// @Tags Fail2ban
// @Summary Operate fail2ban
// @Description 修改 Fail2ban 状态
// @Accept json
// @Param request body dto.Operate true "request"
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/fail2ban/operate [post]
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] Fail2ban","formatEN":"[operation] Fail2ban"}
func (b *BaseApi) OperateFail2Ban(c *gin.Context) {
@@ -72,10 +72,10 @@ func (b *BaseApi) OperateFail2Ban(c *gin.Context) {
// @Tags Fail2ban
// @Summary Operate sshd of fail2ban
// @Description 配置 sshd
// @Accept json
// @Param request body dto.Operate true "request"
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/fail2ban/operate/sshd [post]
func (b *BaseApi) OperateSSHD(c *gin.Context) {
var req dto.Fail2BanSet
@@ -93,11 +93,11 @@ func (b *BaseApi) OperateSSHD(c *gin.Context) {
// @Tags Fail2ban
// @Summary Update fail2ban conf
// @Description 修改 Fail2ban 配置
// @Accept json
// @Param request body dto.Fail2BanUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/fail2ban/update [post]
// @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 Fail2ban 配置 [key] => [value]","formatEN":"update fail2ban conf [key] => [value]"}
func (b *BaseApi) UpdateFail2BanConf(c *gin.Context) {
@@ -115,10 +115,10 @@ func (b *BaseApi) UpdateFail2BanConf(c *gin.Context) {
// @Tags Fail2ban
// @Summary Load fail2ban conf
// @Description 获取 fail2ban 配置文件
// @Accept json
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/fail2ban/load/conf [get]
func (b *BaseApi) LoadFail2BanConf(c *gin.Context) {
path := "/etc/fail2ban/jail.local"
@@ -133,11 +133,11 @@ func (b *BaseApi) LoadFail2BanConf(c *gin.Context) {
// @Tags Fail2ban
// @Summary Update fail2ban conf by file
// @Description 通过文件修改 fail2ban 配置
// @Accept json
// @Param request body dto.UpdateByFile true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/fail2ban/update/byconf [post]
func (b *BaseApi) UpdateFail2BanConfByFile(c *gin.Context) {
var req dto.UpdateByFile
+3 -3
View File
@@ -10,11 +10,11 @@ import (
// @Tags File
// @Summary List favorites
// @Description 获取收藏列表
// @Accept json
// @Param request body dto.PageInfo true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/favorite/search [post]
func (b *BaseApi) SearchFavorite(c *gin.Context) {
var req dto.PageInfo
@@ -34,11 +34,11 @@ func (b *BaseApi) SearchFavorite(c *gin.Context) {
// @Tags File
// @Summary Create favorite
// @Description 创建收藏
// @Accept json
// @Param request body request.FavoriteCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/favorite [post]
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"收藏文件/文件夹 [path]","formatEN":"收藏文件/文件夹 [path]"}
func (b *BaseApi) CreateFavorite(c *gin.Context) {
@@ -56,11 +56,11 @@ func (b *BaseApi) CreateFavorite(c *gin.Context) {
// @Tags File
// @Summary Delete favorite
// @Description 删除收藏
// @Accept json
// @Param request body request.FavoriteDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/favorite/del [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"favorites","output_column":"path","output_value":"path"}],"formatZH":"删除收藏 [path]","formatEN":"delete avorite [path]"}
func (b *BaseApi) DeleteFavorite(c *gin.Context) {
+72 -33
View File
@@ -11,6 +11,7 @@ import (
"path/filepath"
"strconv"
"strings"
"syscall"
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
"github.com/1Panel-dev/1Panel/backend/app/dto"
@@ -27,11 +28,11 @@ import (
// @Tags File
// @Summary List files
// @Description 获取文件列表
// @Accept json
// @Param request body request.FileOption true "request"
// @Success 200 {object} response.FileInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/search [post]
func (b *BaseApi) ListFiles(c *gin.Context) {
var req request.FileOption
@@ -48,11 +49,11 @@ func (b *BaseApi) ListFiles(c *gin.Context) {
// @Tags File
// @Summary Page file
// @Description 分页获取上传文件
// @Accept json
// @Param request body request.SearchUploadWithPage true "request"
// @Success 200 {array} response.FileInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/upload/search [post]
func (b *BaseApi) SearchUploadWithPage(c *gin.Context) {
var req request.SearchUploadWithPage
@@ -72,11 +73,11 @@ func (b *BaseApi) SearchUploadWithPage(c *gin.Context) {
// @Tags File
// @Summary Load files tree
// @Description 加载文件树
// @Accept json
// @Param request body request.FileOption true "request"
// @Success 200 {array} response.FileTree
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/tree [post]
func (b *BaseApi) GetFileTree(c *gin.Context) {
var req request.FileOption
@@ -93,11 +94,11 @@ func (b *BaseApi) GetFileTree(c *gin.Context) {
// @Tags File
// @Summary Create file
// @Description 创建文件/文件夹
// @Accept json
// @Param request body request.FileCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files [post]
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建文件/文件夹 [path]","formatEN":"Create dir or file [path]"}
func (b *BaseApi) CreateFile(c *gin.Context) {
@@ -115,11 +116,11 @@ func (b *BaseApi) CreateFile(c *gin.Context) {
// @Tags File
// @Summary Delete file
// @Description 删除文件/文件夹
// @Accept json
// @Param request body request.FileDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/del [post]
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"删除文件/文件夹 [path]","formatEN":"Delete dir or file [path]"}
func (b *BaseApi) DeleteFile(c *gin.Context) {
@@ -137,11 +138,11 @@ func (b *BaseApi) DeleteFile(c *gin.Context) {
// @Tags File
// @Summary Batch delete file
// @Description 批量删除文件/文件夹
// @Accept json
// @Param request body request.FileBatchDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/batch/del [post]
// @x-panel-log {"bodyKeys":["paths"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"批量删除文件/文件夹 [paths]","formatEN":"Batch delete dir or file [paths]"}
func (b *BaseApi) BatchDeleteFile(c *gin.Context) {
@@ -159,11 +160,11 @@ func (b *BaseApi) BatchDeleteFile(c *gin.Context) {
// @Tags File
// @Summary Change file mode
// @Description 修改文件权限
// @Accept json
// @Param request body request.FileCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/mode [post]
// @x-panel-log {"bodyKeys":["path","mode"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改权限 [paths] => [mode]","formatEN":"Change mode [paths] => [mode]"}
func (b *BaseApi) ChangeFileMode(c *gin.Context) {
@@ -181,11 +182,11 @@ func (b *BaseApi) ChangeFileMode(c *gin.Context) {
// @Tags File
// @Summary Change file owner
// @Description 修改文件用户/组
// @Accept json
// @Param request body request.FileRoleUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/owner [post]
// @x-panel-log {"bodyKeys":["path","user","group"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改用户/组 [paths] => [user]/[group]","formatEN":"Change owner [paths] => [user]/[group]"}
func (b *BaseApi) ChangeFileOwner(c *gin.Context) {
@@ -202,11 +203,11 @@ func (b *BaseApi) ChangeFileOwner(c *gin.Context) {
// @Tags File
// @Summary Compress file
// @Description 压缩文件
// @Accept json
// @Param request body request.FileCompress true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/compress [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"压缩文件 [name]","formatEN":"Compress file [name]"}
func (b *BaseApi) CompressFile(c *gin.Context) {
@@ -224,11 +225,11 @@ func (b *BaseApi) CompressFile(c *gin.Context) {
// @Tags File
// @Summary Decompress file
// @Description 解压文件
// @Accept json
// @Param request body request.FileDeCompress true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/decompress [post]
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"解压 [path]","formatEN":"Decompress file [path]"}
func (b *BaseApi) DeCompressFile(c *gin.Context) {
@@ -246,11 +247,11 @@ func (b *BaseApi) DeCompressFile(c *gin.Context) {
// @Tags File
// @Summary Load file content
// @Description 获取文件内容
// @Accept json
// @Param request body request.FileContentReq true "request"
// @Success 200 {object} response.FileInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/content [post]
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"获取文件内容 [path]","formatEN":"Load file content [path]"}
func (b *BaseApi) GetContent(c *gin.Context) {
@@ -268,11 +269,11 @@ func (b *BaseApi) GetContent(c *gin.Context) {
// @Tags File
// @Summary Update file content
// @Description 更新文件内容
// @Accept json
// @Param request body request.FileEdit true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/save [post]
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新文件内容 [path]","formatEN":"Update file content [path]"}
func (b *BaseApi) SaveContent(c *gin.Context) {
@@ -289,10 +290,10 @@ func (b *BaseApi) SaveContent(c *gin.Context) {
// @Tags File
// @Summary Upload file
// @Description 上传文件
// @Param file formData file true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/upload [post]
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"上传文件 [path]","formatEN":"Upload file [path]"}
func (b *BaseApi) UploadFiles(c *gin.Context) {
@@ -336,8 +337,12 @@ func (b *BaseApi) UploadFiles(c *gin.Context) {
return
}
mode := info.Mode()
fileOp := files.NewFileOp()
stat, ok := info.Sys().(*syscall.Stat_t)
uid, gid := -1, -1
if ok {
uid, gid = int(stat.Uid), int(stat.Gid)
}
success := 0
failures := make(buserr.MultiErr)
@@ -351,6 +356,7 @@ func (b *BaseApi) UploadFiles(c *gin.Context) {
global.LOG.Error(e)
continue
}
_ = os.Chown(dstDir, uid, gid)
}
tmpFilename := dstFilename + ".tmp"
if err := c.SaveUploadedFile(file, tmpFilename); err != nil {
@@ -378,6 +384,9 @@ func (b *BaseApi) UploadFiles(c *gin.Context) {
} else {
_ = os.Chmod(dstFilename, mode)
}
if uid != -1 && gid != -1 {
_ = os.Chown(dstFilename, uid, gid)
}
success++
}
if success == 0 {
@@ -389,11 +398,11 @@ func (b *BaseApi) UploadFiles(c *gin.Context) {
// @Tags File
// @Summary Check file exist
// @Description 检测文件是否存在
// @Accept json
// @Param request body request.FilePathCheck true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/check [post]
func (b *BaseApi) CheckFile(c *gin.Context) {
var req request.FilePathCheck
@@ -409,11 +418,11 @@ func (b *BaseApi) CheckFile(c *gin.Context) {
// @Tags File
// @Summary Change file name
// @Description 修改文件名称
// @Accept json
// @Param request body request.FileRename true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/rename [post]
// @x-panel-log {"bodyKeys":["oldName","newName"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"重命名 [oldName] => [newName]","formatEN":"Rename [oldName] => [newName]"}
func (b *BaseApi) ChangeFileName(c *gin.Context) {
@@ -430,11 +439,11 @@ func (b *BaseApi) ChangeFileName(c *gin.Context) {
// @Tags File
// @Summary Wget file
// @Description 下载远端文件
// @Accept json
// @Param request body request.FileWget true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/wget [post]
// @x-panel-log {"bodyKeys":["url","path","name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"下载 url => [path]/[name]","formatEN":"Download url => [path]/[name]"}
func (b *BaseApi) WgetFile(c *gin.Context) {
@@ -454,11 +463,11 @@ func (b *BaseApi) WgetFile(c *gin.Context) {
// @Tags File
// @Summary Move file
// @Description 移动文件
// @Accept json
// @Param request body request.FileMove true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/move [post]
// @x-panel-log {"bodyKeys":["oldPaths","newPath"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"移动文件 [oldPaths] => [newPath]","formatEN":"Move [oldPaths] => [newPath]"}
func (b *BaseApi) MoveFile(c *gin.Context) {
@@ -475,10 +484,10 @@ func (b *BaseApi) MoveFile(c *gin.Context) {
// @Tags File
// @Summary Download file
// @Description 下载文件
// @Accept json
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/download [get]
func (b *BaseApi) Download(c *gin.Context) {
filePath := c.Query("path")
@@ -495,11 +504,11 @@ func (b *BaseApi) Download(c *gin.Context) {
// @Tags File
// @Summary Chunk Download file
// @Description 分片下载下载文件
// @Accept json
// @Param request body request.FileDownload true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/chunkdownload [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"下载文件 [name]","formatEN":"Download file [name]"}
func (b *BaseApi) DownloadChunkFiles(c *gin.Context) {
@@ -572,11 +581,11 @@ func (b *BaseApi) DownloadChunkFiles(c *gin.Context) {
// @Tags File
// @Summary Load file size
// @Description 获取文件夹大小
// @Accept json
// @Param request body request.DirSizeReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/size [post]
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"获取文件夹大小 [path]","formatEN":"Load file size [path]"}
func (b *BaseApi) Size(c *gin.Context) {
@@ -592,24 +601,46 @@ func (b *BaseApi) Size(c *gin.Context) {
helper.SuccessWithData(c, res)
}
func mergeChunks(fileName string, fileDir string, dstDir string, chunkCount int) error {
func mergeChunks(fileName string, fileDir string, dstDir string, chunkCount int, overwrite bool) error {
defer func() {
_ = os.RemoveAll(fileDir)
}()
op := files.NewFileOp()
dstDir = strings.TrimSpace(dstDir)
mode, _ := files.GetParentMode(dstDir)
if mode == 0 {
mode = 0755
}
if _, err := os.Stat(dstDir); err != nil && os.IsNotExist(err) {
if err = op.CreateDir(dstDir, mode); err != nil {
return err
uid, gid := -1, -1
if info, err := os.Stat(dstDir); err != nil {
if os.IsNotExist(err) {
if err = op.CreateDir(dstDir, mode); err != nil {
return err
}
}
} else {
stat, ok := info.Sys().(*syscall.Stat_t)
if ok {
uid, gid = int(stat.Uid), int(stat.Gid)
}
}
dstFileName := filepath.Join(dstDir, fileName)
dstInfo, statErr := os.Stat(dstFileName)
if statErr == nil {
mode = dstInfo.Mode()
} else {
mode = 0644
}
targetFile, err := os.OpenFile(filepath.Join(dstDir, fileName), os.O_RDWR|os.O_CREATE, mode)
if overwrite {
_ = os.Remove(dstFileName)
}
targetFile, err := os.OpenFile(dstFileName, os.O_RDWR|os.O_CREATE, mode)
if err != nil {
return err
}
defer targetFile.Close()
for i := 0; i < chunkCount; i++ {
chunkPath := filepath.Join(fileDir, fmt.Sprintf("%s.%d", fileName, i))
chunkData, err := os.ReadFile(chunkPath)
@@ -620,17 +651,21 @@ func mergeChunks(fileName string, fileDir string, dstDir string, chunkCount int)
if err != nil {
return err
}
_ = os.Remove(chunkPath)
}
if uid != -1 && gid != -1 {
_ = os.Chown(dstFileName, uid, gid)
}
return files.NewFileOp().DeleteDir(fileDir)
return nil
}
// @Tags File
// @Summary ChunkUpload file
// @Description 分片上传文件
// @Summary Chunk upload file
// @Param file formData file true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/chunkupload [post]
func (b *BaseApi) UploadChunkFiles(c *gin.Context) {
var err error
@@ -704,7 +739,11 @@ func (b *BaseApi) UploadChunkFiles(c *gin.Context) {
}
if chunkIndex+1 == chunkCount {
err = mergeChunks(filename, fileDir, c.PostForm("path"), chunkCount)
overwrite := true
if ow := c.PostForm("overwrite"); ow != "" {
overwrite, _ = strconv.ParseBool(ow)
}
err = mergeChunks(filename, fileDir, c.PostForm("path"), chunkCount, overwrite)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, buserr.WithMap(constant.ErrFileUpload, map[string]interface{}{"name": filename, "detail": err.Error()}, err))
return
@@ -744,10 +783,10 @@ func (b *BaseApi) Keys(c *gin.Context) {
// @Tags File
// @Summary Read file by Line
// @Description 按行读取日志文件
// @Param request body request.FileReadByLineReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/read [post]
func (b *BaseApi) ReadFileByLine(c *gin.Context) {
var req request.FileReadByLineReq
@@ -764,11 +803,11 @@ func (b *BaseApi) ReadFileByLine(c *gin.Context) {
// @Tags File
// @Summary Batch change file mode and owner
// @Description 批量修改文件权限和用户/组
// @Accept json
// @Param request body request.FileRoleReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/batch/role [post]
// @x-panel-log {"bodyKeys":["paths","mode","user","group"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"批量修改文件权限和用户/组 [paths] => [mode]/[user]/[group]","formatEN":"Batch change file mode and owner [paths] => [mode]/[user]/[group]"}
func (b *BaseApi) BatchChangeModeAndOwner(c *gin.Context) {
+37 -14
View File
@@ -9,9 +9,9 @@ import (
// @Tags Firewall
// @Summary Load firewall base info
// @Description 获取防火墙基础信息
// @Success 200 {object} dto.FirewallBaseInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/firewall/base [get]
func (b *BaseApi) LoadFirewallBaseInfo(c *gin.Context) {
data, err := firewallService.LoadBaseInfo()
@@ -25,11 +25,11 @@ func (b *BaseApi) LoadFirewallBaseInfo(c *gin.Context) {
// @Tags Firewall
// @Summary Page firewall rules
// @Description 获取防火墙规则列表分页
// @Accept json
// @Param request body dto.RuleSearch true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/firewall/search [post]
func (b *BaseApi) SearchFirewallRule(c *gin.Context) {
var req dto.RuleSearch
@@ -51,11 +51,11 @@ func (b *BaseApi) SearchFirewallRule(c *gin.Context) {
// @Tags Firewall
// @Summary Page firewall status
// @Description 修改防火墙状态
// @Accept json
// @Param request body dto.FirewallOperation true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/firewall/operate [post]
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] 防火墙","formatEN":"[operation] firewall"}
func (b *BaseApi) OperateFirewall(c *gin.Context) {
@@ -73,12 +73,12 @@ func (b *BaseApi) OperateFirewall(c *gin.Context) {
}
// @Tags Firewall
// @Summary Create group
// @Description 创建防火墙端口规则
// @Summary Create firewall port group
// @Accept json
// @Param request body dto.PortRuleOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/firewall/port [post]
// @x-panel-log {"bodyKeys":["port","strategy"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"添加端口规则 [strategy] [port]","formatEN":"create port rules [strategy][port]"}
func (b *BaseApi) OperatePortRule(c *gin.Context) {
@@ -94,13 +94,36 @@ func (b *BaseApi) OperatePortRule(c *gin.Context) {
helper.SuccessWithData(c, nil)
}
// OperateForwardRule
// @Tags Firewall
// @Summary Create group
// @Description 创建防火墙 IP 规则
// @Summary Update firewall port group
// @Accept json
// @Param request body dto.ForwardRuleOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/firewall/forward [post]
// @x-panel-log {"bodyKeys":["source_port"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新端口转发规则 [source_port]","formatEN":"update port forward rules [source_port]"}
func (b *BaseApi) OperateForwardRule(c *gin.Context) {
var req dto.ForwardRuleOperate
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := firewallService.OperateForwardRule(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
// @Tags Firewall
// @Summary Create firewall group
// @Accept json
// @Param request body dto.AddrRuleOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/firewall/ip [post]
// @x-panel-log {"bodyKeys":["strategy","address"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"添加 ip 规则 [strategy] [address]","formatEN":"create address rules [strategy][address]"}
func (b *BaseApi) OperateIPRule(c *gin.Context) {
@@ -117,12 +140,12 @@ func (b *BaseApi) OperateIPRule(c *gin.Context) {
}
// @Tags Firewall
// @Summary Create group
// @Description 批量删除防火墙规则
// @Summary Batch create group
// @Accept json
// @Param request body dto.BatchRuleOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/firewall/batch [post]
func (b *BaseApi) BatchOperateRule(c *gin.Context) {
var req dto.BatchRuleOperate
@@ -139,11 +162,11 @@ func (b *BaseApi) BatchOperateRule(c *gin.Context) {
// @Tags Firewall
// @Summary Update rule description
// @Description 更新防火墙描述
// @Accept json
// @Param request body dto.UpdateFirewallDescription true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/firewall/update/description [post]
func (b *BaseApi) UpdateFirewallDescription(c *gin.Context) {
var req dto.UpdateFirewallDescription
@@ -159,12 +182,12 @@ func (b *BaseApi) UpdateFirewallDescription(c *gin.Context) {
}
// @Tags Firewall
// @Summary Create group
// @Description 更新端口防火墙规则
// @Summary Update firewall group
// @Accept json
// @Param request body dto.PortRuleUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/firewall/update/port [post]
func (b *BaseApi) UpdatePortRule(c *gin.Context) {
var req dto.PortRuleUpdate
@@ -180,12 +203,12 @@ func (b *BaseApi) UpdatePortRule(c *gin.Context) {
}
// @Tags Firewall
// @Summary Create group
// @Description 更新 ip 防火墙规则
// @Summary Uodate address group
// @Accept json
// @Param request body dto.AddrRuleUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/firewall/update/addr [post]
func (b *BaseApi) UpdateAddrRule(c *gin.Context) {
var req dto.AddrRuleUpdate
+199
View File
@@ -0,0 +1,199 @@
package v1
import (
"encoding/base64"
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
"github.com/1Panel-dev/1Panel/backend/app/dto"
"github.com/1Panel-dev/1Panel/backend/constant"
"github.com/gin-gonic/gin"
)
// @Tags FTP
// @Summary Load FTP base info
// @Success 200 {object} dto.FtpBaseInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/ftp/base [get]
func (b *BaseApi) LoadFtpBaseInfo(c *gin.Context) {
data, err := ftpService.LoadBaseInfo()
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, data)
}
// @Tags FTP
// @Summary Load FTP operation log
// @Accept json
// @Param request body dto.FtpLogSearch true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/ftp/log/search [post]
func (b *BaseApi) LoadFtpLogInfo(c *gin.Context) {
var req dto.FtpLogSearch
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
total, list, err := ftpService.LoadLog(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, dto.PageResult{
Items: list,
Total: total,
})
}
// @Tags FTP
// @Summary Operate FTP
// @Accept json
// @Param request body dto.Operate true "request"
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/ftp/operate [post]
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] FTP","formatEN":"[operation] FTP"}
func (b *BaseApi) OperateFtp(c *gin.Context) {
var req dto.Operate
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := ftpService.Operate(req.Operation); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
// @Tags FTP
// @Summary Page FTP user
// @Accept json
// @Param request body dto.SearchWithPage true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/ftp/search [post]
func (b *BaseApi) SearchFtp(c *gin.Context) {
var req dto.SearchWithPage
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
total, list, err := ftpService.SearchWithPage(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, dto.PageResult{
Items: list,
Total: total,
})
}
// @Tags FTP
// @Summary Create FTP user
// @Accept json
// @Param request body dto.FtpCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/ftp [post]
// @x-panel-log {"bodyKeys":["user", "path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 FTP 账户 [user][path]","formatEN":"create FTP [user][path]"}
func (b *BaseApi) CreateFtp(c *gin.Context) {
var req dto.FtpCreate
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if len(req.Password) != 0 {
pass, err := base64.StdEncoding.DecodeString(req.Password)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
req.Password = string(pass)
}
if _, err := ftpService.Create(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithOutData(c)
}
// @Tags FTP
// @Summary Delete FTP user
// @Accept json
// @Param request body dto.BatchDeleteReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/ftp/del [post]
// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ids","isList":true,"db":"ftps","output_column":"user","output_value":"users"}],"formatZH":"删除 FTP 账户 [users]","formatEN":"delete FTP users [users]"}
func (b *BaseApi) DeleteFtp(c *gin.Context) {
var req dto.BatchDeleteReq
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := ftpService.Delete(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithOutData(c)
}
// @Tags FTP
// @Summary Sync FTP user
// @Accept json
// @Param request body dto.BatchDeleteReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/ftp/sync [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"同步 FTP 账户","formatEN":"sync FTP users"}
func (b *BaseApi) SyncFtp(c *gin.Context) {
if err := ftpService.Sync(); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithOutData(c)
}
// @Tags FTP
// @Summary Update FTP user
// @Accept json
// @Param request body dto.FtpUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /toolbox/ftp/update [post]
// @x-panel-log {"bodyKeys":["user", "path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 FTP 账户 [user][path]","formatEN":"update FTP [user][path]"}
func (b *BaseApi) UpdateFtp(c *gin.Context) {
var req dto.FtpUpdate
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if len(req.Password) != 0 {
pass, err := base64.StdEncoding.DecodeString(req.Password)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
req.Password = string(pass)
}
if err := ftpService.Update(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithOutData(c)
}
+8 -8
View File
@@ -8,12 +8,12 @@ import (
)
// @Tags System Group
// @Summary Create group
// @Description 创建系统组
// @Summary Create system group
// @Accept json
// @Param request body dto.GroupCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /groups [post]
// @x-panel-log {"bodyKeys":["name","type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建组 [name][type]","formatEN":"create group [name][type]"}
func (b *BaseApi) CreateGroup(c *gin.Context) {
@@ -30,12 +30,12 @@ func (b *BaseApi) CreateGroup(c *gin.Context) {
}
// @Tags System Group
// @Summary Delete group
// @Description 删除系统组
// @Summary Delete system group
// @Accept json
// @Param request body dto.OperateByID true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /groups/del [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"groups","output_column":"name","output_value":"name"},{"input_column":"id","input_value":"id","isList":false,"db":"groups","output_column":"type","output_value":"type"}],"formatZH":"删除组 [type][name]","formatEN":"delete group [type][name]"}
func (b *BaseApi) DeleteGroup(c *gin.Context) {
@@ -52,12 +52,12 @@ func (b *BaseApi) DeleteGroup(c *gin.Context) {
}
// @Tags System Group
// @Summary Update group
// @Description 更新系统组
// @Summary Update system group
// @Accept json
// @Param request body dto.GroupUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /groups/update [post]
// @x-panel-log {"bodyKeys":["name","type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新组 [name][type]","formatEN":"update group [name][type]"}
func (b *BaseApi) UpdateGroup(c *gin.Context) {
@@ -74,12 +74,12 @@ func (b *BaseApi) UpdateGroup(c *gin.Context) {
}
// @Tags System Group
// @Summary List groups
// @Description 查询系统组
// @Summary List system groups
// @Accept json
// @Param request body dto.GroupSearch true "request"
// @Success 200 {array} dto.GroupInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /groups/search [post]
func (b *BaseApi) ListGroup(c *gin.Context) {
var req dto.GroupSearch
+21
View File
@@ -3,6 +3,7 @@ package helper
import (
"context"
"fmt"
"github.com/1Panel-dev/1Panel/cmd/server/res"
"net/http"
"strconv"
@@ -133,3 +134,23 @@ func CheckBind(req interface{}, c *gin.Context) error {
}
return nil
}
func ErrWithHtml(ctx *gin.Context, code int, scope string) {
if code == 444 {
ctx.String(444, "")
ctx.Abort()
return
}
file := fmt.Sprintf("html/%d.html", code)
if code == 200 && scope != "" {
file = fmt.Sprintf("html/200_%s.html", scope)
}
data, err := res.ErrorMsg.ReadFile(file)
if err != nil {
ctx.String(http.StatusInternalServerError, "Internal Server Error")
ctx.Abort()
return
}
ctx.Data(code, "text/html; charset=utf-8", data)
ctx.Abort()
}
+8 -8
View File
@@ -10,11 +10,11 @@ import (
// @Tags Host
// @Summary Create host
// @Description 创建主机
// @Accept json
// @Param request body dto.HostOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts [post]
// @x-panel-log {"bodyKeys":["name","addr"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建主机 [name][addr]","formatEN":"create host [name][addr]"}
func (b *BaseApi) CreateHost(c *gin.Context) {
@@ -33,11 +33,11 @@ func (b *BaseApi) CreateHost(c *gin.Context) {
// @Tags Host
// @Summary Test host conn by info
// @Description 测试主机连接
// @Accept json
// @Param request body dto.HostConnTest true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/test/byinfo [post]
func (b *BaseApi) TestByInfo(c *gin.Context) {
var req dto.HostConnTest
@@ -51,11 +51,11 @@ func (b *BaseApi) TestByInfo(c *gin.Context) {
// @Tags Host
// @Summary Test host conn by host id
// @Description 测试主机连接
// @Accept json
// @Param id path integer true "request"
// @Success 200 {boolean} connStatus
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/test/byid/:id [post]
func (b *BaseApi) TestByID(c *gin.Context) {
id, err := helper.GetParamID(c)
@@ -70,11 +70,11 @@ func (b *BaseApi) TestByID(c *gin.Context) {
// @Tags Host
// @Summary Load host tree
// @Description 加载主机树
// @Accept json
// @Param request body dto.SearchForTree true "request"
// @Success 200 {array} dto.HostTree
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/tree [post]
func (b *BaseApi) HostTree(c *gin.Context) {
var req dto.SearchForTree
@@ -93,11 +93,11 @@ func (b *BaseApi) HostTree(c *gin.Context) {
// @Tags Host
// @Summary Page host
// @Description 获取主机列表分页
// @Accept json
// @Param request body dto.SearchHostWithPage true "request"
// @Success 200 {array} dto.HostTree
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/search [post]
func (b *BaseApi) SearchHost(c *gin.Context) {
var req dto.SearchHostWithPage
@@ -119,11 +119,11 @@ func (b *BaseApi) SearchHost(c *gin.Context) {
// @Tags Host
// @Summary Delete host
// @Description 删除主机
// @Accept json
// @Param request body dto.BatchDeleteReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/del [post]
// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ids","isList":true,"db":"hosts","output_column":"addr","output_value":"addrs"}],"formatZH":"删除主机 [addrs]","formatEN":"delete host [addrs]"}
func (b *BaseApi) DeleteHost(c *gin.Context) {
@@ -141,11 +141,11 @@ func (b *BaseApi) DeleteHost(c *gin.Context) {
// @Tags Host
// @Summary Update host
// @Description 更新主机
// @Accept json
// @Param request body dto.HostOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/update [post]
// @x-panel-log {"bodyKeys":["name","addr"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新主机信息 [name][addr]","formatEN":"update host [name][addr]"}
func (b *BaseApi) UpdateHost(c *gin.Context) {
@@ -207,11 +207,11 @@ func (b *BaseApi) UpdateHost(c *gin.Context) {
// @Tags Host
// @Summary Update host group
// @Description 切换分组
// @Accept json
// @Param request body dto.ChangeHostGroup true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/update/group [post]
// @x-panel-log {"bodyKeys":["id","group"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"hosts","output_column":"addr","output_value":"addr"}],"formatZH":"切换主机[addr]分组 => [group]","formatEN":"change host [addr] group => [group]"}
func (b *BaseApi) UpdateHostGroup(c *gin.Context) {
+10 -10
View File
@@ -8,12 +8,12 @@ import (
)
// @Tags Host tool
// @Summary Get tool
// @Description 获取主机工具状态
// @Summary Get tool status
// @Accept json
// @Param request body request.HostToolReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/tool [post]
func (b *BaseApi) GetToolStatus(c *gin.Context) {
var req request.HostToolReq
@@ -31,11 +31,11 @@ func (b *BaseApi) GetToolStatus(c *gin.Context) {
// @Tags Host tool
// @Summary Create Host tool Config
// @Description 创建主机工具配置
// @Accept json
// @Param request body request.HostToolCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/tool/create [post]
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 [type] 配置","formatEN":"create [type] config"}
func (b *BaseApi) InitToolConfig(c *gin.Context) {
@@ -53,11 +53,11 @@ func (b *BaseApi) InitToolConfig(c *gin.Context) {
// @Tags Host tool
// @Summary Operate tool
// @Description 操作主机工具
// @Accept json
// @Param request body request.HostToolReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/tool/operate [post]
// @x-panel-log {"bodyKeys":["operate","type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] [type] ","formatEN":"[operate] [type]"}
func (b *BaseApi) OperateTool(c *gin.Context) {
@@ -75,11 +75,11 @@ func (b *BaseApi) OperateTool(c *gin.Context) {
// @Tags Host tool
// @Summary Get tool config
// @Description 操作主机工具配置文件
// @Accept json
// @Param request body request.HostToolConfig true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/tool/config [post]
// @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] 主机工具配置文件 ","formatEN":"[operate] tool config"}
func (b *BaseApi) OperateToolConfig(c *gin.Context) {
@@ -97,12 +97,12 @@ func (b *BaseApi) OperateToolConfig(c *gin.Context) {
}
// @Tags Host tool
// @Summary Get tool
// @Description 获取主机工具日志
// @Summary Get tool logs
// @Accept json
// @Param request body request.HostToolLogReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/tool/log [post]
func (b *BaseApi) GetToolLog(c *gin.Context) {
var req request.HostToolLogReq
@@ -120,11 +120,11 @@ func (b *BaseApi) GetToolLog(c *gin.Context) {
// @Tags Host tool
// @Summary Create Supervisor process
// @Description 操作守护进程
// @Accept json
// @Param request body request.SupervisorProcessConfig true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/tool/supervisor/process [post]
// @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] 守护进程 ","formatEN":"[operate] process"}
func (b *BaseApi) OperateProcess(c *gin.Context) {
@@ -143,10 +143,10 @@ func (b *BaseApi) OperateProcess(c *gin.Context) {
// @Tags Host tool
// @Summary Get Supervisor process config
// @Description 获取 Supervisor 进程配置
// @Accept json
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/tool/supervisor/process [get]
func (b *BaseApi) GetProcess(c *gin.Context) {
configs, err := hostToolService.GetSupervisorProcessConfig()
@@ -159,11 +159,11 @@ func (b *BaseApi) GetProcess(c *gin.Context) {
// @Tags Host tool
// @Summary Get Supervisor process config
// @Description 操作 Supervisor 进程文件
// @Accept json
// @Param request body request.SupervisorProcessFileReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/tool/supervisor/process/file [post]
// @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] Supervisor 进程文件 ","formatEN":"[operate] Supervisor Process Config file"}
func (b *BaseApi) GetProcessFile(c *gin.Context) {
+10 -10
View File
@@ -9,12 +9,12 @@ import (
// @Tags Container Image
// @Summary Page images
// @Description 获取镜像列表分页
// @Accept json
// @Param request body dto.SearchWithPage true "request"
// @Produce json
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/image/search [post]
func (b *BaseApi) SearchImage(c *gin.Context) {
var req dto.SearchWithPage
@@ -36,10 +36,10 @@ func (b *BaseApi) SearchImage(c *gin.Context) {
// @Tags Container Image
// @Summary List all images
// @Description 获取所有镜像列表
// @Produce json
// @Success 200 {array} dto.ImageInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/image/all [get]
func (b *BaseApi) ListAllImage(c *gin.Context) {
list, err := imageService.ListAll()
@@ -52,10 +52,10 @@ func (b *BaseApi) ListAllImage(c *gin.Context) {
// @Tags Container Image
// @Summary load images options
// @Description 获取镜像名称列表
// @Produce json
// @Success 200 {array} dto.Options
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/image [get]
func (b *BaseApi) ListImage(c *gin.Context) {
list, err := imageService.List()
@@ -68,11 +68,11 @@ func (b *BaseApi) ListImage(c *gin.Context) {
// @Tags Container Image
// @Summary Build image
// @Description 构建镜像
// @Accept json
// @Param request body dto.ImageBuild true "request"
// @Success 200 {string} log
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/image/build [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"构建镜像 [name]","formatEN":"build image [name]"}
func (b *BaseApi) ImageBuild(c *gin.Context) {
@@ -92,11 +92,11 @@ func (b *BaseApi) ImageBuild(c *gin.Context) {
// @Tags Container Image
// @Summary Pull image
// @Description 拉取镜像
// @Accept json
// @Param request body dto.ImagePull true "request"
// @Success 200 {string} log
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/image/pull [post]
// @x-panel-log {"bodyKeys":["repoID","imageName"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"repoID","isList":false,"db":"image_repos","output_column":"name","output_value":"reponame"}],"formatZH":"镜像拉取 [reponame][imageName]","formatEN":"image pull [reponame][imageName]"}
func (b *BaseApi) ImagePull(c *gin.Context) {
@@ -116,11 +116,11 @@ func (b *BaseApi) ImagePull(c *gin.Context) {
// @Tags Container Image
// @Summary Push image
// @Description 推送镜像
// @Accept json
// @Param request body dto.ImagePush true "request"
// @Success 200 {string} log
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/image/push [post]
// @x-panel-log {"bodyKeys":["repoID","tagName","name"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"repoID","isList":false,"db":"image_repos","output_column":"name","output_value":"reponame"}],"formatZH":"[tagName] 推送到 [reponame][name]","formatEN":"push [tagName] to [reponame][name]"}
func (b *BaseApi) ImagePush(c *gin.Context) {
@@ -140,11 +140,11 @@ func (b *BaseApi) ImagePush(c *gin.Context) {
// @Tags Container Image
// @Summary Delete image
// @Description 删除镜像
// @Accept json
// @Param request body dto.BatchDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/image/remove [post]
// @x-panel-log {"bodyKeys":["names"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"移除镜像 [names]","formatEN":"remove image [names]"}
func (b *BaseApi) ImageRemove(c *gin.Context) {
@@ -163,11 +163,11 @@ func (b *BaseApi) ImageRemove(c *gin.Context) {
// @Tags Container Image
// @Summary Save image
// @Description 导出镜像
// @Accept json
// @Param request body dto.ImageSave true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/image/save [post]
// @x-panel-log {"bodyKeys":["tagName","path","name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"保留 [tagName] 为 [path]/[name]","formatEN":"save [tagName] as [path]/[name]"}
func (b *BaseApi) ImageSave(c *gin.Context) {
@@ -186,11 +186,11 @@ func (b *BaseApi) ImageSave(c *gin.Context) {
// @Tags Container Image
// @Summary Tag image
// @Description Tag 镜像
// @Accept json
// @Param request body dto.ImageTag true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/image/tag [post]
// @x-panel-log {"bodyKeys":["repoID","targetName"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"repoID","isList":false,"db":"image_repos","output_column":"name","output_value":"reponame"}],"formatZH":"tag 镜像 [reponame][targetName]","formatEN":"tag image [reponame][targetName]"}
func (b *BaseApi) ImageTag(c *gin.Context) {
@@ -209,11 +209,11 @@ func (b *BaseApi) ImageTag(c *gin.Context) {
// @Tags Container Image
// @Summary Load image
// @Description 导入镜像
// @Accept json
// @Param request body dto.ImageLoad true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/image/load [post]
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"从 [path] 加载镜像","formatEN":"load image from [path]"}
func (b *BaseApi) ImageLoad(c *gin.Context) {
+6 -6
View File
@@ -9,12 +9,12 @@ import (
// @Tags Container Image-repo
// @Summary Page image repos
// @Description 获取镜像仓库列表分页
// @Accept json
// @Param request body dto.SearchWithPage true "request"
// @Produce json
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/repo/search [post]
func (b *BaseApi) SearchRepo(c *gin.Context) {
var req dto.SearchWithPage
@@ -36,10 +36,10 @@ func (b *BaseApi) SearchRepo(c *gin.Context) {
// @Tags Container Image-repo
// @Summary List image repos
// @Description 获取镜像仓库列表
// @Produce json
// @Success 200 {array} dto.ImageRepoOption
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/repo [get]
func (b *BaseApi) ListRepo(c *gin.Context) {
list, err := imageRepoService.List()
@@ -53,12 +53,12 @@ func (b *BaseApi) ListRepo(c *gin.Context) {
// @Tags Container Image-repo
// @Summary Load repo status
// @Description 获取 docker 仓库状态
// @Accept json
// @Param request body dto.OperateByID true "request"
// @Produce json
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/repo/status [get]
func (b *BaseApi) CheckRepoStatus(c *gin.Context) {
var req dto.OperateByID
@@ -75,12 +75,12 @@ func (b *BaseApi) CheckRepoStatus(c *gin.Context) {
// @Tags Container Image-repo
// @Summary Create image repo
// @Description 创建镜像仓库
// @Accept json
// @Param request body dto.ImageRepoDelete true "request"
// @Produce json
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/repo [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建镜像仓库 [name]","formatEN":"create image repo [name]"}
func (b *BaseApi) CreateRepo(c *gin.Context) {
@@ -98,12 +98,12 @@ func (b *BaseApi) CreateRepo(c *gin.Context) {
// @Tags Container Image-repo
// @Summary Delete image repo
// @Description 删除镜像仓库
// @Accept json
// @Param request body dto.ImageRepoDelete true "request"
// @Produce json
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/repo/del [post]
// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ids","isList":true,"db":"image_repos","output_column":"name","output_value":"names"}],"formatZH":"删除镜像仓库 [names]","formatEN":"delete image repo [names]"}
func (b *BaseApi) DeleteRepo(c *gin.Context) {
@@ -121,12 +121,12 @@ func (b *BaseApi) DeleteRepo(c *gin.Context) {
// @Tags Container Image-repo
// @Summary Update image repo
// @Description 更新镜像仓库
// @Accept json
// @Param request body dto.ImageRepoUpdate true "request"
// @Produce json
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /containers/repo/update [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"image_repos","output_column":"name","output_value":"name"}],"formatZH":"更新镜像仓库 [name]","formatEN":"update image repo information [name]"}
func (b *BaseApi) UpdateRepo(c *gin.Context) {
+5 -5
View File
@@ -9,11 +9,11 @@ import (
// @Tags Logs
// @Summary Page login logs
// @Description 获取系统登录日志列表分页
// @Accept json
// @Param request body dto.SearchLgLogWithPage true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /logs/login [post]
func (b *BaseApi) GetLoginLogs(c *gin.Context) {
var req dto.SearchLgLogWithPage
@@ -35,11 +35,11 @@ func (b *BaseApi) GetLoginLogs(c *gin.Context) {
// @Tags Logs
// @Summary Page operation logs
// @Description 获取系统操作日志列表分页
// @Accept json
// @Param request body dto.SearchOpLogWithPage true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /logs/operation [post]
func (b *BaseApi) GetOperationLogs(c *gin.Context) {
var req dto.SearchOpLogWithPage
@@ -61,11 +61,11 @@ func (b *BaseApi) GetOperationLogs(c *gin.Context) {
// @Tags Logs
// @Summary Clean operation logs
// @Description 清空操作日志
// @Accept json
// @Param request body dto.CleanLog true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /logs/clean [post]
// @x-panel-log {"bodyKeys":["logType"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清空 [logType] 日志信息","formatEN":"Clean the [logType] log information"}
func (b *BaseApi) CleanLogs(c *gin.Context) {
@@ -84,9 +84,9 @@ func (b *BaseApi) CleanLogs(c *gin.Context) {
// @Tags Logs
// @Summary Load system log files
// @Description 获取系统日志文件列表
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /logs/system/files [get]
func (b *BaseApi) GetSystemFiles(c *gin.Context) {
data, err := logService.ListSystemLogFile()
@@ -100,9 +100,9 @@ func (b *BaseApi) GetSystemFiles(c *gin.Context) {
// @Tags Logs
// @Summary Load system logs
// @Description 获取系统日志
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /logs/system [post]
func (b *BaseApi) GetSystemLogs(c *gin.Context) {
var req dto.OperationWithName
+3 -3
View File
@@ -17,10 +17,10 @@ import (
// @Tags Monitor
// @Summary Load monitor datas
// @Description 获取监控数据
// @Param request body dto.MonitorSearch true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/monitor/search [post]
func (b *BaseApi) LoadMonitor(c *gin.Context) {
var req dto.MonitorSearch
@@ -28,7 +28,7 @@ func (b *BaseApi) LoadMonitor(c *gin.Context) {
return
}
loc, _ := time.LoadLocation(common.LoadTimeZone())
loc, _ := time.LoadLocation(common.LoadTimeZoneByCmd())
req.StartTime = req.StartTime.In(loc)
req.EndTime = req.EndTime.In(loc)
@@ -89,9 +89,9 @@ func (b *BaseApi) LoadMonitor(c *gin.Context) {
// @Tags Monitor
// @Summary Clean monitor datas
// @Description 清空监控数据
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /hosts/monitor/clean [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清空监控数据","formatEN":"clean monitor datas"}
func (b *BaseApi) CleanMonitor(c *gin.Context) {
+6 -6
View File
@@ -9,9 +9,9 @@ import (
// @Tags OpenResty
// @Summary Load OpenResty conf
// @Description 获取 OpenResty 配置信息
// @Success 200 {object} response.FileInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /openresty [get]
func (b *BaseApi) GetNginx(c *gin.Context) {
fileInfo, err := nginxService.GetNginxConfig()
@@ -24,11 +24,11 @@ func (b *BaseApi) GetNginx(c *gin.Context) {
// @Tags OpenResty
// @Summary Load partial OpenResty conf
// @Description 获取部分 OpenResty 配置信息
// @Accept json
// @Param request body request.NginxScopeReq true "request"
// @Success 200 {array} response.NginxParam
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /openresty/scope [post]
func (b *BaseApi) GetNginxConfigByScope(c *gin.Context) {
var req request.NginxScopeReq
@@ -46,11 +46,11 @@ func (b *BaseApi) GetNginxConfigByScope(c *gin.Context) {
// @Tags OpenResty
// @Summary Update OpenResty conf
// @Description 更新 OpenResty 配置信息
// @Accept json
// @Param request body request.NginxConfigUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /openresty/update [post]
// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"websiteId","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"更新 nginx 配置 [domain]","formatEN":"Update nginx conf [domain]"}
func (b *BaseApi) UpdateNginxConfigByScope(c *gin.Context) {
@@ -67,9 +67,9 @@ func (b *BaseApi) UpdateNginxConfigByScope(c *gin.Context) {
// @Tags OpenResty
// @Summary Load OpenResty status info
// @Description 获取 OpenResty 状态信息
// @Success 200 {object} response.NginxStatus
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /openresty/status [get]
func (b *BaseApi) GetNginxStatus(c *gin.Context) {
res, err := nginxService.GetStatus()
@@ -82,11 +82,11 @@ func (b *BaseApi) GetNginxStatus(c *gin.Context) {
// @Tags OpenResty
// @Summary Update OpenResty conf by upload file
// @Description 上传更新 OpenResty 配置文件
// @Accept json
// @Param request body request.NginxConfigFileUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /openresty/file [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 nginx 配置","formatEN":"Update nginx conf"}
func (b *BaseApi) UpdateNginxFile(c *gin.Context) {
@@ -104,9 +104,9 @@ func (b *BaseApi) UpdateNginxFile(c *gin.Context) {
// @Tags OpenResty
// @Summary Clear OpenResty proxy cache
// @Description 清理 OpenResty 代理缓存
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /openresty/clear [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清理 Openresty 代理缓存","formatEN":"Clear nginx proxy cache"}
func (b *BaseApi) ClearNginxProxyCache(c *gin.Context) {
+4 -4
View File
@@ -10,11 +10,11 @@ import (
// @Tags PHP Extensions
// @Summary Page Extensions
// @Description Page Extensions
// @Accept json
// @Param request body request.PHPExtensionsSearch true "request"
// @Success 200 {array} response.PHPExtensionsDTO
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes/php/extensions/search [post]
func (b *BaseApi) PagePHPExtensions(c *gin.Context) {
var req request.PHPExtensionsSearch
@@ -44,11 +44,11 @@ func (b *BaseApi) PagePHPExtensions(c *gin.Context) {
// @Tags PHP Extensions
// @Summary Create Extensions
// @Description Create Extensions
// @Accept json
// @Param request body request.PHPExtensionsCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes/php/extensions [post]
func (b *BaseApi) CreatePHPExtensions(c *gin.Context) {
var req request.PHPExtensionsCreate
@@ -64,11 +64,11 @@ func (b *BaseApi) CreatePHPExtensions(c *gin.Context) {
// @Tags PHP Extensions
// @Summary Update Extensions
// @Description Update Extensions
// @Accept json
// @Param request body request.PHPExtensionsUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes/php/extensions/update [post]
func (b *BaseApi) UpdatePHPExtensions(c *gin.Context) {
var req request.PHPExtensionsUpdate
@@ -84,11 +84,11 @@ func (b *BaseApi) UpdatePHPExtensions(c *gin.Context) {
// @Tags PHP Extensions
// @Summary Delete Extensions
// @Description Delete Extensions
// @Accept json
// @Param request body request.PHPExtensionsDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes/php/extensions/del [post]
func (b *BaseApi) DeletePHPExtensions(c *gin.Context) {
var req request.PHPExtensionsDelete
+1 -1
View File
@@ -20,10 +20,10 @@ func (b *BaseApi) ProcessWs(c *gin.Context) {
// @Tags Process
// @Summary Stop Process
// @Description 停止进程
// @Param request body request.ProcessReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /process/stop [post]
// @x-panel-log {"bodyKeys":["PID"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"结束进程 [PID]","formatEN":"结束进程 [PID]"}
func (b *BaseApi) StopProcess(c *gin.Context) {
+8 -8
View File
@@ -9,12 +9,12 @@ import (
)
// @Tags File
// @Summary List RecycleBin files
// @Description 获取回收站文件列表
// @Summary List Recycle Bin files
// @Accept json
// @Param request body dto.PageInfo true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/recycle/search [post]
func (b *BaseApi) SearchRecycleBinFile(c *gin.Context) {
var req dto.PageInfo
@@ -33,12 +33,12 @@ func (b *BaseApi) SearchRecycleBinFile(c *gin.Context) {
}
// @Tags File
// @Summary Reduce RecycleBin files
// @Description 还原回收站文件
// @Summary Reduce Recycle Bin files
// @Accept json
// @Param request body request.RecycleBinReduce true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/recycle/reduce [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"还原回收站文件 [name]","formatEN":"Reduce RecycleBin file [name]"}
func (b *BaseApi) ReduceRecycleBinFile(c *gin.Context) {
@@ -54,11 +54,11 @@ func (b *BaseApi) ReduceRecycleBinFile(c *gin.Context) {
}
// @Tags File
// @Summary Clear RecycleBin files
// @Description 清空回收站文件
// @Summary Clear Recycle Bin files
// @Accept json
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/recycle/clear [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清空回收站","formatEN":"清空回收站"}
func (b *BaseApi) ClearRecycleBinFile(c *gin.Context) {
@@ -70,11 +70,11 @@ func (b *BaseApi) ClearRecycleBinFile(c *gin.Context) {
}
// @Tags File
// @Summary Get RecycleBin status
// @Description 获取回收站状态
// @Summary Get Recycle Bin status
// @Accept json
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /files/recycle/status [get]
func (b *BaseApi) GetRecycleStatus(c *gin.Context) {
settingInfo, err := settingService.GetSettingInfo()
+11 -11
View File
@@ -10,11 +10,11 @@ import (
// @Tags Runtime
// @Summary List runtimes
// @Description 获取运行环境列表
// @Accept json
// @Param request body request.RuntimeSearch true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes/search [post]
func (b *BaseApi) SearchRuntimes(c *gin.Context) {
var req request.RuntimeSearch
@@ -34,11 +34,11 @@ func (b *BaseApi) SearchRuntimes(c *gin.Context) {
// @Tags Runtime
// @Summary Create runtime
// @Description 创建运行环境
// @Accept json
// @Param request body request.RuntimeCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建运行环境 [name]","formatEN":"Create runtime [name]"}
func (b *BaseApi) CreateRuntime(c *gin.Context) {
@@ -56,13 +56,13 @@ func (b *BaseApi) CreateRuntime(c *gin.Context) {
// @Tags Website
// @Summary Delete runtime
// @Description 删除运行环境
// @Accept json
// @Param request body request.RuntimeDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes/del [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"删除网站 [name]","formatEN":"Delete website [name]"}
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"删除运行环境 [name]","formatEN":"Delete runtime [name]"}
func (b *BaseApi) DeleteRuntime(c *gin.Context) {
var req request.RuntimeDelete
if err := helper.CheckBindAndValidate(&req, c); err != nil {
@@ -92,11 +92,11 @@ func (b *BaseApi) DeleteRuntimeCheck(c *gin.Context) {
// @Tags Runtime
// @Summary Update runtime
// @Description 更新运行环境
// @Accept json
// @Param request body request.RuntimeUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes/update [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新运行环境 [name]","formatEN":"Update runtime [name]"}
func (b *BaseApi) UpdateRuntime(c *gin.Context) {
@@ -113,11 +113,11 @@ func (b *BaseApi) UpdateRuntime(c *gin.Context) {
// @Tags Runtime
// @Summary Get runtime
// @Description 获取运行环境
// @Accept json
// @Param id path string true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes/:id [get]
func (b *BaseApi) GetRuntime(c *gin.Context) {
id, err := helper.GetIntParamByKey(c, "id")
@@ -135,11 +135,11 @@ func (b *BaseApi) GetRuntime(c *gin.Context) {
// @Tags Runtime
// @Summary Get Node package scripts
// @Description 获取 Node 项目的 scripts
// @Accept json
// @Param request body request.NodePackageReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes/node/package [post]
func (b *BaseApi) GetNodePackageRunScript(c *gin.Context) {
var req request.NodePackageReq
@@ -156,11 +156,11 @@ func (b *BaseApi) GetNodePackageRunScript(c *gin.Context) {
// @Tags Runtime
// @Summary Operate runtime
// @Description 操作运行环境
// @Accept json
// @Param request body request.RuntimeOperate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes/operate [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"操作运行环境 [name]","formatEN":"Operate runtime [name]"}
func (b *BaseApi) OperateRuntime(c *gin.Context) {
@@ -178,11 +178,11 @@ func (b *BaseApi) OperateRuntime(c *gin.Context) {
// @Tags Runtime
// @Summary Get Node modules
// @Description 获取 Node 项目的 modules
// @Accept json
// @Param request body request.NodeModuleReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes/node/modules [post]
func (b *BaseApi) GetNodeModules(c *gin.Context) {
var req request.NodeModuleReq
@@ -199,11 +199,11 @@ func (b *BaseApi) GetNodeModules(c *gin.Context) {
// @Tags Runtime
// @Summary Operate Node modules
// @Description 操作 Node 项目 modules
// @Accept json
// @Param request body request.NodeModuleReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes/node/modules/operate [post]
func (b *BaseApi) OperateNodeModules(c *gin.Context) {
var req request.NodeModuleOperateReq
@@ -220,10 +220,10 @@ func (b *BaseApi) OperateNodeModules(c *gin.Context) {
// @Tags Runtime
// @Summary Sync runtime status
// @Description 同步运行环境状态
// @Accept json
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /runtimes/sync [post]
func (b *BaseApi) SyncStatus(c *gin.Context) {
err := runtimeService.SyncRuntimeStatus()
+97 -16
View File
@@ -1,6 +1,7 @@
package v1
import (
"encoding/base64"
"errors"
"os"
"path"
@@ -15,9 +16,9 @@ import (
// @Tags System Setting
// @Summary Load system setting info
// @Description 加载系统配置信息
// @Success 200 {object} dto.SettingInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/search [post]
func (b *BaseApi) GetSettingInfo(c *gin.Context) {
setting, err := settingService.GetSettingInfo()
@@ -30,9 +31,9 @@ func (b *BaseApi) GetSettingInfo(c *gin.Context) {
// @Tags System Setting
// @Summary Load system available status
// @Description 获取系统可用状态
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/search/available [get]
func (b *BaseApi) GetSystemAvailable(c *gin.Context) {
helper.SuccessWithData(c, nil)
@@ -40,11 +41,11 @@ func (b *BaseApi) GetSystemAvailable(c *gin.Context) {
// @Tags System Setting
// @Summary Update system setting
// @Description 更新系统配置
// @Accept json
// @Param request body dto.SettingUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/update [post]
// @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统配置 [key] => [value]","formatEN":"update system setting [key] => [value]"}
func (b *BaseApi) UpdateSetting(c *gin.Context) {
@@ -60,13 +61,44 @@ func (b *BaseApi) UpdateSetting(c *gin.Context) {
helper.SuccessWithData(c, nil)
}
// @Tags System Setting
// @Summary Update proxy setting
// @Accept json
// @Param request body dto.ProxyUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/proxy/update [post]
// @x-panel-log {"bodyKeys":["proxyUrl","proxyPort"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"服务器代理配置 [proxyPort]:[proxyPort]","formatEN":"set proxy [proxyPort]:[proxyPort]."}
func (b *BaseApi) UpdateProxy(c *gin.Context) {
var req dto.ProxyUpdate
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if len(req.ProxyPasswd) != 0 && len(req.ProxyType) != 0 {
pass, err := base64.StdEncoding.DecodeString(req.ProxyPasswd)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
req.ProxyPasswd = string(pass)
}
if err := settingService.UpdateProxy(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
// @Tags System Setting
// @Summary Update system setting
// @Description 隐藏高级功能菜单
// @Accept json
// @Param request body dto.SettingUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/menu/update [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"隐藏高级功能菜单","formatEN":"Hide advanced feature menu."}
func (b *BaseApi) UpdateMenu(c *gin.Context) {
@@ -84,11 +116,11 @@ func (b *BaseApi) UpdateMenu(c *gin.Context) {
// @Tags System Setting
// @Summary Update system password
// @Description 更新系统登录密码
// @Accept json
// @Param request body dto.PasswordUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/password/update [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统密码","formatEN":"update system password"}
func (b *BaseApi) UpdatePassword(c *gin.Context) {
@@ -106,11 +138,11 @@ func (b *BaseApi) UpdatePassword(c *gin.Context) {
// @Tags System Setting
// @Summary Update system ssl
// @Description 修改系统 ssl 登录
// @Accept json
// @Param request body dto.SSLUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/ssl/update [post]
// @x-panel-log {"bodyKeys":["ssl"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统 ssl => [ssl]","formatEN":"update system ssl => [ssl]"}
func (b *BaseApi) UpdateSSL(c *gin.Context) {
@@ -128,9 +160,9 @@ func (b *BaseApi) UpdateSSL(c *gin.Context) {
// @Tags System Setting
// @Summary Load system cert info
// @Description 获取证书信息
// @Success 200 {object} dto.SettingInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/ssl/info [get]
func (b *BaseApi) LoadFromCert(c *gin.Context) {
info, err := settingService.LoadFromCert()
@@ -143,9 +175,9 @@ func (b *BaseApi) LoadFromCert(c *gin.Context) {
// @Tags System Setting
// @Summary Download system cert
// @Description 下载证书
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/ssl/download [post]
func (b *BaseApi) DownloadSSL(c *gin.Context) {
pathItem := path.Join(global.CONF.System.BaseDir, "1panel/secret/server.crt")
@@ -159,10 +191,10 @@ func (b *BaseApi) DownloadSSL(c *gin.Context) {
// @Tags System Setting
// @Summary Load system address
// @Description 获取系统地址信息
// @Accept json
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/interface [get]
func (b *BaseApi) LoadInterfaceAddr(c *gin.Context) {
data, err := settingService.LoadInterfaceAddr()
@@ -175,11 +207,11 @@ func (b *BaseApi) LoadInterfaceAddr(c *gin.Context) {
// @Tags System Setting
// @Summary Update system bind info
// @Description 更新系统监听信息
// @Accept json
// @Param request body dto.BindInfo true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/bind/update [post]
// @x-panel-log {"bodyKeys":["ipv6", "bindAddress"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统监听信息 => ipv6: [ipv6], 监听 IP: [bindAddress]","formatEN":"update system bind info => ipv6: [ipv6], 监听 IP: [bindAddress]"}
func (b *BaseApi) UpdateBindInfo(c *gin.Context) {
@@ -197,11 +229,11 @@ func (b *BaseApi) UpdateBindInfo(c *gin.Context) {
// @Tags System Setting
// @Summary Update system port
// @Description 更新系统端口
// @Accept json
// @Param request body dto.PortUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/port/update [post]
// @x-panel-log {"bodyKeys":["serverPort"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统端口 => [serverPort]","formatEN":"update system port => [serverPort]"}
func (b *BaseApi) UpdatePort(c *gin.Context) {
@@ -219,11 +251,11 @@ func (b *BaseApi) UpdatePort(c *gin.Context) {
// @Tags System Setting
// @Summary Reset system password expired
// @Description 重置过期系统登录密码
// @Accept json
// @Param request body dto.PasswordUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/expired/handle [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"重置过期密码","formatEN":"reset an expired Password"}
func (b *BaseApi) HandlePasswordExpired(c *gin.Context) {
@@ -240,10 +272,10 @@ func (b *BaseApi) HandlePasswordExpired(c *gin.Context) {
}
// @Tags System Setting
// @Summary Load local backup dir
// @Description 获取安装根目录
// @Summary Load local base dir
// @Success 200 {string} path
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/basedir [get]
func (b *BaseApi) LoadBaseDir(c *gin.Context) {
helper.SuccessWithData(c, global.CONF.System.DataDir)
@@ -251,11 +283,11 @@ func (b *BaseApi) LoadBaseDir(c *gin.Context) {
// @Tags System Setting
// @Summary Load mfa info
// @Description 获取 mfa 信息
// @Accept json
// @Param request body dto.MfaCredential true "request"
// @Success 200 {object} mfa.Otp
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/mfa [post]
func (b *BaseApi) LoadMFA(c *gin.Context) {
var req dto.MfaRequest
@@ -274,11 +306,11 @@ func (b *BaseApi) LoadMFA(c *gin.Context) {
// @Tags System Setting
// @Summary Bind mfa
// @Description Mfa 绑定
// @Accept json
// @Param request body dto.MfaCredential true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/mfa/bind [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"mfa 绑定","formatEN":"bind mfa"}
func (b *BaseApi) MFABind(c *gin.Context) {
@@ -310,3 +342,52 @@ func (b *BaseApi) MFABind(c *gin.Context) {
helper.SuccessWithData(c, nil)
}
// @Tags System Setting
// @Summary Generate api key
// @Accept json
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/api/config/generate/key [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"生成 API 接口密钥","formatEN":"generate api key"}
func (b *BaseApi) GenerateApiKey(c *gin.Context) {
panelToken := c.GetHeader("1Panel-Token")
if panelToken != "" {
helper.ErrorWithDetail(c, constant.CodeErrUnauthorized, constant.ErrApiConfigDisable, nil)
return
}
apiKey, err := settingService.GenerateApiKey()
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, apiKey)
}
// @Tags System Setting
// @Summary Update api config
// @Accept json
// @Param request body dto.ApiInterfaceConfig true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/api/config/update [post]
// @x-panel-log {"bodyKeys":["ipWhiteList"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 API 接口配置 => IP 白名单: [ipWhiteList]","formatEN":"update api config => IP White List: [ipWhiteList]"}
func (b *BaseApi) UpdateApiConfig(c *gin.Context) {
panelToken := c.GetHeader("1Panel-Token")
if panelToken != "" {
helper.ErrorWithDetail(c, constant.CodeErrUnauthorized, constant.ErrApiConfigDisable, nil)
return
}
var req dto.ApiInterfaceConfig
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := settingService.UpdateApiConfig(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, nil)
}
+34 -12
View File
@@ -9,11 +9,11 @@ import (
// @Tags System Setting
// @Summary Create system snapshot
// @Description 创建系统快照
// @Accept json
// @Param request body dto.SnapshotCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/snapshot [post]
// @x-panel-log {"bodyKeys":["from", "description"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建系统快照 [description] 到 [from]","formatEN":"Create system backup [description] to [from]"}
func (b *BaseApi) CreateSnapshot(c *gin.Context) {
@@ -31,11 +31,11 @@ func (b *BaseApi) CreateSnapshot(c *gin.Context) {
// @Tags System Setting
// @Summary Import system snapshot
// @Description 导入已有快照
// @Accept json
// @Param request body dto.SnapshotImport true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/snapshot/import [post]
// @x-panel-log {"bodyKeys":["from", "names"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"从 [from] 同步系统快照 [names]","formatEN":"Sync system snapshots [names] from [from]"}
func (b *BaseApi) ImportSnapshot(c *gin.Context) {
@@ -53,11 +53,11 @@ func (b *BaseApi) ImportSnapshot(c *gin.Context) {
// @Tags System Setting
// @Summary Load Snapshot status
// @Description 获取快照状态
// @Accept json
// @Param request body dto.OperateByID true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/snapshot/status [post]
func (b *BaseApi) LoadSnapShotStatus(c *gin.Context) {
var req dto.OperateByID
@@ -75,11 +75,11 @@ func (b *BaseApi) LoadSnapShotStatus(c *gin.Context) {
// @Tags System Setting
// @Summary Update snapshot description
// @Description 更新快照描述信息
// @Accept json
// @Param request body dto.UpdateDescription true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/snapshot/description/update [post]
// @x-panel-log {"bodyKeys":["id","description"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"snapshots","output_column":"name","output_value":"name"}],"formatZH":"快照 [name] 描述信息修改 [description]","formatEN":"The description of the snapshot [name] is modified => [description]"}
func (b *BaseApi) UpdateSnapDescription(c *gin.Context) {
@@ -97,14 +97,14 @@ func (b *BaseApi) UpdateSnapDescription(c *gin.Context) {
// @Tags System Setting
// @Summary Page system snapshot
// @Description 获取系统快照列表分页
// @Accept json
// @Param request body dto.SearchWithPage true "request"
// @Param request body dto.PageSnapshot true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/snapshot/search [post]
func (b *BaseApi) SearchSnapshot(c *gin.Context) {
var req dto.SearchWithPage
var req dto.PageSnapshot
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
@@ -120,13 +120,35 @@ func (b *BaseApi) SearchSnapshot(c *gin.Context) {
})
}
// @Tags System Setting
// @Summary Load system snapshot size
// @Accept json
// @Param request body dto.PageSnapshot true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/snapshot/size [post]
func (b *BaseApi) LoadSnapshotSize(c *gin.Context) {
var req dto.PageSnapshot
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
data, err := snapshotService.LoadSize(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, data)
}
// @Tags System Setting
// @Summary Recover system backup
// @Description 从系统快照恢复
// @Accept json
// @Param request body dto.SnapshotRecover true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/snapshot/recover [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"snapshots","output_column":"name","output_value":"name"}],"formatZH":"从系统快照 [name] 恢复","formatEN":"Recover from system backup [name]"}
func (b *BaseApi) RecoverSnapshot(c *gin.Context) {
@@ -144,11 +166,11 @@ func (b *BaseApi) RecoverSnapshot(c *gin.Context) {
// @Tags System Setting
// @Summary Rollback system backup
// @Description 从系统快照回滚
// @Accept json
// @Param request body dto.SnapshotRecover true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/snapshot/rollback [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"snapshots","output_column":"name","output_value":"name"}],"formatZH":"从系统快照 [name] 回滚","formatEN":"Rollback from system backup [name]"}
func (b *BaseApi) RollbackSnapshot(c *gin.Context) {
@@ -166,15 +188,15 @@ func (b *BaseApi) RollbackSnapshot(c *gin.Context) {
// @Tags System Setting
// @Summary Delete system backup
// @Description 删除系统快照
// @Accept json
// @Param request body dto.BatchDeleteReq true "request"
// @Param request body dto.SnapshotBatchDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/snapshot/del [post]
// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ids","isList":true,"db":"snapshots","output_column":"name","output_value":"name"}],"formatZH":"删除系统快照 [name]","formatEN":"Delete system backup [name]"}
func (b *BaseApi) DeleteSnapshot(c *gin.Context) {
var req dto.BatchDeleteReq
var req dto.SnapshotBatchDelete
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
+9 -9
View File
@@ -9,9 +9,9 @@ import (
// @Tags SSH
// @Summary Load host SSH setting info
// @Description 加载 SSH 配置信息
// @Success 200 {object} dto.SSHInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/ssh/search [post]
func (b *BaseApi) GetSSHInfo(c *gin.Context) {
info, err := sshService.GetSSHInfo()
@@ -24,10 +24,10 @@ func (b *BaseApi) GetSSHInfo(c *gin.Context) {
// @Tags SSH
// @Summary Operate SSH
// @Description 修改 SSH 服务状态
// @Accept json
// @Param request body dto.Operate true "request"
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/ssh/operate [post]
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] SSH ","formatEN":"[operation] SSH"}
func (b *BaseApi) OperateSSH(c *gin.Context) {
@@ -45,11 +45,11 @@ func (b *BaseApi) OperateSSH(c *gin.Context) {
// @Tags SSH
// @Summary Update host SSH setting
// @Description 更新 SSH 配置
// @Accept json
// @Param request body dto.SSHUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/ssh/update [post]
// @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 SSH 配置 [key] => [value]","formatEN":"update SSH setting [key] => [value]"}
func (b *BaseApi) UpdateSSH(c *gin.Context) {
@@ -67,11 +67,11 @@ func (b *BaseApi) UpdateSSH(c *gin.Context) {
// @Tags SSH
// @Summary Update host SSH setting by file
// @Description 上传文件更新 SSH 配置
// @Accept json
// @Param request body dto.SSHConf true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/conffile/update [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 SSH 配置文件","formatEN":"update SSH conf"}
func (b *BaseApi) UpdateSSHByfile(c *gin.Context) {
@@ -89,11 +89,11 @@ func (b *BaseApi) UpdateSSHByfile(c *gin.Context) {
// @Tags SSH
// @Summary Generate host SSH secret
// @Description 生成 SSH 密钥
// @Accept json
// @Param request body dto.GenerateSSH true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/ssh/generate [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"生成 SSH 密钥 ","formatEN":"generate SSH secret"}
func (b *BaseApi) GenerateSSH(c *gin.Context) {
@@ -111,11 +111,11 @@ func (b *BaseApi) GenerateSSH(c *gin.Context) {
// @Tags SSH
// @Summary Load host SSH secret
// @Description 获取 SSH 密钥
// @Accept json
// @Param request body dto.GenerateLoad true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/ssh/secret [post]
func (b *BaseApi) LoadSSHSecret(c *gin.Context) {
var req dto.GenerateLoad
@@ -133,11 +133,11 @@ func (b *BaseApi) LoadSSHSecret(c *gin.Context) {
// @Tags SSH
// @Summary Load host SSH logs
// @Description 获取 SSH 登录日志
// @Accept json
// @Param request body dto.SearchSSHLog true "request"
// @Success 200 {object} dto.SSHLog
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/ssh/log [post]
func (b *BaseApi) LoadSSHLogs(c *gin.Context) {
var req dto.SearchSSHLog
@@ -145,7 +145,7 @@ func (b *BaseApi) LoadSSHLogs(c *gin.Context) {
return
}
data, err := sshService.LoadLog(req)
data, err := sshService.LoadLog(c, req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
@@ -155,9 +155,9 @@ func (b *BaseApi) LoadSSHLogs(c *gin.Context) {
// @Tags SSH
// @Summary Load host SSH conf
// @Description 获取 SSH 配置文件
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /host/ssh/conf [get]
func (b *BaseApi) LoadSSHConf(c *gin.Context) {
data, err := sshService.LoadSSHConf()
+40 -10
View File
@@ -3,11 +3,13 @@ package v1
import (
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"strconv"
"strings"
"time"
"github.com/1Panel-dev/1Panel/backend/app/dto"
"github.com/1Panel-dev/1Panel/backend/global"
"github.com/1Panel-dev/1Panel/backend/utils/cmd"
"github.com/1Panel-dev/1Panel/backend/utils/copier"
@@ -77,6 +79,13 @@ func (b *BaseApi) RedisWsSsh(c *gin.Context) {
global.LOG.Errorf("gin context http handler failed, err: %v", err)
return
}
defer wsConn.Close()
if global.CONF.System.IsDemo {
if wshandleError(wsConn, errors.New(" demo server, prohibit this operation!")) {
return
}
}
cols, err := strconv.Atoi(c.DefaultQuery("cols", "80"))
if wshandleError(wsConn, errors.WithMessage(err, "invalid param cols in request")) {
@@ -86,23 +95,38 @@ func (b *BaseApi) RedisWsSsh(c *gin.Context) {
if wshandleError(wsConn, errors.WithMessage(err, "invalid param rows in request")) {
return
}
redisConf, err := redisService.LoadConf()
if wshandleError(wsConn, errors.WithMessage(err, "load redis container failed")) {
name := c.Query("name")
from := c.Query("from")
commands := []string{"redis-cli"}
database, err := databaseService.Get(name)
if wshandleError(wsConn, errors.WithMessage(err, "no such database in db")) {
return
}
defer wsConn.Close()
commands := []string{"redis-cli"}
if len(redisConf.Requirepass) != 0 {
commands = []string{"redis-cli", "-a", redisConf.Requirepass, "--no-auth-warning"}
if from == "local" {
redisInfo, err := appInstallService.LoadConnInfo(dto.OperationWithNameAndType{Name: name, Type: "redis"})
if wshandleError(wsConn, errors.WithMessage(err, "no such database in db")) {
return
}
name = redisInfo.ContainerName
if len(database.Password) != 0 {
commands = []string{"redis-cli", "-a", database.Password, "--no-auth-warning"}
}
} else {
itemPort := fmt.Sprintf("%v", database.Port)
commands = []string{"redis-cli", "-h", database.Address, "-p", itemPort}
if len(database.Password) != 0 {
commands = []string{"redis-cli", "-h", database.Address, "-p", itemPort, "-a", database.Password, "--no-auth-warning"}
}
name = "1Panel-redis-cli-tools"
}
pidMap := loadMapFromDockerTop(redisConf.ContainerName)
itemCmds := append([]string{"exec", "-it", redisConf.ContainerName}, commands...)
pidMap := loadMapFromDockerTop(name)
itemCmds := append([]string{"exec", "-it", name}, commands...)
slave, err := terminal.NewCommand(itemCmds)
if wshandleError(wsConn, err) {
return
}
defer killBash(redisConf.ContainerName, strings.Join(commands, " "), pidMap)
defer killBash(name, strings.Join(commands, " "), pidMap)
defer slave.Close()
tty, err := terminal.NewLocalWsSession(cols, rows, wsConn, slave, false)
@@ -130,6 +154,12 @@ func (b *BaseApi) ContainerWsSsh(c *gin.Context) {
}
defer wsConn.Close()
if global.CONF.System.IsDemo {
if wshandleError(wsConn, errors.New(" demo server, prohibit this operation!")) {
return
}
}
containerID := c.Query("containerid")
command := c.Query("command")
user := c.Query("user")
+3 -3
View File
@@ -9,9 +9,9 @@ import (
// @Tags System Setting
// @Summary Load upgrade info
// @Description 系统更新信息
// @Success 200 {object} dto.UpgradeInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/upgrade [get]
func (b *BaseApi) GetUpgradeInfo(c *gin.Context) {
info, err := upgradeService.SearchUpgrade()
@@ -24,11 +24,11 @@ func (b *BaseApi) GetUpgradeInfo(c *gin.Context) {
// @Tags System Setting
// @Summary Load release notes by version
// @Description 获取版本 release notes
// @Accept json
// @Param request body dto.Upgrade true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/upgrade [get]
func (b *BaseApi) GetNotesByVersion(c *gin.Context) {
var req dto.Upgrade
@@ -46,11 +46,11 @@ func (b *BaseApi) GetNotesByVersion(c *gin.Context) {
// @Tags System Setting
// @Summary Upgrade
// @Description 系统更新
// @Accept json
// @Param request body dto.Upgrade true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/upgrade [post]
// @x-panel-log {"bodyKeys":["version"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新系统 => [version]","formatEN":"upgrade system => [version]"}
func (b *BaseApi) Upgrade(c *gin.Context) {
+89 -37
View File
@@ -1,6 +1,8 @@
package v1
import (
"encoding/base64"
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
"github.com/1Panel-dev/1Panel/backend/app/dto"
"github.com/1Panel-dev/1Panel/backend/app/dto/request"
@@ -10,11 +12,11 @@ import (
// @Tags Website
// @Summary Page websites
// @Description 获取网站列表分页
// @Accept json
// @Param request body request.WebsiteSearch true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/search [post]
func (b *BaseApi) PageWebsite(c *gin.Context) {
var req request.WebsiteSearch
@@ -34,9 +36,9 @@ func (b *BaseApi) PageWebsite(c *gin.Context) {
// @Tags Website
// @Summary List websites
// @Description 获取网站列表
// @Success 200 {array} response.WebsiteDTO
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/list [get]
func (b *BaseApi) GetWebsites(c *gin.Context) {
websites, err := websiteService.GetWebsites()
@@ -49,9 +51,9 @@ func (b *BaseApi) GetWebsites(c *gin.Context) {
// @Tags Website
// @Summary List website names
// @Description 获取网站列表
// @Success 200 {array} string
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/options [get]
func (b *BaseApi) GetWebsiteOptions(c *gin.Context) {
websites, err := websiteService.GetWebsiteOptions()
@@ -64,11 +66,11 @@ func (b *BaseApi) GetWebsiteOptions(c *gin.Context) {
// @Tags Website
// @Summary Create website
// @Description 创建网站
// @Accept json
// @Param request body request.WebsiteCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites [post]
// @x-panel-log {"bodyKeys":["primaryDomain"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 [primaryDomain]","formatEN":"Create website [primaryDomain]"}
func (b *BaseApi) CreateWebsite(c *gin.Context) {
@@ -76,6 +78,14 @@ func (b *BaseApi) CreateWebsite(c *gin.Context) {
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if len(req.FtpPassword) != 0 {
pass, err := base64.StdEncoding.DecodeString(req.FtpPassword)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
req.FtpPassword = string(pass)
}
err := websiteService.CreateWebsite(req)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
@@ -86,11 +96,11 @@ func (b *BaseApi) CreateWebsite(c *gin.Context) {
// @Tags Website
// @Summary Operate website
// @Description 操作网站
// @Accept json
// @Param request body request.WebsiteOp true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/operate [post]
// @x-panel-log {"bodyKeys":["id", "operate"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"[operate] 网站 [domain]","formatEN":"[operate] website [domain]"}
func (b *BaseApi) OpWebsite(c *gin.Context) {
@@ -108,11 +118,11 @@ func (b *BaseApi) OpWebsite(c *gin.Context) {
// @Tags Website
// @Summary Delete website
// @Description 删除网站
// @Accept json
// @Param request body request.WebsiteDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/del [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"删除网站 [domain]","formatEN":"Delete website [domain]"}
func (b *BaseApi) DeleteWebsite(c *gin.Context) {
@@ -130,11 +140,11 @@ func (b *BaseApi) DeleteWebsite(c *gin.Context) {
// @Tags Website
// @Summary Update website
// @Description 更新网站
// @Accept json
// @Param request body request.WebsiteUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/update [post]
// @x-panel-log {"bodyKeys":["primaryDomain"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新网站 [primaryDomain]","formatEN":"Update website [primaryDomain]"}
func (b *BaseApi) UpdateWebsite(c *gin.Context) {
@@ -151,11 +161,11 @@ func (b *BaseApi) UpdateWebsite(c *gin.Context) {
// @Tags Website
// @Summary Search website by id
// @Description 通过 id 查询网站
// @Accept json
// @Param id path integer true "request"
// @Success 200 {object} response.WebsiteDTO
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/:id [get]
func (b *BaseApi) GetWebsite(c *gin.Context) {
id, err := helper.GetParamID(c)
@@ -173,11 +183,11 @@ func (b *BaseApi) GetWebsite(c *gin.Context) {
// @Tags Website Nginx
// @Summary Search website nginx by id
// @Description 通过 id 查询网站 nginx
// @Accept json
// @Param id path integer true "request"
// @Success 200 {object} response.FileInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/:id/config/:type [get]
func (b *BaseApi) GetWebsiteNginx(c *gin.Context) {
id, err := helper.GetParamID(c)
@@ -197,11 +207,11 @@ func (b *BaseApi) GetWebsiteNginx(c *gin.Context) {
// @Tags Website Nginx
// @Summary Load nginx conf
// @Description 获取 nginx 配置
// @Accept json
// @Param request body request.NginxScopeReq true "request"
// @Success 200 {object} response.WebsiteNginxConfig
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/config [post]
func (b *BaseApi) GetNginxConfig(c *gin.Context) {
var req request.NginxScopeReq
@@ -218,11 +228,11 @@ func (b *BaseApi) GetNginxConfig(c *gin.Context) {
// @Tags Website Nginx
// @Summary Update nginx conf
// @Description 更新 nginx 配置
// @Accept json
// @Param request body request.NginxConfigUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/config/update [post]
// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"websiteId","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"nginx 配置修改 [domain]","formatEN":"Nginx conf update [domain]"}
func (b *BaseApi) UpdateNginxConfig(c *gin.Context) {
@@ -239,11 +249,11 @@ func (b *BaseApi) UpdateNginxConfig(c *gin.Context) {
// @Tags Website HTTPS
// @Summary Load https conf
// @Description 获取 https 配置
// @Accept json
// @Param id path integer true "request"
// @Success 200 {object} response.WebsiteHTTPS
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/:id/https [get]
func (b *BaseApi) GetHTTPSConfig(c *gin.Context) {
id, err := helper.GetParamID(c)
@@ -261,11 +271,11 @@ func (b *BaseApi) GetHTTPSConfig(c *gin.Context) {
// @Tags Website HTTPS
// @Summary Update https conf
// @Description 更新 https 配置
// @Accept json
// @Param request body request.WebsiteHTTPSOp true "request"
// @Success 200 {object} response.WebsiteHTTPS
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/:id/https [post]
// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"websiteId","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"更新网站 [domain] https 配置","formatEN":"Update website https [domain] conf"}
func (b *BaseApi) UpdateHTTPSConfig(c *gin.Context) {
@@ -286,11 +296,11 @@ func (b *BaseApi) UpdateHTTPSConfig(c *gin.Context) {
// @Tags Website
// @Summary Check before create website
// @Description 网站创建前检查
// @Accept json
// @Param request body request.WebsiteInstallCheckReq true "request"
// @Success 200 {array} response.WebsitePreInstallCheck
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/check [post]
func (b *BaseApi) CreateWebsiteCheck(c *gin.Context) {
var req request.WebsiteInstallCheckReq
@@ -307,11 +317,11 @@ func (b *BaseApi) CreateWebsiteCheck(c *gin.Context) {
// @Tags Website Nginx
// @Summary Update website nginx conf
// @Description 更新 网站 nginx 配置
// @Accept json
// @Param request body request.WebsiteNginxUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/nginx/update [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"[domain] Nginx 配置修改","formatEN":"[domain] Nginx conf update"}
func (b *BaseApi) UpdateWebsiteNginxConfig(c *gin.Context) {
@@ -328,11 +338,11 @@ func (b *BaseApi) UpdateWebsiteNginxConfig(c *gin.Context) {
// @Tags Website
// @Summary Operate website log
// @Description 操作网站日志
// @Accept json
// @Param request body request.WebsiteLogReq true "request"
// @Success 200 {object} response.WebsiteLog
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/log [post]
// @x-panel-log {"bodyKeys":["id", "operate"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"[domain][operate] 日志","formatEN":"[domain][operate] logs"}
func (b *BaseApi) OpWebsiteLog(c *gin.Context) {
@@ -350,11 +360,11 @@ func (b *BaseApi) OpWebsiteLog(c *gin.Context) {
// @Tags Website
// @Summary Change default server
// @Description 操作网站日志
// @Accept json
// @Param request body request.WebsiteDefaultUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/default/server [post]
// @x-panel-log {"bodyKeys":["id", "operate"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"修改默认 server => [domain]","formatEN":"Change default server => [domain]"}
func (b *BaseApi) ChangeDefaultServer(c *gin.Context) {
@@ -371,11 +381,11 @@ func (b *BaseApi) ChangeDefaultServer(c *gin.Context) {
// @Tags Website
// @Summary Load website php conf
// @Description 获取网站 php 配置
// @Accept json
// @Param id path integer true "request"
// @Success 200 {object} response.PHPConfig
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/php/config/:id [get]
func (b *BaseApi) GetWebsitePHPConfig(c *gin.Context) {
id, err := helper.GetParamID(c)
@@ -393,11 +403,11 @@ func (b *BaseApi) GetWebsitePHPConfig(c *gin.Context) {
// @Tags Website PHP
// @Summary Update website php conf
// @Description 更新 网站 PHP 配置
// @Accept json
// @Param request body request.WebsitePHPConfigUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/php/config [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"[domain] PHP 配置修改","formatEN":"[domain] PHP conf update"}
func (b *BaseApi) UpdateWebsitePHPConfig(c *gin.Context) {
@@ -414,11 +424,11 @@ func (b *BaseApi) UpdateWebsitePHPConfig(c *gin.Context) {
// @Tags Website PHP
// @Summary Update php conf
// @Description 更新 php 配置文件
// @Accept json
// @Param request body request.WebsitePHPFileUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/php/update [post]
// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"websiteId","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"php 配置修改 [domain]","formatEN":"Nginx conf update [domain]"}
func (b *BaseApi) UpdatePHPFile(c *gin.Context) {
@@ -435,11 +445,11 @@ func (b *BaseApi) UpdatePHPFile(c *gin.Context) {
// @Tags Website PHP
// @Summary Update php version
// @Description 变更 php 版本
// @Accept json
// @Param request body request.WebsitePHPVersionReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/php/version [post]
// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"websiteId","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"php 版本变更 [domain]","formatEN":"php version update [domain]"}
func (b *BaseApi) ChangePHPVersion(c *gin.Context) {
@@ -456,11 +466,11 @@ func (b *BaseApi) ChangePHPVersion(c *gin.Context) {
// @Tags Website
// @Summary Get rewrite conf
// @Description 获取伪静态配置
// @Accept json
// @Param request body request.NginxRewriteReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/rewrite [post]
func (b *BaseApi) GetRewriteConfig(c *gin.Context) {
var req request.NginxRewriteReq
@@ -477,11 +487,11 @@ func (b *BaseApi) GetRewriteConfig(c *gin.Context) {
// @Tags Website
// @Summary Update rewrite conf
// @Description 更新伪静态配置
// @Accept json
// @Param request body request.NginxRewriteUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/rewrite/update [post]
// @x-panel-log {"bodyKeys":["websiteID"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"websiteID","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"伪静态配置修改 [domain]","formatEN":"Nginx conf rewrite update [domain]"}
func (b *BaseApi) UpdateRewriteConfig(c *gin.Context) {
@@ -498,11 +508,11 @@ func (b *BaseApi) UpdateRewriteConfig(c *gin.Context) {
// @Tags Website
// @Summary Update Site Dir
// @Description 更新网站目录
// @Accept json
// @Param request body request.WebsiteUpdateDir true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/dir/update [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"更新网站 [domain] 目录","formatEN":"Update domain [domain] dir"}
func (b *BaseApi) UpdateSiteDir(c *gin.Context) {
@@ -519,11 +529,11 @@ func (b *BaseApi) UpdateSiteDir(c *gin.Context) {
// @Tags Website
// @Summary Update Site Dir permission
// @Description 更新网站目录权限
// @Accept json
// @Param request body request.WebsiteUpdateDirPermission true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/dir/permission [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"更新网站 [domain] 目录权限","formatEN":"Update domain [domain] dir permission"}
func (b *BaseApi) UpdateSiteDirPermission(c *gin.Context) {
@@ -540,11 +550,11 @@ func (b *BaseApi) UpdateSiteDirPermission(c *gin.Context) {
// @Tags Website
// @Summary Get proxy conf
// @Description 获取反向代理配置
// @Accept json
// @Param request body request.WebsiteProxyReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/proxies [post]
func (b *BaseApi) GetProxyConfig(c *gin.Context) {
var req request.WebsiteProxyReq
@@ -561,11 +571,11 @@ func (b *BaseApi) GetProxyConfig(c *gin.Context) {
// @Tags Website
// @Summary Update proxy conf
// @Description 修改反向代理配置
// @Accept json
// @Param request body request.WebsiteProxyConfig true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/proxies/update [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"修改网站 [domain] 反向代理配置 ","formatEN":"Update domain [domain] proxy config"}
func (b *BaseApi) UpdateProxyConfig(c *gin.Context) {
@@ -583,11 +593,11 @@ func (b *BaseApi) UpdateProxyConfig(c *gin.Context) {
// @Tags Website
// @Summary Update proxy file
// @Description 更新反向代理文件
// @Accept json
// @Param request body request.NginxProxyUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/proxy/file [post]
// @x-panel-log {"bodyKeys":["websiteID"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"websiteID","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"更新反向代理文件 [domain]","formatEN":"Nginx conf proxy file update [domain]"}
func (b *BaseApi) UpdateProxyConfigFile(c *gin.Context) {
@@ -604,11 +614,11 @@ func (b *BaseApi) UpdateProxyConfigFile(c *gin.Context) {
// @Tags Website
// @Summary Get AuthBasic conf
// @Description 获取密码访问配置
// @Accept json
// @Param request body request.NginxAuthReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/auths [post]
func (b *BaseApi) GetAuthConfig(c *gin.Context) {
var req request.NginxAuthReq
@@ -625,11 +635,11 @@ func (b *BaseApi) GetAuthConfig(c *gin.Context) {
// @Tags Website
// @Summary Get AuthBasic conf
// @Description 更新密码访问配置
// @Accept json
// @Param request body request.NginxAuthUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/auths/update [post]
func (b *BaseApi) UpdateAuthConfig(c *gin.Context) {
var req request.NginxAuthUpdate
@@ -645,11 +655,11 @@ func (b *BaseApi) UpdateAuthConfig(c *gin.Context) {
// @Tags Website
// @Summary Get AntiLeech conf
// @Description 获取防盗链配置
// @Accept json
// @Param request body request.NginxCommonReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/leech [post]
func (b *BaseApi) GetAntiLeech(c *gin.Context) {
var req request.NginxCommonReq
@@ -665,12 +675,12 @@ func (b *BaseApi) GetAntiLeech(c *gin.Context) {
}
// @Tags Website
// @Summary Update AntiLeech
// @Description 更新防盗链配置
// @Summary Update AntiLeech conf
// @Accept json
// @Param request body request.NginxAntiLeechUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/leech/update [post]
func (b *BaseApi) UpdateAntiLeech(c *gin.Context) {
var req request.NginxAntiLeechUpdate
@@ -686,11 +696,11 @@ func (b *BaseApi) UpdateAntiLeech(c *gin.Context) {
// @Tags Website
// @Summary Update redirect conf
// @Description 修改重定向配置
// @Accept json
// @Param request body request.NginxRedirectReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/redirect/update [post]
// @x-panel-log {"bodyKeys":["websiteID"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"websiteID","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"修改网站 [domain] 重定向理配置 ","formatEN":"Update domain [domain] redirect config"}
func (b *BaseApi) UpdateRedirectConfig(c *gin.Context) {
@@ -708,11 +718,11 @@ func (b *BaseApi) UpdateRedirectConfig(c *gin.Context) {
// @Tags Website
// @Summary Get redirect conf
// @Description 获取重定向配置
// @Accept json
// @Param request body request.WebsiteProxyReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/redirect [post]
func (b *BaseApi) GetRedirectConfig(c *gin.Context) {
var req request.WebsiteRedirectReq
@@ -729,11 +739,11 @@ func (b *BaseApi) GetRedirectConfig(c *gin.Context) {
// @Tags Website
// @Summary Update redirect file
// @Description 更新重定向文件
// @Accept json
// @Param request body request.NginxRedirectUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/redirect/file [post]
// @x-panel-log {"bodyKeys":["websiteID"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"websiteID","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"更新重定向文件 [domain]","formatEN":"Nginx conf redirect file update [domain]"}
func (b *BaseApi) UpdateRedirectConfigFile(c *gin.Context) {
@@ -750,11 +760,11 @@ func (b *BaseApi) UpdateRedirectConfigFile(c *gin.Context) {
// @Tags Website
// @Summary Get website dir
// @Description 获取网站目录配置
// @Accept json
// @Param request body request.WebsiteCommonReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/dir [post]
func (b *BaseApi) GetDirConfig(c *gin.Context) {
var req request.WebsiteCommonReq
@@ -768,3 +778,45 @@ func (b *BaseApi) GetDirConfig(c *gin.Context) {
}
helper.SuccessWithData(c, res)
}
// @Tags Website
// @Summary Get default html
// @Accept json
// @Success 200 {object} response.FileInfo
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/default/html/:type [get]
func (b *BaseApi) GetDefaultHtml(c *gin.Context) {
resourceType, err := helper.GetStrParamByKey(c, "type")
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInternalServer, nil)
return
}
fileInfo, err := websiteService.GetDefaultHtml(resourceType)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, fileInfo)
}
// @Tags Website
// @Summary Update default html
// @Accept json
// @Param request body request.WebsiteHtmlUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/default/html/update [post]
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新默认 html","formatEN":"Update default html"}
func (b *BaseApi) UpdateDefaultHtml(c *gin.Context) {
var req request.WebsiteHtmlUpdate
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
if err := websiteService.UpdateDefaultHtml(req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithOutData(c)
}
+3 -3
View File
@@ -10,11 +10,11 @@ import (
// @Tags Website Acme
// @Summary Page website acme accounts
// @Description 获取网站 acme 列表分页
// @Accept json
// @Param request body dto.PageInfo true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/acme/search [post]
func (b *BaseApi) PageWebsiteAcmeAccount(c *gin.Context) {
var req dto.PageInfo
@@ -34,11 +34,11 @@ func (b *BaseApi) PageWebsiteAcmeAccount(c *gin.Context) {
// @Tags Website Acme
// @Summary Create website acme account
// @Description 创建网站 acme
// @Accept json
// @Param request body request.WebsiteAcmeAccountCreate true "request"
// @Success 200 {object} response.WebsiteAcmeAccountDTO
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/acme [post]
// @x-panel-log {"bodyKeys":["email"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 acme [email]","formatEN":"Create website acme [email]"}
func (b *BaseApi) CreateWebsiteAcmeAccount(c *gin.Context) {
@@ -56,11 +56,11 @@ func (b *BaseApi) CreateWebsiteAcmeAccount(c *gin.Context) {
// @Tags Website Acme
// @Summary Delete website acme account
// @Description 删除网站 acme
// @Accept json
// @Param request body request.WebsiteResourceReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/acme/del [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_acme_accounts","output_column":"email","output_value":"email"}],"formatZH":"删除网站 acme [email]","formatEN":"Delete website acme [email]"}
func (b *BaseApi) DeleteWebsiteAcmeAccount(c *gin.Context) {
+40 -7
View File
@@ -6,15 +6,18 @@ import (
"github.com/1Panel-dev/1Panel/backend/app/dto/request"
"github.com/1Panel-dev/1Panel/backend/constant"
"github.com/gin-gonic/gin"
"net/http"
"net/url"
"strconv"
)
// @Tags Website CA
// @Summary Page website ca
// @Description 获取网站 ca 列表分页
// @Accept json
// @Param request body request.WebsiteCASearch true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ca/search [post]
func (b *BaseApi) PageWebsiteCA(c *gin.Context) {
var req request.WebsiteCASearch
@@ -34,11 +37,11 @@ func (b *BaseApi) PageWebsiteCA(c *gin.Context) {
// @Tags Website CA
// @Summary Create website ca
// @Description 创建网站 ca
// @Accept json
// @Param request body request.WebsiteCACreate true "request"
// @Success 200 {object} request.WebsiteCACreate
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ca [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 ca [name]","formatEN":"Create website ca [name]"}
func (b *BaseApi) CreateWebsiteCA(c *gin.Context) {
@@ -56,11 +59,11 @@ func (b *BaseApi) CreateWebsiteCA(c *gin.Context) {
// @Tags Website CA
// @Summary Get website ca
// @Description 获取网站 ca
// @Accept json
// @Param id path int true "id"
// @Success 200 {object} response.WebsiteCADTO
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ca/{id} [get]
func (b *BaseApi) GetWebsiteCA(c *gin.Context) {
id, err := helper.GetParamID(c)
@@ -77,11 +80,11 @@ func (b *BaseApi) GetWebsiteCA(c *gin.Context) {
// @Tags Website CA
// @Summary Delete website ca
// @Description 删除网站 ca
// @Accept json
// @Param request body request.WebsiteCommonReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ca/del [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_cas","output_column":"name","output_value":"name"}],"formatZH":"删除网站 ca [name]","formatEN":"Delete website ca [name]"}
func (b *BaseApi) DeleteWebsiteCA(c *gin.Context) {
@@ -98,11 +101,11 @@ func (b *BaseApi) DeleteWebsiteCA(c *gin.Context) {
// @Tags Website CA
// @Summary Obtain SSL
// @Description 自签 SSL 证书
// @Accept json
// @Param request body request.WebsiteCAObtain true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ca/obtain [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_cas","output_column":"name","output_value":"name"}],"formatZH":"自签 SSL 证书 [name]","formatEN":"Obtain SSL [name]"}
func (b *BaseApi) ObtainWebsiteCA(c *gin.Context) {
@@ -118,12 +121,12 @@ func (b *BaseApi) ObtainWebsiteCA(c *gin.Context) {
}
// @Tags Website CA
// @Summary Obtain SSL
// @Description 续签 SSL 证书
// @Summary Renew Obtain SSL
// @Accept json
// @Param request body request.WebsiteCAObtain true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ca/renew [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_cas","output_column":"name","output_value":"name"}],"formatZH":"自签 SSL 证书 [name]","formatEN":"Obtain SSL [name]"}
func (b *BaseApi) RenewWebsiteCA(c *gin.Context) {
@@ -142,3 +145,33 @@ func (b *BaseApi) RenewWebsiteCA(c *gin.Context) {
}
helper.SuccessWithOutData(c)
}
// @Tags Website CA
// @Summary Download CA file
// @Accept json
// @Param request body request.WebsiteResourceReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ca/download [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_cas","output_column":"name","output_value":"name"}],"formatZH":"下载 CA 证书文件 [name]","formatEN":"download ca file [name]"}
func (b *BaseApi) DownloadCAFile(c *gin.Context) {
var req request.WebsiteResourceReq
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
file, err := websiteCAService.DownloadFile(req.ID)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
defer file.Close()
info, err := file.Stat()
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
c.Header("Content-Length", strconv.FormatInt(info.Size(), 10))
c.Header("Content-Disposition", "attachment; filename*=utf-8''"+url.PathEscape(info.Name()))
http.ServeContent(c.Writer, c.Request, info.Name(), info.ModTime(), file)
}
+4 -4
View File
@@ -10,11 +10,11 @@ import (
// @Tags Website DNS
// @Summary Page website dns accounts
// @Description 获取网站 dns 列表分页
// @Accept json
// @Param request body dto.PageInfo true "request"
// @Success 200 {object} dto.PageResult
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/dns/search [post]
func (b *BaseApi) PageWebsiteDnsAccount(c *gin.Context) {
var req dto.PageInfo
@@ -34,11 +34,11 @@ func (b *BaseApi) PageWebsiteDnsAccount(c *gin.Context) {
// @Tags Website DNS
// @Summary Create website dns account
// @Description 创建网站 dns
// @Accept json
// @Param request body request.WebsiteDnsAccountCreate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/dns [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 dns [name]","formatEN":"Create website dns [name]"}
func (b *BaseApi) CreateWebsiteDnsAccount(c *gin.Context) {
@@ -55,11 +55,11 @@ func (b *BaseApi) CreateWebsiteDnsAccount(c *gin.Context) {
// @Tags Website DNS
// @Summary Update website dns account
// @Description 更新网站 dns
// @Accept json
// @Param request body request.WebsiteDnsAccountUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/dns/update [post]
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新网站 dns [name]","formatEN":"Update website dns [name]"}
func (b *BaseApi) UpdateWebsiteDnsAccount(c *gin.Context) {
@@ -76,11 +76,11 @@ func (b *BaseApi) UpdateWebsiteDnsAccount(c *gin.Context) {
// @Tags Website DNS
// @Summary Delete website dns account
// @Description 删除网站 dns
// @Accept json
// @Param request body request.WebsiteResourceReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/dns/del [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_dns_accounts","output_column":"name","output_value":"name"}],"formatZH":"删除网站 dns [name]","formatEN":"Delete website dns [name]"}
func (b *BaseApi) DeleteWebsiteDnsAccount(c *gin.Context) {
+3 -3
View File
@@ -9,11 +9,11 @@ import (
// @Tags Website Domain
// @Summary Delete website domain
// @Description 删除网站域名
// @Accept json
// @Param request body request.WebsiteDomainDelete true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/domains/del [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_domains","output_column":"domain","output_value":"domain"}],"formatZH":"删除域名 [domain]","formatEN":"Delete domain [domain]"}
func (b *BaseApi) DeleteWebDomain(c *gin.Context) {
@@ -30,11 +30,11 @@ func (b *BaseApi) DeleteWebDomain(c *gin.Context) {
// @Tags Website Domain
// @Summary Create website domain
// @Description 创建网站域名
// @Accept json
// @Param request body request.WebsiteDomainCreate true "request"
// @Success 200 {object} model.WebsiteDomain
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/domains [post]
// @x-panel-log {"bodyKeys":["domain"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建域名 [domain]","formatEN":"Create domain [domain]"}
func (b *BaseApi) CreateWebDomain(c *gin.Context) {
@@ -52,11 +52,11 @@ func (b *BaseApi) CreateWebDomain(c *gin.Context) {
// @Tags Website Domain
// @Summary Search website domains by websiteId
// @Description 通过网站 id 查询域名
// @Accept json
// @Param websiteId path integer true "request"
// @Success 200 {array} model.WebsiteDomain
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/domains/:websiteId [get]
func (b *BaseApi) GetWebDomains(c *gin.Context) {
websiteId, err := helper.GetIntParamByKey(c, "websiteId")
+14 -13
View File
@@ -15,11 +15,11 @@ import (
// @Tags Website SSL
// @Summary Page website ssl
// @Description 获取网站 ssl 列表分页
// @Accept json
// @Param request body request.WebsiteSSLSearch true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ssl/search [post]
func (b *BaseApi) PageWebsiteSSL(c *gin.Context) {
var req request.WebsiteSSLSearch
@@ -48,11 +48,11 @@ func (b *BaseApi) PageWebsiteSSL(c *gin.Context) {
// @Tags Website SSL
// @Summary Create website ssl
// @Description 创建网站 ssl
// @Accept json
// @Param request body request.WebsiteSSLCreate true "request"
// @Success 200 {object} request.WebsiteSSLCreate
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ssl [post]
// @x-panel-log {"bodyKeys":["primaryDomain"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 ssl [primaryDomain]","formatEN":"Create website ssl [primaryDomain]"}
func (b *BaseApi) CreateWebsiteSSL(c *gin.Context) {
@@ -70,11 +70,11 @@ func (b *BaseApi) CreateWebsiteSSL(c *gin.Context) {
// @Tags Website SSL
// @Summary Apply ssl
// @Description 申请证书
// @Accept json
// @Param request body request.WebsiteSSLApply true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ssl/obtain [post]
// @x-panel-log {"bodyKeys":["ID"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ID","isList":false,"db":"website_ssls","output_column":"primary_domain","output_value":"domain"}],"formatZH":"申请证书 [domain]","formatEN":"apply ssl [domain]"}
func (b *BaseApi) ApplyWebsiteSSL(c *gin.Context) {
@@ -91,11 +91,11 @@ func (b *BaseApi) ApplyWebsiteSSL(c *gin.Context) {
// @Tags Website SSL
// @Summary Resolve website ssl
// @Description 解析网站 ssl
// @Accept json
// @Param request body request.WebsiteDNSReq true "request"
// @Success 200 {array} response.WebsiteDNSRes
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ssl/resolve [post]
func (b *BaseApi) GetDNSResolve(c *gin.Context) {
var req request.WebsiteDNSReq
@@ -112,11 +112,11 @@ func (b *BaseApi) GetDNSResolve(c *gin.Context) {
// @Tags Website SSL
// @Summary Delete website ssl
// @Description 删除网站 ssl
// @Accept json
// @Param request body request.WebsiteBatchDelReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ssl/del [post]
// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ids","isList":true,"db":"website_ssls","output_column":"primary_domain","output_value":"domain"}],"formatZH":"删除 ssl [domain]","formatEN":"Delete ssl [domain]"}
func (b *BaseApi) DeleteWebsiteSSL(c *gin.Context) {
@@ -133,11 +133,11 @@ func (b *BaseApi) DeleteWebsiteSSL(c *gin.Context) {
// @Tags Website SSL
// @Summary Search website ssl by website id
// @Description 通过网站 id 查询 ssl
// @Accept json
// @Param websiteId path integer true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ssl/website/:websiteId [get]
func (b *BaseApi) GetWebsiteSSLByWebsiteId(c *gin.Context) {
websiteId, err := helper.GetIntParamByKey(c, "websiteId")
@@ -155,11 +155,11 @@ func (b *BaseApi) GetWebsiteSSLByWebsiteId(c *gin.Context) {
// @Tags Website SSL
// @Summary Search website ssl by id
// @Description 通过 id 查询 ssl
// @Accept json
// @Param id path integer true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ssl/:id [get]
func (b *BaseApi) GetWebsiteSSLById(c *gin.Context) {
id, err := helper.GetParamID(c)
@@ -176,12 +176,12 @@ func (b *BaseApi) GetWebsiteSSLById(c *gin.Context) {
}
// @Tags Website SSL
// @Summary Update ssl
// @Description 更新 ssl
// @Summary Update Website ssl
// @Accept json
// @Param request body request.WebsiteSSLUpdate true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ssl/update [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_ssls","output_column":"primary_domain","output_value":"domain"}],"formatZH":"更新证书设置 [domain]","formatEN":"Update ssl config [domain]"}
func (b *BaseApi) UpdateWebsiteSSL(c *gin.Context) {
@@ -197,12 +197,12 @@ func (b *BaseApi) UpdateWebsiteSSL(c *gin.Context) {
}
// @Tags Website SSL
// @Summary Upload ssl
// @Description 上传 ssl
// @Summary Upload Website ssl
// @Accept json
// @Param request body request.WebsiteSSLUpload true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ssl/upload [post]
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"上传 ssl [type]","formatEN":"Upload ssl [type]"}
func (b *BaseApi) UploadWebsiteSSL(c *gin.Context) {
@@ -218,12 +218,12 @@ func (b *BaseApi) UploadWebsiteSSL(c *gin.Context) {
}
// @Tags Website SSL
// @Summary Download SSL file
// @Description 下载证书文件
// @Summary Download SSL file
// @Accept json
// @Param request body request.WebsiteResourceReq true "request"
// @Success 200
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /websites/ssl/download [post]
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_ssls","output_column":"primary_domain","output_value":"domain"}],"formatZH":"下载证书文件 [domain]","formatEN":"download ssl file [domain]"}
func (b *BaseApi) DownloadWebsiteSSL(c *gin.Context) {
@@ -236,6 +236,7 @@ func (b *BaseApi) DownloadWebsiteSSL(c *gin.Context) {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
defer file.Close()
info, err := file.Stat()
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
+20
View File
@@ -0,0 +1,20 @@
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"`
}
+6 -3
View File
@@ -37,8 +37,9 @@ type AppOssConfig struct {
}
type AppVersion struct {
Version string `json:"version"`
DetailId uint `json:"detailId"`
Version string `json:"version"`
DetailId uint `json:"detailId"`
DockerCompose string `json:"dockerCompose"`
}
type AppList struct {
@@ -91,6 +92,7 @@ type AppProperty struct {
Website string `json:"website"`
Github string `json:"github"`
Document string `json:"document"`
Version float64 `json:"version"`
}
type AppConfigVersion struct {
@@ -108,7 +110,8 @@ type Tag struct {
}
type AppForm struct {
FormFields []AppFormFields `json:"formFields"`
FormFields []AppFormFields `json:"formFields"`
SupportVersion float64 `json:"supportVersion"`
}
type AppFormFields struct {
+3
View File
@@ -35,6 +35,8 @@ type CommonBackup struct {
Type string `json:"type" validate:"required,oneof=app mysql mariadb redis website postgresql"`
Name string `json:"name"`
DetailName string `json:"detailName"`
Secret string `json:"secret"`
FileName string `json:"fileName"`
}
type CommonRecover struct {
Source string `json:"source" validate:"required,oneof=OSS S3 SFTP MINIO LOCAL COS KODO OneDrive WebDAV"`
@@ -42,6 +44,7 @@ type CommonRecover struct {
Name string `json:"name"`
DetailName string `json:"detailName"`
File string `json:"file"`
Secret string `json:"secret"`
}
type RecordSearch struct {
+101
View File
@@ -0,0 +1,101 @@
package dto
import (
"time"
)
type SearchClamWithPage struct {
PageInfo
Info string `json:"info"`
OrderBy string `json:"orderBy" validate:"required,oneof=name status created_at"`
Order string `json:"order" validate:"required,oneof=null ascending descending"`
}
type ClamBaseInfo struct {
Version string `json:"version"`
IsActive bool `json:"isActive"`
IsExist bool `json:"isExist"`
FreshVersion string `json:"freshVersion"`
FreshIsActive bool `json:"freshIsActive"`
FreshIsExist bool `json:"freshIsExist"`
}
type ClamInfo struct {
ID uint `json:"id"`
CreatedAt time.Time `json:"createdAt"`
Name string `json:"name"`
Status string `json:"status"`
Path string `json:"path"`
InfectedStrategy string `json:"infectedStrategy"`
InfectedDir string `json:"infectedDir"`
LastHandleDate string `json:"lastHandleDate"`
Spec string `json:"spec"`
Description string `json:"description"`
AlertCount uint `json:"alertCount"`
}
type ClamLogSearch struct {
PageInfo
ClamID uint `json:"clamID"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
}
type ClamLogReq struct {
Tail string `json:"tail"`
ClamName string `json:"clamName"`
RecordName string `json:"recordName"`
}
type ClamFileReq struct {
Tail string `json:"tail"`
Name string `json:"name" validate:"required"`
}
type ClamLog struct {
Name string `json:"name"`
ScanDate string `json:"scanDate"`
ScanTime string `json:"scanTime"`
InfectedFiles string `json:"infectedFiles"`
TotalError string `json:"totalError"`
Status string `json:"status"`
}
type ClamCreate struct {
Name string `json:"name"`
Status string `json:"status"`
Path string `json:"path"`
InfectedStrategy string `json:"infectedStrategy"`
InfectedDir string `json:"infectedDir"`
Spec string `json:"spec"`
Description string `json:"description"`
AlertCount uint `json:"alertCount"`
AlertTitle string `json:"alertTitle"`
}
type ClamUpdate struct {
ID uint `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
InfectedStrategy string `json:"infectedStrategy"`
InfectedDir string `json:"infectedDir"`
Spec string `json:"spec"`
Description string `json:"description"`
AlertCount uint `json:"alertCount"`
AlertTitle string `json:"alertTitle"`
}
type ClamUpdateStatus struct {
ID uint `json:"id"`
Status string `json:"status"`
}
type ClamDelete struct {
RemoveRecord bool `json:"removeRecord"`
RemoveInfected bool `json:"removeInfected"`
Ids []uint `json:"ids" validate:"required"`
}
+9 -3
View File
@@ -1,9 +1,9 @@
package dto
type SearchCommandWithPage struct {
SearchWithPage
OrderBy string `json:"orderBy"`
Order string `json:"order"`
PageInfo
OrderBy string `json:"orderBy" validate:"required,oneof=name command created_at"`
Order string `json:"order" validate:"required,oneof=null ascending descending"`
GroupID uint `json:"groupID"`
Info string `json:"info"`
Name string `json:"name"`
@@ -30,3 +30,9 @@ type CommandTree struct {
Label string `json:"label"`
Children []CommandInfo `json:"children"`
}
type RedisCommand struct {
ID uint `json:"id"`
Name string `json:"name"`
Command string `json:"command"`
}
+1 -3
View File
@@ -2,9 +2,7 @@ package dto
type SearchWithPage struct {
PageInfo
Info string `json:"info"`
OrderBy string `json:"orderBy"`
Order string `json:"order"`
Info string `json:"info"`
}
type PageInfo struct {
+36 -15
View File
@@ -1,13 +1,15 @@
package dto
import "time"
import (
"time"
)
type PageContainer struct {
PageInfo
Name string `json:"name"`
State string `json:"state" validate:"required,oneof=all created running paused restarting removing exited dead"`
OrderBy string `json:"orderBy"`
Order string `json:"order"`
OrderBy string `json:"orderBy" validate:"required,oneof=name state created_at"`
Order string `json:"order" validate:"required,oneof=null ascending descending"`
Filters string `json:"filters"`
ExcludeAppStore bool `json:"excludeAppStore"`
}
@@ -114,7 +116,7 @@ type PortHelper struct {
type ContainerOperation struct {
Names []string `json:"names" validate:"required"`
Operation string `json:"operation" validate:"required,oneof=start stop restart kill pause unpause remove"`
Operation string `json:"operation" validate:"required,oneof=up start stop restart kill pause unpause remove"`
}
type ContainerRename struct {
@@ -122,8 +124,17 @@ type ContainerRename struct {
NewName string `json:"newName" validate:"required"`
}
type ContainerCommit struct {
ContainerId string `json:"containerID" validate:"required"`
ContainerName string `json:"containerName"`
NewImageName string `json:"newImageName"`
Comment string `json:"comment"`
Author string `json:"author"`
Pause bool `json:"pause"`
}
type ContainerPrune struct {
PruneType string `json:"pruneType" validate:"required,oneof=container image volume network"`
PruneType string `json:"pruneType" validate:"required,oneof=container image volume network buildcache"`
WithTagAll bool `json:"withTagAll"`
}
@@ -189,6 +200,7 @@ type ComposeInfo struct {
Workdir string `json:"workdir"`
Path string `json:"path"`
Containers []ComposeContainer `json:"containers"`
Env []string `json:"env"`
}
type ComposeContainer struct {
ContainerID string `json:"containerID"`
@@ -197,20 +209,29 @@ type ComposeContainer struct {
State string `json:"state"`
}
type ComposeCreate struct {
Name string `json:"name"`
From string `json:"from" validate:"required,oneof=edit path template"`
File string `json:"file"`
Path string `json:"path"`
Template uint `json:"template"`
Name string `json:"name"`
From string `json:"from" validate:"required,oneof=edit path template"`
File string `json:"file"`
Path string `json:"path"`
Template uint `json:"template"`
Env []string `json:"env"`
}
type ComposeOperation struct {
Name string `json:"name" validate:"required"`
Path string `json:"path" validate:"required"`
Operation string `json:"operation" validate:"required,oneof=start stop down"`
Path string `json:"path"`
Operation string `json:"operation" validate:"required,oneof=up start stop down delete"`
WithFile bool `json:"withFile"`
}
type ComposeUpdate struct {
Name string `json:"name" validate:"required"`
Path string `json:"path" validate:"required"`
Content string `json:"content" validate:"required"`
Name string `json:"name" validate:"required"`
Path string `json:"path" validate:"required"`
Content string `json:"content" validate:"required"`
Env []string `json:"env"`
}
type ContainerLog struct {
Container string `json:"container" validate:"required"`
Since string `json:"since"`
Tail uint `json:"tail"`
ContainerType string `json:"containerType"`
}
+27 -9
View File
@@ -1,6 +1,15 @@
package dto
import "time"
import (
"time"
)
type PageCronjob struct {
PageInfo
Info string `json:"info"`
OrderBy string `json:"orderBy" validate:"required,oneof=name status created_at"`
Order string `json:"order" validate:"required,oneof=null ascending descending"`
}
type CronjobCreate struct {
Name string `json:"name" validate:"required"`
@@ -21,10 +30,14 @@ type CronjobCreate struct {
BackupAccounts string `json:"backupAccounts"`
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"`
@@ -42,6 +55,9 @@ type CronjobUpdate struct {
BackupAccounts string `json:"backupAccounts"`
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 {
@@ -87,6 +103,8 @@ type CronjobInfo struct {
LastRecordTime string `json:"lastRecordTime"`
Status string `json:"status"`
Secret string `json:"secret"`
AlertCount uint `json:"alertCount"`
}
type SearchRecord struct {
@@ -98,12 +116,12 @@ type SearchRecord struct {
}
type Record struct {
ID uint `json:"id"`
StartTime time.Time `json:"startTime"`
Records string `json:"records"`
Status string `json:"status"`
Message string `json:"message"`
TargetPath string `json:"targetPath"`
Interval int `json:"interval"`
File string `json:"file"`
ID uint `json:"id"`
StartTime string `json:"startTime"`
Records string `json:"records"`
Status string `json:"status"`
Message string `json:"message"`
TargetPath string `json:"targetPath"`
Interval int `json:"interval"`
File string `json:"file"`
}
+24 -4
View File
@@ -16,10 +16,11 @@ type DashboardBase struct {
KernelArch string `json:"kernelArch"`
KernelVersion string `json:"kernelVersion"`
VirtualizationSystem string `json:"virtualizationSystem"`
CPUCores int `json:"cpuCores"`
CPULogicalCores int `json:"cpuLogicalCores"`
CPUModelName string `json:"cpuModelName"`
IpV4Addr string `json:"ipv4Addr"`
SystemProxy string `json:"SystemProxy"`
CPUCores int `json:"cpuCores"`
CPULogicalCores int `json:"cpuLogicalCores"`
CPUModelName string `json:"cpuModelName"`
CurrentInfo DashboardCurrent `json:"currentInfo"`
}
@@ -30,6 +31,14 @@ type OsInfo struct {
PlatformFamily string `json:"platformFamily"`
KernelArch string `json:"kernelArch"`
KernelVersion string `json:"kernelVersion"`
DiskSize int64 `json:"diskSize"`
}
type DashboardReq struct {
Scope string `json:"scope"`
IoOption string `json:"ioOption"`
NetOption string `json:"netOption"`
}
type DashboardCurrent struct {
@@ -70,6 +79,7 @@ type DashboardCurrent struct {
NetBytesRecv uint64 `json:"netBytesRecv"`
GPUData []GPUInfo `json:"gpuData"`
XPUData []XPUInfo `json:"xpuData"`
ShotTime time.Time `json:"shotTime"`
}
@@ -103,3 +113,13 @@ type GPUInfo struct {
MemTotal string `json:"memTotal"`
FanSpeed string `json:"fanSpeed"`
}
type XPUInfo struct {
DeviceID int `json:"deviceID"`
DeviceName string `json:"deviceName"`
Memory string `json:"memory"`
Temperature string `json:"temperature"`
MemoryUsed string `json:"memoryUsed"`
Power string `json:"power"`
MemoryUtil string `json:"memoryUtil"`
}
+19 -15
View File
@@ -27,8 +27,8 @@ type MysqlDBSearch struct {
PageInfo
Info string `json:"info"`
Database string `json:"database" validate:"required"`
OrderBy string `json:"orderBy"`
Order string `json:"order"`
OrderBy string `json:"orderBy" validate:"required,oneof=name created_at"`
Order string `json:"order" validate:"required,oneof=null ascending descending"`
}
type MysqlDBInfo struct {
@@ -131,7 +131,7 @@ type MysqlStatus struct {
}
type MysqlVariables struct {
BinlogCacheSize string `json:"binlog_cache_size"`
BinlogCacheSize string `json:"binlog_cache_size"`
InnodbBufferPoolSize string `json:"innodb_buffer_pool_size"`
InnodbLogBufferSize string `json:"innodb_log_buffer_size"`
JoinBufferSize string `json:"join_buffer_size"`
@@ -139,7 +139,7 @@ type MysqlVariables struct {
MaxConnections string `json:"max_connections"`
MaxHeapTableSize string `json:"max_heap_table_size"`
QueryCacheSize string `json:"query_cache_size"`
QueryCache_type string `json:"query_cache_type"`
QueryCacheType string `json:"query_cache_type"`
ReadBufferSize string `json:"read_buffer_size"`
ReadRndBufferSize string `json:"read_rnd_buffer_size"`
SortBufferSize string `json:"sort_buffer_size"`
@@ -165,26 +165,26 @@ type MysqlVariablesUpdateHelper struct {
// redis
type ChangeRedisPass struct {
Value string `json:"value" validate:"required"`
Database string `json:"database" validate:"required"`
Value string `json:"value"`
}
type RedisConfUpdate struct {
Database string `json:"database" validate:"required"`
Timeout string `json:"timeout"`
Maxclients string `json:"maxclients"`
Maxmemory string `json:"maxmemory"`
}
type RedisConfPersistenceUpdate struct {
Database string `json:"database" validate:"required"`
Type string `json:"type" validate:"required,oneof=aof rbd"`
Appendonly string `json:"appendonly"`
Appendfsync string `json:"appendfsync"`
Save string `json:"save"`
}
type RedisConfUpdateByFile struct {
File string `json:"file" validate:"required"`
RestartNow bool `json:"restartNow"`
}
type RedisConf struct {
Database string `json:"database" validate:"required"`
Name string `json:"name"`
Port int64 `json:"port"`
ContainerName string `json:"containerName"`
@@ -195,18 +195,20 @@ type RedisConf struct {
}
type RedisPersistence struct {
Database string `json:"database" validate:"required"`
Appendonly string `json:"appendonly"`
Appendfsync string `json:"appendfsync"`
Save string `json:"save"`
}
type RedisStatus struct {
Database string `json:"database" validate:"required"`
TcpPort string `json:"tcp_port"`
UptimeInDays string `json:"uptime_in_days"`
ConnectedClients string `json:"connected_clients"`
UsedMemory string `json:"used_memory"`
UsedMemory_rss string `json:"used_memory_rss"`
UsedMemory_peak string `json:"used_memory_peak"`
UsedMemoryRss string `json:"used_memory_rss"`
UsedMemoryPeak string `json:"used_memory_peak"`
MemFragmentationRatio string `json:"mem_fragmentation_ratio"`
TotalConnectionsReceived string `json:"total_connections_received"`
TotalCommandsProcessed string `json:"total_commands_processed"`
@@ -217,12 +219,14 @@ type RedisStatus struct {
}
type DatabaseFileRecords struct {
Database string `json:"database" validate:"required"`
FileName string `json:"fileName"`
FileDir string `json:"fileDir"`
CreatedAt string `json:"createdAt"`
Size int `json:"size"`
}
type RedisBackupRecover struct {
Database string `json:"database" validate:"required"`
FileName string `json:"fileName"`
FileDir string `json:"fileDir"`
}
@@ -232,8 +236,8 @@ type DatabaseSearch struct {
PageInfo
Info string `json:"info"`
Type string `json:"type"`
OrderBy string `json:"orderBy"`
Order string `json:"order"`
OrderBy string `json:"orderBy" validate:"required,oneof=name created_at"`
Order string `json:"order" validate:"required,oneof=null ascending descending"`
}
type DatabaseInfo struct {
@@ -281,7 +285,7 @@ type DatabaseCreate struct {
Address string `json:"address"`
Port uint `json:"port"`
Username string `json:"username" validate:"required"`
Password string `json:"password" validate:"required"`
Password string `json:"password"`
SSL bool `json:"ssl"`
RootCert string `json:"rootCert"`
@@ -299,7 +303,7 @@ type DatabaseUpdate struct {
Address string `json:"address"`
Port uint `json:"port"`
Username string `json:"username" validate:"required"`
Password string `json:"password" validate:"required"`
Password string `json:"password"`
SSL bool `json:"ssl"`
RootCert string `json:"rootCert"`
+2 -2
View File
@@ -6,8 +6,8 @@ type PostgresqlDBSearch struct {
PageInfo
Info string `json:"info"`
Database string `json:"database" validate:"required"`
OrderBy string `json:"orderBy"`
Order string `json:"order"`
OrderBy string `json:"orderBy" validate:"required,oneof=name created_at"`
Order string `json:"order" validate:"required,oneof=null ascending descending"`
}
type PostgresqlDBInfo struct {
+11
View File
@@ -29,6 +29,17 @@ type PortRuleOperate struct {
Description string `json:"description"`
}
type ForwardRuleOperate struct {
Rules []struct {
Operation string `json:"operation" validate:"required,oneof=add remove"`
Num string `json:"num"`
Protocol string `json:"protocol" validate:"required,oneof=tcp udp tcp/udp"`
Port string `json:"port" validate:"required"`
TargetIP string `json:"targetIP"`
TargetPort string `json:"targetPort" validate:"required"`
} `json:"rules"`
}
type UpdateFirewallDescription struct {
Type string `json:"type"`
Address string `json:"address"`
+43
View File
@@ -0,0 +1,43 @@
package dto
import (
"time"
)
type FtpInfo struct {
ID uint `json:"id"`
CreatedAt time.Time `json:"createdAt"`
User string `json:"user"`
Password string `json:"password"`
Path string `json:"path"`
Status string `json:"status"`
Description string `json:"description"`
}
type FtpBaseInfo struct {
IsActive bool `json:"isActive"`
IsExist bool `json:"isExist"`
}
type FtpLogSearch struct {
PageInfo
User string `json:"user"`
Operation string `json:"operation"`
}
type FtpCreate struct {
User string `json:"user" validate:"required"`
Password string `json:"password" validate:"required"`
Path string `json:"path" validate:"required"`
Description string `json:"description"`
}
type FtpUpdate struct {
ID uint `json:"id"`
Password string `json:"password" validate:"required"`
Path string `json:"path" validate:"required"`
Status string `json:"status"`
Description string `json:"description"`
}
+24 -9
View File
@@ -43,6 +43,7 @@ type AppInstalledSearch struct {
Update bool `json:"update"`
Unused bool `json:"unused"`
All bool `json:"all"`
Sync bool `json:"sync"`
}
type AppInstalledInfo struct {
@@ -60,15 +61,24 @@ type AppBackupDelete struct {
}
type AppInstalledOperate struct {
InstallId uint `json:"installId" validate:"required"`
BackupId uint `json:"backupId"`
DetailId uint `json:"detailId"`
Operate constant.AppOperate `json:"operate" validate:"required"`
ForceDelete bool `json:"forceDelete"`
DeleteBackup bool `json:"deleteBackup"`
DeleteDB bool `json:"deleteDB"`
Backup bool `json:"backup"`
PullImage bool `json:"pullImage"`
InstallId uint `json:"installId" validate:"required"`
BackupId uint `json:"backupId"`
DetailId uint `json:"detailId"`
Operate constant.AppOperate `json:"operate" validate:"required"`
ForceDelete bool `json:"forceDelete"`
DeleteBackup bool `json:"deleteBackup"`
DeleteDB bool `json:"deleteDB"`
Backup bool `json:"backup"`
PullImage bool `json:"pullImage"`
DockerCompose string `json:"dockerCompose"`
}
type AppInstallUpgrade struct {
InstallID uint `json:"installId"`
DetailID uint `json:"detailId"`
Backup bool `json:"backup"`
PullImage bool `json:"pullImage"`
DockerCompose string `json:"dockerCompose"`
}
type AppInstalledUpdate struct {
@@ -87,3 +97,8 @@ type PortUpdate struct {
Name string `json:"name"`
Port int64 `json:"port"`
}
type AppUpdateVersion struct {
AppInstallID uint `json:"appInstallID" validate:"required"`
UpdateVersion string `json:"updateVersion"`
}
+8 -4
View File
@@ -10,7 +10,8 @@ type FileOption struct {
}
type FileContentReq struct {
Path string `json:"path" validate:"required"`
Path string `json:"path" validate:"required"`
IsDetail bool `json:"isDetail"`
}
type SearchUploadWithPage struct {
@@ -54,12 +55,14 @@ type FileCompress struct {
Type string `json:"type" validate:"required"`
Name string `json:"name" validate:"required"`
Replace bool `json:"replace"`
Secret string `json:"secret"`
}
type FileDeCompress struct {
Dst string `json:"dst" validate:"required"`
Type string `json:"type" validate:"required"`
Path string `json:"path" validate:"required"`
Dst string `json:"dst" validate:"required"`
Type string `json:"type" validate:"required"`
Path string `json:"path" validate:"required"`
Secret string `json:"secret"`
}
type FileEdit struct {
@@ -124,6 +127,7 @@ type FileReadByLineReq struct {
Type string `json:"type" validate:"required"`
ID uint `json:"ID"`
Name string `json:"name"`
Latest bool `json:"latest"`
}
type FileExistReq struct {
+1 -1
View File
@@ -27,7 +27,7 @@ type NginxRewriteReq struct {
type NginxRewriteUpdate struct {
WebsiteID uint `json:"websiteId" validate:"required"`
Name string `json:"name" validate:"required"`
Content string `json:"content" validate:"required"`
Content string `json:"content"`
}
type NginxProxyUpdate struct {
+32 -17
View File
@@ -7,8 +7,8 @@ import (
type WebsiteSearch struct {
dto.PageInfo
Name string `json:"name"`
OrderBy string `json:"orderBy"`
Order string `json:"order"`
OrderBy string `json:"orderBy" validate:"required,oneof=primary_domain type status created_at expire_date"`
Order string `json:"order" validate:"required,oneof=null ascending descending"`
WebsiteGroupID uint `json:"websiteGroupId"`
}
@@ -27,6 +27,9 @@ type WebsiteCreate struct {
AppID uint `json:"appID"`
AppInstallID uint `json:"appInstallID"`
FtpUser string `json:"ftpUser"`
FtpPassword string `json:"ftpPassword"`
RuntimeID uint `json:"runtimeID"`
RuntimeConfig
}
@@ -52,7 +55,7 @@ type WebsiteUpdate struct {
ID uint `json:"id" validate:"required"`
PrimaryDomain string `json:"primaryDomain" validate:"required"`
Remark string `json:"remark"`
WebsiteGroupID uint `json:"webSiteGroupID" validate:"required"`
WebsiteGroupID uint `json:"webSiteGroupID"`
ExpireDate string `json:"expireDate"`
IPV6 bool `json:"IPV6"`
}
@@ -120,6 +123,7 @@ type WebsiteHTTPSOp struct {
HttpConfig string `json:"httpConfig" validate:"oneof=HTTPSOnly HTTPAlso HTTPToHTTPS"`
SSLProtocol []string `json:"SSLProtocol"`
Algorithm string `json:"algorithm"`
Hsts bool `json:"hsts"`
}
type WebsiteNginxUpdate struct {
@@ -171,20 +175,22 @@ type WebsiteUpdateDirPermission struct {
}
type WebsiteProxyConfig struct {
ID uint `json:"id" validate:"required"`
Operate string `json:"operate" validate:"required"`
Enable bool `json:"enable" `
Cache bool `json:"cache" `
CacheTime int `json:"cacheTime" `
CacheUnit string `json:"cacheUnit"`
Name string `json:"name" validate:"required"`
Modifier string `json:"modifier"`
Match string `json:"match" validate:"required"`
ProxyPass string `json:"proxyPass" validate:"required"`
ProxyHost string `json:"proxyHost" validate:"required"`
Content string `json:"content"`
FilePath string `json:"filePath"`
Replaces map[string]string `json:"replaces"`
ID uint `json:"id" validate:"required"`
Operate string `json:"operate" validate:"required"`
Enable bool `json:"enable" `
Cache bool `json:"cache" `
CacheTime int `json:"cacheTime" `
CacheUnit string `json:"cacheUnit"`
Name string `json:"name" validate:"required"`
Modifier string `json:"modifier"`
Match string `json:"match" validate:"required"`
ProxyPass string `json:"proxyPass" validate:"required"`
ProxyHost string `json:"proxyHost" validate:"required"`
Content string `json:"content"`
FilePath string `json:"filePath"`
Replaces map[string]string `json:"replaces"`
SNI bool `json:"sni"`
ProxySSLName string `json:"proxySSLName"`
}
type WebsiteProxyReq struct {
@@ -204,3 +210,12 @@ type WafWebsite struct {
Domains []string `json:"domains"`
Host []string `json:"host"`
}
type WebsiteHtmlReq struct {
Type string `json:"type" validate:"required"`
}
type WebsiteHtmlUpdate struct {
Type string `json:"type" validate:"required"`
Content string `json:"content" validate:"required"`
}
+8 -1
View File
@@ -24,6 +24,8 @@ type WebsiteSSLCreate struct {
SkipDNS bool `json:"skipDNS"`
Nameserver1 string `json:"nameserver1"`
Nameserver2 string `json:"nameserver2"`
ExecShell bool `json:"execShell"`
Shell string `json:"shell"`
}
type WebsiteDNSReq struct {
@@ -39,6 +41,7 @@ type WebsiteSSLApply struct {
ID uint `json:"ID" validate:"required"`
SkipDNSCheck bool `json:"skipDNSCheck"`
Nameservers []string `json:"nameservers"`
DisableLog bool `json:"disableLog"`
}
type WebsiteAcmeAccountCreate struct {
@@ -77,7 +80,7 @@ type WebsiteSSLUpdate struct {
PrimaryDomain string `json:"primaryDomain" validate:"required"`
OtherDomains string `json:"otherDomains"`
Provider string `json:"provider" validate:"required"`
AcmeAccountID uint `json:"acmeAccountId" validate:"required"`
AcmeAccountID uint `json:"acmeAccountId"`
DnsAccountID uint `json:"dnsAccountId"`
KeyType string `json:"keyType"`
Apply bool `json:"apply"`
@@ -87,6 +90,8 @@ type WebsiteSSLUpdate struct {
SkipDNS bool `json:"skipDNS"`
Nameserver1 string `json:"nameserver1"`
Nameserver2 string `json:"nameserver2"`
ExecShell bool `json:"execShell"`
Shell string `json:"shell"`
}
type WebsiteSSLUpload struct {
@@ -126,6 +131,8 @@ type WebsiteCAObtain struct {
Renew bool `json:"renew"`
SSLID uint `json:"sslID"`
Description string `json:"description"`
ExecShell bool `json:"execShell"`
Shell string `json:"shell"`
}
type WebsiteCARenew struct {
+48 -1
View File
@@ -10,7 +10,7 @@ import (
)
type AppRes struct {
Items []*AppDTO `json:"items"`
Items []*AppDto `json:"items"`
Total int64 `json:"total"`
}
@@ -28,6 +28,22 @@ type AppDTO struct {
Tags []model.Tag `json:"tags"`
}
type AppDto struct {
Name string `json:"name"`
Key string `json:"key"`
ID uint `json:"id"`
ShortDescZh string `json:"shortDescZh"`
ShortDescEn string `json:"shortDescEn"`
Icon string `json:"icon"`
Type string `json:"type"`
Status string `json:"status"`
Resource string `json:"resource"`
Installed bool `json:"installed"`
Versions []string `json:"versions"`
Limit int `json:"limit"`
Tags []model.Tag `json:"tags"`
}
type TagDTO struct {
model.Tag
}
@@ -72,7 +88,38 @@ type AppInstalledDTO struct {
Path string `json:"path"`
}
type AppDetail struct {
Website string `json:"website"`
Document string `json:"document"`
Github string `json:"github"`
}
type AppInstallDTO struct {
ID uint `json:"id"`
Name string `json:"name"`
AppID uint `json:"appID"`
AppDetailID uint `json:"appDetailID"`
Version string `json:"version"`
Status string `json:"status"`
Message string `json:"message"`
HttpPort int `json:"httpPort"`
HttpsPort int `json:"httpsPort"`
Path string `json:"path"`
CanUpdate bool `json:"canUpdate"`
Icon string `json:"icon"`
AppName string `json:"appName"`
Ready int `json:"ready"`
Total int `json:"total"`
AppKey string `json:"appKey"`
AppType string `json:"appType"`
AppStatus string `json:"appStatus"`
DockerCompose string `json:"dockerCompose"`
CreatedAt time.Time `json:"createdAt"`
App AppDetail `json:"app"`
}
type DatabaseConn struct {
Status string `json:"status"`
Username string `json:"username"`
Password string `json:"password"`
ContainerName string `json:"containerName"`
+11 -7
View File
@@ -15,10 +15,12 @@ type UploadInfo struct {
}
type FileTree struct {
ID string `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
Children []FileTree `json:"children"`
ID string `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
IsDir bool `json:"isDir"`
Extension string `json:"extension"`
Children []FileTree `json:"children"`
}
type DirSizeRes struct {
@@ -34,9 +36,11 @@ type FileWgetRes struct {
}
type FileLineContent struct {
Content string `json:"content"`
End bool `json:"end"`
Path string `json:"path"`
Content string `json:"content"`
End bool `json:"end"`
Path string `json:"path"`
Total int `json:"total"`
Lines []string `json:"lines"`
}
type FileExist struct {
+26
View File
@@ -2,6 +2,7 @@ package response
import (
"github.com/1Panel-dev/1Panel/backend/app/model"
"time"
)
type WebsiteDTO struct {
@@ -11,6 +12,26 @@ type WebsiteDTO struct {
SitePath string `json:"sitePath"`
AppName string `json:"appName"`
RuntimeName string `json:"runtimeName"`
SiteDir string `gorm:"type:varchar;" json:"siteDir"`
}
type WebsiteRes struct {
ID uint `json:"id"`
CreatedAt time.Time `json:"createdAt"`
Protocol string `json:"protocol"`
PrimaryDomain string `json:"primaryDomain"`
Type string `json:"type"`
Alias string `json:"alias"`
Remark string `json:"remark"`
Status string `json:"status"`
ExpireDate time.Time `json:"expireDate"`
SitePath string `json:"sitePath"`
AppName string `json:"appName"`
RuntimeName string `json:"runtimeName"`
SSLExpireDate time.Time `json:"sslExpireDate"`
SSLStatus string `json:"sslStatus"`
AppInstallID uint `json:"appInstallId"`
RuntimeType string `json:"runtimeType"`
}
type WebsiteOption struct {
@@ -37,6 +58,7 @@ type WebsiteHTTPS struct {
SSL model.WebsiteSSL `json:"SSL"`
SSLProtocol []string `json:"SSLProtocol"`
Algorithm string `json:"algorithm"`
Hsts bool `json:"hsts"`
}
type WebsiteLog struct {
@@ -62,3 +84,7 @@ type WebsiteDirConfig struct {
UserGroup string `json:"userGroup"`
Msg string `json:"msg"`
}
type WebsiteHtmlRes struct {
Content string `json:"content"`
}
+66 -10
View File
@@ -30,6 +30,7 @@ type SettingInfo struct {
ServerPort string `json:"serverPort"`
SSL string `json:"ssl"`
SSLType string `json:"sslType"`
AutoRestart string `json:"autoRestart"`
BindDomain string `json:"bindDomain"`
AllowIPs string `json:"allowIPs"`
SecurityEntrance string `json:"securityEntrance"`
@@ -58,6 +59,17 @@ type SettingInfo struct {
SnapshotIgnore string `json:"snapshotIgnore"`
XpackHideMenu string `json:"xpackHideMenu"`
NoAuthSetting string `json:"noAuthSetting"`
ProxyUrl string `json:"proxyUrl"`
ProxyType string `json:"proxyType"`
ProxyPort string `json:"proxyPort"`
ProxyUser string `json:"proxyUser"`
ProxyPasswd string `json:"proxyPasswd"`
ProxyPasswdKeep string `json:"proxyPasswdKeep"`
ApiInterfaceStatus string `json:"apiInterfaceStatus"`
ApiKey string `json:"apiKey"`
IpWhiteList string `json:"ipWhiteList"`
}
type SettingUpdate struct {
@@ -66,12 +78,13 @@ type SettingUpdate struct {
}
type SSLUpdate struct {
SSLType string `json:"sslType" validate:"required,oneof=self select import import-paste import-local"`
Domain string `json:"domain"`
SSL string `json:"ssl" validate:"required,oneof=enable disable"`
Cert string `json:"cert"`
Key string `json:"key"`
SSLID uint `json:"sslID"`
SSLType string `json:"sslType" validate:"required,oneof=self select import import-paste import-local"`
Domain string `json:"domain"`
SSL string `json:"ssl" validate:"required,oneof=enable disable"`
Cert string `json:"cert"`
Key string `json:"key"`
SSLID uint `json:"sslID"`
AutoRestart string `json:"autoRestart"`
}
type SSLInfo struct {
Domain string `json:"domain"`
@@ -91,6 +104,12 @@ type PortUpdate struct {
ServerPort uint `json:"serverPort" validate:"required,number,max=65535,min=1"`
}
type PageSnapshot struct {
PageInfo
Info string `json:"info"`
OrderBy string `json:"orderBy" validate:"required,oneof=name created_at"`
Order string `json:"order" validate:"required,oneof=null ascending descending"`
}
type SnapshotStatus struct {
Panel string `json:"panel"`
PanelInfo string `json:"panelInfo"`
@@ -109,11 +128,17 @@ type SnapshotCreate struct {
From string `json:"from" validate:"required"`
DefaultDownload string `json:"defaultDownload" validate:"required"`
Description string `json:"description" validate:"max=256"`
Secret string `json:"secret"`
}
type SnapshotRecover struct {
IsNew bool `json:"isNew"`
ReDownload bool `json:"reDownload"`
ID uint `json:"id" validate:"required"`
IsNew bool `json:"isNew"`
ReDownload bool `json:"reDownload"`
ID uint `json:"id" validate:"required"`
Secret string `json:"secret"`
}
type SnapshotBatchDelete struct {
DeleteWithFile bool `json:"deleteWithFile"`
Ids []uint `json:"ids" validate:"required"`
}
type SnapshotImport struct {
From string `json:"from"`
@@ -128,7 +153,7 @@ type SnapshotInfo struct {
DefaultDownload string `json:"defaultDownload"`
Status string `json:"status"`
Message string `json:"message"`
CreatedAt time.Time `json:"createdAt"`
CreatedAt time.Time `json:"created_at"`
Version string `json:"version"`
InterruptStep string `json:"interruptStep"`
@@ -140,6 +165,12 @@ type SnapshotInfo struct {
LastRollbackedAt string `json:"lastRollbackedAt"`
}
type SnapshotFile struct {
ID uint `json:"id"`
Name string `json:"name"`
Size int64 `json:"size"`
}
type UpgradeInfo struct {
TestVersion string `json:"testVersion"`
NewVersion string `json:"newVersion"`
@@ -160,11 +191,21 @@ type Upgrade struct {
Version string `json:"version" validate:"required"`
}
type ProxyUpdate struct {
ProxyUrl string `json:"proxyUrl"`
ProxyType string `json:"proxyType"`
ProxyPort string `json:"proxyPort"`
ProxyUser string `json:"proxyUser"`
ProxyPasswd string `json:"proxyPasswd"`
ProxyPasswdKeep string `json:"proxyPasswdKeep"`
}
type CleanData struct {
SystemClean []CleanTree `json:"systemClean"`
UploadClean []CleanTree `json:"uploadClean"`
DownloadClean []CleanTree `json:"downloadClean"`
SystemLogClean []CleanTree `json:"systemLogClean"`
ContainerClean []CleanTree `json:"containerClean"`
}
type CleanTree struct {
@@ -185,3 +226,18 @@ type Clean struct {
Name string `json:"name"`
Size uint64 `json:"size"`
}
type XpackHideMenu struct {
ID string `json:"id"`
Label string `json:"label"`
IsCheck bool `json:"isCheck"`
Title string `json:"title"`
Path string `json:"path,omitempty"`
Children []XpackHideMenu `json:"children,omitempty"`
}
type ApiInterfaceConfig struct {
ApiInterfaceStatus string `json:"apiInterfaceStatus"`
ApiKey string `json:"apiKey"`
IpWhiteList string `json:"ipWhiteList"`
}
+1 -1
View File
@@ -16,7 +16,7 @@ type App struct {
Type string `json:"type" gorm:"type:varchar(64);not null"`
Status string `json:"status" gorm:"type:varchar(64);not null"`
Required string `json:"required" gorm:"type:varchar(64);"`
CrossVersionUpdate bool `json:"crossVersionUpdate"`
CrossVersionUpdate bool `json:"crossVersionUpdate" yaml:"crossVersionUpdate"`
Limit int `json:"limit" gorm:"type:Integer;not null"`
Website string `json:"website" gorm:"type:varchar(64);not null"`
Github string `json:"github" gorm:"type:varchar(64);not null"`
+14
View File
@@ -0,0 +1,14 @@
package model
type Clam struct {
BaseModel
Name string `gorm:"type:varchar(64);not null" json:"name"`
Status string `gorm:"type:varchar(64)" json:"status"`
Path string `gorm:"type:varchar(64);not null" json:"path"`
InfectedStrategy string `gorm:"type:varchar(64)" json:"infectedStrategy"`
InfectedDir string `gorm:"type:varchar(64)" json:"infectedDir"`
Spec string `gorm:"type:varchar(64)" json:"spec"`
EntryID int `gorm:"type:varchar(64)" json:"entryID"`
Description string `gorm:"type:varchar(64)" json:"description"`
}
+6
View File
@@ -6,3 +6,9 @@ type Command struct {
GroupID uint `gorm:"type:decimal" json:"groupID"`
Command string `gorm:"type:varchar(256);not null" json:"command"`
}
type RedisCommand struct {
BaseModel
Name string `gorm:"type:varchar(64);unique;not null" json:"name"`
Command string `gorm:"type:varchar(256);not null" json:"command"`
}

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