mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-10-09 16:00:29 +00:00
Compare commits
686
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20b89a8fdd | ||
|
|
8def011e63 | ||
|
|
7c5b2f41e3 | ||
|
|
abd3c24562 | ||
|
|
f4e64ca8b3 | ||
|
|
97fde371d9 | ||
|
|
85bbb9cb15 | ||
|
|
1d34b4aff7 | ||
|
|
dc8c50c07a | ||
|
|
4ac490c6b4 | ||
|
|
0d548c7df9 | ||
|
|
8ec5a5bd4b | ||
|
|
2e8bcc09e6 | ||
|
|
29a304e2c8 | ||
|
|
b1adc37920 | ||
|
|
03fac3ec06 | ||
|
|
6e465ac215 | ||
|
|
21bbadc37b | ||
|
|
3061d640ce | ||
|
|
874717cbcd | ||
|
|
6850acabae | ||
|
|
890ea42749 | ||
|
|
6aaf61cde4 | ||
|
|
73930c5e29 | ||
|
|
8f8d280e90 | ||
|
|
b46192024f | ||
|
|
8f939ad5be | ||
|
|
a6363ce4e5 | ||
|
|
fd490b2642 | ||
|
|
7624670ee0 | ||
|
|
8c3145e1c6 | ||
|
|
bec7b6989f | ||
|
|
326f2654e6 | ||
|
|
708499a335 | ||
|
|
bdeb842939 | ||
|
|
edefdce3ff | ||
|
|
b348c36571 | ||
|
|
6ae150b64e | ||
|
|
3687b9bea2 | ||
|
|
711431da82 | ||
|
|
e93afc33aa | ||
|
|
82dd993751 | ||
|
|
9ba293e154 | ||
|
|
8fa9f128d8 | ||
|
|
ed9f1599e6 | ||
|
|
787a29769d | ||
|
|
6b379389d3 | ||
|
|
5bcbf32823 | ||
|
|
0aa90e1b2d | ||
|
|
a7b87211b4 | ||
|
|
2c666933a5 | ||
|
|
f280b533c6 | ||
|
|
47a16bc9a9 | ||
|
|
713202b6eb | ||
|
|
79020abb1c | ||
|
|
83ef41cf1a | ||
|
|
91675c69e9 | ||
|
|
0e68065b40 | ||
|
|
600b769083 | ||
|
|
e7670f96de | ||
|
|
342c04b30a | ||
|
|
5ab8377ac1 | ||
|
|
74eb2c8dd6 | ||
|
|
f136d97941 | ||
|
|
a5629e3f42 | ||
|
|
515d6ca500 | ||
|
|
c0ccc0318d | ||
|
|
8196c11010 | ||
|
|
170bd22062 | ||
|
|
097a33c68f | ||
|
|
3be3bf9926 | ||
|
|
038f2b4f54 | ||
|
|
f84e284c20 | ||
|
|
48e75b5916 | ||
|
|
a12ceaee6e | ||
|
|
9050680115 | ||
|
|
0022a9b508 | ||
|
|
3437d62f31 | ||
|
|
dc880835d0 | ||
|
|
1663bf8677 | ||
|
|
aed236cbc9 | ||
|
|
90be74504e | ||
|
|
bba8aab18c | ||
|
|
47d135ecca | ||
|
|
d96fe49993 | ||
|
|
ac396b61ce | ||
|
|
6798d0c7ee | ||
|
|
1490ed7541 | ||
|
|
48b3032de6 | ||
|
|
ed12bec460 | ||
|
|
3c4a1ea614 | ||
|
|
79eb0288b4 | ||
|
|
99775e1eb4 | ||
|
|
db848b41d2 | ||
|
|
b5b11dff86 | ||
|
|
9cf4bfc606 | ||
|
|
221162d44f | ||
|
|
617970a1f8 | ||
|
|
5610c73d67 | ||
|
|
51fe02661f | ||
|
|
8f491b2933 | ||
|
|
b7e16bd6d5 | ||
|
|
38ca2ddd01 | ||
|
|
402b41100b | ||
|
|
766beae4e1 | ||
|
|
05f72e9dcf | ||
|
|
23553c68ae | ||
|
|
4dd1eb7a1e | ||
|
|
db307732c6 | ||
|
|
33d4ade1d4 | ||
|
|
186075ff9a | ||
|
|
34df745d1c | ||
|
|
ec363ac157 | ||
|
|
193b0f3cd4 | ||
|
|
67c1bf2924 | ||
|
|
b1373ff77e | ||
|
|
55d0e27212 | ||
|
|
1c052b7c13 | ||
|
|
6c8d48c2dc | ||
|
|
b61dae638b | ||
|
|
872a93aa07 | ||
|
|
b1f337020c | ||
|
|
56858dd74c | ||
|
|
358415f737 | ||
|
|
5e73260103 | ||
|
|
e169f46784 | ||
|
|
39416abd47 | ||
|
|
640a0ca815 | ||
|
|
8e54cd5162 | ||
|
|
0f0099accb | ||
|
|
718ebeb203 | ||
|
|
4101bf691d | ||
|
|
a97deb3dca | ||
|
|
10203d5c0c | ||
|
|
a357d6697d | ||
|
|
555b0aa999 | ||
|
|
6dd0dbe2c3 | ||
|
|
c31bbae768 | ||
|
|
2bb0f15973 | ||
|
|
be229551e3 | ||
|
|
6283eb4c69 | ||
|
|
c329fb6599 | ||
|
|
c3685f6b74 | ||
|
|
f4f5a36475 | ||
|
|
ea1261b48e | ||
|
|
0c68f16a66 | ||
|
|
33e5c9230f | ||
|
|
96eefab36f | ||
|
|
b0b6bf458f | ||
|
|
f3d85d1309 | ||
|
|
39385ea0a0 | ||
|
|
e492c6573c | ||
|
|
10a7fb3be2 | ||
|
|
8bc7cfade3 | ||
|
|
ea044d6c32 | ||
|
|
f6ee3dc75b | ||
|
|
367a74503f | ||
|
|
53b1a7af4c | ||
|
|
078d7fbe1e | ||
|
|
c709e48ceb | ||
|
|
0741f60896 | ||
|
|
af8eef4a91 | ||
|
|
f233ef7069 | ||
|
|
1c199bd3d7 | ||
|
|
036c973fec | ||
|
|
8bb225d272 | ||
|
|
ab932ae154 | ||
|
|
89f969ec6e | ||
|
|
afa8cf22b1 | ||
|
|
67aa8471dc | ||
|
|
0617b81b3b | ||
|
|
98c535a12c | ||
|
|
ec46518936 | ||
|
|
a7b034387f | ||
|
|
7905dd00a6 | ||
|
|
74583aa1aa | ||
|
|
4be9d71edf | ||
|
|
57bfc38eb8 | ||
|
|
aaaa5980b5 | ||
|
|
4f57dfc76e | ||
|
|
2c31ffc66b | ||
|
|
b104a13b71 | ||
|
|
28633d2fef | ||
|
|
9052386c83 | ||
|
|
7bc45f2d77 | ||
|
|
2ef6ecb951 | ||
|
|
ca0dc71338 | ||
|
|
04a1ec9a9a | ||
|
|
999e5a779a | ||
|
|
99f62b7230 | ||
|
|
4dee4e1cc2 | ||
|
|
539addc656 | ||
|
|
1a35b307fa | ||
|
|
a04f4a8b96 | ||
|
|
6b88e1adf2 | ||
|
|
99bc8177d4 | ||
|
|
cf2a1372f2 | ||
|
|
42c30f324a | ||
|
|
dab83fee20 | ||
|
|
6f3c5586fc | ||
|
|
aab8df6abc | ||
|
|
b9be79b05a | ||
|
|
ec3024f2c3 | ||
|
|
070f61e229 | ||
|
|
a82a4ebfc5 | ||
|
|
87009ddb27 | ||
|
|
3650ff27b3 | ||
|
|
6c08a3114a | ||
|
|
381cb61185 | ||
|
|
8d69da7702 | ||
|
|
8922395fdc | ||
|
|
83db40e261 | ||
|
|
95ec6c62ef | ||
|
|
56fc9ea428 | ||
|
|
88c6fc050b | ||
|
|
2392f91567 | ||
|
|
5f0c740eb0 | ||
|
|
120d0dd7c6 | ||
|
|
2844f6db7f | ||
|
|
570074f92d | ||
|
|
a13047c855 | ||
|
|
ca0d24bf56 | ||
|
|
2b18251360 | ||
|
|
f7c875acda | ||
|
|
a291a50c9f | ||
|
|
5bc7bc6aac | ||
|
|
9c376300ff | ||
|
|
5187b20252 | ||
|
|
fc401ffd8f | ||
|
|
667ee5256e | ||
|
|
f8356de93c | ||
|
|
55bb997d51 | ||
|
|
7c46f54e15 | ||
|
|
6dbb6d2247 | ||
|
|
9d0ae45edc | ||
|
|
b467dfa3b2 | ||
|
|
c13387bc70 | ||
|
|
41b2523750 | ||
|
|
afe82bd4be | ||
|
|
0f296fb70b | ||
|
|
d96ccd06a3 | ||
|
|
14095affa9 | ||
|
|
ed60565bc9 | ||
|
|
8313912c4f | ||
|
|
6274015d06 | ||
|
|
d195ce9155 | ||
|
|
cd0cd8a152 | ||
|
|
1f45ed6b06 | ||
|
|
7f6ad89edf | ||
|
|
5cdea288e2 | ||
|
|
e56feaf826 | ||
|
|
1288a09647 | ||
|
|
0cdaafa1c0 | ||
|
|
0b3334253c | ||
|
|
10f72f12d2 | ||
|
|
01643b2816 | ||
|
|
56e0da4fe3 | ||
|
|
144c397bf4 | ||
|
|
e06541984f | ||
|
|
ea7e92db84 | ||
|
|
8d48640c1d | ||
|
|
cfe5cb4b6b | ||
|
|
05c4d7dd38 | ||
|
|
13c6e0df99 | ||
|
|
dafd6ba71e | ||
|
|
2751c37716 | ||
|
|
50c01762e7 | ||
|
|
a77ebd3eb6 | ||
|
|
d84f0b5597 | ||
|
|
a3cdf87ea2 | ||
|
|
8ab3c16b3d | ||
|
|
18e943fd06 | ||
|
|
3b7a067dda | ||
|
|
4636ba815b | ||
|
|
317fad2a28 | ||
|
|
0ae28a1dd9 | ||
|
|
bbfe5f1d96 | ||
|
|
b713f20b66 | ||
|
|
3eb7a5adc5 | ||
|
|
956af78749 | ||
|
|
69ad01687e | ||
|
|
e83d07e88e | ||
|
|
6683696032 | ||
|
|
3396a5ffea | ||
|
|
18a14d3b75 | ||
|
|
2b13352004 | ||
|
|
94e5d7e642 | ||
|
|
001b4dbada | ||
|
|
1192dec689 | ||
|
|
956d47f9da | ||
|
|
063a071228 | ||
|
|
c54a7de827 | ||
|
|
0410e48aad | ||
|
|
a4d95737d3 | ||
|
|
bc64d83ab2 | ||
|
|
87616e388b | ||
|
|
3f35f90fc2 | ||
|
|
c3ba69814c | ||
|
|
66a517e58d | ||
|
|
3108c927af | ||
|
|
5738cceac9 | ||
|
|
db2f648bce | ||
|
|
6012a6cf9f | ||
|
|
a4dcbc90e6 | ||
|
|
955ecce952 | ||
|
|
91fba21ed3 | ||
|
|
490e2934b8 | ||
|
|
cb6d3d4fc3 | ||
|
|
7f2a09eab3 | ||
|
|
c522a308b9 | ||
|
|
dde686d55f | ||
|
|
2f0b4888de | ||
|
|
35e7b11709 | ||
|
|
6cf3f158c7 | ||
|
|
4944e705dc | ||
|
|
3b38b9d86b | ||
|
|
6275eec918 | ||
|
|
ad652ca6f5 | ||
|
|
7029d985c6 | ||
|
|
9539fd40eb | ||
|
|
4c03a482bd | ||
|
|
f58ed5614e | ||
|
|
198e78e0b4 | ||
|
|
1f16e09daa | ||
|
|
16f47f8664 | ||
|
|
40604c7880 | ||
|
|
fa86c4f39a | ||
|
|
7f3cc784cd | ||
|
|
836f6c3520 | ||
|
|
2ff1e3a245 | ||
|
|
f7078a6140 | ||
|
|
141786e4e9 | ||
|
|
2d098f8078 | ||
|
|
229254e3d3 | ||
|
|
96329967ba | ||
|
|
0d988bbd6a | ||
|
|
1ff4f33ceb | ||
|
|
c95d61397d | ||
|
|
590238dc13 | ||
|
|
ed1b2613f2 | ||
|
|
c0e0db670c | ||
|
|
9132a2c4a9 | ||
|
|
5e880ba25e | ||
|
|
5a1928bee6 | ||
|
|
82e9e72c70 | ||
|
|
c35f55f70c | ||
|
|
0542b39373 | ||
|
|
013cf21863 | ||
|
|
c648f9b14a | ||
|
|
d9407c425f | ||
|
|
2c8dad980b | ||
|
|
75d94f5b89 | ||
|
|
4d760d3019 | ||
|
|
20c9230291 | ||
|
|
02c3a34f13 | ||
|
|
c2dadc2b92 | ||
|
|
f5de005ad7 | ||
|
|
335a82332f | ||
|
|
a81cb5c1ab | ||
|
|
aaf1d86a55 | ||
|
|
cbad4dd172 | ||
|
|
932da58759 | ||
|
|
01defdf0f6 | ||
|
|
b33cce3059 | ||
|
|
17ef66aa49 | ||
|
|
f01d770fec | ||
|
|
06cc7fcc02 | ||
|
|
4635047004 | ||
|
|
88b70eba53 | ||
|
|
6ad48250f8 | ||
|
|
9ac9f76a1d | ||
|
|
b7702daea3 | ||
|
|
db7180a761 | ||
|
|
dbe62082ff | ||
|
|
06bf2bbc2f | ||
|
|
162a0c543c | ||
|
|
2bc07c91df | ||
|
|
3d84a5589f | ||
|
|
b88438a0a3 | ||
|
|
b73dcc9388 | ||
|
|
12ad08a619 | ||
|
|
0c000a4994 | ||
|
|
d2da7e2ea5 | ||
|
|
873bba92db | ||
|
|
3e14186d3d | ||
|
|
5be325405d | ||
|
|
5b92b75090 | ||
|
|
7202de6f4c | ||
|
|
e6a772ebfd | ||
|
|
f320492164 | ||
|
|
d8fd430856 | ||
|
|
8e3a06b07f | ||
|
|
b6f65f278d | ||
|
|
3e8dfb6841 | ||
|
|
ffeb47eaac | ||
|
|
4cffe1d6bc | ||
|
|
49b3b6ded5 | ||
|
|
f294130746 | ||
|
|
1910f1b78a | ||
|
|
cc1d2f1eae | ||
|
|
048121a936 | ||
|
|
e41e74d730 | ||
|
|
0ef1a26e95 | ||
|
|
00701a3999 | ||
|
|
8453e60609 | ||
|
|
d139073948 | ||
|
|
f6e6f9cbfb | ||
|
|
66e4af2be5 | ||
|
|
7327ee3ff8 | ||
|
|
23087bdb6f | ||
|
|
5e9a69d8f3 | ||
|
|
3e96e83c3c | ||
|
|
83ce744fb2 | ||
|
|
ae03b85a97 | ||
|
|
53e91a87b0 | ||
|
|
519c6bca66 | ||
|
|
f7dcacab92 | ||
|
|
00c6466423 | ||
|
|
b8d8867ebb | ||
|
|
7b1d746ce7 | ||
|
|
7dc0a2f664 | ||
|
|
52f7df0350 | ||
|
|
38d1cac5d9 | ||
|
|
c3565f72c4 | ||
|
|
7fdb0a5078 | ||
|
|
ce30a7d5cd | ||
|
|
28597721f2 | ||
|
|
c2fd02ac48 | ||
|
|
a8aa1f87f2 | ||
|
|
2ba17d89ef | ||
|
|
aaae8a5d3b | ||
|
|
5ca91157ca | ||
|
|
bad1b0b105 | ||
|
|
d14a149c57 | ||
|
|
9c6c77615e | ||
|
|
913e64bb75 | ||
|
|
fd8ef545e8 | ||
|
|
d068cc40f0 | ||
|
|
ee0e17a496 | ||
|
|
f1afc0f4d9 | ||
|
|
ea1afe7610 | ||
|
|
4ade175a3d | ||
|
|
c6ea06153a | ||
|
|
eb36a0f8cb | ||
|
|
3087c1a6e8 | ||
|
|
e5b0a1c591 | ||
|
|
af41e8e429 | ||
|
|
7e677ee9fa | ||
|
|
eea4cf68ad | ||
|
|
3a400dd15a | ||
|
|
fbbbd52d72 | ||
|
|
27664c7dce | ||
|
|
e1bdd215b1 | ||
|
|
d04a35565e | ||
|
|
7aad2cf4af | ||
|
|
bfa667584a | ||
|
|
1858cb4df8 | ||
|
|
dc30a3d1c3 | ||
|
|
6e690cc6f2 | ||
|
|
911b4076f5 | ||
|
|
4c01b1e542 | ||
|
|
ec372dbb98 | ||
|
|
0b87025c52 | ||
|
|
7d4230ecfb | ||
|
|
d06583773a | ||
|
|
67c1fbd07a | ||
|
|
5c7fab8f01 | ||
|
|
06554375cb | ||
|
|
e65329e7b3 | ||
|
|
f5435c581b | ||
|
|
5e8b23db6a | ||
|
|
f2849aa6ec | ||
|
|
ee947b6468 | ||
|
|
49c072b40d | ||
|
|
204f9f1fbc | ||
|
|
cccbaafd1b | ||
|
|
7bc06bb6b1 | ||
|
|
c16d5190c6 | ||
|
|
ffdd9b9d79 | ||
|
|
8d35c54672 | ||
|
|
eb0164907c | ||
|
|
478d44885c | ||
|
|
541bc456be | ||
|
|
5ce75992a3 | ||
|
|
c8b3ba7f6c | ||
|
|
d92ce86bb8 | ||
|
|
f7b4c8cd28 | ||
|
|
24c063b106 | ||
|
|
e478d2e624 | ||
|
|
dc0f726029 | ||
|
|
784b8da7af | ||
|
|
79e9dc9914 | ||
|
|
4849c6b42d | ||
|
|
024d142c8d | ||
|
|
126aea931c | ||
|
|
2372281d5e | ||
|
|
376d6609f2 | ||
|
|
96ab4c53af | ||
|
|
96cf46d834 | ||
|
|
208414704d | ||
|
|
7f453aa145 | ||
|
|
123997fa13 | ||
|
|
7faef2f8a7 | ||
|
|
f93cf3b996 | ||
|
|
df5b69756c | ||
|
|
745bb98abe | ||
|
|
cf1d02771f | ||
|
|
52377b0042 | ||
|
|
270501a237 | ||
|
|
2e5283b8d3 | ||
|
|
8cad47b29e | ||
|
|
2458d60d80 | ||
|
|
9a79dc4cdd | ||
|
|
e531b509d6 | ||
|
|
d287fc1186 | ||
|
|
f47f7c7361 | ||
|
|
7a6c99d57d | ||
|
|
5105114321 | ||
|
|
60beebcb4c | ||
|
|
fa03b4226a | ||
|
|
b047a053c5 | ||
|
|
42907cd228 | ||
|
|
425892cfc4 | ||
|
|
16fd804e93 | ||
|
|
2f147dde13 | ||
|
|
0d04f07f2a | ||
|
|
96485218b7 | ||
|
|
227cc57426 | ||
|
|
b99061777a | ||
|
|
8749dc649a | ||
|
|
65da51a478 | ||
|
|
0c31ba1c5f | ||
|
|
acf94b052b | ||
|
|
556441d811 | ||
|
|
efcf17e47c | ||
|
|
02b7744995 | ||
|
|
c86947b69c | ||
|
|
839b8c2844 | ||
|
|
e4a634e6e8 | ||
|
|
eb99c10ad0 | ||
|
|
175b7b89e4 | ||
|
|
5374afb226 | ||
|
|
1a44f48fad | ||
|
|
50dbe7cfc0 | ||
|
|
c7e576c879 | ||
|
|
a3e4847744 | ||
|
|
903f8ed5a7 | ||
|
|
b091c7f364 | ||
|
|
e069db3c45 | ||
|
|
047264dbbc | ||
|
|
0c216ba87a | ||
|
|
31cdc28143 | ||
|
|
e03b728240 | ||
|
|
4c275ba52f | ||
|
|
2ac9a888a8 | ||
|
|
f9bdcf8938 | ||
|
|
c3bef26ae6 | ||
|
|
634849c347 | ||
|
|
c557b737f6 | ||
|
|
1d326afa93 | ||
|
|
cb6c58cb5d | ||
|
|
ec4d708569 | ||
|
|
05b19cefa5 | ||
|
|
fdd57d0801 | ||
|
|
c16d6d1644 | ||
|
|
656b39c880 | ||
|
|
753c996291 | ||
|
|
dcdd0cc2bb | ||
|
|
2f32df16d9 | ||
|
|
9caa9c47b4 | ||
|
|
55bec8a911 | ||
|
|
43f95fd40e | ||
|
|
641812e7c1 | ||
|
|
95d3e75425 | ||
|
|
7f06c7e92e | ||
|
|
0e6fdffeec | ||
|
|
f77681b9c9 | ||
|
|
535d4bbe1b | ||
|
|
1dfbca3d5b | ||
|
|
d2ca265cc2 | ||
|
|
fc70345fcd | ||
|
|
6ae9b982a9 | ||
|
|
0122b4c6ce | ||
|
|
08c0faa20e | ||
|
|
ab7efea8c5 | ||
|
|
f4623664d5 | ||
|
|
df147435c5 | ||
|
|
71c1c5ae83 | ||
|
|
0ea142d6db | ||
|
|
f88a3059be | ||
|
|
48281ddf86 | ||
|
|
7cdcf9b757 | ||
|
|
ef0bb12fbd | ||
|
|
a0857f86b2 | ||
|
|
2219b3f47b | ||
|
|
b6c873f22d | ||
|
|
64bc92a7fd | ||
|
|
6c4c0f7595 | ||
|
|
2d9c977805 | ||
|
|
dff0375848 | ||
|
|
ab825a1a70 | ||
|
|
466617847f | ||
|
|
a53fff2416 | ||
|
|
dd1430dbbf | ||
|
|
5aad16968b | ||
|
|
f2d3acb650 | ||
|
|
666f8c813d | ||
|
|
e87fb7b50e | ||
|
|
75612879c7 | ||
|
|
94e0c80d47 | ||
|
|
feb6f4cbe0 | ||
|
|
1173bbf628 | ||
|
|
1cdc2e93ad | ||
|
|
3356bd8825 | ||
|
|
decc7a4a1e | ||
|
|
a397cab61c | ||
|
|
228e3d9ae3 | ||
|
|
051f670453 | ||
|
|
cf8aa86a67 | ||
|
|
5b00286e65 | ||
|
|
6597caaf05 | ||
|
|
5851124dee | ||
|
|
b18689a0d6 | ||
|
|
a5e7f78a1f | ||
|
|
a1d394fbc2 | ||
|
|
5e82bda666 | ||
|
|
3d5580ad9d | ||
|
|
c83cfbe8b0 | ||
|
|
00cc1b62ef | ||
|
|
e782f75863 | ||
|
|
f5f379465f | ||
|
|
70a8fda449 | ||
|
|
ca14302191 | ||
|
|
7297c2626f | ||
|
|
92a3982f21 | ||
|
|
626f5efdcd | ||
|
|
24e780b984 | ||
|
|
596d4aceb6 | ||
|
|
e770254b65 | ||
|
|
7901c26d32 | ||
|
|
fc65f8f689 | ||
|
|
e0a5e14978 | ||
|
|
07562c203a | ||
|
|
8187a19e6e | ||
|
|
32cd684307 | ||
|
|
3a72fc95d9 | ||
|
|
64405fba3d | ||
|
|
cc7981229c | ||
|
|
3ec208dc85 | ||
|
|
1b92b6cbfa | ||
|
|
779addfcb4 | ||
|
|
7da5f7a884 | ||
|
|
34e14636d4 | ||
|
|
aa222aac31 | ||
|
|
5134caa103 | ||
|
|
dca3c92d72 | ||
|
|
a85d5bad46 | ||
|
|
716613a4db | ||
|
|
12eaa66bc5 | ||
|
|
a6af97e3c1 | ||
|
|
d561c86c68 | ||
|
|
f243d1c9b4 | ||
|
|
1cc2cc6400 | ||
|
|
15f4c05772 | ||
|
|
c9a204b7a7 | ||
|
|
3d0018c0bd | ||
|
|
d639e46bc7 | ||
|
|
fa633bf419 | ||
|
|
40f7ef90b3 | ||
|
|
50efe607d4 | ||
|
|
3b057f2c27 | ||
|
|
d3d018bd44 | ||
|
|
1378609aa2 | ||
|
|
001c896eed | ||
|
|
1cf3a0143c | ||
|
|
f04be521e5 | ||
|
|
2873632a40 | ||
|
|
075879b5b5 | ||
|
|
9b12930376 | ||
|
|
3339ba9bad | ||
|
|
68922676fc | ||
|
|
dcf2afb4a6 | ||
|
|
16a35141dd | ||
|
|
f6c334bdad | ||
|
|
cbb119117b | ||
|
|
cae0a6118f |
@@ -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)."
|
||||||
@@ -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: "如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。"
|
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: 问题与讨论 / Questions & Discussions
|
- name: Questions & Discussions
|
||||||
url: https://github.com/1Panel-dev/1Panel/discussions
|
url: https://github.com/1Panel-dev/1Panel/discussions
|
||||||
about: 提出针对本项目安装部署、使用及其他方面的相关问题 / Raise questions about the installation, deployment, use and other aspects of the project.
|
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 有其他想要提问的,我们欢迎到我们的官方社区进行提问。
|
|
||||||
|
|||||||
@@ -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: "如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。"
|
|
||||||
@@ -1,13 +1,10 @@
|
|||||||
|
name: General PR Handling for 1Panel
|
||||||
on: pull_request
|
on: pull_request
|
||||||
|
|
||||||
name: 1Panel 通用 PR 处理
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
generic_handler:
|
generic_handler:
|
||||||
name: 为 PR 添加标签
|
name: Add Labels to PR
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
|
name: Create Release And Upload assets
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
# Sequence of patterns matched against refs/tags
|
|
||||||
tags:
|
tags:
|
||||||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
- 'v*'
|
||||||
|
|
||||||
name: Create Release And Upload assets
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-release:
|
create-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -15,7 +12,7 @@ jobs:
|
|||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20.2'
|
node-version: '22.19.0'
|
||||||
- name: Build Web
|
- name: Build Web
|
||||||
run: |
|
run: |
|
||||||
cd frontend && npm install && npm run build:pro
|
cd frontend && npm install && npm run build:pro
|
||||||
@@ -24,43 +21,27 @@ jobs:
|
|||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.22'
|
go-version: '1.24'
|
||||||
- name: Build Release
|
- name: Build Release
|
||||||
uses: goreleaser/goreleaser-action@v6
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
distribution: goreleaser
|
distribution: goreleaser
|
||||||
version: latest
|
version: '~> v2'
|
||||||
args: release --skip=publish --clean
|
args: release --skip=publish --clean
|
||||||
- name: Upload Assets
|
- name: Upload Assets
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
draft: true
|
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: |
|
files: |
|
||||||
dist/*.tar.gz
|
dist/*.tar.gz
|
||||||
dist/checksums.txt
|
dist/checksums.txt
|
||||||
- name: Setup OSSUTIL
|
- name: Setup OSSUTIL
|
||||||
uses: yizhoumo/setup-ossutil@v1
|
uses: yizhoumo/setup-ossutil@v2
|
||||||
with:
|
with:
|
||||||
endpoint: ${{ secrets.OSS_ENDPOINT }}
|
endpoint: ${{ secrets.OSS_ENDPOINT }}
|
||||||
access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }}
|
access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }}
|
||||||
access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
|
access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
|
||||||
ossutil-version: '1.7.14'
|
ossutil-version: '1.7.18'
|
||||||
- name: Upload Assets to OSS
|
- 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
|
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
|
||||||
@@ -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: '22.19.0'
|
||||||
|
- 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.24'
|
||||||
|
- 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
|
||||||
@@ -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@v4
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20.2'
|
|
||||||
- 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@v5
|
|
||||||
with:
|
|
||||||
go-version: '1.22'
|
|
||||||
- name: Build Server
|
|
||||||
uses: goreleaser/goreleaser-action@v6
|
|
||||||
with:
|
|
||||||
args: release --snapshot --clean
|
|
||||||
@@ -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 }}
|
|
||||||
@@ -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 }}
|
|
||||||
@@ -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"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: Build
|
name: SonarCloud Scan
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@@ -17,4 +17,4 @@ jobs:
|
|||||||
uses: SonarSource/sonarcloud-github-action@master
|
uses: SonarSource/sonarcloud-github-action@master
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
name: sync2gitee
|
name: Synchronize to Gitee
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
repo-sync:
|
repo-sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
name: Typos Check
|
name: Typos Check
|
||||||
on: pull_request
|
on: pull_request
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
name: Spell Check with Typos
|
name: Spell Check with Typos
|
||||||
@@ -8,6 +7,5 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout Actions Repository
|
- name: Checkout Actions Repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Check spelling
|
- name: Check spelling
|
||||||
uses: crate-ci/typos@master
|
uses: crate-ci/typos@master
|
||||||
|
|||||||
+1
-5
@@ -22,7 +22,6 @@ build/1panel
|
|||||||
*.iml
|
*.iml
|
||||||
*.ipr
|
*.ipr
|
||||||
|
|
||||||
|
|
||||||
# Test binary, built with `go test -c`
|
# Test binary, built with `go test -c`
|
||||||
*.test
|
*.test
|
||||||
|
|
||||||
@@ -40,10 +39,7 @@ frontend/auto-imports.d.ts
|
|||||||
frontend/components.d.ts
|
frontend/components.d.ts
|
||||||
frontend/src/xpack
|
frontend/src/xpack
|
||||||
backend/xpack
|
backend/xpack
|
||||||
backend/router/entry_xpack.go
|
*_xpack.go
|
||||||
backend/server/init_xpack.go
|
|
||||||
backend/utils/xpack/xpack_xpack.go
|
|
||||||
|
|
||||||
.history/
|
.history/
|
||||||
dist/
|
dist/
|
||||||
1pctl
|
1pctl
|
||||||
|
|||||||
+20
-23
@@ -1,14 +1,16 @@
|
|||||||
# This is an example .goreleaser.yml file with some sensible defaults.
|
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
|
||||||
# Make sure to check the documentation at https://goreleaser.com
|
# vim: set ts=2 sw=2 tw=0 fo=jcroql
|
||||||
|
version: 2
|
||||||
|
|
||||||
before:
|
before:
|
||||||
hooks:
|
hooks:
|
||||||
# - export NODE_OPTIONS="--max-old-space-size=8192"
|
# - export NODE_OPTIONS="--max-old-space-size=8192"
|
||||||
# - make build_web
|
# - make build_web
|
||||||
- chmod +x ./script.sh
|
- chmod +x ./ci/script.sh
|
||||||
- ./script.sh
|
- ./ci/script.sh
|
||||||
- sed -i 's@ORIGINAL_VERSION=.*@ORIGINAL_VERSION=v{{ .Version }}@g' 1pctl
|
- sed -i 's@ORIGINAL_VERSION=.*@ORIGINAL_VERSION=v{{ .Version }}@g' 1pctl
|
||||||
- go mod tidy
|
- go mod tidy
|
||||||
|
|
||||||
builds:
|
builds:
|
||||||
- main: ./cmd/server/main.go
|
- main: ./cmd/server/main.go
|
||||||
binary: 1panel
|
binary: 1panel
|
||||||
@@ -29,31 +31,26 @@ builds:
|
|||||||
- arm
|
- arm
|
||||||
- ppc64le
|
- ppc64le
|
||||||
- s390x
|
- s390x
|
||||||
|
- riscv64
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
- format: tar.gz
|
- formats: [ 'tar.gz' ]
|
||||||
name_template: "1panel-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{- if .Arm }}v{{ .Arm }}{{ end }}"
|
name_template: "1panel-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{- if .Arm }}v{{ .Arm }}{{ end }}"
|
||||||
wrap_in_directory: true
|
wrap_in_directory: true
|
||||||
files:
|
files:
|
||||||
- 1pctl
|
- 1pctl
|
||||||
- 1panel.service
|
|
||||||
- install.sh
|
- install.sh
|
||||||
- README.md
|
- 1panel.service
|
||||||
- LICENSE
|
- initscript/*
|
||||||
|
- lang/*
|
||||||
|
- GeoIP.mmdb
|
||||||
|
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'checksums.txt'
|
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`
|
changelog:
|
||||||
# Feel free to remove those if you don't want/use them.
|
sort: asc
|
||||||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
|
filters:
|
||||||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
|
exclude:
|
||||||
|
- "^docs:"
|
||||||
|
- "^test:"
|
||||||
|
|||||||
Generated
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 3.3 KiB |
Vendored
-3
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"ansible.python.interpreterPath": "/opt/homebrew/bin/python3"
|
|
||||||
}
|
|
||||||
+1
-1
@@ -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
|
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/faq. Translations are available at
|
||||||
https://www.contributor-covenant.org/translations.
|
https://www.contributor-covenant.org/translations.
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ PR are always welcome, even if they only contain small fixes like typos or a few
|
|||||||
|
|
||||||
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.
|
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.pro/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.
|
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.
|
||||||
|
|
||||||
|
|||||||
@@ -2,15 +2,15 @@ GOCMD=go
|
|||||||
GOBUILD=$(GOCMD) build
|
GOBUILD=$(GOCMD) build
|
||||||
GOCLEAN=$(GOCMD) clean
|
GOCLEAN=$(GOCMD) clean
|
||||||
GOARCH=$(shell go env GOARCH)
|
GOARCH=$(shell go env GOARCH)
|
||||||
GOOS=$(shell go env GOOS )
|
GOOS=$(shell go env GOOS)
|
||||||
|
|
||||||
BASE_PAH := $(shell pwd)
|
BASE_PATH := $(shell pwd)
|
||||||
BUILD_PATH = $(BASE_PAH)/build
|
BUILD_PATH = $(BASE_PATH)/build
|
||||||
WEB_PATH=$(BASE_PAH)/frontend
|
WEB_PATH=$(BASE_PATH)/frontend
|
||||||
SERVER_PATH=$(BASE_PAH)/backend
|
SERVER_PATH=$(BASE_PATH)/backend
|
||||||
MAIN= $(BASE_PAH)/cmd/server/main.go
|
MAIN= $(BASE_PATH)/cmd/server/main.go
|
||||||
APP_NAME=1panel
|
APP_NAME=1panel
|
||||||
ASSERT_PATH= $(BASE_PAH)/cmd/server/web/assets
|
ASSERT_PATH= $(BASE_PATH)/cmd/server/web/assets
|
||||||
|
|
||||||
clean_assets:
|
clean_assets:
|
||||||
rm -rf $(ASSERT_PATH)
|
rm -rf $(ASSERT_PATH)
|
||||||
@@ -23,7 +23,7 @@ build_frontend:
|
|||||||
|
|
||||||
build_backend_on_linux:
|
build_backend_on_linux:
|
||||||
cd $(SERVER_PATH) \
|
cd $(SERVER_PATH) \
|
||||||
&& GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags '-s -w' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
|
&& CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOBUILD) -trimpath -ldflags '-s -w' -o $(BUILD_PATH)/$(APP_NAME) $(MAIN)
|
||||||
|
|
||||||
build_backend_on_darwin:
|
build_backend_on_darwin:
|
||||||
cd $(SERVER_PATH) \
|
cd $(SERVER_PATH) \
|
||||||
@@ -31,4 +31,4 @@ build_backend_on_darwin:
|
|||||||
|
|
||||||
build_all: build_frontend build_backend_on_linux
|
build_all: build_frontend build_backend_on_linux
|
||||||
|
|
||||||
build_on_local: clean_assets build_frontend build_backend_on_darwin upx_bin
|
build_on_local: clean_assets build_frontend build_backend_on_darwin
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
reviewers:
|
reviewers:
|
||||||
|
- wanghe-fit2cloud
|
||||||
- zhengkunwang223
|
- zhengkunwang223
|
||||||
- ssongliu
|
- ssongliu
|
||||||
- wanghe-fit2cloud
|
|
||||||
- wangdan-fit2cloud
|
|
||||||
|
|
||||||
approvers:
|
approvers:
|
||||||
|
- wanghe-fit2cloud
|
||||||
- zhengkunwang223
|
- zhengkunwang223
|
||||||
- ssongliu
|
- ssongliu
|
||||||
- wanghe-fit2cloud
|
|
||||||
- wangdan-fit2cloud
|
|
||||||
@@ -1,64 +1,87 @@
|
|||||||
<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"><a href="https://1panel.pro"><img src="https://resource.1panel.pro/img/1panel-logo.png" alt="1Panel" width="300" /></a></p>
|
||||||
<p align="center"><b>Web-based linux server management control panel</b></p>
|
<p align="center"><b>Simplify Linux Server Management</b></p>
|
||||||
<p align="center"><b>现代化、开源的 Linux 服务器运维管理面板</b></p>
|
|
||||||
<p align="center">
|
<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: 250px; height: 55px;" width="250" height="55"/></a>
|
<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: 240px; height: auto;" /></a>
|
||||||
<a href="https://hellogithub.com/repository/71791baf930149ac9b84e1acf186573f" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=71791baf930149ac9b84e1acf186573f&claim_uid=p8vB3kP5CMrthiL&theme=dark&theme=neutral" alt="Featured|HelloGitHub" style="width: 250px; height: 55px;" width="250" height="55" /></a>
|
|
||||||
</p>
|
</p>
|
||||||
<p align="center">
|
<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://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://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://discord.gg/bUpUqWqdRr" target="_blank">
|
||||||
|
<img src="https://img.shields.io/discord/1318846410149335080?logo=discord&labelColor=%20%235462eb&logoColor=%20%23f5f5f5&color=%20%235462eb"
|
||||||
|
alt="chat on Discord"></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/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="GitHub Stars"></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="https://gitee.com/fit2cloud-feizhiyun/1Panel"><img src="https://gitee.com/fit2cloud-feizhiyun/1Panel/badge/star.svg?theme=gvp" alt="Gitee Stars"></a><br>
|
</p>
|
||||||
[<a href="docs/README_EN.md">English</a>] | [<a href="docs/README_TW.md">中文(繁體)</a>] | [<a href="docs/README_JP.md">日本語</a>]
|
<p align="center">
|
||||||
|
<a href="/README.md"><img alt="English" src="https://img.shields.io/badge/English-d9d9d9"></a>
|
||||||
|
<a href="/docs/README.zh-Hans.md"><img alt="中文(简体)" src="https://img.shields.io/badge/中文(简体)-d9d9d9"></a>
|
||||||
|
<a href="/docs/README.ja.md"><img alt="日本語" src="https://img.shields.io/badge/日本語-d9d9d9"></a>
|
||||||
|
<a href="/docs/README.pt-br.md"><img alt="Português (Brasil)" src="https://img.shields.io/badge/Português (Brasil)-d9d9d9"></a>
|
||||||
|
<a href="/docs/README.ar.md"><img alt="العربية" src="https://img.shields.io/badge/العربية-d9d9d9"></a>
|
||||||
|
<a href="/docs/README.de.md"><img alt="Deutsch" src="https://img.shields.io/badge/Deutsch-d9d9d9"></a>
|
||||||
|
<a href="/docs/README.es.md"><img alt="Español" src="https://img.shields.io/badge/Español-d9d9d9"></a><br>
|
||||||
|
<a href="/docs/README.fr.md"><img alt="français" src="https://img.shields.io/badge/français-d9d9d9"></a>
|
||||||
|
<a href="/docs/README.ko.md"><img alt="한국어" src="https://img.shields.io/badge/한국어-d9d9d9"></a>
|
||||||
|
<a href="/docs/README.id.md"><img alt="Bahasa Indonesia" src="https://img.shields.io/badge/Bahasa Indonesia-d9d9d9"></a>
|
||||||
|
<a href="/docs/README.zh-Hant.md"><img alt="中文(繁體)" src="https://img.shields.io/badge/中文(繁體)-d9d9d9"></a>
|
||||||
|
<a href="/docs/README.tr.md"><img alt="Türkçe" src="https://img.shields.io/badge/Türkçe-d9d9d9"></a>
|
||||||
|
<a href="/docs/README.ru.md"><img alt="Русский" src="https://img.shields.io/badge/%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9-d9d9d9"></a>
|
||||||
|
<a href="/docs/README.ms.md"><img alt="Bahasa Melayu" src="https://img.shields.io/badge/Bahasa Melayu-d9d9d9"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[](https://www.bilibili.com/video/BV1Mt421n7LZ/)
|
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
## 什么是 1Panel?
|
|
||||||
|
|
||||||
1Panel 是新一代的 Linux 服务器运维管理面板。
|
1Panel provides an intuitive web interface and MCP Server to manage websites, files, containers, databases, and LLMs on a Linux server.
|
||||||
|
|
||||||
- **高效管理**:用户可以通过 Web 界面轻松管理 Linux 服务器,如主机监控、文件管理、数据库管理、容器管理等;
|
- **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, container management, LLMs management.
|
||||||
- **快速建站**:深度集成开源建站软件 WordPress 和 [Halo](https://github.com/halo-dev/halo/),域名绑定、SSL 证书配置等操作一键搞定;
|
- **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.
|
||||||
|
- **MCP Server**: [1Panel MCP Server](https://github.com/1Panel-dev/mcp-1panel) allow user to execute server operations via natural language.
|
||||||
|
|
||||||
## 快速开始
|
## Quick Start
|
||||||
|
|
||||||
**一键安装**
|
Execute the script below and follow the prompts to install 1Panel:
|
||||||
|
|
||||||
执行如下命令一键安装 1Panel:
|
```bash
|
||||||
|
curl -sSL https://resource.1panel.pro/quick_start.sh -o quick_start.sh && bash quick_start.sh
|
||||||
```sh
|
|
||||||
curl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && sudo bash quick_start.sh
|
|
||||||
```
|
```
|
||||||
|
|
||||||
如果是用于离线环境,推荐使用 [安装包方式](https://1panel.cn/docs/installation/package_installation/) 进行安装部署。
|
Please refer to our [documentation](https://docs.1panel.pro/quick_start/) for more details.
|
||||||
|
|
||||||
**学习资料**
|
中国用户请使用此 [安装脚本](https://1panel.cn/docs/v2/installation/online_installation/),默认安装 V2 版本,应用数量相较国际版本更丰富。
|
||||||
|
|
||||||
- [在线文档](https://1panel.cn/docs/)
|
## Screenshot
|
||||||
- [社区论坛](https://bbs.fit2cloud.com/c/1p/7)
|
|
||||||
- [如何加入微信交流群?](https://bbs.fit2cloud.com/t/topic/2147)
|
|
||||||
|
|
||||||
## 飞致云的其他明星项目
|

|
||||||
|
|
||||||
- [MaxKB](https://github.com/1Panel-dev/MaxKB/) - 基于 LLM 大语言模型的开源知识库问答系统
|
## Star History
|
||||||
- [JumpServer](https://github.com/jumpserver/jumpserver/) - 广受欢迎的开源堡垒机
|
|
||||||
- [Halo](https://github.com/halo-dev/halo/) - 强大易用的开源建站工具
|
[](https://star-history.com/#1Panel-dev/1Panel&Date)
|
||||||
- [DataEase](https://github.com/dataease/dataease/) - 人人可用的开源数据可视化分析工具
|
|
||||||
- [MeterSphere](https://github.com/metersphere/metersphere/) - 开源自动化测试平台
|
## Pro Edition
|
||||||
|
|
||||||
|
Compared to the OSS Edition, 1Panel Pro Edition provides users with a wealth of enhanced features and technical support services. Enhanced features include WAF enhancement, Website monitoring, Mobile APP, custom logo and theme, etc.
|
||||||
|
|
||||||
|
[Click to see Pro Edition details](https://1panel.pro/pricing).
|
||||||
|
|
||||||
|
## Security Information
|
||||||
|
|
||||||
|
If you discover any security issues, please refer to [SECURITY.md](/SECURITY.md).
|
||||||
|
|
||||||
|
## GitAds Sponsored
|
||||||
|
|
||||||
|
[](https://gitads.dev/v1/ad-track?source=1panel-dev/1panel@github)
|
||||||
|
|
||||||
## License
|
## 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
|
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>
|
<https://www.gnu.org/licenses/gpl-3.0.html>
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
|
||||||
|
<!-- GitAds-Verify: 9M8AMBB11GYJ3RUNXGB5R1MR71KPATU9 -->
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+8
-10
@@ -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:
|
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.
|
||||||
|
|
||||||
- wanghe@fit2cloud.com
|
|
||||||
|
|
||||||
Thanks for your support!
|
|
||||||
|
|||||||
@@ -0,0 +1,257 @@
|
|||||||
|
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/1Panel-dev/1Panel/backend/utils/ai_tools/gpu"
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/utils/ai_tools/gpu/common"
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/utils/ai_tools/xpu"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
// @Tags AI
|
||||||
|
// @Summary Create Ollama model
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body dto.OllamaModelName true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /ai/ollama/model [post]
|
||||||
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"添加 Ollama 模型 [name]","formatEN":"add Ollama model [name]"}
|
||||||
|
func (b *BaseApi) CreateOllamaModel(c *gin.Context) {
|
||||||
|
var req dto.OllamaModelName
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := AIToolService.Create(req.Name); err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithData(c, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags AI
|
||||||
|
// @Summary Rereate Ollama model
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body dto.OllamaModelName true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /ai/ollama/model/recreate [post]
|
||||||
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"添加 Ollama 模型重试 [name]","formatEN":"re-add Ollama model [name]"}
|
||||||
|
func (b *BaseApi) RecreateOllamaModel(c *gin.Context) {
|
||||||
|
var req dto.OllamaModelName
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := AIToolService.Recreate(req.Name); err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithData(c, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags AI
|
||||||
|
// @Summary Close Ollama model conn
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body dto.OllamaModelName true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /ai/ollama/model/close [post]
|
||||||
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"关闭 Ollama 模型连接 [name]","formatEN":"close conn for Ollama model [name]"}
|
||||||
|
func (b *BaseApi) CloseOllamaModel(c *gin.Context) {
|
||||||
|
var req dto.OllamaModelName
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := AIToolService.Close(req.Name); err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithData(c, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags AI
|
||||||
|
// @Summary Sync Ollama model list
|
||||||
|
// @Success 200 {array} dto.OllamaModelDropList
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /ai/ollama/model/sync [post]
|
||||||
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"同步 Ollama 模型列表","formatEN":"sync Ollama model list"}
|
||||||
|
func (b *BaseApi) SyncOllamaModel(c *gin.Context) {
|
||||||
|
list, err := AIToolService.Sync()
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithData(c, list)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags AI
|
||||||
|
// @Summary Page Ollama models
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body dto.SearchWithPage true "request"
|
||||||
|
// @Success 200 {object} dto.PageResult
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /ai/ollama/model/search [post]
|
||||||
|
func (b *BaseApi) SearchOllamaModel(c *gin.Context) {
|
||||||
|
var req dto.SearchWithPage
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
total, list, err := AIToolService.Search(req)
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
helper.SuccessWithData(c, dto.PageResult{
|
||||||
|
Items: list,
|
||||||
|
Total: total,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags AI
|
||||||
|
// @Summary Page Ollama models
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body dto.OllamaModelName true "request"
|
||||||
|
// @Success 200 {string} details
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /ai/ollama/model/load [post]
|
||||||
|
func (b *BaseApi) LoadOllamaModelDetail(c *gin.Context) {
|
||||||
|
var req dto.OllamaModelName
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
detail, err := AIToolService.LoadDetail(req.Name)
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
helper.SuccessWithData(c, detail)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags AI
|
||||||
|
// @Summary Delete Ollama model
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body dto.ForceDelete true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /ai/ollama/model/del [post]
|
||||||
|
// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFunctions":[{"input_column":"id","input_value":"ids","isList":true,"db":"ollama_models","output_column":"name","output_value":"names"}],"formatZH":"删除 Ollama 模型 [names]","formatEN":"remove Ollama model [names]"}
|
||||||
|
func (b *BaseApi) DeleteOllamaModel(c *gin.Context) {
|
||||||
|
var req dto.ForceDelete
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := AIToolService.Delete(req); err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
helper.SuccessWithOutData(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags AI
|
||||||
|
// @Summary Load gpu / xpu info
|
||||||
|
// @Accept json
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /ai/gpu/load [get]
|
||||||
|
func (b *BaseApi) LoadGpuInfo(c *gin.Context) {
|
||||||
|
ok, client := gpu.New()
|
||||||
|
if ok {
|
||||||
|
info, err := client.LoadGpuInfo()
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithData(c, info)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
xpuOK, xpuClient := xpu.New()
|
||||||
|
if xpuOK {
|
||||||
|
info, err := xpuClient.LoadGpuInfo()
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithData(c, info)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithData(c, &common.GpuInfo{})
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags AI
|
||||||
|
// @Summary Bind domain
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body dto.OllamaBindDomain true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /ai/domain/bind [post]
|
||||||
|
func (b *BaseApi) BindDomain(c *gin.Context) {
|
||||||
|
var req dto.OllamaBindDomain
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := AIToolService.BindDomain(req); err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithOutData(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags AI
|
||||||
|
// @Summary Get bind domain
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body dto.OllamaBindDomainReq true "request"
|
||||||
|
// @Success 200 {object} dto.OllamaBindDomainRes
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /ai/domain/get [post]
|
||||||
|
func (b *BaseApi) GetBindDomain(c *gin.Context) {
|
||||||
|
var req dto.OllamaBindDomainReq
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := AIToolService.GetBindDomain(req)
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithData(c, res)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tags AI
|
||||||
|
// Summary Update bind domain
|
||||||
|
// Accept json
|
||||||
|
// Param request body dto.OllamaBindDomain true "request"
|
||||||
|
// Success 200
|
||||||
|
// Security ApiKeyAuth
|
||||||
|
// Security Timestamp
|
||||||
|
// Router /ai/domain/update [post]
|
||||||
|
func (b *BaseApi) UpdateBindDomain(c *gin.Context) {
|
||||||
|
var req dto.OllamaBindDomain
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := AIToolService.UpdateBindDomain(req); err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithOutData(c)
|
||||||
|
}
|
||||||
+20
-20
@@ -11,18 +11,18 @@ import (
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary List apps
|
// @Summary List apps
|
||||||
// @Description 获取应用列表
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.AppSearch true "request"
|
// @Param request body request.AppSearch true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} response.AppRes
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/search [post]
|
// @Router /apps/search [post]
|
||||||
func (b *BaseApi) SearchApp(c *gin.Context) {
|
func (b *BaseApi) SearchApp(c *gin.Context) {
|
||||||
var req request.AppSearch
|
var req request.AppSearch
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
list, err := appService.PageApp(req)
|
list, err := appService.PageApp(c, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
@@ -32,9 +32,9 @@ func (b *BaseApi) SearchApp(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Sync app list
|
// @Summary Sync app list
|
||||||
// @Description 同步应用列表
|
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/sync [post]
|
// @Router /apps/sync [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"应用商店同步","formatEN":"App store synchronization"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"应用商店同步","formatEN":"App store synchronization"}
|
||||||
func (b *BaseApi) SyncApp(c *gin.Context) {
|
func (b *BaseApi) SyncApp(c *gin.Context) {
|
||||||
@@ -63,19 +63,19 @@ func (b *BaseApi) SyncApp(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Search app by key
|
// @Summary Search app by key
|
||||||
// @Description 通过 key 获取应用信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param key path string true "app key"
|
// @Param key path string true "app key"
|
||||||
// @Success 200 {object} response.AppDTO
|
// @Success 200 {object} response.AppDTO
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /apps/:key [get]
|
// @Security Timestamp
|
||||||
|
// @Router /apps/{key} [get]
|
||||||
func (b *BaseApi) GetApp(c *gin.Context) {
|
func (b *BaseApi) GetApp(c *gin.Context) {
|
||||||
appKey, err := helper.GetStrParamByKey(c, "key")
|
appKey, err := helper.GetStrParamByKey(c, "key")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
|
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
appDTO, err := appService.GetApp(appKey)
|
appDTO, err := appService.GetApp(c, appKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
@@ -85,14 +85,14 @@ func (b *BaseApi) GetApp(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Search app detail by appid
|
// @Summary Search app detail by appid
|
||||||
// @Description 通过 appid 获取应用详情
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param appId path integer true "app id"
|
// @Param appId path integer true "app id"
|
||||||
// @Param version path string true "app 版本"
|
// @Param version path string true "app version"
|
||||||
// @Param version path string true "app 类型"
|
// @Param type path string true "app type"
|
||||||
// @Success 200 {object} response.AppDetailDTO
|
// @Success 200 {object} response.AppDetailDTO
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /apps/detail/:appId/:version/:type [get]
|
// @Security Timestamp
|
||||||
|
// @Router /apps/detail/{appId}/{version}/{type} [get]
|
||||||
func (b *BaseApi) GetAppDetail(c *gin.Context) {
|
func (b *BaseApi) GetAppDetail(c *gin.Context) {
|
||||||
appID, err := helper.GetIntParamByKey(c, "appId")
|
appID, err := helper.GetIntParamByKey(c, "appId")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -111,12 +111,12 @@ func (b *BaseApi) GetAppDetail(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Get app detail by id
|
// @Summary Get app detail by id
|
||||||
// @Description 通过 id 获取应用详情
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param appId path integer true "id"
|
// @Param id path integer true "id"
|
||||||
// @Success 200 {object} response.AppDetailDTO
|
// @Success 200 {object} response.AppDetailDTO
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /apps/details/:id [get]
|
// @Security Timestamp
|
||||||
|
// @Router /apps/details/{id} [get]
|
||||||
func (b *BaseApi) GetAppDetailByID(c *gin.Context) {
|
func (b *BaseApi) GetAppDetailByID(c *gin.Context) {
|
||||||
appDetailID, err := helper.GetIntParamByKey(c, "id")
|
appDetailID, err := helper.GetIntParamByKey(c, "id")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -133,10 +133,10 @@ func (b *BaseApi) GetAppDetailByID(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Get Ignore App
|
// @Summary Get Ignore App
|
||||||
// @Description 获取忽略的应用版本
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200 {object} response.IgnoredApp
|
// @Success 200 {object} response.IgnoredApp
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/ignored [get]
|
// @Router /apps/ignored [get]
|
||||||
func (b *BaseApi) GetIgnoredApp(c *gin.Context) {
|
func (b *BaseApi) GetIgnoredApp(c *gin.Context) {
|
||||||
res, err := appService.GetIgnoredApp()
|
res, err := appService.GetIgnoredApp()
|
||||||
@@ -149,13 +149,13 @@ func (b *BaseApi) GetIgnoredApp(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Install app
|
// @Summary Install app
|
||||||
// @Description 安装应用
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.AppInstallCreate true "request"
|
// @Param request body request.AppInstallCreate true "request"
|
||||||
// @Success 200 {object} model.AppInstall
|
// @Success 200 {object} model.AppInstall
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/install [post]
|
// @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) {
|
func (b *BaseApi) InstallApp(c *gin.Context) {
|
||||||
var req request.AppInstallCreate
|
var req request.AppInstallCreate
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
@@ -173,7 +173,7 @@ func (b *BaseApi) InstallApp(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseApi) GetAppTags(c *gin.Context) {
|
func (b *BaseApi) GetAppTags(c *gin.Context) {
|
||||||
tags, err := appService.GetAppTags()
|
tags, err := appService.GetAppTags(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
@@ -183,9 +183,9 @@ func (b *BaseApi) GetAppTags(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Get app list update
|
// @Summary Get app list update
|
||||||
// @Description 获取应用更新版本
|
// @Success 200 {object} response.AppUpdateRes
|
||||||
// @Success 200
|
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/checkupdate [get]
|
// @Router /apps/checkupdate [get]
|
||||||
func (b *BaseApi) GetAppListUpdate(c *gin.Context) {
|
func (b *BaseApi) GetAppListUpdate(c *gin.Context) {
|
||||||
res, err := appService.GetAppUpdate()
|
res, err := appService.GetAppUpdate()
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Page app installed
|
// @Summary Page app installed
|
||||||
// @Description 分页获取已安装应用列表
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.AppInstalledSearch true "request"
|
// @Param request body request.AppInstalledSearch true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/installed/search [post]
|
// @Router /apps/installed/search [post]
|
||||||
func (b *BaseApi) SearchAppInstalled(c *gin.Context) {
|
func (b *BaseApi) SearchAppInstalled(c *gin.Context) {
|
||||||
var req request.AppInstalledSearch
|
var req request.AppInstalledSearch
|
||||||
@@ -28,7 +28,10 @@ func (b *BaseApi) SearchAppInstalled(c *gin.Context) {
|
|||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
helper.SuccessWithData(c, list)
|
helper.SuccessWithData(c, dto.PageResult{
|
||||||
|
Items: list,
|
||||||
|
Total: int64(len(list)),
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
total, list, err := appInstallService.Page(req)
|
total, list, err := appInstallService.Page(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -44,10 +47,10 @@ func (b *BaseApi) SearchAppInstalled(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary List app installed
|
// @Summary List app installed
|
||||||
// @Description 获取已安装应用列表
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200 array dto.AppInstallInfo
|
// @Success 200 {array} dto.AppInstallInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/installed/list [get]
|
// @Router /apps/installed/list [get]
|
||||||
func (b *BaseApi) ListAppInstalled(c *gin.Context) {
|
func (b *BaseApi) ListAppInstalled(c *gin.Context) {
|
||||||
list, err := appInstallService.GetInstallList()
|
list, err := appInstallService.GetInstallList()
|
||||||
@@ -60,11 +63,11 @@ func (b *BaseApi) ListAppInstalled(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Check app installed
|
// @Summary Check app installed
|
||||||
// @Description 检查应用安装情况
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.AppInstalledInfo true "request"
|
// @Param request body request.AppInstalledInfo true "request"
|
||||||
// @Success 200 {object} response.AppInstalledCheck
|
// @Success 200 {object} response.AppInstalledCheck
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/installed/check [post]
|
// @Router /apps/installed/check [post]
|
||||||
func (b *BaseApi) CheckAppInstalled(c *gin.Context) {
|
func (b *BaseApi) CheckAppInstalled(c *gin.Context) {
|
||||||
var req request.AppInstalledInfo
|
var req request.AppInstalledInfo
|
||||||
@@ -81,11 +84,11 @@ func (b *BaseApi) CheckAppInstalled(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Search app port by key
|
// @Summary Search app port by key
|
||||||
// @Description 获取应用端口
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithNameAndType true "request"
|
// @Param request body dto.OperationWithNameAndType true "request"
|
||||||
// @Success 200 {integer} port
|
// @Success 200 {integer} port
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/installed/loadport [post]
|
// @Router /apps/installed/loadport [post]
|
||||||
func (b *BaseApi) LoadPort(c *gin.Context) {
|
func (b *BaseApi) LoadPort(c *gin.Context) {
|
||||||
var req dto.OperationWithNameAndType
|
var req dto.OperationWithNameAndType
|
||||||
@@ -102,12 +105,13 @@ func (b *BaseApi) LoadPort(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Search app password by key
|
// @Summary Search app password by key
|
||||||
// @Description 获取应用连接信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithNameAndType true "request"
|
// @Param request body dto.OperationWithNameAndType true "request"
|
||||||
// @Success 200 {string} response.DatabaseConn
|
// @Param key path string true "key"
|
||||||
|
// @Success 200 {object} response.DatabaseConn
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /apps/installed/conninfo/:key [get]
|
// @Security Timestamp
|
||||||
|
// @Router /apps/installed/conninfo/{key} [get]
|
||||||
func (b *BaseApi) LoadConnInfo(c *gin.Context) {
|
func (b *BaseApi) LoadConnInfo(c *gin.Context) {
|
||||||
var req dto.OperationWithNameAndType
|
var req dto.OperationWithNameAndType
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
@@ -123,12 +127,12 @@ func (b *BaseApi) LoadConnInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Check before delete
|
// @Summary Check before delete
|
||||||
// @Description 删除前检查
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param appInstallId path integer true "App install id"
|
// @Param appInstallId path integer true "App install id"
|
||||||
// @Success 200 {array} dto.AppResource
|
// @Success 200 {array} dto.AppResource
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /apps/installed/delete/check/:appInstallId [get]
|
// @Security Timestamp
|
||||||
|
// @Router /apps/installed/delete/check/{appInstallId} [get]
|
||||||
func (b *BaseApi) DeleteCheck(c *gin.Context) {
|
func (b *BaseApi) DeleteCheck(c *gin.Context) {
|
||||||
appInstallId, err := helper.GetIntParamByKey(c, "appInstallId")
|
appInstallId, err := helper.GetIntParamByKey(c, "appInstallId")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -146,9 +150,9 @@ func (b *BaseApi) DeleteCheck(c *gin.Context) {
|
|||||||
// Sync app installed
|
// Sync app installed
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Sync app installed
|
// @Summary Sync app installed
|
||||||
// @Description 同步已安装应用列表
|
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/installed/sync [post]
|
// @Router /apps/installed/sync [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"同步已安装应用列表","formatEN":"Sync the list of installed apps"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"同步已安装应用列表","formatEN":"Sync the list of installed apps"}
|
||||||
func (b *BaseApi) SyncInstalled(c *gin.Context) {
|
func (b *BaseApi) SyncInstalled(c *gin.Context) {
|
||||||
@@ -161,11 +165,11 @@ func (b *BaseApi) SyncInstalled(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Operate installed app
|
// @Summary Operate installed app
|
||||||
// @Description 操作已安装应用
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.AppInstalledOperate true "request"
|
// @Param request body request.AppInstalledOperate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/installed/op [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) OperateInstalled(c *gin.Context) {
|
||||||
@@ -182,12 +186,12 @@ func (b *BaseApi) OperateInstalled(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Search app service by key
|
// @Summary Search app service by key
|
||||||
// @Description 通过 key 获取应用 service
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param key path string true "request"
|
// @Param key path string true "request"
|
||||||
// @Success 200 {array} response.AppService
|
// @Success 200 {array} response.AppService
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /apps/services/:key [get]
|
// @Security Timestamp
|
||||||
|
// @Router /apps/services/{key} [get]
|
||||||
func (b *BaseApi) GetServices(c *gin.Context) {
|
func (b *BaseApi) GetServices(c *gin.Context) {
|
||||||
key := c.Param("key")
|
key := c.Param("key")
|
||||||
services, err := appInstallService.GetServices(key)
|
services, err := appInstallService.GetServices(key)
|
||||||
@@ -200,11 +204,10 @@ func (b *BaseApi) GetServices(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Search app update version by install id
|
// @Summary Search app update version by install id
|
||||||
// @Description 通过 install id 获取应用更新版本
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param appInstallId path integer true "request"
|
|
||||||
// @Success 200 {array} dto.AppVersion
|
// @Success 200 {array} dto.AppVersion
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/installed/update/versions [post]
|
// @Router /apps/installed/update/versions [post]
|
||||||
func (b *BaseApi) GetUpdateVersions(c *gin.Context) {
|
func (b *BaseApi) GetUpdateVersions(c *gin.Context) {
|
||||||
var req request.AppUpdateVersion
|
var req request.AppUpdateVersion
|
||||||
@@ -221,11 +224,11 @@ func (b *BaseApi) GetUpdateVersions(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Change app port
|
// @Summary Change app port
|
||||||
// @Description 修改应用端口
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.PortUpdate true "request"
|
// @Param request body request.PortUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/installed/port/change [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) ChangeAppPort(c *gin.Context) {
|
||||||
@@ -242,11 +245,11 @@ func (b *BaseApi) ChangeAppPort(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Search default config by key
|
// @Summary Search default config by key
|
||||||
// @Description 通过 key 获取应用默认配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithNameAndType true "request"
|
// @Param request body dto.OperationWithNameAndType true "request"
|
||||||
// @Success 200 {string} content
|
// @Success 200 {string} content
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/installed/conf [post]
|
// @Router /apps/installed/conf [post]
|
||||||
func (b *BaseApi) GetDefaultConfig(c *gin.Context) {
|
func (b *BaseApi) GetDefaultConfig(c *gin.Context) {
|
||||||
var req dto.OperationWithNameAndType
|
var req dto.OperationWithNameAndType
|
||||||
@@ -264,12 +267,12 @@ func (b *BaseApi) GetDefaultConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Search params by appInstallId
|
// @Summary Search params by appInstallId
|
||||||
// @Description 通过 install id 获取应用参数
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param appInstallId path string true "request"
|
// @Param appInstallId path string true "request"
|
||||||
// @Success 200 {object} response.AppParam
|
// @Success 200 {object} response.AppConfig
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /apps/installed/params/:appInstallId [get]
|
// @Security Timestamp
|
||||||
|
// @Router /apps/installed/params/{appInstallId} [get]
|
||||||
func (b *BaseApi) GetParams(c *gin.Context) {
|
func (b *BaseApi) GetParams(c *gin.Context) {
|
||||||
appInstallId, err := helper.GetIntParamByKey(c, "appInstallId")
|
appInstallId, err := helper.GetIntParamByKey(c, "appInstallId")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -286,11 +289,11 @@ func (b *BaseApi) GetParams(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary Change app params
|
// @Summary Change app params
|
||||||
// @Description 修改应用参数
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.AppInstalledUpdate true "request"
|
// @Param request body request.AppInstalledUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/installed/params/update [post]
|
// @Router /apps/installed/params/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["installId"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"应用参数修改 [installId]","formatEN":"Application param update [installId]"}
|
// @x-panel-log {"bodyKeys":["installId"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"应用参数修改 [installId]","formatEN":"Application param update [installId]"}
|
||||||
func (b *BaseApi) UpdateInstalled(c *gin.Context) {
|
func (b *BaseApi) UpdateInstalled(c *gin.Context) {
|
||||||
@@ -307,11 +310,11 @@ func (b *BaseApi) UpdateInstalled(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags App
|
// @Tags App
|
||||||
// @Summary ignore App Update
|
// @Summary ignore App Update
|
||||||
// @Description 忽略应用升级版本
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.AppInstalledIgnoreUpgrade true "request"
|
// @Param request body request.AppInstalledIgnoreUpgrade true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /apps/installed/ignore [post]
|
// @Router /apps/installed/ignore [post]
|
||||||
// @x-panel-log {"bodyKeys":["installId"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"忽略应用 [installId] 版本升级","formatEN":"Application param update [installId]"}
|
// @x-panel-log {"bodyKeys":["installId"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"忽略应用 [installId] 版本升级","formatEN":"Application param update [installId]"}
|
||||||
func (b *BaseApi) IgnoreUpgrade(c *gin.Context) {
|
func (b *BaseApi) IgnoreUpgrade(c *gin.Context) {
|
||||||
|
|||||||
+35
-50
@@ -8,9 +8,8 @@ import (
|
|||||||
"github.com/1Panel-dev/1Panel/backend/app/model"
|
"github.com/1Panel-dev/1Panel/backend/app/model"
|
||||||
"github.com/1Panel-dev/1Panel/backend/constant"
|
"github.com/1Panel-dev/1Panel/backend/constant"
|
||||||
"github.com/1Panel-dev/1Panel/backend/global"
|
"github.com/1Panel-dev/1Panel/backend/global"
|
||||||
"github.com/1Panel-dev/1Panel/backend/middleware"
|
|
||||||
"github.com/1Panel-dev/1Panel/backend/utils/captcha"
|
"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/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -18,9 +17,8 @@ type BaseApi struct{}
|
|||||||
|
|
||||||
// @Tags Auth
|
// @Tags Auth
|
||||||
// @Summary User login
|
// @Summary User login
|
||||||
// @Description 用户登录
|
|
||||||
// @Accept json
|
// @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"
|
// @Param request body dto.Login true "request"
|
||||||
// @Success 200 {object} dto.UserLoginInfo
|
// @Success 200 {object} dto.UserLoginInfo
|
||||||
// @Router /auth/login [post]
|
// @Router /auth/login [post]
|
||||||
@@ -30,35 +28,45 @@ func (b *BaseApi) Login(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.AuthMethod != "jwt" && !req.IgnoreCaptcha {
|
ip := common.GetRealClientIP(c)
|
||||||
|
needCaptcha := global.IPTracker.NeedCaptcha(ip)
|
||||||
|
if needCaptcha {
|
||||||
if err := captcha.VerifyCode(req.CaptchaID, req.Captcha); err != nil {
|
if err := captcha.VerifyCode(req.CaptchaID, req.Captcha); err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
entranceItem := c.Request.Header.Get("EntranceCode")
|
entranceItem := c.Request.Header.Get("EntranceCode")
|
||||||
var entrance []byte
|
var entrance []byte
|
||||||
if len(entranceItem) != 0 {
|
if len(entranceItem) != 0 {
|
||||||
entrance, _ = base64.StdEncoding.DecodeString(entranceItem)
|
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))
|
user, err := authService.Login(c, req, string(entrance))
|
||||||
go saveLoginLogs(c, err)
|
go saveLoginLogs(c, err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
global.IPTracker.SetNeedCaptcha(ip)
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
global.IPTracker.Clear(ip)
|
||||||
helper.SuccessWithData(c, user)
|
helper.SuccessWithData(c, user)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Auth
|
// @Tags Auth
|
||||||
// @Summary User login with mfa
|
// @Summary User login with mfa
|
||||||
// @Description 用户 mfa 登录
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.MFALogin true "request"
|
// @Param request body dto.MFALogin true "request"
|
||||||
// @Success 200 {object} dto.UserLoginInfo
|
// @Success 200 {object} dto.UserLoginInfo
|
||||||
// @Router /auth/mfalogin [post]
|
// @Router /auth/mfalogin [post]
|
||||||
// @Header 200 {string} EntranceCode "安全入口"
|
// @Header 200 {string} EntranceCode
|
||||||
func (b *BaseApi) MFALogin(c *gin.Context) {
|
func (b *BaseApi) MFALogin(c *gin.Context) {
|
||||||
var req dto.MFALogin
|
var req dto.MFALogin
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
@@ -81,9 +89,9 @@ func (b *BaseApi) MFALogin(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Auth
|
// @Tags Auth
|
||||||
// @Summary User logout
|
// @Summary User logout
|
||||||
// @Description 用户登出
|
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /auth/logout [post]
|
// @Router /auth/logout [post]
|
||||||
func (b *BaseApi) LogOut(c *gin.Context) {
|
func (b *BaseApi) LogOut(c *gin.Context) {
|
||||||
if err := authService.LogOut(c); err != nil {
|
if err := authService.LogOut(c); err != nil {
|
||||||
@@ -95,7 +103,6 @@ func (b *BaseApi) LogOut(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Auth
|
// @Tags Auth
|
||||||
// @Summary Load captcha
|
// @Summary Load captcha
|
||||||
// @Description 加载验证码
|
|
||||||
// @Success 200 {object} dto.CaptchaResponse
|
// @Success 200 {object} dto.CaptchaResponse
|
||||||
// @Router /auth/captcha [get]
|
// @Router /auth/captcha [get]
|
||||||
func (b *BaseApi) Captcha(c *gin.Context) {
|
func (b *BaseApi) Captcha(c *gin.Context) {
|
||||||
@@ -107,33 +114,6 @@ func (b *BaseApi) Captcha(c *gin.Context) {
|
|||||||
helper.SuccessWithData(c, captcha)
|
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
|
|
||||||
}
|
|
||||||
if status == "disable" && len(code) != 0 {
|
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrNotFound, constant.ErrTypeInternalServer, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if status == "unpass" {
|
|
||||||
if middleware.LoadErrCode("err-entrance") != 200 {
|
|
||||||
helper.ErrResponse(c, middleware.LoadErrCode("err-entrance"))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrEntrance, constant.ErrTypeInternalServer, nil)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
helper.SuccessWithOutData(c)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *BaseApi) GetResponsePage(c *gin.Context) {
|
func (b *BaseApi) GetResponsePage(c *gin.Context) {
|
||||||
pageCode, err := authService.GetResponsePage()
|
pageCode, err := authService.GetResponsePage()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -145,25 +125,36 @@ func (b *BaseApi) GetResponsePage(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Auth
|
// @Tags Auth
|
||||||
// @Summary Check System isDemo
|
// @Summary Check System isDemo
|
||||||
// @Description 判断是否为demo环境
|
// @Success 200 {boolean} isDemo
|
||||||
// @Success 200
|
|
||||||
// @Router /auth/demo [get]
|
// @Router /auth/demo [get]
|
||||||
func (b *BaseApi) CheckIsDemo(c *gin.Context) {
|
func (b *BaseApi) CheckIsDemo(c *gin.Context) {
|
||||||
helper.SuccessWithData(c, global.CONF.System.IsDemo)
|
helper.SuccessWithData(c, global.CONF.System.IsDemo)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Auth
|
// @Tags Auth
|
||||||
// @Summary Load System Language
|
// @Summary Check System isIntl
|
||||||
// @Description 获取系统语言设置
|
// @Success 200 {boolean} isIntl
|
||||||
// @Success 200
|
// @Router /auth/intl [get]
|
||||||
// @Router /auth/language [get]
|
func (b *BaseApi) CheckIsIntl(c *gin.Context) {
|
||||||
func (b *BaseApi) GetLanguage(c *gin.Context) {
|
helper.SuccessWithData(c, global.CONF.System.IsIntl)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags Auth
|
||||||
|
// @Summary Load System Setting for login
|
||||||
|
// @Success 200 {object} dto.LoginSetting
|
||||||
|
// @Router /auth/setting [get]
|
||||||
|
func (b *BaseApi) GetAuthSetting(c *gin.Context) {
|
||||||
settingInfo, err := settingService.GetSettingInfo()
|
settingInfo, err := settingService.GetSettingInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
helper.SuccessWithData(c, settingInfo.Language)
|
ip := common.GetRealClientIP(c)
|
||||||
|
needCaptcha := global.IPTracker.NeedCaptcha(ip)
|
||||||
|
helper.SuccessWithData(c, dto.LoginSetting{
|
||||||
|
NeedCaptcha: needCaptcha,
|
||||||
|
Language: settingInfo.Language,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func saveLoginLogs(c *gin.Context, err error) {
|
func saveLoginLogs(c *gin.Context, err error) {
|
||||||
@@ -175,12 +166,6 @@ func saveLoginLogs(c *gin.Context, err error) {
|
|||||||
logs.Status = constant.StatusSuccess
|
logs.Status = constant.StatusSuccess
|
||||||
}
|
}
|
||||||
logs.IP = c.ClientIP()
|
logs.IP = c.ClientIP()
|
||||||
qqWry, err := qqwry.NewQQwry()
|
|
||||||
if err != nil {
|
|
||||||
global.LOG.Errorf("load qqwry datas failed: %s", err)
|
|
||||||
}
|
|
||||||
res := qqWry.Find(logs.IP)
|
|
||||||
logs.Agent = c.GetHeader("User-Agent")
|
logs.Agent = c.GetHeader("User-Agent")
|
||||||
logs.Address = res.Area
|
|
||||||
_ = logService.CreateLoginLog(logs)
|
_ = logService.CreateLoginLog(logs)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary Create backup account
|
// @Summary Create backup account
|
||||||
// @Description 创建备份账号
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BackupOperate true "request"
|
// @Param request body dto.BackupOperate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup [post]
|
// @Router /settings/backup [post]
|
||||||
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建备份账号 [type]","formatEN":"create backup account [type]"}
|
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建备份账号 [type]","formatEN":"create backup account [type]"}
|
||||||
func (b *BaseApi) CreateBackup(c *gin.Context) {
|
func (b *BaseApi) CreateBackup(c *gin.Context) {
|
||||||
@@ -51,9 +51,9 @@ func (b *BaseApi) CreateBackup(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary Refresh OneDrive token
|
// @Summary Refresh OneDrive token
|
||||||
// @Description 刷新 OneDrive token
|
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/refresh/onedrive [post]
|
// @Router /settings/backup/refresh/onedrive [post]
|
||||||
func (b *BaseApi) RefreshOneDriveToken(c *gin.Context) {
|
func (b *BaseApi) RefreshOneDriveToken(c *gin.Context) {
|
||||||
backupService.Run()
|
backupService.Run()
|
||||||
@@ -62,11 +62,11 @@ func (b *BaseApi) RefreshOneDriveToken(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary List buckets
|
// @Summary List buckets
|
||||||
// @Description 获取 bucket 列表
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ForBuckets true "request"
|
// @Param request body dto.ForBuckets true "request"
|
||||||
// @Success 200 {array} string
|
// @Success 200 {array} object
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/search [post]
|
// @Router /settings/backup/search [post]
|
||||||
func (b *BaseApi) ListBuckets(c *gin.Context) {
|
func (b *BaseApi) ListBuckets(c *gin.Context) {
|
||||||
var req dto.ForBuckets
|
var req dto.ForBuckets
|
||||||
@@ -100,10 +100,10 @@ func (b *BaseApi) ListBuckets(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary Load OneDrive info
|
// @Summary Load OneDrive info
|
||||||
// @Description 获取 OneDrive 信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200 {object} dto.OneDriveInfo
|
// @Success 200 {object} dto.OneDriveInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/onedrive [get]
|
// @Router /settings/backup/onedrive [get]
|
||||||
func (b *BaseApi) LoadOneDriveInfo(c *gin.Context) {
|
func (b *BaseApi) LoadOneDriveInfo(c *gin.Context) {
|
||||||
data, err := backupService.LoadOneDriveInfo()
|
data, err := backupService.LoadOneDriveInfo()
|
||||||
@@ -116,11 +116,11 @@ func (b *BaseApi) LoadOneDriveInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary Delete backup account
|
// @Summary Delete backup account
|
||||||
// @Description 删除备份账号
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperateByID true "request"
|
// @Param request body dto.OperateByID true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/del [post]
|
// @Router /settings/backup/del [post]
|
||||||
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteBackup(c *gin.Context) {
|
||||||
@@ -138,11 +138,11 @@ func (b *BaseApi) DeleteBackup(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary Page backup records
|
// @Summary Page backup records
|
||||||
// @Description 获取备份记录列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.RecordSearch true "request"
|
// @Param request body dto.RecordSearch true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/record/search [post]
|
// @Router /settings/backup/record/search [post]
|
||||||
func (b *BaseApi) SearchBackupRecords(c *gin.Context) {
|
func (b *BaseApi) SearchBackupRecords(c *gin.Context) {
|
||||||
var req dto.RecordSearch
|
var req dto.RecordSearch
|
||||||
@@ -162,13 +162,36 @@ func (b *BaseApi) SearchBackupRecords(c *gin.Context) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Tags Backup Account
|
||||||
|
// @Summary Load backup records size
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body dto.RecordSearch true "request"
|
||||||
|
// @Success 200 {array} dto.BackupFile
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /settings/backup/record/size [post]
|
||||||
|
func (b *BaseApi) LoadBackupSize(c *gin.Context) {
|
||||||
|
var req dto.RecordSearch
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
list, err := backupService.LoadSize(req)
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
helper.SuccessWithData(c, list)
|
||||||
|
}
|
||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary Page backup records by cronjob
|
// @Summary Page backup records by cronjob
|
||||||
// @Description 通过计划任务获取备份记录列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.RecordSearchByCronjob true "request"
|
// @Param request body dto.RecordSearchByCronjob true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/record/search/bycronjob [post]
|
// @Router /settings/backup/record/search/bycronjob [post]
|
||||||
func (b *BaseApi) SearchBackupRecordsByCronjob(c *gin.Context) {
|
func (b *BaseApi) SearchBackupRecordsByCronjob(c *gin.Context) {
|
||||||
var req dto.RecordSearchByCronjob
|
var req dto.RecordSearchByCronjob
|
||||||
@@ -188,13 +211,36 @@ func (b *BaseApi) SearchBackupRecordsByCronjob(c *gin.Context) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Tags Backup Account
|
||||||
|
// @Summary Load backup records size for cronjob
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body dto.RecordSearchByCronjob true "request"
|
||||||
|
// @Success 200 {array} dto.BackupFile
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /settings/backup/record/size/bycronjob [post]
|
||||||
|
func (b *BaseApi) LoadBackupSizeByCronjob(c *gin.Context) {
|
||||||
|
var req dto.RecordSearchByCronjob
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
list, err := backupService.LoadSizeByCronjob(req)
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
helper.SuccessWithData(c, list)
|
||||||
|
}
|
||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary Download backup record
|
// @Summary Download backup record
|
||||||
// @Description 下载备份记录
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.DownloadRecord true "request"
|
// @Param request body dto.DownloadRecord true "request"
|
||||||
// @Success 200
|
// @Success 200 {string} filePath
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/record/download [post]
|
// @Router /settings/backup/record/download [post]
|
||||||
// @x-panel-log {"bodyKeys":["source","fileName"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"下载备份记录 [source][fileName]","formatEN":"download backup records [source][fileName]"}
|
// @x-panel-log {"bodyKeys":["source","fileName"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"下载备份记录 [source][fileName]","formatEN":"download backup records [source][fileName]"}
|
||||||
func (b *BaseApi) DownloadRecord(c *gin.Context) {
|
func (b *BaseApi) DownloadRecord(c *gin.Context) {
|
||||||
@@ -213,11 +259,11 @@ func (b *BaseApi) DownloadRecord(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary Delete backup record
|
// @Summary Delete backup record
|
||||||
// @Description 删除备份记录
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BatchDeleteReq true "request"
|
// @Param request body dto.BatchDeleteReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/record/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteBackupRecord(c *gin.Context) {
|
||||||
@@ -235,11 +281,11 @@ func (b *BaseApi) DeleteBackupRecord(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary Update backup account
|
// @Summary Update backup account
|
||||||
// @Description 更新备份账号信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BackupOperate true "request"
|
// @Param request body dto.BackupOperate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/update [post]
|
// @Router /settings/backup/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新备份账号 [types]","formatEN":"update backup account [types]"}
|
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新备份账号 [types]","formatEN":"update backup account [types]"}
|
||||||
func (b *BaseApi) UpdateBackup(c *gin.Context) {
|
func (b *BaseApi) UpdateBackup(c *gin.Context) {
|
||||||
@@ -274,9 +320,9 @@ func (b *BaseApi) UpdateBackup(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary List backup accounts
|
// @Summary List backup accounts
|
||||||
// @Description 获取备份账号列表
|
|
||||||
// @Success 200 {array} dto.BackupInfo
|
// @Success 200 {array} dto.BackupInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/search [get]
|
// @Router /settings/backup/search [get]
|
||||||
func (b *BaseApi) ListBackup(c *gin.Context) {
|
func (b *BaseApi) ListBackup(c *gin.Context) {
|
||||||
data, err := backupService.List()
|
data, err := backupService.List()
|
||||||
@@ -290,11 +336,11 @@ func (b *BaseApi) ListBackup(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary List files from backup accounts
|
// @Summary List files from backup accounts
|
||||||
// @Description 获取备份账号内文件列表
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BackupSearchFile true "request"
|
// @Param request body dto.BackupSearchFile true "request"
|
||||||
// @Success 200 {array} string
|
// @Success 200 {array} string
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/search/files [post]
|
// @Router /settings/backup/search/files [post]
|
||||||
func (b *BaseApi) LoadFilesFromBackup(c *gin.Context) {
|
func (b *BaseApi) LoadFilesFromBackup(c *gin.Context) {
|
||||||
var req dto.BackupSearchFile
|
var req dto.BackupSearchFile
|
||||||
@@ -308,11 +354,11 @@ func (b *BaseApi) LoadFilesFromBackup(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary Backup system data
|
// @Summary Backup system data
|
||||||
// @Description 备份系统数据
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.CommonBackup true "request"
|
// @Param request body dto.CommonBackup true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/backup [post]
|
// @Router /settings/backup/backup [post]
|
||||||
// @x-panel-log {"bodyKeys":["type","name","detailName"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"备份 [type] 数据 [name][detailName]","formatEN":"backup [type] data [name][detailName]"}
|
// @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) {
|
func (b *BaseApi) Backup(c *gin.Context) {
|
||||||
@@ -353,11 +399,11 @@ func (b *BaseApi) Backup(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary Recover system data
|
// @Summary Recover system data
|
||||||
// @Description 恢复系统数据
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.CommonRecover true "request"
|
// @Param request body dto.CommonRecover true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/recover [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) Recover(c *gin.Context) {
|
||||||
@@ -404,11 +450,11 @@ func (b *BaseApi) Recover(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Backup Account
|
// @Tags Backup Account
|
||||||
// @Summary Recover system data by upload
|
// @Summary Recover system data by upload
|
||||||
// @Description 从上传恢复系统数据
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.CommonRecover true "request"
|
// @Param request body dto.CommonRecover true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/backup/recover/byupload [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) RecoverByUpload(c *gin.Context) {
|
||||||
|
|||||||
+17
-15
@@ -9,11 +9,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Clam
|
// @Tags Clam
|
||||||
// @Summary Create clam
|
// @Summary Create clam
|
||||||
// @Description 创建扫描规则
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ClamCreate true "request"
|
// @Param request body dto.ClamCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clam [post]
|
// @Router /toolbox/clam [post]
|
||||||
// @x-panel-log {"bodyKeys":["name","path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建扫描规则 [name][path]","formatEN":"create clam [name][path]"}
|
// @x-panel-log {"bodyKeys":["name","path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建扫描规则 [name][path]","formatEN":"create clam [name][path]"}
|
||||||
func (b *BaseApi) CreateClam(c *gin.Context) {
|
func (b *BaseApi) CreateClam(c *gin.Context) {
|
||||||
@@ -31,11 +31,11 @@ func (b *BaseApi) CreateClam(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Clam
|
// @Tags Clam
|
||||||
// @Summary Update clam
|
// @Summary Update clam
|
||||||
// @Description 修改扫描规则
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ClamUpdate true "request"
|
// @Param request body dto.ClamUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clam/update [post]
|
// @Router /toolbox/clam/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["name","path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改扫描规则 [name][path]","formatEN":"update clam [name][path]"}
|
// @x-panel-log {"bodyKeys":["name","path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改扫描规则 [name][path]","formatEN":"update clam [name][path]"}
|
||||||
func (b *BaseApi) UpdateClam(c *gin.Context) {
|
func (b *BaseApi) UpdateClam(c *gin.Context) {
|
||||||
@@ -53,11 +53,11 @@ func (b *BaseApi) UpdateClam(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Clam
|
// @Tags Clam
|
||||||
// @Summary Update clam status
|
// @Summary Update clam status
|
||||||
// @Description 修改扫描规则状态
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ClamUpdateStatus true "request"
|
// @Param request body dto.ClamUpdateStatus true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clam/status/update [post]
|
// @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]."}
|
// @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) {
|
func (b *BaseApi) UpdateClamStatus(c *gin.Context) {
|
||||||
@@ -75,11 +75,11 @@ func (b *BaseApi) UpdateClamStatus(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Clam
|
// @Tags Clam
|
||||||
// @Summary Page clam
|
// @Summary Page clam
|
||||||
// @Description 获取扫描规则列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchClamWithPage true "request"
|
// @Param request body dto.SearchClamWithPage true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clam/search [post]
|
// @Router /toolbox/clam/search [post]
|
||||||
func (b *BaseApi) SearchClam(c *gin.Context) {
|
func (b *BaseApi) SearchClam(c *gin.Context) {
|
||||||
var req dto.SearchClamWithPage
|
var req dto.SearchClamWithPage
|
||||||
@@ -101,10 +101,10 @@ func (b *BaseApi) SearchClam(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Clam
|
// @Tags Clam
|
||||||
// @Summary Load clam base info
|
// @Summary Load clam base info
|
||||||
// @Description 获取 Clam 基础信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200 {object} dto.ClamBaseInfo
|
// @Success 200 {object} dto.ClamBaseInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clam/base [get]
|
// @Router /toolbox/clam/base [get]
|
||||||
func (b *BaseApi) LoadClamBaseInfo(c *gin.Context) {
|
func (b *BaseApi) LoadClamBaseInfo(c *gin.Context) {
|
||||||
info, err := clamService.LoadBaseInfo()
|
info, err := clamService.LoadBaseInfo()
|
||||||
@@ -118,10 +118,11 @@ func (b *BaseApi) LoadClamBaseInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Clam
|
// @Tags Clam
|
||||||
// @Summary Operate Clam
|
// @Summary Operate Clam
|
||||||
// @Description 修改 Clam 状态
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.Operate true "request"
|
// @Param request body dto.Operate true "request"
|
||||||
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clam/operate [post]
|
// @Router /toolbox/clam/operate [post]
|
||||||
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] Clam","formatEN":"[operation] FTP"}
|
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] Clam","formatEN":"[operation] FTP"}
|
||||||
func (b *BaseApi) OperateClam(c *gin.Context) {
|
func (b *BaseApi) OperateClam(c *gin.Context) {
|
||||||
@@ -140,10 +141,11 @@ func (b *BaseApi) OperateClam(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Clam
|
// @Tags Clam
|
||||||
// @Summary Clean clam record
|
// @Summary Clean clam record
|
||||||
// @Description 清空扫描报告
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperateByID true "request"
|
// @Param request body dto.OperateByID true "request"
|
||||||
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clam/record/clean [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) CleanClamRecord(c *gin.Context) {
|
||||||
@@ -161,11 +163,11 @@ func (b *BaseApi) CleanClamRecord(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Clam
|
// @Tags Clam
|
||||||
// @Summary Page clam record
|
// @Summary Page clam record
|
||||||
// @Description 获取扫描结果列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ClamLogSearch true "request"
|
// @Param request body dto.ClamLogSearch true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clam/record/search [post]
|
// @Router /toolbox/clam/record/search [post]
|
||||||
func (b *BaseApi) SearchClamRecord(c *gin.Context) {
|
func (b *BaseApi) SearchClamRecord(c *gin.Context) {
|
||||||
var req dto.ClamLogSearch
|
var req dto.ClamLogSearch
|
||||||
@@ -187,11 +189,11 @@ func (b *BaseApi) SearchClamRecord(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Clam
|
// @Tags Clam
|
||||||
// @Summary Load clam record detail
|
// @Summary Load clam record detail
|
||||||
// @Description 获取扫描结果详情
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ClamLogReq true "request"
|
// @Param request body dto.ClamLogReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {string} content
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clam/record/log [post]
|
// @Router /toolbox/clam/record/log [post]
|
||||||
func (b *BaseApi) LoadClamRecordLog(c *gin.Context) {
|
func (b *BaseApi) LoadClamRecordLog(c *gin.Context) {
|
||||||
var req dto.ClamLogReq
|
var req dto.ClamLogReq
|
||||||
@@ -210,11 +212,11 @@ func (b *BaseApi) LoadClamRecordLog(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Clam
|
// @Tags Clam
|
||||||
// @Summary Load clam file
|
// @Summary Load clam file
|
||||||
// @Description 获取扫描文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ClamFileReq true "request"
|
// @Param request body dto.ClamFileReq true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {string} content
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clam/file/search [post]
|
// @Router /toolbox/clam/file/search [post]
|
||||||
func (b *BaseApi) SearchClamFile(c *gin.Context) {
|
func (b *BaseApi) SearchClamFile(c *gin.Context) {
|
||||||
var req dto.ClamFileReq
|
var req dto.ClamFileReq
|
||||||
@@ -233,11 +235,11 @@ func (b *BaseApi) SearchClamFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Clam
|
// @Tags Clam
|
||||||
// @Summary Update clam file
|
// @Summary Update clam file
|
||||||
// @Description 更新病毒扫描配置文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.UpdateByNameAndFile true "request"
|
// @Param request body dto.UpdateByNameAndFile true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clam/file/update [post]
|
// @Router /toolbox/clam/file/update [post]
|
||||||
func (b *BaseApi) UpdateFile(c *gin.Context) {
|
func (b *BaseApi) UpdateFile(c *gin.Context) {
|
||||||
var req dto.UpdateByNameAndFile
|
var req dto.UpdateByNameAndFile
|
||||||
@@ -253,11 +255,11 @@ func (b *BaseApi) UpdateFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Clam
|
// @Tags Clam
|
||||||
// @Summary Delete clam
|
// @Summary Delete clam
|
||||||
// @Description 删除扫描规则
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ClamDelete true "request"
|
// @Param request body dto.ClamDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clam/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteClam(c *gin.Context) {
|
||||||
@@ -275,11 +277,11 @@ func (b *BaseApi) DeleteClam(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Clam
|
// @Tags Clam
|
||||||
// @Summary Handle clam scan
|
// @Summary Handle clam scan
|
||||||
// @Description 执行病毒扫描
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperateByID true "request"
|
// @Param request body dto.OperateByID true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clam/handle [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) HandleClamScan(c *gin.Context) {
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Command
|
// @Tags Command
|
||||||
// @Summary Create command
|
// @Summary Create command
|
||||||
// @Description 创建快速命令
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.CommandOperate true "request"
|
// @Param request body dto.CommandOperate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/command [post]
|
// @Router /hosts/command [post]
|
||||||
// @x-panel-log {"bodyKeys":["name","command"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建快捷命令 [name][command]","formatEN":"create quick command [name][command]"}
|
// @x-panel-log {"bodyKeys":["name","command"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建快捷命令 [name][command]","formatEN":"create quick command [name][command]"}
|
||||||
func (b *BaseApi) CreateCommand(c *gin.Context) {
|
func (b *BaseApi) CreateCommand(c *gin.Context) {
|
||||||
@@ -31,11 +31,11 @@ func (b *BaseApi) CreateCommand(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Redis Command
|
// @Tags Redis Command
|
||||||
// @Summary Save redis command
|
// @Summary Save redis command
|
||||||
// @Description 保存 Redis 快速命令
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.RedisCommand true "request"
|
// @Param request body dto.RedisCommand true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/command/redis [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) SaveRedisCommand(c *gin.Context) {
|
||||||
@@ -53,11 +53,11 @@ func (b *BaseApi) SaveRedisCommand(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Command
|
// @Tags Command
|
||||||
// @Summary Page commands
|
// @Summary Page commands
|
||||||
// @Description 获取快速命令列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchWithPage true "request"
|
// @Param request body dto.SearchWithPage true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/command/search [post]
|
// @Router /hosts/command/search [post]
|
||||||
func (b *BaseApi) SearchCommand(c *gin.Context) {
|
func (b *BaseApi) SearchCommand(c *gin.Context) {
|
||||||
var req dto.SearchCommandWithPage
|
var req dto.SearchCommandWithPage
|
||||||
@@ -79,11 +79,11 @@ func (b *BaseApi) SearchCommand(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Redis Command
|
// @Tags Redis Command
|
||||||
// @Summary Page redis commands
|
// @Summary Page redis commands
|
||||||
// @Description 获取 redis 快速命令列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchWithPage true "request"
|
// @Param request body dto.SearchWithPage true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/command/redis/search [post]
|
// @Router /hosts/command/redis/search [post]
|
||||||
func (b *BaseApi) SearchRedisCommand(c *gin.Context) {
|
func (b *BaseApi) SearchRedisCommand(c *gin.Context) {
|
||||||
var req dto.SearchWithPage
|
var req dto.SearchWithPage
|
||||||
@@ -105,10 +105,10 @@ func (b *BaseApi) SearchRedisCommand(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Command
|
// @Tags Command
|
||||||
// @Summary Tree commands
|
// @Summary Tree commands
|
||||||
// @Description 获取快速命令树
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200 {Array} dto.CommandTree
|
// @Success 200 {array} dto.CommandTree
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/command/tree [get]
|
// @Router /hosts/command/tree [get]
|
||||||
func (b *BaseApi) SearchCommandTree(c *gin.Context) {
|
func (b *BaseApi) SearchCommandTree(c *gin.Context) {
|
||||||
list, err := commandService.SearchForTree()
|
list, err := commandService.SearchForTree()
|
||||||
@@ -122,9 +122,9 @@ func (b *BaseApi) SearchCommandTree(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Redis Command
|
// @Tags Redis Command
|
||||||
// @Summary List redis commands
|
// @Summary List redis commands
|
||||||
// @Description 获取 redis 快速命令列表
|
// @Success 200 {array} dto.RedisCommand
|
||||||
// @Success 200 {Array} dto.RedisCommand
|
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/command/redis [get]
|
// @Router /hosts/command/redis [get]
|
||||||
func (b *BaseApi) ListRedisCommand(c *gin.Context) {
|
func (b *BaseApi) ListRedisCommand(c *gin.Context) {
|
||||||
list, err := commandService.ListRedisCommand()
|
list, err := commandService.ListRedisCommand()
|
||||||
@@ -138,9 +138,9 @@ func (b *BaseApi) ListRedisCommand(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Command
|
// @Tags Command
|
||||||
// @Summary List commands
|
// @Summary List commands
|
||||||
// @Description 获取快速命令列表
|
|
||||||
// @Success 200 {object} dto.CommandInfo
|
// @Success 200 {object} dto.CommandInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/command [get]
|
// @Router /hosts/command [get]
|
||||||
func (b *BaseApi) ListCommand(c *gin.Context) {
|
func (b *BaseApi) ListCommand(c *gin.Context) {
|
||||||
list, err := commandService.List()
|
list, err := commandService.List()
|
||||||
@@ -154,11 +154,11 @@ func (b *BaseApi) ListCommand(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Command
|
// @Tags Command
|
||||||
// @Summary Delete command
|
// @Summary Delete command
|
||||||
// @Description 删除快速命令
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BatchDeleteReq true "request"
|
// @Param request body dto.BatchDeleteReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/command/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteCommand(c *gin.Context) {
|
||||||
@@ -176,11 +176,11 @@ func (b *BaseApi) DeleteCommand(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Redis Command
|
// @Tags Redis Command
|
||||||
// @Summary Delete redis command
|
// @Summary Delete redis command
|
||||||
// @Description 删除 redis 快速命令
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BatchDeleteReq true "request"
|
// @Param request body dto.BatchDeleteReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/command/redis/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteRedisCommand(c *gin.Context) {
|
||||||
@@ -198,11 +198,11 @@ func (b *BaseApi) DeleteRedisCommand(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Command
|
// @Tags Command
|
||||||
// @Summary Update command
|
// @Summary Update command
|
||||||
// @Description 更新快速命令
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.CommandOperate true "request"
|
// @Param request body dto.CommandOperate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/command/update [post]
|
// @Router /hosts/command/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新快捷命令 [name]","formatEN":"update quick command [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新快捷命令 [name]","formatEN":"update quick command [name]"}
|
||||||
func (b *BaseApi) UpdateCommand(c *gin.Context) {
|
func (b *BaseApi) UpdateCommand(c *gin.Context) {
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Container Compose-template
|
// @Tags Container Compose-template
|
||||||
// @Summary Create compose template
|
// @Summary Create compose template
|
||||||
// @Description 创建容器编排模版
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ComposeTemplateCreate true "request"
|
// @Param request body dto.ComposeTemplateCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/template [post]
|
// @Router /containers/template [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 compose 模版 [name]","formatEN":"create compose template [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 compose 模版 [name]","formatEN":"create compose template [name]"}
|
||||||
func (b *BaseApi) CreateComposeTemplate(c *gin.Context) {
|
func (b *BaseApi) CreateComposeTemplate(c *gin.Context) {
|
||||||
@@ -31,12 +31,12 @@ func (b *BaseApi) CreateComposeTemplate(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Compose-template
|
// @Tags Container Compose-template
|
||||||
// @Summary Page compose templates
|
// @Summary Page compose templates
|
||||||
// @Description 获取容器编排模版列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchWithPage true "request"
|
// @Param request body dto.SearchWithPage true "request"
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/template/search [post]
|
// @Router /containers/template/search [post]
|
||||||
func (b *BaseApi) SearchComposeTemplate(c *gin.Context) {
|
func (b *BaseApi) SearchComposeTemplate(c *gin.Context) {
|
||||||
var req dto.SearchWithPage
|
var req dto.SearchWithPage
|
||||||
@@ -58,10 +58,10 @@ func (b *BaseApi) SearchComposeTemplate(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Compose-template
|
// @Tags Container Compose-template
|
||||||
// @Summary List compose templates
|
// @Summary List compose templates
|
||||||
// @Description 获取容器编排模版列表
|
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {array} dto.ComposeTemplateInfo
|
// @Success 200 {array} dto.ComposeTemplateInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/template [get]
|
// @Router /containers/template [get]
|
||||||
func (b *BaseApi) ListComposeTemplate(c *gin.Context) {
|
func (b *BaseApi) ListComposeTemplate(c *gin.Context) {
|
||||||
list, err := composeTemplateService.List()
|
list, err := composeTemplateService.List()
|
||||||
@@ -75,11 +75,11 @@ func (b *BaseApi) ListComposeTemplate(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Compose-template
|
// @Tags Container Compose-template
|
||||||
// @Summary Delete compose template
|
// @Summary Delete compose template
|
||||||
// @Description 删除容器编排模版
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BatchDelete true "request"
|
// @Param request body dto.BatchDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/template/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteComposeTemplate(c *gin.Context) {
|
||||||
@@ -97,11 +97,11 @@ func (b *BaseApi) DeleteComposeTemplate(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Compose-template
|
// @Tags Container Compose-template
|
||||||
// @Summary Update compose template
|
// @Summary Update compose template
|
||||||
// @Description 更新容器编排模版
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ComposeTemplateUpdate true "request"
|
// @Param request body dto.ComposeTemplateUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/template/update [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdateComposeTemplate(c *gin.Context) {
|
||||||
|
|||||||
@@ -1,23 +1,24 @@
|
|||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
|
"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"
|
||||||
"github.com/1Panel-dev/1Panel/backend/constant"
|
"github.com/1Panel-dev/1Panel/backend/constant"
|
||||||
"github.com/1Panel-dev/1Panel/backend/global"
|
"github.com/1Panel-dev/1Panel/backend/global"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"strconv"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Page containers
|
// @Summary Page containers
|
||||||
// @Description 获取容器列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PageContainer true "request"
|
// @Param request body dto.PageContainer true "request"
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/search [post]
|
// @Router /containers/search [post]
|
||||||
func (b *BaseApi) SearchContainer(c *gin.Context) {
|
func (b *BaseApi) SearchContainer(c *gin.Context) {
|
||||||
var req dto.PageContainer
|
var req dto.PageContainer
|
||||||
@@ -38,11 +39,11 @@ func (b *BaseApi) SearchContainer(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary List containers
|
// @Summary List containers
|
||||||
// @Description 获取容器名称
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200
|
// @Success 200 {array} string
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/list [post]
|
// @Router /containers/list [post]
|
||||||
func (b *BaseApi) ListContainer(c *gin.Context) {
|
func (b *BaseApi) ListContainer(c *gin.Context) {
|
||||||
list, err := containerService.List()
|
list, err := containerService.List()
|
||||||
@@ -55,11 +56,11 @@ func (b *BaseApi) ListContainer(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Compose
|
// @Tags Container Compose
|
||||||
// @Summary Page composes
|
// @Summary Page composes
|
||||||
// @Description 获取编排列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchWithPage true "request"
|
// @Param request body dto.SearchWithPage true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/compose/search [post]
|
// @Router /containers/compose/search [post]
|
||||||
func (b *BaseApi) SearchCompose(c *gin.Context) {
|
func (b *BaseApi) SearchCompose(c *gin.Context) {
|
||||||
var req dto.SearchWithPage
|
var req dto.SearchWithPage
|
||||||
@@ -80,11 +81,11 @@ func (b *BaseApi) SearchCompose(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Compose
|
// @Tags Container Compose
|
||||||
// @Summary Test compose
|
// @Summary Test compose
|
||||||
// @Description 测试 compose 是否可用
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ComposeCreate true "request"
|
// @Param request body dto.ComposeCreate true "request"
|
||||||
// @Success 200
|
// @Success 200 {boolean} isOK
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/compose/test [post]
|
// @Router /containers/compose/test [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"检测 compose [name] 格式","formatEN":"check compose [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"检测 compose [name] 格式","formatEN":"check compose [name]"}
|
||||||
func (b *BaseApi) TestCompose(c *gin.Context) {
|
func (b *BaseApi) TestCompose(c *gin.Context) {
|
||||||
@@ -103,11 +104,11 @@ func (b *BaseApi) TestCompose(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Compose
|
// @Tags Container Compose
|
||||||
// @Summary Create compose
|
// @Summary Create compose
|
||||||
// @Description 创建容器编排
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ComposeCreate true "request"
|
// @Param request body dto.ComposeCreate true "request"
|
||||||
// @Success 200
|
// @Success 200 {string} log
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/compose [post]
|
// @Router /containers/compose [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 compose [name]","formatEN":"create compose [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 compose [name]","formatEN":"create compose [name]"}
|
||||||
func (b *BaseApi) CreateCompose(c *gin.Context) {
|
func (b *BaseApi) CreateCompose(c *gin.Context) {
|
||||||
@@ -126,11 +127,11 @@ func (b *BaseApi) CreateCompose(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Compose
|
// @Tags Container Compose
|
||||||
// @Summary Operate compose
|
// @Summary Operate compose
|
||||||
// @Description 容器编排操作
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ComposeOperation true "request"
|
// @Param request body dto.ComposeOperation true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/compose/operate [post]
|
// @Router /containers/compose/operate [post]
|
||||||
// @x-panel-log {"bodyKeys":["name","operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"compose [operation] [name]","formatEN":"compose [operation] [name]"}
|
// @x-panel-log {"bodyKeys":["name","operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"compose [operation] [name]","formatEN":"compose [operation] [name]"}
|
||||||
func (b *BaseApi) OperatorCompose(c *gin.Context) {
|
func (b *BaseApi) OperatorCompose(c *gin.Context) {
|
||||||
@@ -148,11 +149,11 @@ func (b *BaseApi) OperatorCompose(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Update container
|
// @Summary Update container
|
||||||
// @Description 更新容器
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ContainerOperate true "request"
|
// @Param request body dto.ContainerOperate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/update [post]
|
// @Router /containers/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["name","image"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新容器 [name][image]","formatEN":"update container [name][image]"}
|
// @x-panel-log {"bodyKeys":["name","image"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新容器 [name][image]","formatEN":"update container [name][image]"}
|
||||||
func (b *BaseApi) ContainerUpdate(c *gin.Context) {
|
func (b *BaseApi) ContainerUpdate(c *gin.Context) {
|
||||||
@@ -170,11 +171,11 @@ func (b *BaseApi) ContainerUpdate(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Load container info
|
// @Summary Load container info
|
||||||
// @Description 获取容器表单信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithName true "request"
|
// @Param request body dto.OperationWithName true "request"
|
||||||
// @Success 200 {object} dto.ContainerOperate
|
// @Success 200 {object} dto.ContainerOperate
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/info [post]
|
// @Router /containers/info [post]
|
||||||
func (b *BaseApi) ContainerInfo(c *gin.Context) {
|
func (b *BaseApi) ContainerInfo(c *gin.Context) {
|
||||||
var req dto.OperationWithName
|
var req dto.OperationWithName
|
||||||
@@ -191,9 +192,9 @@ func (b *BaseApi) ContainerInfo(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Summary Load container limits
|
// @Summary Load container limits
|
||||||
// @Description 获取容器限制
|
|
||||||
// @Success 200 {object} dto.ResourceLimit
|
// @Success 200 {object} dto.ResourceLimit
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/limit [get]
|
// @Router /containers/limit [get]
|
||||||
func (b *BaseApi) LoadResourceLimit(c *gin.Context) {
|
func (b *BaseApi) LoadResourceLimit(c *gin.Context) {
|
||||||
data, err := containerService.LoadResourceLimit()
|
data, err := containerService.LoadResourceLimit()
|
||||||
@@ -205,9 +206,9 @@ func (b *BaseApi) LoadResourceLimit(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Summary Load container stats
|
// @Summary Load container stats
|
||||||
// @Description 获取容器列表资源占用
|
|
||||||
// @Success 200 {array} dto.ContainerListStats
|
// @Success 200 {array} dto.ContainerListStats
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/list/stats [get]
|
// @Router /containers/list/stats [get]
|
||||||
func (b *BaseApi) ContainerListStats(c *gin.Context) {
|
func (b *BaseApi) ContainerListStats(c *gin.Context) {
|
||||||
data, err := containerService.ContainerListStats()
|
data, err := containerService.ContainerListStats()
|
||||||
@@ -220,11 +221,11 @@ func (b *BaseApi) ContainerListStats(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Create container
|
// @Summary Create container
|
||||||
// @Description 创建容器
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ContainerOperate true "request"
|
// @Param request body dto.ContainerOperate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers [post]
|
// @Router /containers [post]
|
||||||
// @x-panel-log {"bodyKeys":["name","image"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建容器 [name][image]","formatEN":"create container [name][image]"}
|
// @x-panel-log {"bodyKeys":["name","image"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建容器 [name][image]","formatEN":"create container [name][image]"}
|
||||||
func (b *BaseApi) ContainerCreate(c *gin.Context) {
|
func (b *BaseApi) ContainerCreate(c *gin.Context) {
|
||||||
@@ -242,11 +243,11 @@ func (b *BaseApi) ContainerCreate(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Upgrade container
|
// @Summary Upgrade container
|
||||||
// @Description 更新容器镜像
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ContainerUpgrade true "request"
|
// @Param request body dto.ContainerUpgrade true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/upgrade [post]
|
// @Router /containers/upgrade [post]
|
||||||
// @x-panel-log {"bodyKeys":["name","image"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新容器镜像 [name][image]","formatEN":"upgrade container image [name][image]"}
|
// @x-panel-log {"bodyKeys":["name","image"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新容器镜像 [name][image]","formatEN":"upgrade container image [name][image]"}
|
||||||
func (b *BaseApi) ContainerUpgrade(c *gin.Context) {
|
func (b *BaseApi) ContainerUpgrade(c *gin.Context) {
|
||||||
@@ -264,11 +265,11 @@ func (b *BaseApi) ContainerUpgrade(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Clean container
|
// @Summary Clean container
|
||||||
// @Description 容器清理
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ContainerPrune true "request"
|
// @Param request body dto.ContainerPrune true "request"
|
||||||
// @Success 200 {object} dto.ContainerPruneReport
|
// @Success 200 {object} dto.ContainerPruneReport
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/prune [post]
|
// @Router /containers/prune [post]
|
||||||
// @x-panel-log {"bodyKeys":["pruneType"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清理容器 [pruneType]","formatEN":"clean container [pruneType]"}
|
// @x-panel-log {"bodyKeys":["pruneType"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清理容器 [pruneType]","formatEN":"clean container [pruneType]"}
|
||||||
func (b *BaseApi) ContainerPrune(c *gin.Context) {
|
func (b *BaseApi) ContainerPrune(c *gin.Context) {
|
||||||
@@ -287,11 +288,11 @@ func (b *BaseApi) ContainerPrune(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Clean container log
|
// @Summary Clean container log
|
||||||
// @Description 清理容器日志
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithName true "request"
|
// @Param request body dto.OperationWithName true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/clean/log [post]
|
// @Router /containers/clean/log [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清理容器 [name] 日志","formatEN":"clean container [name] logs"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清理容器 [name] 日志","formatEN":"clean container [name] logs"}
|
||||||
func (b *BaseApi) CleanContainerLog(c *gin.Context) {
|
func (b *BaseApi) CleanContainerLog(c *gin.Context) {
|
||||||
@@ -309,11 +310,11 @@ func (b *BaseApi) CleanContainerLog(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Load container log
|
// @Summary Load container log
|
||||||
// @Description 获取容器操作日志
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithNameAndType true "request"
|
// @Param request body dto.OperationWithNameAndType true "request"
|
||||||
// @Success 200
|
// @Success 200 {string} content
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/load/log [post]
|
// @Router /containers/load/log [post]
|
||||||
func (b *BaseApi) LoadContainerLog(c *gin.Context) {
|
func (b *BaseApi) LoadContainerLog(c *gin.Context) {
|
||||||
var req dto.OperationWithNameAndType
|
var req dto.OperationWithNameAndType
|
||||||
@@ -327,11 +328,11 @@ func (b *BaseApi) LoadContainerLog(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Rename Container
|
// @Summary Rename Container
|
||||||
// @Description 容器重命名
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ContainerRename true "request"
|
// @Param request body dto.ContainerRename true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/rename [post]
|
// @Router /containers/rename [post]
|
||||||
// @x-panel-log {"bodyKeys":["name","newName"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"容器重命名 [name] => [newName]","formatEN":"rename container [name] => [newName]"}
|
// @x-panel-log {"bodyKeys":["name","newName"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"容器重命名 [name] => [newName]","formatEN":"rename container [name] => [newName]"}
|
||||||
func (b *BaseApi) ContainerRename(c *gin.Context) {
|
func (b *BaseApi) ContainerRename(c *gin.Context) {
|
||||||
@@ -349,7 +350,6 @@ func (b *BaseApi) ContainerRename(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Commit Container
|
// @Summary Commit Container
|
||||||
// @Description 容器提交生成新镜像
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ContainerCommit true "request"
|
// @Param request body dto.ContainerCommit true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
@@ -369,11 +369,11 @@ func (b *BaseApi) ContainerCommit(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Operate Container
|
// @Summary Operate Container
|
||||||
// @Description 容器操作
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ContainerOperation true "request"
|
// @Param request body dto.ContainerOperation true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/operate [post]
|
// @Router /containers/operate [post]
|
||||||
// @x-panel-log {"bodyKeys":["names","operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"容器 [names] 执行 [operation]","formatEN":"container [operation] [names]"}
|
// @x-panel-log {"bodyKeys":["names","operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"容器 [names] 执行 [operation]","formatEN":"container [operation] [names]"}
|
||||||
func (b *BaseApi) ContainerOperation(c *gin.Context) {
|
func (b *BaseApi) ContainerOperation(c *gin.Context) {
|
||||||
@@ -391,11 +391,11 @@ func (b *BaseApi) ContainerOperation(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Container stats
|
// @Summary Container stats
|
||||||
// @Description 容器监控信息
|
// @Param id path string true "container id"
|
||||||
// @Param id path integer true "容器id"
|
|
||||||
// @Success 200 {object} dto.ContainerStats
|
// @Success 200 {object} dto.ContainerStats
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /containers/stats/:id [get]
|
// @Security Timestamp
|
||||||
|
// @Router /containers/stats/{id} [get]
|
||||||
func (b *BaseApi) ContainerStats(c *gin.Context) {
|
func (b *BaseApi) ContainerStats(c *gin.Context) {
|
||||||
containerID, ok := c.Params.Get("id")
|
containerID, ok := c.Params.Get("id")
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -413,11 +413,11 @@ func (b *BaseApi) ContainerStats(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Container inspect
|
// @Summary Container inspect
|
||||||
// @Description 容器详情
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.InspectReq true "request"
|
// @Param request body dto.InspectReq true "request"
|
||||||
// @Success 200 {string} result
|
// @Success 200 {string} result
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/inspect [post]
|
// @Router /containers/inspect [post]
|
||||||
func (b *BaseApi) Inspect(c *gin.Context) {
|
func (b *BaseApi) Inspect(c *gin.Context) {
|
||||||
var req dto.InspectReq
|
var req dto.InspectReq
|
||||||
@@ -435,12 +435,13 @@ func (b *BaseApi) Inspect(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container
|
// @Tags Container
|
||||||
// @Summary Container logs
|
// @Summary Container logs
|
||||||
// @Description 容器日志
|
// @Param container query string false "container name"
|
||||||
// @Param container query string false "容器名称"
|
// @Param since query string false "since"
|
||||||
// @Param since query string false "时间筛选"
|
// @Param follow query string false "follow"
|
||||||
// @Param follow query string false "是否追踪"
|
// @Param tail query string false "tail"
|
||||||
// @Param tail query string false "显示行号"
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/search/log [post]
|
// @Router /containers/search/log [post]
|
||||||
func (b *BaseApi) ContainerLogs(c *gin.Context) {
|
func (b *BaseApi) ContainerLogs(c *gin.Context) {
|
||||||
wsConn, err := upGrader.Upgrade(c.Writer, c.Request, nil)
|
wsConn, err := upGrader.Upgrade(c.Writer, c.Request, nil)
|
||||||
@@ -461,7 +462,13 @@ func (b *BaseApi) ContainerLogs(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Description 下载容器日志
|
// @Tags Container
|
||||||
|
// @Summary Download Container logs
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body dto.ContainerLog true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/download/log [post]
|
// @Router /containers/download/log [post]
|
||||||
func (b *BaseApi) DownloadContainerLogs(c *gin.Context) {
|
func (b *BaseApi) DownloadContainerLogs(c *gin.Context) {
|
||||||
var req dto.ContainerLog
|
var req dto.ContainerLog
|
||||||
@@ -476,12 +483,12 @@ func (b *BaseApi) DownloadContainerLogs(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Network
|
// @Tags Container Network
|
||||||
// @Summary Page networks
|
// @Summary Page networks
|
||||||
// @Description 获取容器网络列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchWithPage true "request"
|
// @Param request body dto.SearchWithPage true "request"
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/network/search [post]
|
// @Router /containers/network/search [post]
|
||||||
func (b *BaseApi) SearchNetwork(c *gin.Context) {
|
func (b *BaseApi) SearchNetwork(c *gin.Context) {
|
||||||
var req dto.SearchWithPage
|
var req dto.SearchWithPage
|
||||||
@@ -502,11 +509,11 @@ func (b *BaseApi) SearchNetwork(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Network
|
// @Tags Container Network
|
||||||
// @Summary List networks
|
// @Summary List networks
|
||||||
// @Description 获取容器网络列表
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {array} dto.Options
|
// @Success 200 {array} dto.Options
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/network [get]
|
// @Router /containers/network [get]
|
||||||
func (b *BaseApi) ListNetwork(c *gin.Context) {
|
func (b *BaseApi) ListNetwork(c *gin.Context) {
|
||||||
list, err := containerService.ListNetwork()
|
list, err := containerService.ListNetwork()
|
||||||
@@ -519,11 +526,11 @@ func (b *BaseApi) ListNetwork(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Network
|
// @Tags Container Network
|
||||||
// @Summary Delete network
|
// @Summary Delete network
|
||||||
// @Description 删除容器网络
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BatchDelete true "request"
|
// @Param request body dto.BatchDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/network/del [post]
|
// @Router /containers/network/del [post]
|
||||||
// @x-panel-log {"bodyKeys":["names"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"删除容器网络 [names]","formatEN":"delete container network [names]"}
|
// @x-panel-log {"bodyKeys":["names"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"删除容器网络 [names]","formatEN":"delete container network [names]"}
|
||||||
func (b *BaseApi) DeleteNetwork(c *gin.Context) {
|
func (b *BaseApi) DeleteNetwork(c *gin.Context) {
|
||||||
@@ -541,11 +548,11 @@ func (b *BaseApi) DeleteNetwork(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Network
|
// @Tags Container Network
|
||||||
// @Summary Create network
|
// @Summary Create network
|
||||||
// @Description 创建容器网络
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.NetworkCreate true "request"
|
// @Param request body dto.NetworkCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/network [post]
|
// @Router /containers/network [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建容器网络 name","formatEN":"create container network [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建容器网络 name","formatEN":"create container network [name]"}
|
||||||
func (b *BaseApi) CreateNetwork(c *gin.Context) {
|
func (b *BaseApi) CreateNetwork(c *gin.Context) {
|
||||||
@@ -562,13 +569,13 @@ func (b *BaseApi) CreateNetwork(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Container Volume
|
// @Tags Container Volume
|
||||||
// @Summary Page volumes
|
// @Summary Page Container Volumes
|
||||||
// @Description 获取容器存储卷分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchWithPage true "request"
|
// @Param request body dto.SearchWithPage true "request"
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/volume/search [post]
|
// @Router /containers/volume/search [post]
|
||||||
func (b *BaseApi) SearchVolume(c *gin.Context) {
|
func (b *BaseApi) SearchVolume(c *gin.Context) {
|
||||||
var req dto.SearchWithPage
|
var req dto.SearchWithPage
|
||||||
@@ -588,12 +595,12 @@ func (b *BaseApi) SearchVolume(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Container Volume
|
// @Tags Container Volume
|
||||||
// @Summary List volumes
|
// @Summary List Container Volumes
|
||||||
// @Description 获取容器存储卷列表
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {array} dto.Options
|
// @Success 200 {array} dto.Options
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/volume [get]
|
// @Router /containers/volume [get]
|
||||||
func (b *BaseApi) ListVolume(c *gin.Context) {
|
func (b *BaseApi) ListVolume(c *gin.Context) {
|
||||||
list, err := containerService.ListVolume()
|
list, err := containerService.ListVolume()
|
||||||
@@ -605,12 +612,12 @@ func (b *BaseApi) ListVolume(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Container Volume
|
// @Tags Container Volume
|
||||||
// @Summary Delete volume
|
// @Summary Delete Container Volume
|
||||||
// @Description 删除容器存储卷
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BatchDelete true "request"
|
// @Param request body dto.BatchDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/volume/del [post]
|
// @Router /containers/volume/del [post]
|
||||||
// @x-panel-log {"bodyKeys":["names"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"删除容器存储卷 [names]","formatEN":"delete container volume [names]"}
|
// @x-panel-log {"bodyKeys":["names"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"删除容器存储卷 [names]","formatEN":"delete container volume [names]"}
|
||||||
func (b *BaseApi) DeleteVolume(c *gin.Context) {
|
func (b *BaseApi) DeleteVolume(c *gin.Context) {
|
||||||
@@ -627,12 +634,12 @@ func (b *BaseApi) DeleteVolume(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Container Volume
|
// @Tags Container Volume
|
||||||
// @Summary Create volume
|
// @Summary Create Container Volume
|
||||||
// @Description 创建容器存储卷
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.VolumeCreate true "request"
|
// @Param request body dto.VolumeCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/volume [post]
|
// @Router /containers/volume [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建容器存储卷 [name]","formatEN":"create container volume [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建容器存储卷 [name]","formatEN":"create container volume [name]"}
|
||||||
func (b *BaseApi) CreateVolume(c *gin.Context) {
|
func (b *BaseApi) CreateVolume(c *gin.Context) {
|
||||||
@@ -649,12 +656,12 @@ func (b *BaseApi) CreateVolume(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Container Compose
|
// @Tags Container Compose
|
||||||
// @Summary Update compose
|
// @Summary Update Container Compose
|
||||||
// @Description 更新容器编排
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ComposeUpdate true "request"
|
// @Param request body dto.ComposeUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/compose/update [post]
|
// @Router /containers/compose/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 compose [name]","formatEN":"update compose information [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 compose [name]","formatEN":"update compose information [name]"}
|
||||||
func (b *BaseApi) ComposeUpdate(c *gin.Context) {
|
func (b *BaseApi) ComposeUpdate(c *gin.Context) {
|
||||||
@@ -672,12 +679,13 @@ func (b *BaseApi) ComposeUpdate(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Compose
|
// @Tags Container Compose
|
||||||
// @Summary Container Compose logs
|
// @Summary Container Compose logs
|
||||||
// @Description docker-compose 日志
|
// @Param compose query string false "compose file address"
|
||||||
// @Param compose query string false "compose 文件地址"
|
// @Param since query string false "date"
|
||||||
// @Param since query string false "时间筛选"
|
// @Param follow query string false "follow"
|
||||||
// @Param follow query string false "是否追踪"
|
// @Param tail query string false "tail"
|
||||||
// @Param tail query string false "显示行号"
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/compose/search/log [get]
|
// @Router /containers/compose/search/log [get]
|
||||||
func (b *BaseApi) ComposeLogs(c *gin.Context) {
|
func (b *BaseApi) ComposeLogs(c *gin.Context) {
|
||||||
wsConn, err := upGrader.Upgrade(c.Writer, c.Request, nil)
|
wsConn, err := upGrader.Upgrade(c.Writer, c.Request, nil)
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Cronjob
|
// @Tags Cronjob
|
||||||
// @Summary Create cronjob
|
// @Summary Create cronjob
|
||||||
// @Description 创建计划任务
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.CronjobCreate true "request"
|
// @Param request body dto.CronjobCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /cronjobs [post]
|
// @Router /cronjobs [post]
|
||||||
// @x-panel-log {"bodyKeys":["type","name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建计划任务 [type][name]","formatEN":"create cronjob [type][name]"}
|
// @x-panel-log {"bodyKeys":["type","name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建计划任务 [type][name]","formatEN":"create cronjob [type][name]"}
|
||||||
func (b *BaseApi) CreateCronjob(c *gin.Context) {
|
func (b *BaseApi) CreateCronjob(c *gin.Context) {
|
||||||
@@ -34,11 +34,11 @@ func (b *BaseApi) CreateCronjob(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Cronjob
|
// @Tags Cronjob
|
||||||
// @Summary Page cronjobs
|
// @Summary Page cronjobs
|
||||||
// @Description 获取计划任务分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PageCronjob true "request"
|
// @Param request body dto.PageCronjob true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /cronjobs/search [post]
|
// @Router /cronjobs/search [post]
|
||||||
func (b *BaseApi) SearchCronjob(c *gin.Context) {
|
func (b *BaseApi) SearchCronjob(c *gin.Context) {
|
||||||
var req dto.PageCronjob
|
var req dto.PageCronjob
|
||||||
@@ -60,11 +60,11 @@ func (b *BaseApi) SearchCronjob(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Cronjob
|
// @Tags Cronjob
|
||||||
// @Summary Page job records
|
// @Summary Page job records
|
||||||
// @Description 获取计划任务记录
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchRecord true "request"
|
// @Param request body dto.SearchRecord true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /cronjobs/search/records [post]
|
// @Router /cronjobs/search/records [post]
|
||||||
func (b *BaseApi) SearchJobRecords(c *gin.Context) {
|
func (b *BaseApi) SearchJobRecords(c *gin.Context) {
|
||||||
var req dto.SearchRecord
|
var req dto.SearchRecord
|
||||||
@@ -72,7 +72,7 @@ func (b *BaseApi) SearchJobRecords(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
loc, _ := time.LoadLocation(common.LoadTimeZone())
|
loc, _ := time.LoadLocation(common.LoadTimeZoneByCmd())
|
||||||
req.StartTime = req.StartTime.In(loc)
|
req.StartTime = req.StartTime.In(loc)
|
||||||
req.EndTime = req.EndTime.In(loc)
|
req.EndTime = req.EndTime.In(loc)
|
||||||
|
|
||||||
@@ -90,11 +90,11 @@ func (b *BaseApi) SearchJobRecords(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Cronjob
|
// @Tags Cronjob
|
||||||
// @Summary Load Cronjob record log
|
// @Summary Load Cronjob record log
|
||||||
// @Description 获取计划任务记录日志
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperateByID true "request"
|
// @Param request body dto.OperateByID true "request"
|
||||||
// @Success 200
|
// @Success 200 {string} content
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /cronjobs/records/log [post]
|
// @Router /cronjobs/records/log [post]
|
||||||
func (b *BaseApi) LoadRecordLog(c *gin.Context) {
|
func (b *BaseApi) LoadRecordLog(c *gin.Context) {
|
||||||
var req dto.OperateByID
|
var req dto.OperateByID
|
||||||
@@ -107,11 +107,11 @@ func (b *BaseApi) LoadRecordLog(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Cronjob
|
// @Tags Cronjob
|
||||||
// @Summary Clean job records
|
// @Summary Clean job records
|
||||||
// @Description 清空计划任务记录
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.CronjobClean true "request"
|
// @Param request body dto.CronjobClean true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /cronjobs/records/clean [post]
|
// @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"}
|
// @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) {
|
func (b *BaseApi) CleanRecord(c *gin.Context) {
|
||||||
@@ -130,11 +130,11 @@ func (b *BaseApi) CleanRecord(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Cronjob
|
// @Tags Cronjob
|
||||||
// @Summary Delete cronjob
|
// @Summary Delete cronjob
|
||||||
// @Description 删除计划任务
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.CronjobBatchDelete true "request"
|
// @Param request body dto.CronjobBatchDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /cronjobs/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteCronjob(c *gin.Context) {
|
||||||
@@ -152,11 +152,11 @@ func (b *BaseApi) DeleteCronjob(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Cronjob
|
// @Tags Cronjob
|
||||||
// @Summary Update cronjob
|
// @Summary Update cronjob
|
||||||
// @Description 更新计划任务
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.CronjobUpdate true "request"
|
// @Param request body dto.CronjobUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /cronjobs/update [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdateCronjob(c *gin.Context) {
|
||||||
@@ -174,11 +174,11 @@ func (b *BaseApi) UpdateCronjob(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Cronjob
|
// @Tags Cronjob
|
||||||
// @Summary Update cronjob status
|
// @Summary Update cronjob status
|
||||||
// @Description 更新计划任务状态
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.CronjobUpdateStatus true "request"
|
// @Param request body dto.CronjobUpdateStatus true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /cronjobs/status [post]
|
// @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]."}
|
// @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) {
|
func (b *BaseApi) UpdateCronjobStatus(c *gin.Context) {
|
||||||
@@ -196,11 +196,11 @@ func (b *BaseApi) UpdateCronjobStatus(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Cronjob
|
// @Tags Cronjob
|
||||||
// @Summary Download cronjob records
|
// @Summary Download cronjob records
|
||||||
// @Description 下载计划任务记录
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.CronjobDownload true "request"
|
// @Param request body dto.CronjobDownload true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /cronjobs/download [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) TargetDownload(c *gin.Context) {
|
||||||
@@ -220,11 +220,11 @@ func (b *BaseApi) TargetDownload(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Cronjob
|
// @Tags Cronjob
|
||||||
// @Summary Handle cronjob once
|
// @Summary Handle cronjob once
|
||||||
// @Description 手动执行计划任务
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperateByID true "request"
|
// @Param request body dto.OperateByID true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /cronjobs/handle [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) HandleOnce(c *gin.Context) {
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package v1
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"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/app/api/v1/helper"
|
||||||
"github.com/1Panel-dev/1Panel/backend/constant"
|
"github.com/1Panel-dev/1Panel/backend/constant"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
@@ -10,10 +12,10 @@ import (
|
|||||||
|
|
||||||
// @Tags Dashboard
|
// @Tags Dashboard
|
||||||
// @Summary Load os info
|
// @Summary Load os info
|
||||||
// @Description 获取服务器基础数据
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200 {object} dto.OsInfo
|
// @Success 200 {object} dto.OsInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /dashboard/base/os [get]
|
// @Router /dashboard/base/os [get]
|
||||||
func (b *BaseApi) LoadDashboardOsInfo(c *gin.Context) {
|
func (b *BaseApi) LoadDashboardOsInfo(c *gin.Context) {
|
||||||
data, err := dashboardService.LoadOsInfo()
|
data, err := dashboardService.LoadOsInfo()
|
||||||
@@ -26,13 +28,13 @@ func (b *BaseApi) LoadDashboardOsInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Dashboard
|
// @Tags Dashboard
|
||||||
// @Summary Load dashboard base info
|
// @Summary Load dashboard base info
|
||||||
// @Description 获取首页基础数据
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param ioOption path string true "request"
|
// @Param ioOption path string true "request"
|
||||||
// @Param netOption path string true "request"
|
// @Param netOption path string true "request"
|
||||||
// @Success 200 {object} dto.DashboardBase
|
// @Success 200 {object} dto.DashboardBase
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /dashboard/base/:ioOption/:netOption [get]
|
// @Security Timestamp
|
||||||
|
// @Router /dashboard/base/{ioOption}/{netOption} [get]
|
||||||
func (b *BaseApi) LoadDashboardBaseInfo(c *gin.Context) {
|
func (b *BaseApi) LoadDashboardBaseInfo(c *gin.Context) {
|
||||||
ioOption, ok := c.Params.Get("ioOption")
|
ioOption, ok := c.Params.Get("ioOption")
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -54,37 +56,29 @@ func (b *BaseApi) LoadDashboardBaseInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Dashboard
|
// @Tags Dashboard
|
||||||
// @Summary Load dashboard current info
|
// @Summary Load dashboard current info
|
||||||
// @Description 获取首页实时数据
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param ioOption path string true "request"
|
// @Param request body dto.DashboardReq true "request"
|
||||||
// @Param netOption path string true "request"
|
|
||||||
// @Success 200 {object} dto.DashboardCurrent
|
// @Success 200 {object} dto.DashboardCurrent
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /dashboard/current/:ioOption/:netOption [get]
|
// @Security Timestamp
|
||||||
|
// @Router /dashboard/current [post]
|
||||||
func (b *BaseApi) LoadDashboardCurrentInfo(c *gin.Context) {
|
func (b *BaseApi) LoadDashboardCurrentInfo(c *gin.Context) {
|
||||||
ioOption, ok := c.Params.Get("ioOption")
|
var req dto.DashboardReq
|
||||||
if !ok {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, errors.New("error ioOption in path"))
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
netOption, ok := c.Params.Get("netOption")
|
data := dashboardService.LoadCurrentInfo(req)
|
||||||
if !ok {
|
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, errors.New("error netOption in path"))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
data := dashboardService.LoadCurrentInfo(ioOption, netOption)
|
|
||||||
helper.SuccessWithData(c, data)
|
helper.SuccessWithData(c, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Dashboard
|
// @Tags Dashboard
|
||||||
// @Summary System restart
|
// @Summary System restart panel
|
||||||
// @Description 重启服务器/面板
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param operation path string true "request"
|
// @Param operation path string true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /dashboard/system/restart/:operation [post]
|
// @Security Timestamp
|
||||||
|
// @Router /dashboard/system/restart/{operation} [post]
|
||||||
func (b *BaseApi) SystemRestart(c *gin.Context) {
|
func (b *BaseApi) SystemRestart(c *gin.Context) {
|
||||||
operation, ok := c.Params.Get("operation")
|
operation, ok := c.Params.Get("operation")
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Database
|
// @Tags Database
|
||||||
// @Summary Create database
|
// @Summary Create database
|
||||||
// @Description 创建远程数据库
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.DatabaseCreate true "request"
|
// @Param request body dto.DatabaseCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/db [post]
|
// @Router /databases/db [post]
|
||||||
// @x-panel-log {"bodyKeys":["name", "type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建远程数据库 [name][type]","formatEN":"create database [name][type]"}
|
// @x-panel-log {"bodyKeys":["name", "type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建远程数据库 [name][type]","formatEN":"create database [name][type]"}
|
||||||
func (b *BaseApi) CreateDatabase(c *gin.Context) {
|
func (b *BaseApi) CreateDatabase(c *gin.Context) {
|
||||||
@@ -41,11 +41,11 @@ func (b *BaseApi) CreateDatabase(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database
|
// @Tags Database
|
||||||
// @Summary Check database
|
// @Summary Check database
|
||||||
// @Description 检测远程数据库连接性
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.DatabaseCreate true "request"
|
// @Param request body dto.DatabaseCreate true "request"
|
||||||
// @Success 200
|
// @Success 200 {boolean} isOk
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/db/check [post]
|
// @Router /databases/db/check [post]
|
||||||
// @x-panel-log {"bodyKeys":["name", "type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"检测远程数据库 [name][type] 连接性","formatEN":"check if database [name][type] is connectable"}
|
// @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) {
|
func (b *BaseApi) CheckDatabase(c *gin.Context) {
|
||||||
@@ -67,11 +67,11 @@ func (b *BaseApi) CheckDatabase(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database
|
// @Tags Database
|
||||||
// @Summary Page databases
|
// @Summary Page databases
|
||||||
// @Description 获取远程数据库列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.DatabaseSearch true "request"
|
// @Param request body dto.DatabaseSearch true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/db/search [post]
|
// @Router /databases/db/search [post]
|
||||||
func (b *BaseApi) SearchDatabase(c *gin.Context) {
|
func (b *BaseApi) SearchDatabase(c *gin.Context) {
|
||||||
var req dto.DatabaseSearch
|
var req dto.DatabaseSearch
|
||||||
@@ -93,10 +93,11 @@ func (b *BaseApi) SearchDatabase(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database
|
// @Tags Database
|
||||||
// @Summary List databases
|
// @Summary List databases
|
||||||
// @Description 获取远程数据库列表
|
// @Param type path string true "type"
|
||||||
// @Success 200 {array} dto.DatabaseOption
|
// @Success 200 {array} dto.DatabaseOption
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /databases/db/list/:type [get]
|
// @Security Timestamp
|
||||||
|
// @Router /databases/db/list/{type} [get]
|
||||||
func (b *BaseApi) ListDatabase(c *gin.Context) {
|
func (b *BaseApi) ListDatabase(c *gin.Context) {
|
||||||
dbType, err := helper.GetStrParamByKey(c, "type")
|
dbType, err := helper.GetStrParamByKey(c, "type")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -113,11 +114,12 @@ func (b *BaseApi) ListDatabase(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Database
|
// @Tags Database
|
||||||
// @Summary List databases
|
// @Summary Retrieve database list based on type
|
||||||
// @Description 获取数据库列表
|
// @Param type path string true "type"
|
||||||
// @Success 200 {array} dto.DatabaseItem
|
// @Success 200 {array} dto.DatabaseItem
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /databases/db/item/:type [get]
|
// @Security Timestamp
|
||||||
|
// @Router /databases/db/item/{type} [get]
|
||||||
func (b *BaseApi) LoadDatabaseItems(c *gin.Context) {
|
func (b *BaseApi) LoadDatabaseItems(c *gin.Context) {
|
||||||
dbType, err := helper.GetStrParamByKey(c, "type")
|
dbType, err := helper.GetStrParamByKey(c, "type")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -135,10 +137,11 @@ func (b *BaseApi) LoadDatabaseItems(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database
|
// @Tags Database
|
||||||
// @Summary Get databases
|
// @Summary Get databases
|
||||||
// @Description 获取远程数据库
|
// @Param name path string true "name"
|
||||||
// @Success 200 {object} dto.DatabaseInfo
|
// @Success 200 {object} dto.DatabaseInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /databases/db/:name [get]
|
// @Security Timestamp
|
||||||
|
// @Router /databases/db/{name} [get]
|
||||||
func (b *BaseApi) GetDatabase(c *gin.Context) {
|
func (b *BaseApi) GetDatabase(c *gin.Context) {
|
||||||
name, err := helper.GetStrParamByKey(c, "name")
|
name, err := helper.GetStrParamByKey(c, "name")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -156,11 +159,11 @@ func (b *BaseApi) GetDatabase(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database
|
// @Tags Database
|
||||||
// @Summary Check before delete remote database
|
// @Summary Check before delete remote database
|
||||||
// @Description Mysql 远程数据库删除前检查
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperateByID true "request"
|
// @Param request body dto.OperateByID true "request"
|
||||||
// @Success 200 {array} string
|
// @Success 200 {array} string
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /db/remote/del/check [post]
|
// @Router /db/remote/del/check [post]
|
||||||
func (b *BaseApi) DeleteCheckDatabase(c *gin.Context) {
|
func (b *BaseApi) DeleteCheckDatabase(c *gin.Context) {
|
||||||
var req dto.OperateByID
|
var req dto.OperateByID
|
||||||
@@ -178,11 +181,11 @@ func (b *BaseApi) DeleteCheckDatabase(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database
|
// @Tags Database
|
||||||
// @Summary Delete database
|
// @Summary Delete database
|
||||||
// @Description 删除远程数据库
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.DatabaseDelete true "request"
|
// @Param request body dto.DatabaseDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/db/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteDatabase(c *gin.Context) {
|
||||||
@@ -200,11 +203,11 @@ func (b *BaseApi) DeleteDatabase(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database
|
// @Tags Database
|
||||||
// @Summary Update database
|
// @Summary Update database
|
||||||
// @Description 更新远程数据库
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.DatabaseUpdate true "request"
|
// @Param request body dto.DatabaseUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/db/update [post]
|
// @Router /databases/db/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新远程数据库 [name]","formatEN":"update database [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新远程数据库 [name]","formatEN":"update database [name]"}
|
||||||
func (b *BaseApi) UpdateDatabase(c *gin.Context) {
|
func (b *BaseApi) UpdateDatabase(c *gin.Context) {
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Database Common
|
// @Tags Database Common
|
||||||
// @Summary Load base info
|
// @Summary Load base info
|
||||||
// @Description 获取数据库基础信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithNameAndType true "request"
|
// @Param request body dto.OperationWithNameAndType true "request"
|
||||||
// @Success 200 {object} dto.DBBaseInfo
|
// @Success 200 {object} dto.DBBaseInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/common/info [post]
|
// @Router /databases/common/info [post]
|
||||||
func (b *BaseApi) LoadDBBaseInfo(c *gin.Context) {
|
func (b *BaseApi) LoadDBBaseInfo(c *gin.Context) {
|
||||||
var req dto.OperationWithNameAndType
|
var req dto.OperationWithNameAndType
|
||||||
@@ -32,11 +32,11 @@ func (b *BaseApi) LoadDBBaseInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Common
|
// @Tags Database Common
|
||||||
// @Summary Load Database conf
|
// @Summary Load Database conf
|
||||||
// @Description 获取数据库配置文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithNameAndType true "request"
|
// @Param request body dto.OperationWithNameAndType true "request"
|
||||||
// @Success 200
|
// @Success 200 {string} content
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/common/load/file [post]
|
// @Router /databases/common/load/file [post]
|
||||||
func (b *BaseApi) LoadDBFile(c *gin.Context) {
|
func (b *BaseApi) LoadDBFile(c *gin.Context) {
|
||||||
var req dto.OperationWithNameAndType
|
var req dto.OperationWithNameAndType
|
||||||
@@ -53,11 +53,11 @@ func (b *BaseApi) LoadDBFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Common
|
// @Tags Database Common
|
||||||
// @Summary Update conf by upload file
|
// @Summary Update conf by upload file
|
||||||
// @Description 上传替换配置文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.DBConfUpdateByFile true "request"
|
// @Param request body dto.DBConfUpdateByFile true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/common/update/conf [post]
|
// @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"}
|
// @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) {
|
func (b *BaseApi) UpdateDBConfByFile(c *gin.Context) {
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary Create mysql database
|
// @Summary Create mysql database
|
||||||
// @Description 创建 mysql 数据库
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.MysqlDBCreate true "request"
|
// @Param request body dto.MysqlDBCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases [post]
|
// @Router /databases [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 mysql 数据库 [name]","formatEN":"create mysql database [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 mysql 数据库 [name]","formatEN":"create mysql database [name]"}
|
||||||
func (b *BaseApi) CreateMysql(c *gin.Context) {
|
func (b *BaseApi) CreateMysql(c *gin.Context) {
|
||||||
@@ -43,11 +43,11 @@ func (b *BaseApi) CreateMysql(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary Bind user of mysql database
|
// @Summary Bind user of mysql database
|
||||||
// @Description 绑定 mysql 数据库用户
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BindUser true "request"
|
// @Param request body dto.BindUser true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/bind [post]
|
// @Router /databases/bind [post]
|
||||||
// @x-panel-log {"bodyKeys":["database", "username"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"绑定 mysql 数据库名 [database] [username]","formatEN":"bind mysql database [database] [username]"}
|
// @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) {
|
func (b *BaseApi) BindUser(c *gin.Context) {
|
||||||
@@ -74,11 +74,11 @@ func (b *BaseApi) BindUser(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary Update mysql database description
|
// @Summary Update mysql database description
|
||||||
// @Description 更新 mysql 数据库库描述信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.UpdateDescription true "request"
|
// @Param request body dto.UpdateDescription true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/description/update [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdateMysqlDescription(c *gin.Context) {
|
||||||
@@ -96,11 +96,11 @@ func (b *BaseApi) UpdateMysqlDescription(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary Change mysql password
|
// @Summary Change mysql password
|
||||||
// @Description 修改 mysql 密码
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ChangeDBInfo true "request"
|
// @Param request body dto.ChangeDBInfo true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/change/password [post]
|
// @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"}
|
// @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) {
|
func (b *BaseApi) ChangeMysqlPassword(c *gin.Context) {
|
||||||
@@ -127,11 +127,11 @@ func (b *BaseApi) ChangeMysqlPassword(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary Change mysql access
|
// @Summary Change mysql access
|
||||||
// @Description 修改 mysql 访问权限
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ChangeDBInfo true "request"
|
// @Param request body dto.ChangeDBInfo true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/change/access [post]
|
// @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"}
|
// @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) {
|
func (b *BaseApi) ChangeMysqlAccess(c *gin.Context) {
|
||||||
@@ -149,11 +149,11 @@ func (b *BaseApi) ChangeMysqlAccess(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary Update mysql variables
|
// @Summary Update mysql variables
|
||||||
// @Description mysql 性能调优
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.MysqlVariablesUpdate true "request"
|
// @Param request body dto.MysqlVariablesUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/variables/update [post]
|
// @Router /databases/variables/update [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"调整 mysql 数据库性能参数","formatEN":"adjust mysql database performance parameters"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"调整 mysql 数据库性能参数","formatEN":"adjust mysql database performance parameters"}
|
||||||
func (b *BaseApi) UpdateMysqlVariables(c *gin.Context) {
|
func (b *BaseApi) UpdateMysqlVariables(c *gin.Context) {
|
||||||
@@ -171,11 +171,11 @@ func (b *BaseApi) UpdateMysqlVariables(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary Page mysql databases
|
// @Summary Page mysql databases
|
||||||
// @Description 获取 mysql 数据库列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.MysqlDBSearch true "request"
|
// @Param request body dto.MysqlDBSearch true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/search [post]
|
// @Router /databases/search [post]
|
||||||
func (b *BaseApi) SearchMysql(c *gin.Context) {
|
func (b *BaseApi) SearchMysql(c *gin.Context) {
|
||||||
var req dto.MysqlDBSearch
|
var req dto.MysqlDBSearch
|
||||||
@@ -197,11 +197,11 @@ func (b *BaseApi) SearchMysql(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary List mysql database names
|
// @Summary List mysql database names
|
||||||
// @Description 获取 mysql 数据库列表
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PageInfo true "request"
|
// @Param request body dto.PageInfo true "request"
|
||||||
// @Success 200 {array} dto.MysqlOption
|
// @Success 200 {array} dto.MysqlOption
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/options [get]
|
// @Router /databases/options [get]
|
||||||
func (b *BaseApi) ListDBName(c *gin.Context) {
|
func (b *BaseApi) ListDBName(c *gin.Context) {
|
||||||
list, err := mysqlService.ListDBOption()
|
list, err := mysqlService.ListDBOption()
|
||||||
@@ -215,10 +215,11 @@ func (b *BaseApi) ListDBName(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary Load mysql database from remote
|
// @Summary Load mysql database from remote
|
||||||
// @Description 从服务器获取
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.MysqlLoadDB true "request"
|
// @Param request body dto.MysqlLoadDB true "request"
|
||||||
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/load [post]
|
// @Router /databases/load [post]
|
||||||
func (b *BaseApi) LoadDBFromRemote(c *gin.Context) {
|
func (b *BaseApi) LoadDBFromRemote(c *gin.Context) {
|
||||||
var req dto.MysqlLoadDB
|
var req dto.MysqlLoadDB
|
||||||
@@ -236,11 +237,11 @@ func (b *BaseApi) LoadDBFromRemote(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary Check before delete mysql database
|
// @Summary Check before delete mysql database
|
||||||
// @Description Mysql 数据库删除前检查
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.MysqlDBDeleteCheck true "request"
|
// @Param request body dto.MysqlDBDeleteCheck true "request"
|
||||||
// @Success 200 {array} string
|
// @Success 200 {array} string
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/del/check [post]
|
// @Router /databases/del/check [post]
|
||||||
func (b *BaseApi) DeleteCheckMysql(c *gin.Context) {
|
func (b *BaseApi) DeleteCheckMysql(c *gin.Context) {
|
||||||
var req dto.MysqlDBDeleteCheck
|
var req dto.MysqlDBDeleteCheck
|
||||||
@@ -258,11 +259,11 @@ func (b *BaseApi) DeleteCheckMysql(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary Delete mysql database
|
// @Summary Delete mysql database
|
||||||
// @Description 删除 mysql 数据库
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.MysqlDBDelete true "request"
|
// @Param request body dto.MysqlDBDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteMysql(c *gin.Context) {
|
||||||
@@ -283,11 +284,11 @@ func (b *BaseApi) DeleteMysql(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary Load mysql remote access
|
// @Summary Load mysql remote access
|
||||||
// @Description 获取 mysql 远程访问权限
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithNameAndType true "request"
|
// @Param request body dto.OperationWithNameAndType true "request"
|
||||||
// @Success 200 {boolean} isRemote
|
// @Success 200 {boolean} isRemote
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/remote [post]
|
// @Router /databases/remote [post]
|
||||||
func (b *BaseApi) LoadRemoteAccess(c *gin.Context) {
|
func (b *BaseApi) LoadRemoteAccess(c *gin.Context) {
|
||||||
var req dto.OperationWithNameAndType
|
var req dto.OperationWithNameAndType
|
||||||
@@ -305,11 +306,11 @@ func (b *BaseApi) LoadRemoteAccess(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary Load mysql status info
|
// @Summary Load mysql status info
|
||||||
// @Description 获取 mysql 状态信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithNameAndType true "request"
|
// @Param request body dto.OperationWithNameAndType true "request"
|
||||||
// @Success 200 {object} dto.MysqlStatus
|
// @Success 200 {object} dto.MysqlStatus
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/status [post]
|
// @Router /databases/status [post]
|
||||||
func (b *BaseApi) LoadStatus(c *gin.Context) {
|
func (b *BaseApi) LoadStatus(c *gin.Context) {
|
||||||
var req dto.OperationWithNameAndType
|
var req dto.OperationWithNameAndType
|
||||||
@@ -328,11 +329,11 @@ func (b *BaseApi) LoadStatus(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Mysql
|
// @Tags Database Mysql
|
||||||
// @Summary Load mysql variables info
|
// @Summary Load mysql variables info
|
||||||
// @Description 获取 mysql 性能参数信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithNameAndType true "request"
|
// @Param request body dto.OperationWithNameAndType true "request"
|
||||||
// @Success 200 {object} dto.MysqlVariables
|
// @Success 200 {object} dto.MysqlVariables
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/variables [post]
|
// @Router /databases/variables [post]
|
||||||
func (b *BaseApi) LoadVariables(c *gin.Context) {
|
func (b *BaseApi) LoadVariables(c *gin.Context) {
|
||||||
var req dto.OperationWithNameAndType
|
var req dto.OperationWithNameAndType
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Database Postgresql
|
// @Tags Database Postgresql
|
||||||
// @Summary Create postgresql database
|
// @Summary Create postgresql database
|
||||||
// @Description 创建 postgresql 数据库
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PostgresqlDBCreate true "request"
|
// @Param request body dto.PostgresqlDBCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/pg [post]
|
// @Router /databases/pg [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 postgresql 数据库 [name]","formatEN":"create postgresql database [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 postgresql 数据库 [name]","formatEN":"create postgresql database [name]"}
|
||||||
func (b *BaseApi) CreatePostgresql(c *gin.Context) {
|
func (b *BaseApi) CreatePostgresql(c *gin.Context) {
|
||||||
@@ -43,11 +43,11 @@ func (b *BaseApi) CreatePostgresql(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Postgresql
|
// @Tags Database Postgresql
|
||||||
// @Summary Bind postgresql user
|
// @Summary Bind postgresql user
|
||||||
// @Description 绑定 postgresql 数据库用户
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PostgresqlBindUser true "request"
|
// @Param request body dto.PostgresqlBindUser true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/pg/bind [post]
|
// @Router /databases/pg/bind [post]
|
||||||
// @x-panel-log {"bodyKeys":["name", "username"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"绑定 postgresql 数据库 [name] 用户 [username]","formatEN":"bind postgresql database [name] user [username]"}
|
// @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) {
|
func (b *BaseApi) BindPostgresqlUser(c *gin.Context) {
|
||||||
@@ -65,11 +65,11 @@ func (b *BaseApi) BindPostgresqlUser(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Postgresql
|
// @Tags Database Postgresql
|
||||||
// @Summary Update postgresql database description
|
// @Summary Update postgresql database description
|
||||||
// @Description 更新 postgresql 数据库库描述信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.UpdateDescription true "request"
|
// @Param request body dto.UpdateDescription true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/pg/description [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdatePostgresqlDescription(c *gin.Context) {
|
||||||
@@ -87,11 +87,11 @@ func (b *BaseApi) UpdatePostgresqlDescription(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Postgresql
|
// @Tags Database Postgresql
|
||||||
// @Summary Change postgresql privileges
|
// @Summary Change postgresql privileges
|
||||||
// @Description 修改 postgresql 用户权限
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ChangeDBInfo true "request"
|
// @Param request body dto.ChangeDBInfo true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/pg/privileges [post]
|
// @Router /databases/pg/privileges [post]
|
||||||
// @x-panel-log {"bodyKeys":["database", "username"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新数据库 [database] 用户 [username] 权限","formatEN":"Update [user] privileges of database [database]"}
|
// @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) {
|
func (b *BaseApi) ChangePostgresqlPrivileges(c *gin.Context) {
|
||||||
@@ -109,11 +109,11 @@ func (b *BaseApi) ChangePostgresqlPrivileges(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Postgresql
|
// @Tags Database Postgresql
|
||||||
// @Summary Change postgresql password
|
// @Summary Change postgresql password
|
||||||
// @Description 修改 postgresql 密码
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ChangeDBInfo true "request"
|
// @Param request body dto.ChangeDBInfo true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/pg/password [post]
|
// @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"}
|
// @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) {
|
func (b *BaseApi) ChangePostgresqlPassword(c *gin.Context) {
|
||||||
@@ -140,11 +140,11 @@ func (b *BaseApi) ChangePostgresqlPassword(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Postgresql
|
// @Tags Database Postgresql
|
||||||
// @Summary Page postgresql databases
|
// @Summary Page postgresql databases
|
||||||
// @Description 获取 postgresql 数据库列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PostgresqlDBSearch true "request"
|
// @Param request body dto.PostgresqlDBSearch true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/pg/search [post]
|
// @Router /databases/pg/search [post]
|
||||||
func (b *BaseApi) SearchPostgresql(c *gin.Context) {
|
func (b *BaseApi) SearchPostgresql(c *gin.Context) {
|
||||||
var req dto.PostgresqlDBSearch
|
var req dto.PostgresqlDBSearch
|
||||||
@@ -166,11 +166,13 @@ func (b *BaseApi) SearchPostgresql(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Postgresql
|
// @Tags Database Postgresql
|
||||||
// @Summary Load postgresql database from remote
|
// @Summary Load postgresql database from remote
|
||||||
// @Description 从服务器获取
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PostgresqlLoadDB true "request"
|
// @Param request body dto.PostgresqlLoadDB true "request"
|
||||||
|
// @Param database path string true "database"
|
||||||
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /databases/pg/:database/load [post]
|
// @Security Timestamp
|
||||||
|
// @Router /databases/pg/{database}/load [post]
|
||||||
func (b *BaseApi) LoadPostgresqlDBFromRemote(c *gin.Context) {
|
func (b *BaseApi) LoadPostgresqlDBFromRemote(c *gin.Context) {
|
||||||
database, err := helper.GetStrParamByKey(c, "database")
|
database, err := helper.GetStrParamByKey(c, "database")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -188,11 +190,11 @@ func (b *BaseApi) LoadPostgresqlDBFromRemote(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Postgresql
|
// @Tags Database Postgresql
|
||||||
// @Summary Check before delete postgresql database
|
// @Summary Check before delete postgresql database
|
||||||
// @Description Postgresql 数据库删除前检查
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PostgresqlDBDeleteCheck true "request"
|
// @Param request body dto.PostgresqlDBDeleteCheck true "request"
|
||||||
// @Success 200 {array} string
|
// @Success 200 {array} string
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/pg/del/check [post]
|
// @Router /databases/pg/del/check [post]
|
||||||
func (b *BaseApi) DeleteCheckPostgresql(c *gin.Context) {
|
func (b *BaseApi) DeleteCheckPostgresql(c *gin.Context) {
|
||||||
var req dto.PostgresqlDBDeleteCheck
|
var req dto.PostgresqlDBDeleteCheck
|
||||||
@@ -210,11 +212,11 @@ func (b *BaseApi) DeleteCheckPostgresql(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Postgresql
|
// @Tags Database Postgresql
|
||||||
// @Summary Delete postgresql database
|
// @Summary Delete postgresql database
|
||||||
// @Description 删除 postgresql 数据库
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PostgresqlDBDelete true "request"
|
// @Param request body dto.PostgresqlDBDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/pg/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeletePostgresql(c *gin.Context) {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Database Redis
|
// @Tags Database Redis
|
||||||
// @Summary Load redis status info
|
// @Summary Load redis status info
|
||||||
// @Description 获取 redis 状态信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithName true "request"
|
// @Param request body dto.OperationWithName true "request"
|
||||||
// @Success 200 {object} dto.RedisStatus
|
// @Success 200 {object} dto.RedisStatus
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/redis/status [post]
|
// @Router /databases/redis/status [post]
|
||||||
func (b *BaseApi) LoadRedisStatus(c *gin.Context) {
|
func (b *BaseApi) LoadRedisStatus(c *gin.Context) {
|
||||||
var req dto.OperationWithName
|
var req dto.OperationWithName
|
||||||
@@ -33,11 +33,11 @@ func (b *BaseApi) LoadRedisStatus(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Redis
|
// @Tags Database Redis
|
||||||
// @Summary Load redis conf
|
// @Summary Load redis conf
|
||||||
// @Description 获取 redis 配置信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithName true "request"
|
// @Param request body dto.OperationWithName true "request"
|
||||||
// @Success 200 {object} dto.RedisConf
|
// @Success 200 {object} dto.RedisConf
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/redis/conf [post]
|
// @Router /databases/redis/conf [post]
|
||||||
func (b *BaseApi) LoadRedisConf(c *gin.Context) {
|
func (b *BaseApi) LoadRedisConf(c *gin.Context) {
|
||||||
var req dto.OperationWithName
|
var req dto.OperationWithName
|
||||||
@@ -55,11 +55,11 @@ func (b *BaseApi) LoadRedisConf(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Redis
|
// @Tags Database Redis
|
||||||
// @Summary Load redis persistence conf
|
// @Summary Load redis persistence conf
|
||||||
// @Description 获取 redis 持久化配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithName true "request"
|
// @Param request body dto.OperationWithName true "request"
|
||||||
// @Success 200 {object} dto.RedisPersistence
|
// @Success 200 {object} dto.RedisPersistence
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/redis/persistence/conf [post]
|
// @Router /databases/redis/persistence/conf [post]
|
||||||
func (b *BaseApi) LoadPersistenceConf(c *gin.Context) {
|
func (b *BaseApi) LoadPersistenceConf(c *gin.Context) {
|
||||||
var req dto.OperationWithName
|
var req dto.OperationWithName
|
||||||
@@ -81,9 +81,9 @@ func (b *BaseApi) CheckHasCli(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Redis
|
// @Tags Database Redis
|
||||||
// @Summary Install redis-cli
|
// @Summary Install redis-cli
|
||||||
// @Description 安装 redis cli
|
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/redis/install/cli [post]
|
// @Router /databases/redis/install/cli [post]
|
||||||
func (b *BaseApi) InstallCli(c *gin.Context) {
|
func (b *BaseApi) InstallCli(c *gin.Context) {
|
||||||
if err := redisService.InstallCli(); err != nil {
|
if err := redisService.InstallCli(); err != nil {
|
||||||
@@ -96,11 +96,11 @@ func (b *BaseApi) InstallCli(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Redis
|
// @Tags Database Redis
|
||||||
// @Summary Update redis conf
|
// @Summary Update redis conf
|
||||||
// @Description 更新 redis 配置信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.RedisConfUpdate true "request"
|
// @Param request body dto.RedisConfUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/redis/conf/update [post]
|
// @Router /databases/redis/conf/update [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 redis 数据库配置信息","formatEN":"update the redis database configuration information"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 redis 数据库配置信息","formatEN":"update the redis database configuration information"}
|
||||||
func (b *BaseApi) UpdateRedisConf(c *gin.Context) {
|
func (b *BaseApi) UpdateRedisConf(c *gin.Context) {
|
||||||
@@ -118,11 +118,11 @@ func (b *BaseApi) UpdateRedisConf(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Redis
|
// @Tags Database Redis
|
||||||
// @Summary Change redis password
|
// @Summary Change redis password
|
||||||
// @Description 更新 redis 密码
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ChangeRedisPass true "request"
|
// @Param request body dto.ChangeRedisPass true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/redis/password [post]
|
// @Router /databases/redis/password [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 redis 数据库密码","formatEN":"change the password of the redis database"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 redis 数据库密码","formatEN":"change the password of the redis database"}
|
||||||
func (b *BaseApi) ChangeRedisPassword(c *gin.Context) {
|
func (b *BaseApi) ChangeRedisPassword(c *gin.Context) {
|
||||||
@@ -149,11 +149,11 @@ func (b *BaseApi) ChangeRedisPassword(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Database Redis
|
// @Tags Database Redis
|
||||||
// @Summary Update redis persistence conf
|
// @Summary Update redis persistence conf
|
||||||
// @Description 更新 redis 持久化配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.RedisConfPersistenceUpdate true "request"
|
// @Param request body dto.RedisConfPersistenceUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /databases/redis/persistence/update [post]
|
// @Router /databases/redis/persistence/update [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"redis 数据库持久化配置更新","formatEN":"redis database persistence configuration update"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"redis 数据库持久化配置更新","formatEN":"redis database persistence configuration update"}
|
||||||
func (b *BaseApi) UpdateRedisPersistenceConf(c *gin.Context) {
|
func (b *BaseApi) UpdateRedisPersistenceConf(c *gin.Context) {
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ import (
|
|||||||
|
|
||||||
// @Tags Device
|
// @Tags Device
|
||||||
// @Summary Load device base info
|
// @Summary Load device base info
|
||||||
// @Description 获取设备基础信息
|
|
||||||
// @Success 200 {object} dto.DeviceBaseInfo
|
// @Success 200 {object} dto.DeviceBaseInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/device/base [post]
|
// @Router /toolbox/device/base [post]
|
||||||
func (b *BaseApi) LoadDeviceBaseInfo(c *gin.Context) {
|
func (b *BaseApi) LoadDeviceBaseInfo(c *gin.Context) {
|
||||||
data, err := deviceService.LoadBaseInfo()
|
data, err := deviceService.LoadBaseInfo()
|
||||||
@@ -27,10 +27,10 @@ func (b *BaseApi) LoadDeviceBaseInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Device
|
// @Tags Device
|
||||||
// @Summary list time zone options
|
// @Summary list time zone options
|
||||||
// @Description 获取系统可用时区选项
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200 {Array} string
|
// @Success 200 {array} string
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/device/zone/options [get]
|
// @Router /toolbox/device/zone/options [get]
|
||||||
func (b *BaseApi) LoadTimeOption(c *gin.Context) {
|
func (b *BaseApi) LoadTimeOption(c *gin.Context) {
|
||||||
list, err := deviceService.LoadTimeZone()
|
list, err := deviceService.LoadTimeZone()
|
||||||
@@ -44,11 +44,11 @@ func (b *BaseApi) LoadTimeOption(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Device
|
// @Tags Device
|
||||||
// @Summary load conf
|
// @Summary load conf
|
||||||
// @Description 获取系统配置文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperationWithName true "request"
|
// @Param request body dto.OperationWithName true "request"
|
||||||
// @Success 200
|
// @Success 200 {array} string
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/device/conf [post]
|
// @Router /toolbox/device/conf [post]
|
||||||
func (b *BaseApi) LoadDeviceConf(c *gin.Context) {
|
func (b *BaseApi) LoadDeviceConf(c *gin.Context) {
|
||||||
var req dto.OperationWithName
|
var req dto.OperationWithName
|
||||||
@@ -67,11 +67,11 @@ func (b *BaseApi) LoadDeviceConf(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Device
|
// @Tags Device
|
||||||
// @Summary Update device conf by file
|
// @Summary Update device conf by file
|
||||||
// @Description 通过文件修改配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.UpdateByNameAndFile true "request"
|
// @Param request body dto.UpdateByNameAndFile true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/device/update/byconf [post]
|
// @Router /toolbox/device/update/byconf [post]
|
||||||
func (b *BaseApi) UpdateDeviceByFile(c *gin.Context) {
|
func (b *BaseApi) UpdateDeviceByFile(c *gin.Context) {
|
||||||
var req dto.UpdateByNameAndFile
|
var req dto.UpdateByNameAndFile
|
||||||
@@ -88,11 +88,11 @@ func (b *BaseApi) UpdateDeviceByFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Device
|
// @Tags Device
|
||||||
// @Summary Update device
|
// @Summary Update device
|
||||||
// @Description 修改系统参数
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SettingUpdate true "request"
|
// @Param request body dto.SettingUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/device/update/conf [post]
|
// @Router /toolbox/device/update/conf [post]
|
||||||
// @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改主机参数 [key] => [value]","formatEN":"update device conf [key] => [value]"}
|
// @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改主机参数 [key] => [value]","formatEN":"update device conf [key] => [value]"}
|
||||||
func (b *BaseApi) UpdateDeviceConf(c *gin.Context) {
|
func (b *BaseApi) UpdateDeviceConf(c *gin.Context) {
|
||||||
@@ -111,9 +111,9 @@ func (b *BaseApi) UpdateDeviceConf(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Device
|
// @Tags Device
|
||||||
// @Summary Update device hosts
|
// @Summary Update device hosts
|
||||||
// @Description 修改系统 hosts
|
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/device/update/host [post]
|
// @Router /toolbox/device/update/host [post]
|
||||||
// @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改主机 Host [key] => [value]","formatEN":"update device host [key] => [value]"}
|
// @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) {
|
func (b *BaseApi) UpdateDeviceHost(c *gin.Context) {
|
||||||
@@ -132,11 +132,11 @@ func (b *BaseApi) UpdateDeviceHost(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Device
|
// @Tags Device
|
||||||
// @Summary Update device passwd
|
// @Summary Update device passwd
|
||||||
// @Description 修改系统密码
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ChangePasswd true "request"
|
// @Param request body dto.ChangePasswd true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/device/update/passwd [post]
|
// @Router /toolbox/device/update/passwd [post]
|
||||||
func (b *BaseApi) UpdateDevicePasswd(c *gin.Context) {
|
func (b *BaseApi) UpdateDevicePasswd(c *gin.Context) {
|
||||||
var req dto.ChangePasswd
|
var req dto.ChangePasswd
|
||||||
@@ -161,11 +161,11 @@ func (b *BaseApi) UpdateDevicePasswd(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Device
|
// @Tags Device
|
||||||
// @Summary Update device swap
|
// @Summary Update device swap
|
||||||
// @Description 修改系统 Swap
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SwapHelper true "request"
|
// @Param request body dto.SwapHelper true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/device/update/swap [post]
|
// @Router /toolbox/device/update/swap [post]
|
||||||
// @x-panel-log {"bodyKeys":["operate","path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] 主机 swap [path]","formatEN":"[operate] device swap [path]"}
|
// @x-panel-log {"bodyKeys":["operate","path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] 主机 swap [path]","formatEN":"[operate] device swap [path]"}
|
||||||
func (b *BaseApi) UpdateDeviceSwap(c *gin.Context) {
|
func (b *BaseApi) UpdateDeviceSwap(c *gin.Context) {
|
||||||
@@ -183,11 +183,11 @@ func (b *BaseApi) UpdateDeviceSwap(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Device
|
// @Tags Device
|
||||||
// @Summary Check device DNS conf
|
// @Summary Check device DNS conf
|
||||||
// @Description 检查系统 DNS 配置可用性
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SettingUpdate true "request"
|
// @Param request body dto.SettingUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200 {boolean} data
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/device/check/dns [post]
|
// @Router /toolbox/device/check/dns [post]
|
||||||
func (b *BaseApi) CheckDNS(c *gin.Context) {
|
func (b *BaseApi) CheckDNS(c *gin.Context) {
|
||||||
var req dto.SettingUpdate
|
var req dto.SettingUpdate
|
||||||
@@ -206,9 +206,9 @@ func (b *BaseApi) CheckDNS(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Device
|
// @Tags Device
|
||||||
// @Summary Scan system
|
// @Summary Scan system
|
||||||
// @Description 扫描系统垃圾文件
|
// @Success 200 {object} dto.CleanData
|
||||||
// @Success 200
|
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/scan [post]
|
// @Router /toolbox/scan [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"扫描系统垃圾文件","formatEN":"scan System Junk Files"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"扫描系统垃圾文件","formatEN":"scan System Junk Files"}
|
||||||
func (b *BaseApi) ScanSystem(c *gin.Context) {
|
func (b *BaseApi) ScanSystem(c *gin.Context) {
|
||||||
@@ -217,11 +217,11 @@ func (b *BaseApi) ScanSystem(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Device
|
// @Tags Device
|
||||||
// @Summary Clean system
|
// @Summary Clean system
|
||||||
// @Description 清理系统垃圾文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body []dto.Clean true "request"
|
// @Param request body []dto.Clean true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/clean [post]
|
// @Router /toolbox/clean [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清理系统垃圾文件","formatEN":"Clean system junk files"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清理系统垃圾文件","formatEN":"Clean system junk files"}
|
||||||
func (b *BaseApi) SystemClean(c *gin.Context) {
|
func (b *BaseApi) SystemClean(c *gin.Context) {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
|
|
||||||
// @Tags Container Docker
|
// @Tags Container Docker
|
||||||
// @Summary Load docker status
|
// @Summary Load docker status
|
||||||
// @Description 获取 docker 服务状态
|
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {string} status
|
// @Success 200 {string} status
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/docker/status [get]
|
// @Router /containers/docker/status [get]
|
||||||
func (b *BaseApi) LoadDockerStatus(c *gin.Context) {
|
func (b *BaseApi) LoadDockerStatus(c *gin.Context) {
|
||||||
status := dockerService.LoadDockerStatus()
|
status := dockerService.LoadDockerStatus()
|
||||||
@@ -23,10 +23,10 @@ func (b *BaseApi) LoadDockerStatus(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Docker
|
// @Tags Container Docker
|
||||||
// @Summary Load docker daemon.json
|
// @Summary Load docker daemon.json
|
||||||
// @Description 获取 docker 配置信息(表单)
|
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {object} string
|
// @Success 200 {object} string
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/daemonjson/file [get]
|
// @Router /containers/daemonjson/file [get]
|
||||||
func (b *BaseApi) LoadDaemonJsonFile(c *gin.Context) {
|
func (b *BaseApi) LoadDaemonJsonFile(c *gin.Context) {
|
||||||
if _, err := os.Stat(constant.DaemonJsonPath); err != nil {
|
if _, err := os.Stat(constant.DaemonJsonPath); err != nil {
|
||||||
@@ -43,10 +43,10 @@ func (b *BaseApi) LoadDaemonJsonFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Docker
|
// @Tags Container Docker
|
||||||
// @Summary Load docker daemon.json
|
// @Summary Load docker daemon.json
|
||||||
// @Description 获取 docker 配置信息
|
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {object} dto.DaemonJsonConf
|
// @Success 200 {object} dto.DaemonJsonConf
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/daemonjson [get]
|
// @Router /containers/daemonjson [get]
|
||||||
func (b *BaseApi) LoadDaemonJson(c *gin.Context) {
|
func (b *BaseApi) LoadDaemonJson(c *gin.Context) {
|
||||||
conf := dockerService.LoadDockerConf()
|
conf := dockerService.LoadDockerConf()
|
||||||
@@ -55,11 +55,11 @@ func (b *BaseApi) LoadDaemonJson(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Docker
|
// @Tags Container Docker
|
||||||
// @Summary Update docker daemon.json
|
// @Summary Update docker daemon.json
|
||||||
// @Description 修改 docker 配置信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SettingUpdate true "request"
|
// @Param request body dto.SettingUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/daemonjson/update [post]
|
// @Router /containers/daemonjson/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["key", "value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新配置 [key]","formatEN":"Updated configuration [key]"}
|
// @x-panel-log {"bodyKeys":["key", "value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新配置 [key]","formatEN":"Updated configuration [key]"}
|
||||||
func (b *BaseApi) UpdateDaemonJson(c *gin.Context) {
|
func (b *BaseApi) UpdateDaemonJson(c *gin.Context) {
|
||||||
@@ -78,11 +78,11 @@ func (b *BaseApi) UpdateDaemonJson(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Docker
|
// @Tags Container Docker
|
||||||
// @Summary Update docker daemon.json log option
|
// @Summary Update docker daemon.json log option
|
||||||
// @Description 修改 docker 日志配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.LogOption true "request"
|
// @Param request body dto.LogOption true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/logoption/update [post]
|
// @Router /containers/logoption/update [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新日志配置","formatEN":"Updated the log option"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新日志配置","formatEN":"Updated the log option"}
|
||||||
func (b *BaseApi) UpdateLogOption(c *gin.Context) {
|
func (b *BaseApi) UpdateLogOption(c *gin.Context) {
|
||||||
@@ -101,11 +101,11 @@ func (b *BaseApi) UpdateLogOption(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Docker
|
// @Tags Container Docker
|
||||||
// @Summary Update docker daemon.json ipv6 option
|
// @Summary Update docker daemon.json ipv6 option
|
||||||
// @Description 修改 docker ipv6 配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.LogOption true "request"
|
// @Param request body dto.LogOption true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/ipv6option/update [post]
|
// @Router /containers/ipv6option/update [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 ipv6 配置","formatEN":"Updated the ipv6 option"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 ipv6 配置","formatEN":"Updated the ipv6 option"}
|
||||||
func (b *BaseApi) UpdateIpv6Option(c *gin.Context) {
|
func (b *BaseApi) UpdateIpv6Option(c *gin.Context) {
|
||||||
@@ -124,11 +124,11 @@ func (b *BaseApi) UpdateIpv6Option(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Docker
|
// @Tags Container Docker
|
||||||
// @Summary Update docker daemon.json by upload file
|
// @Summary Update docker daemon.json by upload file
|
||||||
// @Description 上传替换 docker 配置文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.DaemonJsonUpdateByFile true "request"
|
// @Param request body dto.DaemonJsonUpdateByFile true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/daemonjson/update/byfile [post]
|
// @Router /containers/daemonjson/update/byfile [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新配置文件","formatEN":"Updated configuration file"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新配置文件","formatEN":"Updated configuration file"}
|
||||||
func (b *BaseApi) UpdateDaemonJsonByFile(c *gin.Context) {
|
func (b *BaseApi) UpdateDaemonJsonByFile(c *gin.Context) {
|
||||||
@@ -147,11 +147,11 @@ func (b *BaseApi) UpdateDaemonJsonByFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Docker
|
// @Tags Container Docker
|
||||||
// @Summary Operate docker
|
// @Summary Operate docker
|
||||||
// @Description Docker 操作
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.DockerOperation true "request"
|
// @Param request body dto.DockerOperation true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/docker/operate [post]
|
// @Router /containers/docker/operate [post]
|
||||||
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"docker 服务 [operation]","formatEN":"[operation] docker service"}
|
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"docker 服务 [operation]","formatEN":"[operation] docker service"}
|
||||||
func (b *BaseApi) OperateDocker(c *gin.Context) {
|
func (b *BaseApi) OperateDocker(c *gin.Context) {
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ var (
|
|||||||
appService = service.NewIAppService()
|
appService = service.NewIAppService()
|
||||||
appInstallService = service.NewIAppInstalledService()
|
appInstallService = service.NewIAppInstalledService()
|
||||||
|
|
||||||
|
AIToolService = service.NewIAIToolService()
|
||||||
|
|
||||||
containerService = service.NewIContainerService()
|
containerService = service.NewIContainerService()
|
||||||
composeTemplateService = service.NewIComposeTemplateService()
|
composeTemplateService = service.NewIComposeTemplateService()
|
||||||
imageRepoService = service.NewIImageRepoService()
|
imageRepoService = service.NewIImageRepoService()
|
||||||
@@ -66,4 +68,6 @@ var (
|
|||||||
favoriteService = service.NewIFavoriteService()
|
favoriteService = service.NewIFavoriteService()
|
||||||
|
|
||||||
websiteCAService = service.NewIWebsiteCAService()
|
websiteCAService = service.NewIWebsiteCAService()
|
||||||
|
|
||||||
|
mcpServerService = service.NewIMcpServerService()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ import (
|
|||||||
|
|
||||||
// @Tags Fail2ban
|
// @Tags Fail2ban
|
||||||
// @Summary Load fail2ban base info
|
// @Summary Load fail2ban base info
|
||||||
// @Description 获取 Fail2ban 基础信息
|
|
||||||
// @Success 200 {object} dto.Fail2BanBaseInfo
|
// @Success 200 {object} dto.Fail2BanBaseInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/fail2ban/base [get]
|
// @Router /toolbox/fail2ban/base [get]
|
||||||
func (b *BaseApi) LoadFail2BanBaseInfo(c *gin.Context) {
|
func (b *BaseApi) LoadFail2BanBaseInfo(c *gin.Context) {
|
||||||
data, err := fail2banService.LoadBaseInfo()
|
data, err := fail2banService.LoadBaseInfo()
|
||||||
@@ -27,11 +27,11 @@ func (b *BaseApi) LoadFail2BanBaseInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Fail2ban
|
// @Tags Fail2ban
|
||||||
// @Summary Page fail2ban ip list
|
// @Summary Page fail2ban ip list
|
||||||
// @Description 获取 Fail2ban ip
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.Fail2BanSearch true "request"
|
// @Param request body dto.Fail2BanSearch true "request"
|
||||||
// @Success 200 {Array} string
|
// @Success 200 {array} string
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/fail2ban/search [post]
|
// @Router /toolbox/fail2ban/search [post]
|
||||||
func (b *BaseApi) SearchFail2Ban(c *gin.Context) {
|
func (b *BaseApi) SearchFail2Ban(c *gin.Context) {
|
||||||
var req dto.Fail2BanSearch
|
var req dto.Fail2BanSearch
|
||||||
@@ -50,10 +50,11 @@ func (b *BaseApi) SearchFail2Ban(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Fail2ban
|
// @Tags Fail2ban
|
||||||
// @Summary Operate fail2ban
|
// @Summary Operate fail2ban
|
||||||
// @Description 修改 Fail2ban 状态
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.Operate true "request"
|
// @Param request body dto.Operate true "request"
|
||||||
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/fail2ban/operate [post]
|
// @Router /toolbox/fail2ban/operate [post]
|
||||||
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] Fail2ban","formatEN":"[operation] Fail2ban"}
|
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] Fail2ban","formatEN":"[operation] Fail2ban"}
|
||||||
func (b *BaseApi) OperateFail2Ban(c *gin.Context) {
|
func (b *BaseApi) OperateFail2Ban(c *gin.Context) {
|
||||||
@@ -72,10 +73,11 @@ func (b *BaseApi) OperateFail2Ban(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Fail2ban
|
// @Tags Fail2ban
|
||||||
// @Summary Operate sshd of fail2ban
|
// @Summary Operate sshd of fail2ban
|
||||||
// @Description 配置 sshd
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.Operate true "request"
|
// @Param request body dto.Operate true "request"
|
||||||
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/fail2ban/operate/sshd [post]
|
// @Router /toolbox/fail2ban/operate/sshd [post]
|
||||||
func (b *BaseApi) OperateSSHD(c *gin.Context) {
|
func (b *BaseApi) OperateSSHD(c *gin.Context) {
|
||||||
var req dto.Fail2BanSet
|
var req dto.Fail2BanSet
|
||||||
@@ -93,11 +95,11 @@ func (b *BaseApi) OperateSSHD(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Fail2ban
|
// @Tags Fail2ban
|
||||||
// @Summary Update fail2ban conf
|
// @Summary Update fail2ban conf
|
||||||
// @Description 修改 Fail2ban 配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.Fail2BanUpdate true "request"
|
// @Param request body dto.Fail2BanUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/fail2ban/update [post]
|
// @Router /toolbox/fail2ban/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 Fail2ban 配置 [key] => [value]","formatEN":"update fail2ban conf [key] => [value]"}
|
// @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) {
|
func (b *BaseApi) UpdateFail2BanConf(c *gin.Context) {
|
||||||
@@ -115,10 +117,10 @@ func (b *BaseApi) UpdateFail2BanConf(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Fail2ban
|
// @Tags Fail2ban
|
||||||
// @Summary Load fail2ban conf
|
// @Summary Load fail2ban conf
|
||||||
// @Description 获取 fail2ban 配置文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200
|
// @Success 200 {string} file
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/fail2ban/load/conf [get]
|
// @Router /toolbox/fail2ban/load/conf [get]
|
||||||
func (b *BaseApi) LoadFail2BanConf(c *gin.Context) {
|
func (b *BaseApi) LoadFail2BanConf(c *gin.Context) {
|
||||||
path := "/etc/fail2ban/jail.local"
|
path := "/etc/fail2ban/jail.local"
|
||||||
@@ -133,11 +135,11 @@ func (b *BaseApi) LoadFail2BanConf(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Fail2ban
|
// @Tags Fail2ban
|
||||||
// @Summary Update fail2ban conf by file
|
// @Summary Update fail2ban conf by file
|
||||||
// @Description 通过文件修改 fail2ban 配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.UpdateByFile true "request"
|
// @Param request body dto.UpdateByFile true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/fail2ban/update/byconf [post]
|
// @Router /toolbox/fail2ban/update/byconf [post]
|
||||||
func (b *BaseApi) UpdateFail2BanConfByFile(c *gin.Context) {
|
func (b *BaseApi) UpdateFail2BanConfByFile(c *gin.Context) {
|
||||||
var req dto.UpdateByFile
|
var req dto.UpdateByFile
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary List favorites
|
// @Summary List favorites
|
||||||
// @Description 获取收藏列表
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PageInfo true "request"
|
// @Param request body dto.PageInfo true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/favorite/search [post]
|
// @Router /files/favorite/search [post]
|
||||||
func (b *BaseApi) SearchFavorite(c *gin.Context) {
|
func (b *BaseApi) SearchFavorite(c *gin.Context) {
|
||||||
var req dto.PageInfo
|
var req dto.PageInfo
|
||||||
@@ -34,11 +34,11 @@ func (b *BaseApi) SearchFavorite(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Create favorite
|
// @Summary Create favorite
|
||||||
// @Description 创建收藏
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FavoriteCreate true "request"
|
// @Param request body request.FavoriteCreate true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} model.Favorite
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/favorite [post]
|
// @Router /files/favorite [post]
|
||||||
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"收藏文件/文件夹 [path]","formatEN":"收藏文件/文件夹 [path]"}
|
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"收藏文件/文件夹 [path]","formatEN":"收藏文件/文件夹 [path]"}
|
||||||
func (b *BaseApi) CreateFavorite(c *gin.Context) {
|
func (b *BaseApi) CreateFavorite(c *gin.Context) {
|
||||||
@@ -56,11 +56,11 @@ func (b *BaseApi) CreateFavorite(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Delete favorite
|
// @Summary Delete favorite
|
||||||
// @Description 删除收藏
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FavoriteDelete true "request"
|
// @Param request body request.FavoriteDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/favorite/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteFavorite(c *gin.Context) {
|
||||||
|
|||||||
+87
-38
@@ -11,6 +11,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
|
"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"
|
||||||
@@ -27,32 +28,32 @@ import (
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary List files
|
// @Summary List files
|
||||||
// @Description 获取文件列表
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileOption true "request"
|
// @Param request body request.FileOption true "request"
|
||||||
// @Success 200 {object} response.FileInfo
|
// @Success 200 {object} response.FileInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/search [post]
|
// @Router /files/search [post]
|
||||||
func (b *BaseApi) ListFiles(c *gin.Context) {
|
func (b *BaseApi) ListFiles(c *gin.Context) {
|
||||||
var req request.FileOption
|
var req request.FileOption
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
files, err := fileService.GetFileList(req)
|
fileList, err := fileService.GetFileList(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
helper.SuccessWithData(c, files)
|
helper.SuccessWithData(c, fileList)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Page file
|
// @Summary Page file
|
||||||
// @Description 分页获取上传文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.SearchUploadWithPage true "request"
|
// @Param request body request.SearchUploadWithPage true "request"
|
||||||
// @Success 200 {array} response.FileInfo
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/upload/search [post]
|
// @Router /files/upload/search [post]
|
||||||
func (b *BaseApi) SearchUploadWithPage(c *gin.Context) {
|
func (b *BaseApi) SearchUploadWithPage(c *gin.Context) {
|
||||||
var req request.SearchUploadWithPage
|
var req request.SearchUploadWithPage
|
||||||
@@ -72,11 +73,11 @@ func (b *BaseApi) SearchUploadWithPage(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Load files tree
|
// @Summary Load files tree
|
||||||
// @Description 加载文件树
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileOption true "request"
|
// @Param request body request.FileOption true "request"
|
||||||
// @Success 200 {array} response.FileTree
|
// @Success 200 {array} response.FileTree
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/tree [post]
|
// @Router /files/tree [post]
|
||||||
func (b *BaseApi) GetFileTree(c *gin.Context) {
|
func (b *BaseApi) GetFileTree(c *gin.Context) {
|
||||||
var req request.FileOption
|
var req request.FileOption
|
||||||
@@ -93,11 +94,11 @@ func (b *BaseApi) GetFileTree(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Create file
|
// @Summary Create file
|
||||||
// @Description 创建文件/文件夹
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileCreate true "request"
|
// @Param request body request.FileCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files [post]
|
// @Router /files [post]
|
||||||
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建文件/文件夹 [path]","formatEN":"Create dir or file [path]"}
|
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建文件/文件夹 [path]","formatEN":"Create dir or file [path]"}
|
||||||
func (b *BaseApi) CreateFile(c *gin.Context) {
|
func (b *BaseApi) CreateFile(c *gin.Context) {
|
||||||
@@ -115,11 +116,11 @@ func (b *BaseApi) CreateFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Delete file
|
// @Summary Delete file
|
||||||
// @Description 删除文件/文件夹
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileDelete true "request"
|
// @Param request body request.FileDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/del [post]
|
// @Router /files/del [post]
|
||||||
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"删除文件/文件夹 [path]","formatEN":"Delete dir or file [path]"}
|
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"删除文件/文件夹 [path]","formatEN":"Delete dir or file [path]"}
|
||||||
func (b *BaseApi) DeleteFile(c *gin.Context) {
|
func (b *BaseApi) DeleteFile(c *gin.Context) {
|
||||||
@@ -137,11 +138,11 @@ func (b *BaseApi) DeleteFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Batch delete file
|
// @Summary Batch delete file
|
||||||
// @Description 批量删除文件/文件夹
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileBatchDelete true "request"
|
// @Param request body request.FileBatchDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/batch/del [post]
|
// @Router /files/batch/del [post]
|
||||||
// @x-panel-log {"bodyKeys":["paths"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"批量删除文件/文件夹 [paths]","formatEN":"Batch delete dir or file [paths]"}
|
// @x-panel-log {"bodyKeys":["paths"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"批量删除文件/文件夹 [paths]","formatEN":"Batch delete dir or file [paths]"}
|
||||||
func (b *BaseApi) BatchDeleteFile(c *gin.Context) {
|
func (b *BaseApi) BatchDeleteFile(c *gin.Context) {
|
||||||
@@ -159,11 +160,11 @@ func (b *BaseApi) BatchDeleteFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Change file mode
|
// @Summary Change file mode
|
||||||
// @Description 修改文件权限
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileCreate true "request"
|
// @Param request body request.FileCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/mode [post]
|
// @Router /files/mode [post]
|
||||||
// @x-panel-log {"bodyKeys":["path","mode"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改权限 [paths] => [mode]","formatEN":"Change mode [paths] => [mode]"}
|
// @x-panel-log {"bodyKeys":["path","mode"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改权限 [paths] => [mode]","formatEN":"Change mode [paths] => [mode]"}
|
||||||
func (b *BaseApi) ChangeFileMode(c *gin.Context) {
|
func (b *BaseApi) ChangeFileMode(c *gin.Context) {
|
||||||
@@ -181,11 +182,11 @@ func (b *BaseApi) ChangeFileMode(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Change file owner
|
// @Summary Change file owner
|
||||||
// @Description 修改文件用户/组
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileRoleUpdate true "request"
|
// @Param request body request.FileRoleUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/owner [post]
|
// @Router /files/owner [post]
|
||||||
// @x-panel-log {"bodyKeys":["path","user","group"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改用户/组 [paths] => [user]/[group]","formatEN":"Change owner [paths] => [user]/[group]"}
|
// @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) {
|
func (b *BaseApi) ChangeFileOwner(c *gin.Context) {
|
||||||
@@ -202,11 +203,11 @@ func (b *BaseApi) ChangeFileOwner(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Compress file
|
// @Summary Compress file
|
||||||
// @Description 压缩文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileCompress true "request"
|
// @Param request body request.FileCompress true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/compress [post]
|
// @Router /files/compress [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"压缩文件 [name]","formatEN":"Compress file [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"压缩文件 [name]","formatEN":"Compress file [name]"}
|
||||||
func (b *BaseApi) CompressFile(c *gin.Context) {
|
func (b *BaseApi) CompressFile(c *gin.Context) {
|
||||||
@@ -224,11 +225,11 @@ func (b *BaseApi) CompressFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Decompress file
|
// @Summary Decompress file
|
||||||
// @Description 解压文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileDeCompress true "request"
|
// @Param request body request.FileDeCompress true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/decompress [post]
|
// @Router /files/decompress [post]
|
||||||
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"解压 [path]","formatEN":"Decompress file [path]"}
|
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"解压 [path]","formatEN":"Decompress file [path]"}
|
||||||
func (b *BaseApi) DeCompressFile(c *gin.Context) {
|
func (b *BaseApi) DeCompressFile(c *gin.Context) {
|
||||||
@@ -246,11 +247,11 @@ func (b *BaseApi) DeCompressFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Load file content
|
// @Summary Load file content
|
||||||
// @Description 获取文件内容
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileContentReq true "request"
|
// @Param request body request.FileContentReq true "request"
|
||||||
// @Success 200 {object} response.FileInfo
|
// @Success 200 {object} response.FileInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/content [post]
|
// @Router /files/content [post]
|
||||||
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"获取文件内容 [path]","formatEN":"Load file content [path]"}
|
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"获取文件内容 [path]","formatEN":"Load file content [path]"}
|
||||||
func (b *BaseApi) GetContent(c *gin.Context) {
|
func (b *BaseApi) GetContent(c *gin.Context) {
|
||||||
@@ -268,11 +269,11 @@ func (b *BaseApi) GetContent(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Update file content
|
// @Summary Update file content
|
||||||
// @Description 更新文件内容
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileEdit true "request"
|
// @Param request body request.FileEdit true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/save [post]
|
// @Router /files/save [post]
|
||||||
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新文件内容 [path]","formatEN":"Update file content [path]"}
|
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新文件内容 [path]","formatEN":"Update file content [path]"}
|
||||||
func (b *BaseApi) SaveContent(c *gin.Context) {
|
func (b *BaseApi) SaveContent(c *gin.Context) {
|
||||||
@@ -289,10 +290,11 @@ func (b *BaseApi) SaveContent(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Upload file
|
// @Summary Upload file
|
||||||
// @Description 上传文件
|
// @Accept multipart/form-data
|
||||||
// @Param file formData file true "request"
|
// @Param file formData file true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/upload [post]
|
// @Router /files/upload [post]
|
||||||
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"上传文件 [path]","formatEN":"Upload file [path]"}
|
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"上传文件 [path]","formatEN":"Upload file [path]"}
|
||||||
func (b *BaseApi) UploadFiles(c *gin.Context) {
|
func (b *BaseApi) UploadFiles(c *gin.Context) {
|
||||||
@@ -336,8 +338,12 @@ func (b *BaseApi) UploadFiles(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
mode := info.Mode()
|
mode := info.Mode()
|
||||||
|
|
||||||
fileOp := files.NewFileOp()
|
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
|
success := 0
|
||||||
failures := make(buserr.MultiErr)
|
failures := make(buserr.MultiErr)
|
||||||
@@ -351,6 +357,7 @@ func (b *BaseApi) UploadFiles(c *gin.Context) {
|
|||||||
global.LOG.Error(e)
|
global.LOG.Error(e)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
_ = os.Chown(dstDir, uid, gid)
|
||||||
}
|
}
|
||||||
tmpFilename := dstFilename + ".tmp"
|
tmpFilename := dstFilename + ".tmp"
|
||||||
if err := c.SaveUploadedFile(file, tmpFilename); err != nil {
|
if err := c.SaveUploadedFile(file, tmpFilename); err != nil {
|
||||||
@@ -378,6 +385,9 @@ func (b *BaseApi) UploadFiles(c *gin.Context) {
|
|||||||
} else {
|
} else {
|
||||||
_ = os.Chmod(dstFilename, mode)
|
_ = os.Chmod(dstFilename, mode)
|
||||||
}
|
}
|
||||||
|
if uid != -1 && gid != -1 {
|
||||||
|
_ = os.Chown(dstFilename, uid, gid)
|
||||||
|
}
|
||||||
success++
|
success++
|
||||||
}
|
}
|
||||||
if success == 0 {
|
if success == 0 {
|
||||||
@@ -389,31 +399,57 @@ func (b *BaseApi) UploadFiles(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Check file exist
|
// @Summary Check file exist
|
||||||
// @Description 检测文件是否存在
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FilePathCheck true "request"
|
// @Param request body request.FilePathCheck true "request"
|
||||||
// @Success 200
|
// @Success 200 {boolean} isOk
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/check [post]
|
// @Router /files/check [post]
|
||||||
func (b *BaseApi) CheckFile(c *gin.Context) {
|
func (b *BaseApi) CheckFile(c *gin.Context) {
|
||||||
var req request.FilePathCheck
|
var req request.FilePathCheck
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if _, err := os.Stat(req.Path); err != nil {
|
fileOp := files.NewFileOp()
|
||||||
helper.SuccessWithData(c, false)
|
if fileOp.Stat(req.Path) {
|
||||||
|
helper.SuccessWithData(c, true)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
helper.SuccessWithData(c, true)
|
if req.WithInit {
|
||||||
|
if err := fileOp.CreateDir(req.Path, 0644); err != nil {
|
||||||
|
helper.SuccessWithData(c, false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithData(c, true)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithData(c, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags File
|
||||||
|
// @Summary Batch check file exist
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body request.FilePathsCheck true "request"
|
||||||
|
// @Success 200 {array} response.ExistFileInfo
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /files/batch/check [post]
|
||||||
|
func (b *BaseApi) BatchCheckFiles(c *gin.Context) {
|
||||||
|
var req request.FilePathsCheck
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fileList := fileService.BatchCheckFiles(req)
|
||||||
|
helper.SuccessWithData(c, fileList)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Change file name
|
// @Summary Change file name
|
||||||
// @Description 修改文件名称
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileRename true "request"
|
// @Param request body request.FileRename true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/rename [post]
|
// @Router /files/rename [post]
|
||||||
// @x-panel-log {"bodyKeys":["oldName","newName"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"重命名 [oldName] => [newName]","formatEN":"Rename [oldName] => [newName]"}
|
// @x-panel-log {"bodyKeys":["oldName","newName"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"重命名 [oldName] => [newName]","formatEN":"Rename [oldName] => [newName]"}
|
||||||
func (b *BaseApi) ChangeFileName(c *gin.Context) {
|
func (b *BaseApi) ChangeFileName(c *gin.Context) {
|
||||||
@@ -430,11 +466,11 @@ func (b *BaseApi) ChangeFileName(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Wget file
|
// @Summary Wget file
|
||||||
// @Description 下载远端文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileWget true "request"
|
// @Param request body request.FileWget true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} response.FileWgetRes
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/wget [post]
|
// @Router /files/wget [post]
|
||||||
// @x-panel-log {"bodyKeys":["url","path","name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"下载 url => [path]/[name]","formatEN":"Download url => [path]/[name]"}
|
// @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) {
|
func (b *BaseApi) WgetFile(c *gin.Context) {
|
||||||
@@ -454,11 +490,11 @@ func (b *BaseApi) WgetFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Move file
|
// @Summary Move file
|
||||||
// @Description 移动文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileMove true "request"
|
// @Param request body request.FileMove true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/move [post]
|
// @Router /files/move [post]
|
||||||
// @x-panel-log {"bodyKeys":["oldPaths","newPath"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"移动文件 [oldPaths] => [newPath]","formatEN":"Move [oldPaths] => [newPath]"}
|
// @x-panel-log {"bodyKeys":["oldPaths","newPath"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"移动文件 [oldPaths] => [newPath]","formatEN":"Move [oldPaths] => [newPath]"}
|
||||||
func (b *BaseApi) MoveFile(c *gin.Context) {
|
func (b *BaseApi) MoveFile(c *gin.Context) {
|
||||||
@@ -475,10 +511,10 @@ func (b *BaseApi) MoveFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Download file
|
// @Summary Download file
|
||||||
// @Description 下载文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/download [get]
|
// @Router /files/download [get]
|
||||||
func (b *BaseApi) Download(c *gin.Context) {
|
func (b *BaseApi) Download(c *gin.Context) {
|
||||||
filePath := c.Query("path")
|
filePath := c.Query("path")
|
||||||
@@ -495,11 +531,11 @@ func (b *BaseApi) Download(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Chunk Download file
|
// @Summary Chunk Download file
|
||||||
// @Description 分片下载下载文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileDownload true "request"
|
// @Param request body request.FileDownload true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/chunkdownload [post]
|
// @Router /files/chunkdownload [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"下载文件 [name]","formatEN":"Download file [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"下载文件 [name]","formatEN":"Download file [name]"}
|
||||||
func (b *BaseApi) DownloadChunkFiles(c *gin.Context) {
|
func (b *BaseApi) DownloadChunkFiles(c *gin.Context) {
|
||||||
@@ -572,11 +608,11 @@ func (b *BaseApi) DownloadChunkFiles(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Load file size
|
// @Summary Load file size
|
||||||
// @Description 获取文件夹大小
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.DirSizeReq true "request"
|
// @Param request body request.DirSizeReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} response.DirSizeRes
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/size [post]
|
// @Router /files/size [post]
|
||||||
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"获取文件夹大小 [path]","formatEN":"Load file size [path]"}
|
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"获取文件夹大小 [path]","formatEN":"Load file size [path]"}
|
||||||
func (b *BaseApi) Size(c *gin.Context) {
|
func (b *BaseApi) Size(c *gin.Context) {
|
||||||
@@ -603,9 +639,17 @@ func mergeChunks(fileName string, fileDir string, dstDir string, chunkCount int,
|
|||||||
if mode == 0 {
|
if mode == 0 {
|
||||||
mode = 0755
|
mode = 0755
|
||||||
}
|
}
|
||||||
if _, err := os.Stat(dstDir); err != nil && os.IsNotExist(err) {
|
uid, gid := -1, -1
|
||||||
if err = op.CreateDir(dstDir, mode); err != nil {
|
if info, err := os.Stat(dstDir); err != nil {
|
||||||
return err
|
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)
|
dstFileName := filepath.Join(dstDir, fileName)
|
||||||
@@ -615,6 +659,7 @@ func mergeChunks(fileName string, fileDir string, dstDir string, chunkCount int,
|
|||||||
} else {
|
} else {
|
||||||
mode = 0644
|
mode = 0644
|
||||||
}
|
}
|
||||||
|
|
||||||
if overwrite {
|
if overwrite {
|
||||||
_ = os.Remove(dstFileName)
|
_ = os.Remove(dstFileName)
|
||||||
}
|
}
|
||||||
@@ -635,16 +680,20 @@ func mergeChunks(fileName string, fileDir string, dstDir string, chunkCount int,
|
|||||||
}
|
}
|
||||||
_ = os.Remove(chunkPath)
|
_ = os.Remove(chunkPath)
|
||||||
}
|
}
|
||||||
|
if uid != -1 && gid != -1 {
|
||||||
|
_ = os.Chown(dstFileName, uid, gid)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary ChunkUpload file
|
// @Summary Chunk upload file
|
||||||
// @Description 分片上传文件
|
// @Accept multipart/form-data
|
||||||
// @Param file formData file true "request"
|
// @Param file formData file true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/chunkupload [post]
|
// @Router /files/chunkupload [post]
|
||||||
func (b *BaseApi) UploadChunkFiles(c *gin.Context) {
|
func (b *BaseApi) UploadChunkFiles(c *gin.Context) {
|
||||||
var err error
|
var err error
|
||||||
@@ -762,10 +811,10 @@ func (b *BaseApi) Keys(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Read file by Line
|
// @Summary Read file by Line
|
||||||
// @Description 按行读取日志文件
|
|
||||||
// @Param request body request.FileReadByLineReq true "request"
|
// @Param request body request.FileReadByLineReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} response.FileLineContent
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/read [post]
|
// @Router /files/read [post]
|
||||||
func (b *BaseApi) ReadFileByLine(c *gin.Context) {
|
func (b *BaseApi) ReadFileByLine(c *gin.Context) {
|
||||||
var req request.FileReadByLineReq
|
var req request.FileReadByLineReq
|
||||||
@@ -782,11 +831,11 @@ func (b *BaseApi) ReadFileByLine(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Batch change file mode and owner
|
// @Summary Batch change file mode and owner
|
||||||
// @Description 批量修改文件权限和用户/组
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.FileRoleReq true "request"
|
// @Param request body request.FileRoleReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/batch/role [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) BatchChangeModeAndOwner(c *gin.Context) {
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import (
|
|||||||
|
|
||||||
// @Tags Firewall
|
// @Tags Firewall
|
||||||
// @Summary Load firewall base info
|
// @Summary Load firewall base info
|
||||||
// @Description 获取防火墙基础信息
|
|
||||||
// @Success 200 {object} dto.FirewallBaseInfo
|
// @Success 200 {object} dto.FirewallBaseInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/firewall/base [get]
|
// @Router /hosts/firewall/base [get]
|
||||||
func (b *BaseApi) LoadFirewallBaseInfo(c *gin.Context) {
|
func (b *BaseApi) LoadFirewallBaseInfo(c *gin.Context) {
|
||||||
data, err := firewallService.LoadBaseInfo()
|
data, err := firewallService.LoadBaseInfo()
|
||||||
@@ -25,11 +25,11 @@ func (b *BaseApi) LoadFirewallBaseInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Firewall
|
// @Tags Firewall
|
||||||
// @Summary Page firewall rules
|
// @Summary Page firewall rules
|
||||||
// @Description 获取防火墙规则列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.RuleSearch true "request"
|
// @Param request body dto.RuleSearch true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/firewall/search [post]
|
// @Router /hosts/firewall/search [post]
|
||||||
func (b *BaseApi) SearchFirewallRule(c *gin.Context) {
|
func (b *BaseApi) SearchFirewallRule(c *gin.Context) {
|
||||||
var req dto.RuleSearch
|
var req dto.RuleSearch
|
||||||
@@ -51,11 +51,11 @@ func (b *BaseApi) SearchFirewallRule(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Firewall
|
// @Tags Firewall
|
||||||
// @Summary Page firewall status
|
// @Summary Page firewall status
|
||||||
// @Description 修改防火墙状态
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.FirewallOperation true "request"
|
// @Param request body dto.FirewallOperation true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/firewall/operate [post]
|
// @Router /hosts/firewall/operate [post]
|
||||||
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] 防火墙","formatEN":"[operation] firewall"}
|
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] 防火墙","formatEN":"[operation] firewall"}
|
||||||
func (b *BaseApi) OperateFirewall(c *gin.Context) {
|
func (b *BaseApi) OperateFirewall(c *gin.Context) {
|
||||||
@@ -73,12 +73,12 @@ func (b *BaseApi) OperateFirewall(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Firewall
|
// @Tags Firewall
|
||||||
// @Summary Create group
|
// @Summary Create firewall port group
|
||||||
// @Description 创建防火墙端口规则
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PortRuleOperate true "request"
|
// @Param request body dto.PortRuleOperate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/firewall/port [post]
|
// @Router /hosts/firewall/port [post]
|
||||||
// @x-panel-log {"bodyKeys":["port","strategy"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"添加端口规则 [strategy] [port]","formatEN":"create port rules [strategy][port]"}
|
// @x-panel-log {"bodyKeys":["port","strategy"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"添加端口规则 [strategy] [port]","formatEN":"create port rules [strategy][port]"}
|
||||||
func (b *BaseApi) OperatePortRule(c *gin.Context) {
|
func (b *BaseApi) OperatePortRule(c *gin.Context) {
|
||||||
@@ -96,12 +96,12 @@ func (b *BaseApi) OperatePortRule(c *gin.Context) {
|
|||||||
|
|
||||||
// OperateForwardRule
|
// OperateForwardRule
|
||||||
// @Tags Firewall
|
// @Tags Firewall
|
||||||
// @Summary Create group
|
// @Summary Update firewall port group
|
||||||
// @Description 更新防火墙端口转发规则
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ForwardRuleOperate true "request"
|
// @Param request body dto.ForwardRuleOperate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/firewall/forward [post]
|
// @Router /hosts/firewall/forward [post]
|
||||||
// @x-panel-log {"bodyKeys":["source_port"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新端口转发规则 [source_port]","formatEN":"update port forward rules [source_port]"}
|
// @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) {
|
func (b *BaseApi) OperateForwardRule(c *gin.Context) {
|
||||||
@@ -118,12 +118,12 @@ func (b *BaseApi) OperateForwardRule(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Firewall
|
// @Tags Firewall
|
||||||
// @Summary Create group
|
// @Summary Create firewall group
|
||||||
// @Description 创建防火墙 IP 规则
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.AddrRuleOperate true "request"
|
// @Param request body dto.AddrRuleOperate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/firewall/ip [post]
|
// @Router /hosts/firewall/ip [post]
|
||||||
// @x-panel-log {"bodyKeys":["strategy","address"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"添加 ip 规则 [strategy] [address]","formatEN":"create address rules [strategy][address]"}
|
// @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) {
|
func (b *BaseApi) OperateIPRule(c *gin.Context) {
|
||||||
@@ -140,12 +140,12 @@ func (b *BaseApi) OperateIPRule(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Firewall
|
// @Tags Firewall
|
||||||
// @Summary Create group
|
// @Summary Batch create group
|
||||||
// @Description 批量删除防火墙规则
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BatchRuleOperate true "request"
|
// @Param request body dto.BatchRuleOperate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/firewall/batch [post]
|
// @Router /hosts/firewall/batch [post]
|
||||||
func (b *BaseApi) BatchOperateRule(c *gin.Context) {
|
func (b *BaseApi) BatchOperateRule(c *gin.Context) {
|
||||||
var req dto.BatchRuleOperate
|
var req dto.BatchRuleOperate
|
||||||
@@ -162,11 +162,11 @@ func (b *BaseApi) BatchOperateRule(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Firewall
|
// @Tags Firewall
|
||||||
// @Summary Update rule description
|
// @Summary Update rule description
|
||||||
// @Description 更新防火墙描述
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.UpdateFirewallDescription true "request"
|
// @Param request body dto.UpdateFirewallDescription true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/firewall/update/description [post]
|
// @Router /hosts/firewall/update/description [post]
|
||||||
func (b *BaseApi) UpdateFirewallDescription(c *gin.Context) {
|
func (b *BaseApi) UpdateFirewallDescription(c *gin.Context) {
|
||||||
var req dto.UpdateFirewallDescription
|
var req dto.UpdateFirewallDescription
|
||||||
@@ -182,12 +182,12 @@ func (b *BaseApi) UpdateFirewallDescription(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Firewall
|
// @Tags Firewall
|
||||||
// @Summary Create group
|
// @Summary Update firewall group
|
||||||
// @Description 更新端口防火墙规则
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PortRuleUpdate true "request"
|
// @Param request body dto.PortRuleUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/firewall/update/port [post]
|
// @Router /hosts/firewall/update/port [post]
|
||||||
func (b *BaseApi) UpdatePortRule(c *gin.Context) {
|
func (b *BaseApi) UpdatePortRule(c *gin.Context) {
|
||||||
var req dto.PortRuleUpdate
|
var req dto.PortRuleUpdate
|
||||||
@@ -203,12 +203,12 @@ func (b *BaseApi) UpdatePortRule(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Firewall
|
// @Tags Firewall
|
||||||
// @Summary Create group
|
// @Summary Update address group
|
||||||
// @Description 更新 ip 防火墙规则
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.AddrRuleUpdate true "request"
|
// @Param request body dto.AddrRuleUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/firewall/update/addr [post]
|
// @Router /hosts/firewall/update/addr [post]
|
||||||
func (b *BaseApi) UpdateAddrRule(c *gin.Context) {
|
func (b *BaseApi) UpdateAddrRule(c *gin.Context) {
|
||||||
var req dto.AddrRuleUpdate
|
var req dto.AddrRuleUpdate
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ import (
|
|||||||
|
|
||||||
// @Tags FTP
|
// @Tags FTP
|
||||||
// @Summary Load FTP base info
|
// @Summary Load FTP base info
|
||||||
// @Description 获取 FTP 基础信息
|
|
||||||
// @Success 200 {object} dto.FtpBaseInfo
|
// @Success 200 {object} dto.FtpBaseInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/ftp/base [get]
|
// @Router /toolbox/ftp/base [get]
|
||||||
func (b *BaseApi) LoadFtpBaseInfo(c *gin.Context) {
|
func (b *BaseApi) LoadFtpBaseInfo(c *gin.Context) {
|
||||||
data, err := ftpService.LoadBaseInfo()
|
data, err := ftpService.LoadBaseInfo()
|
||||||
@@ -27,11 +27,11 @@ func (b *BaseApi) LoadFtpBaseInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags FTP
|
// @Tags FTP
|
||||||
// @Summary Load FTP operation log
|
// @Summary Load FTP operation log
|
||||||
// @Description 获取 FTP 操作日志
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.FtpLogSearch true "request"
|
// @Param request body dto.FtpLogSearch true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/ftp/log/search [post]
|
// @Router /toolbox/ftp/log/search [post]
|
||||||
func (b *BaseApi) LoadFtpLogInfo(c *gin.Context) {
|
func (b *BaseApi) LoadFtpLogInfo(c *gin.Context) {
|
||||||
var req dto.FtpLogSearch
|
var req dto.FtpLogSearch
|
||||||
@@ -53,10 +53,11 @@ func (b *BaseApi) LoadFtpLogInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags FTP
|
// @Tags FTP
|
||||||
// @Summary Operate FTP
|
// @Summary Operate FTP
|
||||||
// @Description 修改 FTP 状态
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.Operate true "request"
|
// @Param request body dto.Operate true "request"
|
||||||
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/ftp/operate [post]
|
// @Router /toolbox/ftp/operate [post]
|
||||||
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] FTP","formatEN":"[operation] FTP"}
|
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] FTP","formatEN":"[operation] FTP"}
|
||||||
func (b *BaseApi) OperateFtp(c *gin.Context) {
|
func (b *BaseApi) OperateFtp(c *gin.Context) {
|
||||||
@@ -75,11 +76,11 @@ func (b *BaseApi) OperateFtp(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags FTP
|
// @Tags FTP
|
||||||
// @Summary Page FTP user
|
// @Summary Page FTP user
|
||||||
// @Description 获取 FTP 账户列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchWithPage true "request"
|
// @Param request body dto.SearchWithPage true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/ftp/search [post]
|
// @Router /toolbox/ftp/search [post]
|
||||||
func (b *BaseApi) SearchFtp(c *gin.Context) {
|
func (b *BaseApi) SearchFtp(c *gin.Context) {
|
||||||
var req dto.SearchWithPage
|
var req dto.SearchWithPage
|
||||||
@@ -101,11 +102,11 @@ func (b *BaseApi) SearchFtp(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags FTP
|
// @Tags FTP
|
||||||
// @Summary Create FTP user
|
// @Summary Create FTP user
|
||||||
// @Description 创建 FTP 账户
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.FtpCreate true "request"
|
// @Param request body dto.FtpCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/ftp [post]
|
// @Router /toolbox/ftp [post]
|
||||||
// @x-panel-log {"bodyKeys":["user", "path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 FTP 账户 [user][path]","formatEN":"create FTP [user][path]"}
|
// @x-panel-log {"bodyKeys":["user", "path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 FTP 账户 [user][path]","formatEN":"create FTP [user][path]"}
|
||||||
func (b *BaseApi) CreateFtp(c *gin.Context) {
|
func (b *BaseApi) CreateFtp(c *gin.Context) {
|
||||||
@@ -131,11 +132,11 @@ func (b *BaseApi) CreateFtp(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags FTP
|
// @Tags FTP
|
||||||
// @Summary Delete FTP user
|
// @Summary Delete FTP user
|
||||||
// @Description 删除 FTP 账户
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BatchDeleteReq true "request"
|
// @Param request body dto.BatchDeleteReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/ftp/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteFtp(c *gin.Context) {
|
||||||
@@ -153,11 +154,11 @@ func (b *BaseApi) DeleteFtp(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags FTP
|
// @Tags FTP
|
||||||
// @Summary Sync FTP user
|
// @Summary Sync FTP user
|
||||||
// @Description 同步 FTP 账户
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BatchDeleteReq true "request"
|
// @Param request body dto.BatchDeleteReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/ftp/sync [post]
|
// @Router /toolbox/ftp/sync [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"同步 FTP 账户","formatEN":"sync FTP users"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"同步 FTP 账户","formatEN":"sync FTP users"}
|
||||||
func (b *BaseApi) SyncFtp(c *gin.Context) {
|
func (b *BaseApi) SyncFtp(c *gin.Context) {
|
||||||
@@ -170,11 +171,11 @@ func (b *BaseApi) SyncFtp(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags FTP
|
// @Tags FTP
|
||||||
// @Summary Update FTP user
|
// @Summary Update FTP user
|
||||||
// @Description 修改 FTP 账户
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.FtpUpdate true "request"
|
// @Param request body dto.FtpUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /toolbox/ftp/update [post]
|
// @Router /toolbox/ftp/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["user", "path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 FTP 账户 [user][path]","formatEN":"update FTP [user][path]"}
|
// @x-panel-log {"bodyKeys":["user", "path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 FTP 账户 [user][path]","formatEN":"update FTP [user][path]"}
|
||||||
func (b *BaseApi) UpdateFtp(c *gin.Context) {
|
func (b *BaseApi) UpdateFtp(c *gin.Context) {
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// @Tags System Group
|
// @Tags System Group
|
||||||
// @Summary Create group
|
// @Summary Create system group
|
||||||
// @Description 创建系统组
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.GroupCreate true "request"
|
// @Param request body dto.GroupCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /groups [post]
|
// @Router /groups [post]
|
||||||
// @x-panel-log {"bodyKeys":["name","type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建组 [name][type]","formatEN":"create group [name][type]"}
|
// @x-panel-log {"bodyKeys":["name","type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建组 [name][type]","formatEN":"create group [name][type]"}
|
||||||
func (b *BaseApi) CreateGroup(c *gin.Context) {
|
func (b *BaseApi) CreateGroup(c *gin.Context) {
|
||||||
@@ -30,12 +30,12 @@ func (b *BaseApi) CreateGroup(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags System Group
|
// @Tags System Group
|
||||||
// @Summary Delete group
|
// @Summary Delete system group
|
||||||
// @Description 删除系统组
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperateByID true "request"
|
// @Param request body dto.OperateByID true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /groups/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteGroup(c *gin.Context) {
|
||||||
@@ -52,12 +52,12 @@ func (b *BaseApi) DeleteGroup(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags System Group
|
// @Tags System Group
|
||||||
// @Summary Update group
|
// @Summary Update system group
|
||||||
// @Description 更新系统组
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.GroupUpdate true "request"
|
// @Param request body dto.GroupUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /groups/update [post]
|
// @Router /groups/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["name","type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新组 [name][type]","formatEN":"update group [name][type]"}
|
// @x-panel-log {"bodyKeys":["name","type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新组 [name][type]","formatEN":"update group [name][type]"}
|
||||||
func (b *BaseApi) UpdateGroup(c *gin.Context) {
|
func (b *BaseApi) UpdateGroup(c *gin.Context) {
|
||||||
@@ -74,12 +74,12 @@ func (b *BaseApi) UpdateGroup(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags System Group
|
// @Tags System Group
|
||||||
// @Summary List groups
|
// @Summary List system groups
|
||||||
// @Description 查询系统组
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.GroupSearch true "request"
|
// @Param request body dto.GroupSearch true "request"
|
||||||
// @Success 200 {array} dto.GroupInfo
|
// @Success 200 {array} dto.GroupInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /groups/search [post]
|
// @Router /groups/search [post]
|
||||||
func (b *BaseApi) ListGroup(c *gin.Context) {
|
func (b *BaseApi) ListGroup(c *gin.Context) {
|
||||||
var req dto.GroupSearch
|
var req dto.GroupSearch
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package helper
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/1Panel-dev/1Panel/cmd/server/res"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -134,7 +135,22 @@ func CheckBind(req interface{}, c *gin.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ErrResponse(ctx *gin.Context, code int) {
|
func ErrWithHtml(ctx *gin.Context, code int, scope string) {
|
||||||
ctx.JSON(code, nil)
|
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()
|
ctx.Abort()
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-12
@@ -10,11 +10,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Host
|
// @Tags Host
|
||||||
// @Summary Create host
|
// @Summary Create host
|
||||||
// @Description 创建主机
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.HostOperate true "request"
|
// @Param request body dto.HostOperate true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} dto.HostInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts [post]
|
// @Router /hosts [post]
|
||||||
// @x-panel-log {"bodyKeys":["name","addr"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建主机 [name][addr]","formatEN":"create host [name][addr]"}
|
// @x-panel-log {"bodyKeys":["name","addr"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建主机 [name][addr]","formatEN":"create host [name][addr]"}
|
||||||
func (b *BaseApi) CreateHost(c *gin.Context) {
|
func (b *BaseApi) CreateHost(c *gin.Context) {
|
||||||
@@ -33,11 +33,11 @@ func (b *BaseApi) CreateHost(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Host
|
// @Tags Host
|
||||||
// @Summary Test host conn by info
|
// @Summary Test host conn by info
|
||||||
// @Description 测试主机连接
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.HostConnTest true "request"
|
// @Param request body dto.HostConnTest true "request"
|
||||||
// @Success 200
|
// @Success 200 {boolean} connStatus
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/test/byinfo [post]
|
// @Router /hosts/test/byinfo [post]
|
||||||
func (b *BaseApi) TestByInfo(c *gin.Context) {
|
func (b *BaseApi) TestByInfo(c *gin.Context) {
|
||||||
var req dto.HostConnTest
|
var req dto.HostConnTest
|
||||||
@@ -51,12 +51,12 @@ func (b *BaseApi) TestByInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Host
|
// @Tags Host
|
||||||
// @Summary Test host conn by host id
|
// @Summary Test host conn by host id
|
||||||
// @Description 测试主机连接
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param id path integer true "request"
|
// @Param id path integer true "request"
|
||||||
// @Success 200 {boolean} connStatus
|
// @Success 200 {boolean} connStatus
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /hosts/test/byid/:id [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/test/byid/{id} [post]
|
||||||
func (b *BaseApi) TestByID(c *gin.Context) {
|
func (b *BaseApi) TestByID(c *gin.Context) {
|
||||||
id, err := helper.GetParamID(c)
|
id, err := helper.GetParamID(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -70,11 +70,11 @@ func (b *BaseApi) TestByID(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Host
|
// @Tags Host
|
||||||
// @Summary Load host tree
|
// @Summary Load host tree
|
||||||
// @Description 加载主机树
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchForTree true "request"
|
// @Param request body dto.SearchForTree true "request"
|
||||||
// @Success 200 {array} dto.HostTree
|
// @Success 200 {array} dto.HostTree
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/tree [post]
|
// @Router /hosts/tree [post]
|
||||||
func (b *BaseApi) HostTree(c *gin.Context) {
|
func (b *BaseApi) HostTree(c *gin.Context) {
|
||||||
var req dto.SearchForTree
|
var req dto.SearchForTree
|
||||||
@@ -93,11 +93,11 @@ func (b *BaseApi) HostTree(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Host
|
// @Tags Host
|
||||||
// @Summary Page host
|
// @Summary Page host
|
||||||
// @Description 获取主机列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchHostWithPage true "request"
|
// @Param request body dto.SearchHostWithPage true "request"
|
||||||
// @Success 200 {array} dto.HostTree
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/search [post]
|
// @Router /hosts/search [post]
|
||||||
func (b *BaseApi) SearchHost(c *gin.Context) {
|
func (b *BaseApi) SearchHost(c *gin.Context) {
|
||||||
var req dto.SearchHostWithPage
|
var req dto.SearchHostWithPage
|
||||||
@@ -119,11 +119,11 @@ func (b *BaseApi) SearchHost(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Host
|
// @Tags Host
|
||||||
// @Summary Delete host
|
// @Summary Delete host
|
||||||
// @Description 删除主机
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BatchDeleteReq true "request"
|
// @Param request body dto.BatchDeleteReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteHost(c *gin.Context) {
|
||||||
@@ -141,11 +141,11 @@ func (b *BaseApi) DeleteHost(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Host
|
// @Tags Host
|
||||||
// @Summary Update host
|
// @Summary Update host
|
||||||
// @Description 更新主机
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.HostOperate true "request"
|
// @Param request body dto.HostOperate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/update [post]
|
// @Router /hosts/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["name","addr"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新主机信息 [name][addr]","formatEN":"update host [name][addr]"}
|
// @x-panel-log {"bodyKeys":["name","addr"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新主机信息 [name][addr]","formatEN":"update host [name][addr]"}
|
||||||
func (b *BaseApi) UpdateHost(c *gin.Context) {
|
func (b *BaseApi) UpdateHost(c *gin.Context) {
|
||||||
@@ -207,11 +207,11 @@ func (b *BaseApi) UpdateHost(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Host
|
// @Tags Host
|
||||||
// @Summary Update host group
|
// @Summary Update host group
|
||||||
// @Description 切换分组
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ChangeHostGroup true "request"
|
// @Param request body dto.ChangeHostGroup true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/update/group [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdateHostGroup(c *gin.Context) {
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// @Tags Host tool
|
// @Tags Host tool
|
||||||
// @Summary Get tool
|
// @Summary Get tool status
|
||||||
// @Description 获取主机工具状态
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.HostToolReq true "request"
|
// @Param request body request.HostToolReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} response.HostToolRes
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/tool [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/tool [post]
|
||||||
func (b *BaseApi) GetToolStatus(c *gin.Context) {
|
func (b *BaseApi) GetToolStatus(c *gin.Context) {
|
||||||
var req request.HostToolReq
|
var req request.HostToolReq
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
@@ -31,12 +31,12 @@ func (b *BaseApi) GetToolStatus(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Host tool
|
// @Tags Host tool
|
||||||
// @Summary Create Host tool Config
|
// @Summary Create Host tool Config
|
||||||
// @Description 创建主机工具配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.HostToolCreate true "request"
|
// @Param request body request.HostToolCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/tool/create [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/tool/create [post]
|
||||||
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 [type] 配置","formatEN":"create [type] config"}
|
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 [type] 配置","formatEN":"create [type] config"}
|
||||||
func (b *BaseApi) InitToolConfig(c *gin.Context) {
|
func (b *BaseApi) InitToolConfig(c *gin.Context) {
|
||||||
var req request.HostToolCreate
|
var req request.HostToolCreate
|
||||||
@@ -53,12 +53,12 @@ func (b *BaseApi) InitToolConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Host tool
|
// @Tags Host tool
|
||||||
// @Summary Operate tool
|
// @Summary Operate tool
|
||||||
// @Description 操作主机工具
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.HostToolReq true "request"
|
// @Param request body request.HostToolReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/tool/operate [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/tool/operate [post]
|
||||||
// @x-panel-log {"bodyKeys":["operate","type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] [type] ","formatEN":"[operate] [type]"}
|
// @x-panel-log {"bodyKeys":["operate","type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] [type] ","formatEN":"[operate] [type]"}
|
||||||
func (b *BaseApi) OperateTool(c *gin.Context) {
|
func (b *BaseApi) OperateTool(c *gin.Context) {
|
||||||
var req request.HostToolReq
|
var req request.HostToolReq
|
||||||
@@ -75,12 +75,12 @@ func (b *BaseApi) OperateTool(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Host tool
|
// @Tags Host tool
|
||||||
// @Summary Get tool config
|
// @Summary Get tool config
|
||||||
// @Description 操作主机工具配置文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.HostToolConfig true "request"
|
// @Param request body request.HostToolConfig true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} response.HostToolConfig
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/tool/config [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/tool/config [post]
|
||||||
// @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] 主机工具配置文件 ","formatEN":"[operate] tool config"}
|
// @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] 主机工具配置文件 ","formatEN":"[operate] tool config"}
|
||||||
func (b *BaseApi) OperateToolConfig(c *gin.Context) {
|
func (b *BaseApi) OperateToolConfig(c *gin.Context) {
|
||||||
var req request.HostToolConfig
|
var req request.HostToolConfig
|
||||||
@@ -97,13 +97,13 @@ func (b *BaseApi) OperateToolConfig(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Host tool
|
// @Tags Host tool
|
||||||
// @Summary Get tool
|
// @Summary Get tool logs
|
||||||
// @Description 获取主机工具日志
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.HostToolLogReq true "request"
|
// @Param request body request.HostToolLogReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {string} logContent
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/tool/log [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/tool/log [post]
|
||||||
func (b *BaseApi) GetToolLog(c *gin.Context) {
|
func (b *BaseApi) GetToolLog(c *gin.Context) {
|
||||||
var req request.HostToolLogReq
|
var req request.HostToolLogReq
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
@@ -120,12 +120,12 @@ func (b *BaseApi) GetToolLog(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Host tool
|
// @Tags Host tool
|
||||||
// @Summary Create Supervisor process
|
// @Summary Create Supervisor process
|
||||||
// @Description 操作守护进程
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.SupervisorProcessConfig true "request"
|
// @Param request body request.SupervisorProcessConfig true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/tool/supervisor/process [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/tool/supervisor/process [post]
|
||||||
// @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] 守护进程 ","formatEN":"[operate] process"}
|
// @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] 守护进程 ","formatEN":"[operate] process"}
|
||||||
func (b *BaseApi) OperateProcess(c *gin.Context) {
|
func (b *BaseApi) OperateProcess(c *gin.Context) {
|
||||||
var req request.SupervisorProcessConfig
|
var req request.SupervisorProcessConfig
|
||||||
@@ -143,11 +143,11 @@ func (b *BaseApi) OperateProcess(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Host tool
|
// @Tags Host tool
|
||||||
// @Summary Get Supervisor process config
|
// @Summary Get Supervisor process config
|
||||||
// @Description 获取 Supervisor 进程配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200
|
// @Success 200 {object} response.SupervisorProcessConfig
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/tool/supervisor/process [get]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/tool/supervisor/process [get]
|
||||||
func (b *BaseApi) GetProcess(c *gin.Context) {
|
func (b *BaseApi) GetProcess(c *gin.Context) {
|
||||||
configs, err := hostToolService.GetSupervisorProcessConfig()
|
configs, err := hostToolService.GetSupervisorProcessConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -159,12 +159,12 @@ func (b *BaseApi) GetProcess(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Host tool
|
// @Tags Host tool
|
||||||
// @Summary Get Supervisor process config
|
// @Summary Get Supervisor process config
|
||||||
// @Description 操作 Supervisor 进程文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.SupervisorProcessFileReq true "request"
|
// @Param request body request.SupervisorProcessFileReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {string} content
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/tool/supervisor/process/file [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/tool/supervisor/process/file [post]
|
||||||
// @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] Supervisor 进程文件 ","formatEN":"[operate] Supervisor Process Config file"}
|
// @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] Supervisor 进程文件 ","formatEN":"[operate] Supervisor Process Config file"}
|
||||||
func (b *BaseApi) GetProcessFile(c *gin.Context) {
|
func (b *BaseApi) GetProcessFile(c *gin.Context) {
|
||||||
var req request.SupervisorProcessFileReq
|
var req request.SupervisorProcessFileReq
|
||||||
|
|||||||
+12
-12
@@ -9,12 +9,12 @@ import (
|
|||||||
|
|
||||||
// @Tags Container Image
|
// @Tags Container Image
|
||||||
// @Summary Page images
|
// @Summary Page images
|
||||||
// @Description 获取镜像列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchWithPage true "request"
|
// @Param request body dto.SearchWithPage true "request"
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/image/search [post]
|
// @Router /containers/image/search [post]
|
||||||
func (b *BaseApi) SearchImage(c *gin.Context) {
|
func (b *BaseApi) SearchImage(c *gin.Context) {
|
||||||
var req dto.SearchWithPage
|
var req dto.SearchWithPage
|
||||||
@@ -36,10 +36,10 @@ func (b *BaseApi) SearchImage(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image
|
// @Tags Container Image
|
||||||
// @Summary List all images
|
// @Summary List all images
|
||||||
// @Description 获取所有镜像列表
|
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {array} dto.ImageInfo
|
// @Success 200 {array} dto.ImageInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/image/all [get]
|
// @Router /containers/image/all [get]
|
||||||
func (b *BaseApi) ListAllImage(c *gin.Context) {
|
func (b *BaseApi) ListAllImage(c *gin.Context) {
|
||||||
list, err := imageService.ListAll()
|
list, err := imageService.ListAll()
|
||||||
@@ -52,10 +52,10 @@ func (b *BaseApi) ListAllImage(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image
|
// @Tags Container Image
|
||||||
// @Summary load images options
|
// @Summary load images options
|
||||||
// @Description 获取镜像名称列表
|
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {array} dto.Options
|
// @Success 200 {array} dto.Options
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/image [get]
|
// @Router /containers/image [get]
|
||||||
func (b *BaseApi) ListImage(c *gin.Context) {
|
func (b *BaseApi) ListImage(c *gin.Context) {
|
||||||
list, err := imageService.List()
|
list, err := imageService.List()
|
||||||
@@ -68,11 +68,11 @@ func (b *BaseApi) ListImage(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image
|
// @Tags Container Image
|
||||||
// @Summary Build image
|
// @Summary Build image
|
||||||
// @Description 构建镜像
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ImageBuild true "request"
|
// @Param request body dto.ImageBuild true "request"
|
||||||
// @Success 200 {string} log
|
// @Success 200 {string} log
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/image/build [post]
|
// @Router /containers/image/build [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"构建镜像 [name]","formatEN":"build image [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"构建镜像 [name]","formatEN":"build image [name]"}
|
||||||
func (b *BaseApi) ImageBuild(c *gin.Context) {
|
func (b *BaseApi) ImageBuild(c *gin.Context) {
|
||||||
@@ -92,11 +92,11 @@ func (b *BaseApi) ImageBuild(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image
|
// @Tags Container Image
|
||||||
// @Summary Pull image
|
// @Summary Pull image
|
||||||
// @Description 拉取镜像
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ImagePull true "request"
|
// @Param request body dto.ImagePull true "request"
|
||||||
// @Success 200 {string} log
|
// @Success 200 {string} logPath
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/image/pull [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) ImagePull(c *gin.Context) {
|
||||||
@@ -116,11 +116,11 @@ func (b *BaseApi) ImagePull(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image
|
// @Tags Container Image
|
||||||
// @Summary Push image
|
// @Summary Push image
|
||||||
// @Description 推送镜像
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ImagePush true "request"
|
// @Param request body dto.ImagePush true "request"
|
||||||
// @Success 200 {string} log
|
// @Success 200 {string} logPath
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/image/push [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) ImagePush(c *gin.Context) {
|
||||||
@@ -140,11 +140,11 @@ func (b *BaseApi) ImagePush(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image
|
// @Tags Container Image
|
||||||
// @Summary Delete image
|
// @Summary Delete image
|
||||||
// @Description 删除镜像
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BatchDelete true "request"
|
// @Param request body dto.BatchDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/image/remove [post]
|
// @Router /containers/image/remove [post]
|
||||||
// @x-panel-log {"bodyKeys":["names"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"移除镜像 [names]","formatEN":"remove image [names]"}
|
// @x-panel-log {"bodyKeys":["names"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"移除镜像 [names]","formatEN":"remove image [names]"}
|
||||||
func (b *BaseApi) ImageRemove(c *gin.Context) {
|
func (b *BaseApi) ImageRemove(c *gin.Context) {
|
||||||
@@ -163,11 +163,11 @@ func (b *BaseApi) ImageRemove(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image
|
// @Tags Container Image
|
||||||
// @Summary Save image
|
// @Summary Save image
|
||||||
// @Description 导出镜像
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ImageSave true "request"
|
// @Param request body dto.ImageSave true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/image/save [post]
|
// @Router /containers/image/save [post]
|
||||||
// @x-panel-log {"bodyKeys":["tagName","path","name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"保留 [tagName] 为 [path]/[name]","formatEN":"save [tagName] as [path]/[name]"}
|
// @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) {
|
func (b *BaseApi) ImageSave(c *gin.Context) {
|
||||||
@@ -186,11 +186,11 @@ func (b *BaseApi) ImageSave(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image
|
// @Tags Container Image
|
||||||
// @Summary Tag image
|
// @Summary Tag image
|
||||||
// @Description Tag 镜像
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ImageTag true "request"
|
// @Param request body dto.ImageTag true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/image/tag [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) ImageTag(c *gin.Context) {
|
||||||
@@ -209,11 +209,11 @@ func (b *BaseApi) ImageTag(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image
|
// @Tags Container Image
|
||||||
// @Summary Load image
|
// @Summary Load image
|
||||||
// @Description 导入镜像
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ImageLoad true "request"
|
// @Param request body dto.ImageLoad true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/image/load [post]
|
// @Router /containers/image/load [post]
|
||||||
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"从 [path] 加载镜像","formatEN":"load image from [path]"}
|
// @x-panel-log {"bodyKeys":["path"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"从 [path] 加载镜像","formatEN":"load image from [path]"}
|
||||||
func (b *BaseApi) ImageLoad(c *gin.Context) {
|
func (b *BaseApi) ImageLoad(c *gin.Context) {
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ import (
|
|||||||
|
|
||||||
// @Tags Container Image-repo
|
// @Tags Container Image-repo
|
||||||
// @Summary Page image repos
|
// @Summary Page image repos
|
||||||
// @Description 获取镜像仓库列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchWithPage true "request"
|
// @Param request body dto.SearchWithPage true "request"
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/repo/search [post]
|
// @Router /containers/repo/search [post]
|
||||||
func (b *BaseApi) SearchRepo(c *gin.Context) {
|
func (b *BaseApi) SearchRepo(c *gin.Context) {
|
||||||
var req dto.SearchWithPage
|
var req dto.SearchWithPage
|
||||||
@@ -36,10 +36,10 @@ func (b *BaseApi) SearchRepo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image-repo
|
// @Tags Container Image-repo
|
||||||
// @Summary List image repos
|
// @Summary List image repos
|
||||||
// @Description 获取镜像仓库列表
|
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {array} dto.ImageRepoOption
|
// @Success 200 {array} dto.ImageRepoOption
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/repo [get]
|
// @Router /containers/repo [get]
|
||||||
func (b *BaseApi) ListRepo(c *gin.Context) {
|
func (b *BaseApi) ListRepo(c *gin.Context) {
|
||||||
list, err := imageRepoService.List()
|
list, err := imageRepoService.List()
|
||||||
@@ -53,12 +53,12 @@ func (b *BaseApi) ListRepo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image-repo
|
// @Tags Container Image-repo
|
||||||
// @Summary Load repo status
|
// @Summary Load repo status
|
||||||
// @Description 获取 docker 仓库状态
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperateByID true "request"
|
// @Param request body dto.OperateByID true "request"
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/repo/status [get]
|
// @Router /containers/repo/status [get]
|
||||||
func (b *BaseApi) CheckRepoStatus(c *gin.Context) {
|
func (b *BaseApi) CheckRepoStatus(c *gin.Context) {
|
||||||
var req dto.OperateByID
|
var req dto.OperateByID
|
||||||
@@ -75,12 +75,12 @@ func (b *BaseApi) CheckRepoStatus(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image-repo
|
// @Tags Container Image-repo
|
||||||
// @Summary Create image repo
|
// @Summary Create image repo
|
||||||
// @Description 创建镜像仓库
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ImageRepoDelete true "request"
|
// @Param request body dto.ImageRepoCreate true "request"
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/repo [post]
|
// @Router /containers/repo [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建镜像仓库 [name]","formatEN":"create image repo [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建镜像仓库 [name]","formatEN":"create image repo [name]"}
|
||||||
func (b *BaseApi) CreateRepo(c *gin.Context) {
|
func (b *BaseApi) CreateRepo(c *gin.Context) {
|
||||||
@@ -98,21 +98,21 @@ func (b *BaseApi) CreateRepo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image-repo
|
// @Tags Container Image-repo
|
||||||
// @Summary Delete image repo
|
// @Summary Delete image repo
|
||||||
// @Description 删除镜像仓库
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ImageRepoDelete true "request"
|
// @Param request body dto.OperateByID true "request"
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/repo/del [post]
|
// @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]"}
|
// @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":"delete image repo [name]"}
|
||||||
func (b *BaseApi) DeleteRepo(c *gin.Context) {
|
func (b *BaseApi) DeleteRepo(c *gin.Context) {
|
||||||
var req dto.ImageRepoDelete
|
var req dto.OperateByID
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := imageRepoService.BatchDelete(req); err != nil {
|
if err := imageRepoService.Delete(req); err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -121,12 +121,12 @@ func (b *BaseApi) DeleteRepo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Container Image-repo
|
// @Tags Container Image-repo
|
||||||
// @Summary Update image repo
|
// @Summary Update image repo
|
||||||
// @Description 更新镜像仓库
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ImageRepoUpdate true "request"
|
// @Param request body dto.ImageRepoUpdate true "request"
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /containers/repo/update [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdateRepo(c *gin.Context) {
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Logs
|
// @Tags Logs
|
||||||
// @Summary Page login logs
|
// @Summary Page login logs
|
||||||
// @Description 获取系统登录日志列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchLgLogWithPage true "request"
|
// @Param request body dto.SearchLgLogWithPage true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /logs/login [post]
|
// @Router /logs/login [post]
|
||||||
func (b *BaseApi) GetLoginLogs(c *gin.Context) {
|
func (b *BaseApi) GetLoginLogs(c *gin.Context) {
|
||||||
var req dto.SearchLgLogWithPage
|
var req dto.SearchLgLogWithPage
|
||||||
@@ -21,7 +21,7 @@ func (b *BaseApi) GetLoginLogs(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
total, list, err := logService.PageLoginLog(req)
|
total, list, err := logService.PageLoginLog(c, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
@@ -35,11 +35,11 @@ func (b *BaseApi) GetLoginLogs(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Logs
|
// @Tags Logs
|
||||||
// @Summary Page operation logs
|
// @Summary Page operation logs
|
||||||
// @Description 获取系统操作日志列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchOpLogWithPage true "request"
|
// @Param request body dto.SearchOpLogWithPage true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /logs/operation [post]
|
// @Router /logs/operation [post]
|
||||||
func (b *BaseApi) GetOperationLogs(c *gin.Context) {
|
func (b *BaseApi) GetOperationLogs(c *gin.Context) {
|
||||||
var req dto.SearchOpLogWithPage
|
var req dto.SearchOpLogWithPage
|
||||||
@@ -61,11 +61,11 @@ func (b *BaseApi) GetOperationLogs(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Logs
|
// @Tags Logs
|
||||||
// @Summary Clean operation logs
|
// @Summary Clean operation logs
|
||||||
// @Description 清空操作日志
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.CleanLog true "request"
|
// @Param request body dto.CleanLog true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /logs/clean [post]
|
// @Router /logs/clean [post]
|
||||||
// @x-panel-log {"bodyKeys":["logType"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清空 [logType] 日志信息","formatEN":"Clean the [logType] log information"}
|
// @x-panel-log {"bodyKeys":["logType"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清空 [logType] 日志信息","formatEN":"Clean the [logType] log information"}
|
||||||
func (b *BaseApi) CleanLogs(c *gin.Context) {
|
func (b *BaseApi) CleanLogs(c *gin.Context) {
|
||||||
@@ -84,9 +84,9 @@ func (b *BaseApi) CleanLogs(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Logs
|
// @Tags Logs
|
||||||
// @Summary Load system log files
|
// @Summary Load system log files
|
||||||
// @Description 获取系统日志文件列表
|
// @Success 200 {array} string
|
||||||
// @Success 200
|
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /logs/system/files [get]
|
// @Router /logs/system/files [get]
|
||||||
func (b *BaseApi) GetSystemFiles(c *gin.Context) {
|
func (b *BaseApi) GetSystemFiles(c *gin.Context) {
|
||||||
data, err := logService.ListSystemLogFile()
|
data, err := logService.ListSystemLogFile()
|
||||||
@@ -100,9 +100,9 @@ func (b *BaseApi) GetSystemFiles(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Logs
|
// @Tags Logs
|
||||||
// @Summary Load system logs
|
// @Summary Load system logs
|
||||||
// @Description 获取系统日志
|
// @Success 200 {string} data
|
||||||
// @Success 200
|
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /logs/system [post]
|
// @Router /logs/system [post]
|
||||||
func (b *BaseApi) GetSystemLogs(c *gin.Context) {
|
func (b *BaseApi) GetSystemLogs(c *gin.Context) {
|
||||||
var req dto.OperationWithName
|
var req dto.OperationWithName
|
||||||
|
|||||||
@@ -0,0 +1,167 @@
|
|||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/app/dto/request"
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/constant"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
// @Tags McpServer
|
||||||
|
// @Summary List mcp servers
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body request.McpServerSearch true "request"
|
||||||
|
// @Success 200 {object} response.McpServersRes
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /mcp/search [post]
|
||||||
|
func (b *BaseApi) PageMcpServers(c *gin.Context) {
|
||||||
|
var req request.McpServerSearch
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
list := mcpServerService.Page(req)
|
||||||
|
helper.SuccessWithData(c, list)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags McpServer
|
||||||
|
// @Summary Create mcp server
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body request.McpServerCreate true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /mcp/server [post]
|
||||||
|
func (b *BaseApi) CreateMcpServer(c *gin.Context) {
|
||||||
|
var req request.McpServerCreate
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err := mcpServerService.Create(req)
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithOutData(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags McpServer
|
||||||
|
// @Summary Update mcp server
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body request.McpServerUpdate true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /mcp/server/update [post]
|
||||||
|
func (b *BaseApi) UpdateMcpServer(c *gin.Context) {
|
||||||
|
var req request.McpServerUpdate
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err := mcpServerService.Update(req)
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithOutData(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags McpServer
|
||||||
|
// @Summary Delete mcp server
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body request.McpServerDelete true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /mcp/server/del [post]
|
||||||
|
func (b *BaseApi) DeleteMcpServer(c *gin.Context) {
|
||||||
|
var req request.McpServerDelete
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err := mcpServerService.Delete(req.ID)
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithOutData(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags McpServer
|
||||||
|
// @Summary Operate mcp server
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body request.McpServerOperate true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /mcp/server/op [post]
|
||||||
|
func (b *BaseApi) OperateMcpServer(c *gin.Context) {
|
||||||
|
var req request.McpServerOperate
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err := mcpServerService.Operate(req)
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithOutData(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags McpServer
|
||||||
|
// @Summary Bind Domain for mcp server
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body request.McpBindDomain true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /mcp/domain/bind [post]
|
||||||
|
func (b *BaseApi) BindMcpDomain(c *gin.Context) {
|
||||||
|
var req request.McpBindDomain
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err := mcpServerService.BindDomain(req)
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithOutData(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags McpServer
|
||||||
|
// @Summary Update bind Domain for mcp server
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body request.McpBindDomainUpdate true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /mcp/domain/update [post]
|
||||||
|
func (b *BaseApi) UpdateMcpBindDomain(c *gin.Context) {
|
||||||
|
var req request.McpBindDomainUpdate
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err := mcpServerService.UpdateBindDomain(req)
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithOutData(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags McpServer
|
||||||
|
// @Summary Get bin Domain for mcp server
|
||||||
|
// @Accept json
|
||||||
|
// @Success 200 {object} response.McpBindDomainRes
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /mcp/domain/get [get]
|
||||||
|
func (b *BaseApi) GetMcpBindDomain(c *gin.Context) {
|
||||||
|
res, err := mcpServerService.GetBindDomain()
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithData(c, res)
|
||||||
|
}
|
||||||
@@ -17,10 +17,10 @@ import (
|
|||||||
|
|
||||||
// @Tags Monitor
|
// @Tags Monitor
|
||||||
// @Summary Load monitor datas
|
// @Summary Load monitor datas
|
||||||
// @Description 获取监控数据
|
|
||||||
// @Param request body dto.MonitorSearch true "request"
|
// @Param request body dto.MonitorSearch true "request"
|
||||||
// @Success 200
|
// @Success 200 {array} dto.MonitorData
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/monitor/search [post]
|
// @Router /hosts/monitor/search [post]
|
||||||
func (b *BaseApi) LoadMonitor(c *gin.Context) {
|
func (b *BaseApi) LoadMonitor(c *gin.Context) {
|
||||||
var req dto.MonitorSearch
|
var req dto.MonitorSearch
|
||||||
@@ -28,7 +28,7 @@ func (b *BaseApi) LoadMonitor(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
loc, _ := time.LoadLocation(common.LoadTimeZone())
|
loc, _ := time.LoadLocation(common.LoadTimeZoneByCmd())
|
||||||
req.StartTime = req.StartTime.In(loc)
|
req.StartTime = req.StartTime.In(loc)
|
||||||
req.EndTime = req.EndTime.In(loc)
|
req.EndTime = req.EndTime.In(loc)
|
||||||
|
|
||||||
@@ -89,9 +89,9 @@ func (b *BaseApi) LoadMonitor(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Monitor
|
// @Tags Monitor
|
||||||
// @Summary Clean monitor datas
|
// @Summary Clean monitor datas
|
||||||
// @Description 清空监控数据
|
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /hosts/monitor/clean [post]
|
// @Router /hosts/monitor/clean [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清空监控数据","formatEN":"clean monitor datas"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清空监控数据","formatEN":"clean monitor datas"}
|
||||||
func (b *BaseApi) CleanMonitor(c *gin.Context) {
|
func (b *BaseApi) CleanMonitor(c *gin.Context) {
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import (
|
|||||||
|
|
||||||
// @Tags OpenResty
|
// @Tags OpenResty
|
||||||
// @Summary Load OpenResty conf
|
// @Summary Load OpenResty conf
|
||||||
// @Description 获取 OpenResty 配置信息
|
// @Success 200 {object} response.NginxFile
|
||||||
// @Success 200 {object} response.FileInfo
|
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /openresty [get]
|
// @Router /openresty [get]
|
||||||
func (b *BaseApi) GetNginx(c *gin.Context) {
|
func (b *BaseApi) GetNginx(c *gin.Context) {
|
||||||
fileInfo, err := nginxService.GetNginxConfig()
|
fileInfo, err := nginxService.GetNginxConfig()
|
||||||
@@ -24,11 +24,11 @@ func (b *BaseApi) GetNginx(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags OpenResty
|
// @Tags OpenResty
|
||||||
// @Summary Load partial OpenResty conf
|
// @Summary Load partial OpenResty conf
|
||||||
// @Description 获取部分 OpenResty 配置信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxScopeReq true "request"
|
// @Param request body request.NginxScopeReq true "request"
|
||||||
// @Success 200 {array} response.NginxParam
|
// @Success 200 {array} response.NginxParam
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /openresty/scope [post]
|
// @Router /openresty/scope [post]
|
||||||
func (b *BaseApi) GetNginxConfigByScope(c *gin.Context) {
|
func (b *BaseApi) GetNginxConfigByScope(c *gin.Context) {
|
||||||
var req request.NginxScopeReq
|
var req request.NginxScopeReq
|
||||||
@@ -46,11 +46,11 @@ func (b *BaseApi) GetNginxConfigByScope(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags OpenResty
|
// @Tags OpenResty
|
||||||
// @Summary Update OpenResty conf
|
// @Summary Update OpenResty conf
|
||||||
// @Description 更新 OpenResty 配置信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxConfigUpdate true "request"
|
// @Param request body request.NginxConfigUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /openresty/update [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdateNginxConfigByScope(c *gin.Context) {
|
||||||
@@ -67,9 +67,9 @@ func (b *BaseApi) UpdateNginxConfigByScope(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags OpenResty
|
// @Tags OpenResty
|
||||||
// @Summary Load OpenResty status info
|
// @Summary Load OpenResty status info
|
||||||
// @Description 获取 OpenResty 状态信息
|
|
||||||
// @Success 200 {object} response.NginxStatus
|
// @Success 200 {object} response.NginxStatus
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /openresty/status [get]
|
// @Router /openresty/status [get]
|
||||||
func (b *BaseApi) GetNginxStatus(c *gin.Context) {
|
func (b *BaseApi) GetNginxStatus(c *gin.Context) {
|
||||||
res, err := nginxService.GetStatus()
|
res, err := nginxService.GetStatus()
|
||||||
@@ -82,11 +82,11 @@ func (b *BaseApi) GetNginxStatus(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags OpenResty
|
// @Tags OpenResty
|
||||||
// @Summary Update OpenResty conf by upload file
|
// @Summary Update OpenResty conf by upload file
|
||||||
// @Description 上传更新 OpenResty 配置文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxConfigFileUpdate true "request"
|
// @Param request body request.NginxConfigFileUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /openresty/file [post]
|
// @Router /openresty/file [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 nginx 配置","formatEN":"Update nginx conf"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新 nginx 配置","formatEN":"Update nginx conf"}
|
||||||
func (b *BaseApi) UpdateNginxFile(c *gin.Context) {
|
func (b *BaseApi) UpdateNginxFile(c *gin.Context) {
|
||||||
@@ -104,9 +104,9 @@ func (b *BaseApi) UpdateNginxFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags OpenResty
|
// @Tags OpenResty
|
||||||
// @Summary Clear OpenResty proxy cache
|
// @Summary Clear OpenResty proxy cache
|
||||||
// @Description 清理 OpenResty 代理缓存
|
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /openresty/clear [post]
|
// @Router /openresty/clear [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清理 Openresty 代理缓存","formatEN":"Clear nginx proxy cache"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清理 Openresty 代理缓存","formatEN":"Clear nginx proxy cache"}
|
||||||
func (b *BaseApi) ClearNginxProxyCache(c *gin.Context) {
|
func (b *BaseApi) ClearNginxProxyCache(c *gin.Context) {
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
|
|
||||||
// @Tags PHP Extensions
|
// @Tags PHP Extensions
|
||||||
// @Summary Page Extensions
|
// @Summary Page Extensions
|
||||||
// @Description Page Extensions
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.PHPExtensionsSearch true "request"
|
// @Param request body request.PHPExtensionsSearch true "request"
|
||||||
// @Success 200 {array} response.PHPExtensionsDTO
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /runtimes/php/extensions/search [post]
|
// @Router /runtimes/php/extensions/search [post]
|
||||||
func (b *BaseApi) PagePHPExtensions(c *gin.Context) {
|
func (b *BaseApi) PagePHPExtensions(c *gin.Context) {
|
||||||
var req request.PHPExtensionsSearch
|
var req request.PHPExtensionsSearch
|
||||||
@@ -27,7 +27,10 @@ func (b *BaseApi) PagePHPExtensions(c *gin.Context) {
|
|||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
helper.SuccessWithData(c, list)
|
helper.SuccessWithData(c, dto.PageResult{
|
||||||
|
Total: int64(len(list)),
|
||||||
|
Items: list,
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
total, list, err := phpExtensionsService.Page(req)
|
total, list, err := phpExtensionsService.Page(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -44,11 +47,11 @@ func (b *BaseApi) PagePHPExtensions(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags PHP Extensions
|
// @Tags PHP Extensions
|
||||||
// @Summary Create Extensions
|
// @Summary Create Extensions
|
||||||
// @Description Create Extensions
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.PHPExtensionsCreate true "request"
|
// @Param request body request.PHPExtensionsCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /runtimes/php/extensions [post]
|
// @Router /runtimes/php/extensions [post]
|
||||||
func (b *BaseApi) CreatePHPExtensions(c *gin.Context) {
|
func (b *BaseApi) CreatePHPExtensions(c *gin.Context) {
|
||||||
var req request.PHPExtensionsCreate
|
var req request.PHPExtensionsCreate
|
||||||
@@ -64,11 +67,11 @@ func (b *BaseApi) CreatePHPExtensions(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags PHP Extensions
|
// @Tags PHP Extensions
|
||||||
// @Summary Update Extensions
|
// @Summary Update Extensions
|
||||||
// @Description Update Extensions
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.PHPExtensionsUpdate true "request"
|
// @Param request body request.PHPExtensionsUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /runtimes/php/extensions/update [post]
|
// @Router /runtimes/php/extensions/update [post]
|
||||||
func (b *BaseApi) UpdatePHPExtensions(c *gin.Context) {
|
func (b *BaseApi) UpdatePHPExtensions(c *gin.Context) {
|
||||||
var req request.PHPExtensionsUpdate
|
var req request.PHPExtensionsUpdate
|
||||||
@@ -84,11 +87,11 @@ func (b *BaseApi) UpdatePHPExtensions(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags PHP Extensions
|
// @Tags PHP Extensions
|
||||||
// @Summary Delete Extensions
|
// @Summary Delete Extensions
|
||||||
// @Description Delete Extensions
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.PHPExtensionsDelete true "request"
|
// @Param request body request.PHPExtensionsDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /runtimes/php/extensions/del [post]
|
// @Router /runtimes/php/extensions/del [post]
|
||||||
func (b *BaseApi) DeletePHPExtensions(c *gin.Context) {
|
func (b *BaseApi) DeletePHPExtensions(c *gin.Context) {
|
||||||
var req request.PHPExtensionsDelete
|
var req request.PHPExtensionsDelete
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ func (b *BaseApi) ProcessWs(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Process
|
// @Tags Process
|
||||||
// @Summary Stop Process
|
// @Summary Stop Process
|
||||||
// @Description 停止进程
|
|
||||||
// @Param request body request.ProcessReq true "request"
|
// @Param request body request.ProcessReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /process/stop [post]
|
// @Router /process/stop [post]
|
||||||
// @x-panel-log {"bodyKeys":["PID"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"结束进程 [PID]","formatEN":"结束进程 [PID]"}
|
// @x-panel-log {"bodyKeys":["PID"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"结束进程 [PID]","formatEN":"结束进程 [PID]"}
|
||||||
func (b *BaseApi) StopProcess(c *gin.Context) {
|
func (b *BaseApi) StopProcess(c *gin.Context) {
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary List RecycleBin files
|
// @Summary List Recycle Bin files
|
||||||
// @Description 获取回收站文件列表
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PageInfo true "request"
|
// @Param request body dto.PageInfo true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/recycle/search [post]
|
// @Router /files/recycle/search [post]
|
||||||
func (b *BaseApi) SearchRecycleBinFile(c *gin.Context) {
|
func (b *BaseApi) SearchRecycleBinFile(c *gin.Context) {
|
||||||
var req dto.PageInfo
|
var req dto.PageInfo
|
||||||
@@ -33,12 +33,12 @@ func (b *BaseApi) SearchRecycleBinFile(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Reduce RecycleBin files
|
// @Summary Reduce Recycle Bin files
|
||||||
// @Description 还原回收站文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.RecycleBinReduce true "request"
|
// @Param request body request.RecycleBinReduce true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/recycle/reduce [post]
|
// @Router /files/recycle/reduce [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"还原回收站文件 [name]","formatEN":"Reduce RecycleBin file [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"还原回收站文件 [name]","formatEN":"Reduce RecycleBin file [name]"}
|
||||||
func (b *BaseApi) ReduceRecycleBinFile(c *gin.Context) {
|
func (b *BaseApi) ReduceRecycleBinFile(c *gin.Context) {
|
||||||
@@ -54,11 +54,11 @@ func (b *BaseApi) ReduceRecycleBinFile(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Clear RecycleBin files
|
// @Summary Clear Recycle Bin files
|
||||||
// @Description 清空回收站文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/recycle/clear [post]
|
// @Router /files/recycle/clear [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清空回收站","formatEN":"清空回收站"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清空回收站","formatEN":"清空回收站"}
|
||||||
func (b *BaseApi) ClearRecycleBinFile(c *gin.Context) {
|
func (b *BaseApi) ClearRecycleBinFile(c *gin.Context) {
|
||||||
@@ -70,11 +70,11 @@ func (b *BaseApi) ClearRecycleBinFile(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags File
|
// @Tags File
|
||||||
// @Summary Get RecycleBin status
|
// @Summary Get Recycle Bin status
|
||||||
// @Description 获取回收站状态
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200
|
// @Success 200 {string} content
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /files/recycle/status [get]
|
// @Router /files/recycle/status [get]
|
||||||
func (b *BaseApi) GetRecycleStatus(c *gin.Context) {
|
func (b *BaseApi) GetRecycleStatus(c *gin.Context) {
|
||||||
settingInfo, err := settingService.GetSettingInfo()
|
settingInfo, err := settingService.GetSettingInfo()
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Runtime
|
// @Tags Runtime
|
||||||
// @Summary List runtimes
|
// @Summary List runtimes
|
||||||
// @Description 获取运行环境列表
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.RuntimeSearch true "request"
|
// @Param request body request.RuntimeSearch true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /runtimes/search [post]
|
// @Router /runtimes/search [post]
|
||||||
func (b *BaseApi) SearchRuntimes(c *gin.Context) {
|
func (b *BaseApi) SearchRuntimes(c *gin.Context) {
|
||||||
var req request.RuntimeSearch
|
var req request.RuntimeSearch
|
||||||
@@ -34,11 +34,11 @@ func (b *BaseApi) SearchRuntimes(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Runtime
|
// @Tags Runtime
|
||||||
// @Summary Create runtime
|
// @Summary Create runtime
|
||||||
// @Description 创建运行环境
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.RuntimeCreate true "request"
|
// @Param request body request.RuntimeCreate true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} model.Runtime
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /runtimes [post]
|
// @Router /runtimes [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建运行环境 [name]","formatEN":"Create runtime [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建运行环境 [name]","formatEN":"Create runtime [name]"}
|
||||||
func (b *BaseApi) CreateRuntime(c *gin.Context) {
|
func (b *BaseApi) CreateRuntime(c *gin.Context) {
|
||||||
@@ -56,13 +56,13 @@ func (b *BaseApi) CreateRuntime(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Delete runtime
|
// @Summary Delete runtime
|
||||||
// @Description 删除运行环境
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.RuntimeDelete true "request"
|
// @Param request body request.RuntimeDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /runtimes/del [post]
|
// @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) {
|
func (b *BaseApi) DeleteRuntime(c *gin.Context) {
|
||||||
var req request.RuntimeDelete
|
var req request.RuntimeDelete
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
@@ -92,11 +92,11 @@ func (b *BaseApi) DeleteRuntimeCheck(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Runtime
|
// @Tags Runtime
|
||||||
// @Summary Update runtime
|
// @Summary Update runtime
|
||||||
// @Description 更新运行环境
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.RuntimeUpdate true "request"
|
// @Param request body request.RuntimeUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /runtimes/update [post]
|
// @Router /runtimes/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新运行环境 [name]","formatEN":"Update runtime [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新运行环境 [name]","formatEN":"Update runtime [name]"}
|
||||||
func (b *BaseApi) UpdateRuntime(c *gin.Context) {
|
func (b *BaseApi) UpdateRuntime(c *gin.Context) {
|
||||||
@@ -113,12 +113,12 @@ func (b *BaseApi) UpdateRuntime(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Runtime
|
// @Tags Runtime
|
||||||
// @Summary Get runtime
|
// @Summary Get runtime
|
||||||
// @Description 获取运行环境
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param id path string true "request"
|
// @Param id path string true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} response.RuntimeDTO
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /runtimes/:id [get]
|
// @Security Timestamp
|
||||||
|
// @Router /runtimes/{id} [get]
|
||||||
func (b *BaseApi) GetRuntime(c *gin.Context) {
|
func (b *BaseApi) GetRuntime(c *gin.Context) {
|
||||||
id, err := helper.GetIntParamByKey(c, "id")
|
id, err := helper.GetIntParamByKey(c, "id")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -135,11 +135,11 @@ func (b *BaseApi) GetRuntime(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Runtime
|
// @Tags Runtime
|
||||||
// @Summary Get Node package scripts
|
// @Summary Get Node package scripts
|
||||||
// @Description 获取 Node 项目的 scripts
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NodePackageReq true "request"
|
// @Param request body request.NodePackageReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {array} response.PackageScripts
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /runtimes/node/package [post]
|
// @Router /runtimes/node/package [post]
|
||||||
func (b *BaseApi) GetNodePackageRunScript(c *gin.Context) {
|
func (b *BaseApi) GetNodePackageRunScript(c *gin.Context) {
|
||||||
var req request.NodePackageReq
|
var req request.NodePackageReq
|
||||||
@@ -156,11 +156,11 @@ func (b *BaseApi) GetNodePackageRunScript(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Runtime
|
// @Tags Runtime
|
||||||
// @Summary Operate runtime
|
// @Summary Operate runtime
|
||||||
// @Description 操作运行环境
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.RuntimeOperate true "request"
|
// @Param request body request.RuntimeOperate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /runtimes/operate [post]
|
// @Router /runtimes/operate [post]
|
||||||
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"操作运行环境 [name]","formatEN":"Operate runtime [name]"}
|
// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"操作运行环境 [name]","formatEN":"Operate runtime [name]"}
|
||||||
func (b *BaseApi) OperateRuntime(c *gin.Context) {
|
func (b *BaseApi) OperateRuntime(c *gin.Context) {
|
||||||
@@ -178,11 +178,11 @@ func (b *BaseApi) OperateRuntime(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Runtime
|
// @Tags Runtime
|
||||||
// @Summary Get Node modules
|
// @Summary Get Node modules
|
||||||
// @Description 获取 Node 项目的 modules
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NodeModuleReq true "request"
|
// @Param request body request.NodeModuleReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {array} response.NodeModule
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /runtimes/node/modules [post]
|
// @Router /runtimes/node/modules [post]
|
||||||
func (b *BaseApi) GetNodeModules(c *gin.Context) {
|
func (b *BaseApi) GetNodeModules(c *gin.Context) {
|
||||||
var req request.NodeModuleReq
|
var req request.NodeModuleReq
|
||||||
@@ -199,11 +199,11 @@ func (b *BaseApi) GetNodeModules(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Runtime
|
// @Tags Runtime
|
||||||
// @Summary Operate Node modules
|
// @Summary Operate Node modules
|
||||||
// @Description 操作 Node 项目 modules
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NodeModuleReq true "request"
|
// @Param request body request.NodeModuleReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /runtimes/node/modules/operate [post]
|
// @Router /runtimes/node/modules/operate [post]
|
||||||
func (b *BaseApi) OperateNodeModules(c *gin.Context) {
|
func (b *BaseApi) OperateNodeModules(c *gin.Context) {
|
||||||
var req request.NodeModuleOperateReq
|
var req request.NodeModuleOperateReq
|
||||||
@@ -220,10 +220,10 @@ func (b *BaseApi) OperateNodeModules(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Runtime
|
// @Tags Runtime
|
||||||
// @Summary Sync runtime status
|
// @Summary Sync runtime status
|
||||||
// @Description 同步运行环境状态
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /runtimes/sync [post]
|
// @Router /runtimes/sync [post]
|
||||||
func (b *BaseApi) SyncStatus(c *gin.Context) {
|
func (b *BaseApi) SyncStatus(c *gin.Context) {
|
||||||
err := runtimeService.SyncRuntimeStatus()
|
err := runtimeService.SyncRuntimeStatus()
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ package v1
|
|||||||
import (
|
import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"regexp"
|
||||||
|
|
||||||
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
|
"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"
|
||||||
@@ -16,9 +18,9 @@ import (
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Load system setting info
|
// @Summary Load system setting info
|
||||||
// @Description 加载系统配置信息
|
|
||||||
// @Success 200 {object} dto.SettingInfo
|
// @Success 200 {object} dto.SettingInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/search [post]
|
// @Router /settings/search [post]
|
||||||
func (b *BaseApi) GetSettingInfo(c *gin.Context) {
|
func (b *BaseApi) GetSettingInfo(c *gin.Context) {
|
||||||
setting, err := settingService.GetSettingInfo()
|
setting, err := settingService.GetSettingInfo()
|
||||||
@@ -31,9 +33,9 @@ func (b *BaseApi) GetSettingInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Load system available status
|
// @Summary Load system available status
|
||||||
// @Description 获取系统可用状态
|
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/search/available [get]
|
// @Router /settings/search/available [get]
|
||||||
func (b *BaseApi) GetSystemAvailable(c *gin.Context) {
|
func (b *BaseApi) GetSystemAvailable(c *gin.Context) {
|
||||||
helper.SuccessWithData(c, nil)
|
helper.SuccessWithData(c, nil)
|
||||||
@@ -41,11 +43,11 @@ func (b *BaseApi) GetSystemAvailable(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Update system setting
|
// @Summary Update system setting
|
||||||
// @Description 更新系统配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SettingUpdate true "request"
|
// @Param request body dto.SettingUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/update [post]
|
// @Router /settings/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统配置 [key] => [value]","formatEN":"update system setting [key] => [value]"}
|
// @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统配置 [key] => [value]","formatEN":"update system setting [key] => [value]"}
|
||||||
func (b *BaseApi) UpdateSetting(c *gin.Context) {
|
func (b *BaseApi) UpdateSetting(c *gin.Context) {
|
||||||
@@ -53,21 +55,31 @@ func (b *BaseApi) UpdateSetting(c *gin.Context) {
|
|||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if req.Key == "SecurityEntrance" {
|
||||||
|
if !checkEntrancePattern(req.Value) {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, fmt.Errorf("the format of the security entrance %s is incorrect.", req.Value))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := settingService.Update(req.Key, req.Value); err != nil {
|
if err := settingService.Update(req.Key, req.Value); err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if req.Key == "SecurityEntrance" {
|
||||||
|
entranceValue := base64.StdEncoding.EncodeToString([]byte(req.Value))
|
||||||
|
c.SetCookie("SecurityEntrance", entranceValue, 0, "", "", false, true)
|
||||||
|
}
|
||||||
helper.SuccessWithData(c, nil)
|
helper.SuccessWithData(c, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Update proxy setting
|
// @Summary Update proxy setting
|
||||||
// @Description 服务器代理配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.ProxyUpdate true "request"
|
// @Param request body dto.ProxyUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/proxy/update [post]
|
// @Router /settings/proxy/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["proxyUrl","proxyPort"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"服务器代理配置 [proxyPort]:[proxyPort]","formatEN":"set proxy [proxyPort]:[proxyPort]."}
|
// @x-panel-log {"bodyKeys":["proxyUrl","proxyPort"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"服务器代理配置 [proxyPort]:[proxyPort]","formatEN":"set proxy [proxyPort]:[proxyPort]."}
|
||||||
func (b *BaseApi) UpdateProxy(c *gin.Context) {
|
func (b *BaseApi) UpdateProxy(c *gin.Context) {
|
||||||
@@ -94,11 +106,11 @@ func (b *BaseApi) UpdateProxy(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Update system setting
|
// @Summary Update system setting
|
||||||
// @Description 隐藏高级功能菜单
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SettingUpdate true "request"
|
// @Param request body dto.SettingUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/menu/update [post]
|
// @Router /settings/menu/update [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"隐藏高级功能菜单","formatEN":"Hide advanced feature menu."}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"隐藏高级功能菜单","formatEN":"Hide advanced feature menu."}
|
||||||
func (b *BaseApi) UpdateMenu(c *gin.Context) {
|
func (b *BaseApi) UpdateMenu(c *gin.Context) {
|
||||||
@@ -116,11 +128,11 @@ func (b *BaseApi) UpdateMenu(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Update system password
|
// @Summary Update system password
|
||||||
// @Description 更新系统登录密码
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PasswordUpdate true "request"
|
// @Param request body dto.PasswordUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/password/update [post]
|
// @Router /settings/password/update [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统密码","formatEN":"update system password"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统密码","formatEN":"update system password"}
|
||||||
func (b *BaseApi) UpdatePassword(c *gin.Context) {
|
func (b *BaseApi) UpdatePassword(c *gin.Context) {
|
||||||
@@ -138,11 +150,11 @@ func (b *BaseApi) UpdatePassword(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Update system ssl
|
// @Summary Update system ssl
|
||||||
// @Description 修改系统 ssl 登录
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SSLUpdate true "request"
|
// @Param request body dto.SSLUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/ssl/update [post]
|
// @Router /settings/ssl/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["ssl"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统 ssl => [ssl]","formatEN":"update system ssl => [ssl]"}
|
// @x-panel-log {"bodyKeys":["ssl"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统 ssl => [ssl]","formatEN":"update system ssl => [ssl]"}
|
||||||
func (b *BaseApi) UpdateSSL(c *gin.Context) {
|
func (b *BaseApi) UpdateSSL(c *gin.Context) {
|
||||||
@@ -160,9 +172,9 @@ func (b *BaseApi) UpdateSSL(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Load system cert info
|
// @Summary Load system cert info
|
||||||
// @Description 获取证书信息
|
// @Success 200 {object} dto.SSLInfo
|
||||||
// @Success 200 {object} dto.SettingInfo
|
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/ssl/info [get]
|
// @Router /settings/ssl/info [get]
|
||||||
func (b *BaseApi) LoadFromCert(c *gin.Context) {
|
func (b *BaseApi) LoadFromCert(c *gin.Context) {
|
||||||
info, err := settingService.LoadFromCert()
|
info, err := settingService.LoadFromCert()
|
||||||
@@ -175,9 +187,9 @@ func (b *BaseApi) LoadFromCert(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Download system cert
|
// @Summary Download system cert
|
||||||
// @Description 下载证书
|
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/ssl/download [post]
|
// @Router /settings/ssl/download [post]
|
||||||
func (b *BaseApi) DownloadSSL(c *gin.Context) {
|
func (b *BaseApi) DownloadSSL(c *gin.Context) {
|
||||||
pathItem := path.Join(global.CONF.System.BaseDir, "1panel/secret/server.crt")
|
pathItem := path.Join(global.CONF.System.BaseDir, "1panel/secret/server.crt")
|
||||||
@@ -191,10 +203,10 @@ func (b *BaseApi) DownloadSSL(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Load system address
|
// @Summary Load system address
|
||||||
// @Description 获取系统地址信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200
|
// @Success 200 {array} string
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/interface [get]
|
// @Router /settings/interface [get]
|
||||||
func (b *BaseApi) LoadInterfaceAddr(c *gin.Context) {
|
func (b *BaseApi) LoadInterfaceAddr(c *gin.Context) {
|
||||||
data, err := settingService.LoadInterfaceAddr()
|
data, err := settingService.LoadInterfaceAddr()
|
||||||
@@ -207,11 +219,11 @@ func (b *BaseApi) LoadInterfaceAddr(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Update system bind info
|
// @Summary Update system bind info
|
||||||
// @Description 更新系统监听信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.BindInfo true "request"
|
// @Param request body dto.BindInfo true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/bind/update [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdateBindInfo(c *gin.Context) {
|
||||||
@@ -229,11 +241,11 @@ func (b *BaseApi) UpdateBindInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Update system port
|
// @Summary Update system port
|
||||||
// @Description 更新系统端口
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PortUpdate true "request"
|
// @Param request body dto.PortUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/port/update [post]
|
// @Router /settings/port/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["serverPort"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统端口 => [serverPort]","formatEN":"update system port => [serverPort]"}
|
// @x-panel-log {"bodyKeys":["serverPort"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改系统端口 => [serverPort]","formatEN":"update system port => [serverPort]"}
|
||||||
func (b *BaseApi) UpdatePort(c *gin.Context) {
|
func (b *BaseApi) UpdatePort(c *gin.Context) {
|
||||||
@@ -251,11 +263,11 @@ func (b *BaseApi) UpdatePort(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Reset system password expired
|
// @Summary Reset system password expired
|
||||||
// @Description 重置过期系统登录密码
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PasswordUpdate true "request"
|
// @Param request body dto.PasswordUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/expired/handle [post]
|
// @Router /settings/expired/handle [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"重置过期密码","formatEN":"reset an expired Password"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"重置过期密码","formatEN":"reset an expired Password"}
|
||||||
func (b *BaseApi) HandlePasswordExpired(c *gin.Context) {
|
func (b *BaseApi) HandlePasswordExpired(c *gin.Context) {
|
||||||
@@ -272,10 +284,10 @@ func (b *BaseApi) HandlePasswordExpired(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Load local backup dir
|
// @Summary Load local base dir
|
||||||
// @Description 获取安装根目录
|
|
||||||
// @Success 200 {string} path
|
// @Success 200 {string} path
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/basedir [get]
|
// @Router /settings/basedir [get]
|
||||||
func (b *BaseApi) LoadBaseDir(c *gin.Context) {
|
func (b *BaseApi) LoadBaseDir(c *gin.Context) {
|
||||||
helper.SuccessWithData(c, global.CONF.System.DataDir)
|
helper.SuccessWithData(c, global.CONF.System.DataDir)
|
||||||
@@ -283,11 +295,11 @@ func (b *BaseApi) LoadBaseDir(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Load mfa info
|
// @Summary Load mfa info
|
||||||
// @Description 获取 mfa 信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.MfaCredential true "request"
|
// @Param request body dto.MfaCredential true "request"
|
||||||
// @Success 200 {object} mfa.Otp
|
// @Success 200 {object} mfa.Otp
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/mfa [post]
|
// @Router /settings/mfa [post]
|
||||||
func (b *BaseApi) LoadMFA(c *gin.Context) {
|
func (b *BaseApi) LoadMFA(c *gin.Context) {
|
||||||
var req dto.MfaRequest
|
var req dto.MfaRequest
|
||||||
@@ -306,11 +318,11 @@ func (b *BaseApi) LoadMFA(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Bind mfa
|
// @Summary Bind mfa
|
||||||
// @Description Mfa 绑定
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.MfaCredential true "request"
|
// @Param request body dto.MfaCredential true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/mfa/bind [post]
|
// @Router /settings/mfa/bind [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"mfa 绑定","formatEN":"bind mfa"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"mfa 绑定","formatEN":"bind mfa"}
|
||||||
func (b *BaseApi) MFABind(c *gin.Context) {
|
func (b *BaseApi) MFABind(c *gin.Context) {
|
||||||
@@ -342,3 +354,60 @@ func (b *BaseApi) MFABind(c *gin.Context) {
|
|||||||
|
|
||||||
helper.SuccessWithData(c, nil)
|
helper.SuccessWithData(c, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Tags System Setting
|
||||||
|
// @Summary Generate api key
|
||||||
|
// @Accept json
|
||||||
|
// @Success 200 {string} apiKey
|
||||||
|
// @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)
|
||||||
|
}
|
||||||
|
|
||||||
|
func checkEntrancePattern(val string) bool {
|
||||||
|
if len(val) == 0 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
result, _ := regexp.MatchString("^[a-zA-Z0-9]{5,116}$", val)
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import (
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Create system snapshot
|
// @Summary Create system snapshot
|
||||||
// @Description 创建系统快照
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SnapshotCreate true "request"
|
// @Param request body dto.SnapshotCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/snapshot [post]
|
// @Router /settings/snapshot [post]
|
||||||
// @x-panel-log {"bodyKeys":["from", "description"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建系统快照 [description] 到 [from]","formatEN":"Create system backup [description] to [from]"}
|
// @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) {
|
func (b *BaseApi) CreateSnapshot(c *gin.Context) {
|
||||||
@@ -31,11 +31,11 @@ func (b *BaseApi) CreateSnapshot(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Import system snapshot
|
// @Summary Import system snapshot
|
||||||
// @Description 导入已有快照
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SnapshotImport true "request"
|
// @Param request body dto.SnapshotImport true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/snapshot/import [post]
|
// @Router /settings/snapshot/import [post]
|
||||||
// @x-panel-log {"bodyKeys":["from", "names"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"从 [from] 同步系统快照 [names]","formatEN":"Sync system snapshots [names] from [from]"}
|
// @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) {
|
func (b *BaseApi) ImportSnapshot(c *gin.Context) {
|
||||||
@@ -53,11 +53,11 @@ func (b *BaseApi) ImportSnapshot(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Load Snapshot status
|
// @Summary Load Snapshot status
|
||||||
// @Description 获取快照状态
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.OperateByID true "request"
|
// @Param request body dto.OperateByID true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} dto.SnapshotStatus
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/snapshot/status [post]
|
// @Router /settings/snapshot/status [post]
|
||||||
func (b *BaseApi) LoadSnapShotStatus(c *gin.Context) {
|
func (b *BaseApi) LoadSnapShotStatus(c *gin.Context) {
|
||||||
var req dto.OperateByID
|
var req dto.OperateByID
|
||||||
@@ -75,11 +75,11 @@ func (b *BaseApi) LoadSnapShotStatus(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Update snapshot description
|
// @Summary Update snapshot description
|
||||||
// @Description 更新快照描述信息
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.UpdateDescription true "request"
|
// @Param request body dto.UpdateDescription true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/snapshot/description/update [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdateSnapDescription(c *gin.Context) {
|
||||||
@@ -97,14 +97,14 @@ func (b *BaseApi) UpdateSnapDescription(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Page system snapshot
|
// @Summary Page system snapshot
|
||||||
// @Description 获取系统快照列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchWithPage true "request"
|
// @Param request body dto.PageSnapshot true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/snapshot/search [post]
|
// @Router /settings/snapshot/search [post]
|
||||||
func (b *BaseApi) SearchSnapshot(c *gin.Context) {
|
func (b *BaseApi) SearchSnapshot(c *gin.Context) {
|
||||||
var req dto.SearchWithPage
|
var req dto.PageSnapshot
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
return
|
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 {array} dto.SnapshotFile
|
||||||
|
// @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
|
// @Tags System Setting
|
||||||
// @Summary Recover system backup
|
// @Summary Recover system backup
|
||||||
// @Description 从系统快照恢复
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SnapshotRecover true "request"
|
// @Param request body dto.SnapshotRecover true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/snapshot/recover [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) RecoverSnapshot(c *gin.Context) {
|
||||||
@@ -144,11 +166,11 @@ func (b *BaseApi) RecoverSnapshot(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Rollback system backup
|
// @Summary Rollback system backup
|
||||||
// @Description 从系统快照回滚
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SnapshotRecover true "request"
|
// @Param request body dto.SnapshotRecover true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/snapshot/rollback [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) RollbackSnapshot(c *gin.Context) {
|
||||||
@@ -166,11 +188,11 @@ func (b *BaseApi) RollbackSnapshot(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Delete system backup
|
// @Summary Delete system backup
|
||||||
// @Description 删除系统快照
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SnapshotBatchDelete true "request"
|
// @Param request body dto.SnapshotBatchDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/snapshot/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteSnapshot(c *gin.Context) {
|
||||||
|
|||||||
+20
-19
@@ -9,10 +9,10 @@ import (
|
|||||||
|
|
||||||
// @Tags SSH
|
// @Tags SSH
|
||||||
// @Summary Load host SSH setting info
|
// @Summary Load host SSH setting info
|
||||||
// @Description 加载 SSH 配置信息
|
|
||||||
// @Success 200 {object} dto.SSHInfo
|
// @Success 200 {object} dto.SSHInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/ssh/search [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/ssh/search [post]
|
||||||
func (b *BaseApi) GetSSHInfo(c *gin.Context) {
|
func (b *BaseApi) GetSSHInfo(c *gin.Context) {
|
||||||
info, err := sshService.GetSSHInfo()
|
info, err := sshService.GetSSHInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -24,11 +24,12 @@ func (b *BaseApi) GetSSHInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags SSH
|
// @Tags SSH
|
||||||
// @Summary Operate SSH
|
// @Summary Operate SSH
|
||||||
// @Description 修改 SSH 服务状态
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.Operate true "request"
|
// @Param request body dto.Operate true "request"
|
||||||
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/ssh/operate [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/ssh/operate [post]
|
||||||
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] SSH ","formatEN":"[operation] SSH"}
|
// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] SSH ","formatEN":"[operation] SSH"}
|
||||||
func (b *BaseApi) OperateSSH(c *gin.Context) {
|
func (b *BaseApi) OperateSSH(c *gin.Context) {
|
||||||
var req dto.Operate
|
var req dto.Operate
|
||||||
@@ -45,12 +46,12 @@ func (b *BaseApi) OperateSSH(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags SSH
|
// @Tags SSH
|
||||||
// @Summary Update host SSH setting
|
// @Summary Update host SSH setting
|
||||||
// @Description 更新 SSH 配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SSHUpdate true "request"
|
// @Param request body dto.SSHUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/ssh/update [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/ssh/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 SSH 配置 [key] => [value]","formatEN":"update SSH setting [key] => [value]"}
|
// @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) {
|
func (b *BaseApi) UpdateSSH(c *gin.Context) {
|
||||||
var req dto.SSHUpdate
|
var req dto.SSHUpdate
|
||||||
@@ -67,12 +68,12 @@ func (b *BaseApi) UpdateSSH(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags SSH
|
// @Tags SSH
|
||||||
// @Summary Update host SSH setting by file
|
// @Summary Update host SSH setting by file
|
||||||
// @Description 上传文件更新 SSH 配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SSHConf true "request"
|
// @Param request body dto.SSHConf true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/conffile/update [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/conffile/update [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 SSH 配置文件","formatEN":"update SSH conf"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 SSH 配置文件","formatEN":"update SSH conf"}
|
||||||
func (b *BaseApi) UpdateSSHByfile(c *gin.Context) {
|
func (b *BaseApi) UpdateSSHByfile(c *gin.Context) {
|
||||||
var req dto.SSHConf
|
var req dto.SSHConf
|
||||||
@@ -89,12 +90,12 @@ func (b *BaseApi) UpdateSSHByfile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags SSH
|
// @Tags SSH
|
||||||
// @Summary Generate host SSH secret
|
// @Summary Generate host SSH secret
|
||||||
// @Description 生成 SSH 密钥
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.GenerateSSH true "request"
|
// @Param request body dto.GenerateSSH true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/ssh/generate [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/ssh/generate [post]
|
||||||
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"生成 SSH 密钥 ","formatEN":"generate SSH secret"}
|
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"生成 SSH 密钥 ","formatEN":"generate SSH secret"}
|
||||||
func (b *BaseApi) GenerateSSH(c *gin.Context) {
|
func (b *BaseApi) GenerateSSH(c *gin.Context) {
|
||||||
var req dto.GenerateSSH
|
var req dto.GenerateSSH
|
||||||
@@ -111,12 +112,12 @@ func (b *BaseApi) GenerateSSH(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags SSH
|
// @Tags SSH
|
||||||
// @Summary Load host SSH secret
|
// @Summary Load host SSH secret
|
||||||
// @Description 获取 SSH 密钥
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.GenerateLoad true "request"
|
// @Param request body dto.GenerateLoad true "request"
|
||||||
// @Success 200
|
// @Success 200 {string} data
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/ssh/secret [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/ssh/secret [post]
|
||||||
func (b *BaseApi) LoadSSHSecret(c *gin.Context) {
|
func (b *BaseApi) LoadSSHSecret(c *gin.Context) {
|
||||||
var req dto.GenerateLoad
|
var req dto.GenerateLoad
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
@@ -133,19 +134,19 @@ func (b *BaseApi) LoadSSHSecret(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags SSH
|
// @Tags SSH
|
||||||
// @Summary Load host SSH logs
|
// @Summary Load host SSH logs
|
||||||
// @Description 获取 SSH 登录日志
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.SearchSSHLog true "request"
|
// @Param request body dto.SearchSSHLog true "request"
|
||||||
// @Success 200 {object} dto.SSHLog
|
// @Success 200 {object} dto.SSHLog
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/ssh/log [post]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/ssh/log [post]
|
||||||
func (b *BaseApi) LoadSSHLogs(c *gin.Context) {
|
func (b *BaseApi) LoadSSHLogs(c *gin.Context) {
|
||||||
var req dto.SearchSSHLog
|
var req dto.SearchSSHLog
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
data, err := sshService.LoadLog(req)
|
data, err := sshService.LoadLog(c, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
@@ -155,10 +156,10 @@ func (b *BaseApi) LoadSSHLogs(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags SSH
|
// @Tags SSH
|
||||||
// @Summary Load host SSH conf
|
// @Summary Load host SSH conf
|
||||||
// @Description 获取 SSH 配置文件
|
// @Success 200 {string} data
|
||||||
// @Success 200
|
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /host/ssh/conf [get]
|
// @Security Timestamp
|
||||||
|
// @Router /hosts/ssh/conf [get]
|
||||||
func (b *BaseApi) LoadSSHConf(c *gin.Context) {
|
func (b *BaseApi) LoadSSHConf(c *gin.Context) {
|
||||||
data, err := sshService.LoadSSHConf()
|
data, err := sshService.LoadSSHConf()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -68,12 +68,11 @@ func (b *BaseApi) WsSsh(c *gin.Context) {
|
|||||||
|
|
||||||
<-quitChan
|
<-quitChan
|
||||||
|
|
||||||
if wshandleError(wsConn, err) {
|
dt := time.Now().Add(time.Second)
|
||||||
return
|
_ = wsConn.WriteControl(websocket.CloseMessage, nil, dt)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseApi) RedisWsSsh(c *gin.Context) {
|
func (b *BaseApi) ContainerWsSSH(c *gin.Context) {
|
||||||
wsConn, err := upGrader.Upgrade(c.Writer, c.Request, nil)
|
wsConn, err := upGrader.Upgrade(c.Writer, c.Request, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
global.LOG.Errorf("gin context http handler failed, err: %v", err)
|
global.LOG.Errorf("gin context http handler failed, err: %v", err)
|
||||||
@@ -95,38 +94,30 @@ func (b *BaseApi) RedisWsSsh(c *gin.Context) {
|
|||||||
if wshandleError(wsConn, errors.WithMessage(err, "invalid param rows in request")) {
|
if wshandleError(wsConn, errors.WithMessage(err, "invalid param rows in request")) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
name := c.Query("name")
|
source := c.Query("source")
|
||||||
from := c.Query("from")
|
var containerID string
|
||||||
commands := []string{"redis-cli"}
|
var initCmd []string
|
||||||
database, err := databaseService.Get(name)
|
switch source {
|
||||||
if wshandleError(wsConn, errors.WithMessage(err, "no such database in db")) {
|
case "redis":
|
||||||
return
|
containerID, initCmd, err = loadRedisInitCmd(c)
|
||||||
}
|
case "ollama":
|
||||||
if from == "local" {
|
containerID, initCmd, err = loadOllamaInitCmd(c)
|
||||||
redisInfo, err := appInstallService.LoadConnInfo(dto.OperationWithNameAndType{Name: name, Type: "redis"})
|
case "container":
|
||||||
if wshandleError(wsConn, errors.WithMessage(err, "no such database in db")) {
|
containerID, initCmd, err = loadContainerInitCmd(c)
|
||||||
|
default:
|
||||||
|
if wshandleError(wsConn, fmt.Errorf("not support such source %s", source)) {
|
||||||
return
|
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(name)
|
|
||||||
itemCmds := append([]string{"exec", "-it", name}, commands...)
|
|
||||||
slave, err := terminal.NewCommand(itemCmds)
|
|
||||||
if wshandleError(wsConn, err) {
|
if wshandleError(wsConn, err) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer killBash(name, strings.Join(commands, " "), pidMap)
|
pidMap := loadMapFromDockerTop(containerID)
|
||||||
|
slave, err := terminal.NewCommand(initCmd)
|
||||||
|
if wshandleError(wsConn, err) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer killBash(containerID, strings.ReplaceAll(strings.Join(initCmd, " "), fmt.Sprintf("exec -it %s ", containerID), ""), pidMap)
|
||||||
defer slave.Close()
|
defer slave.Close()
|
||||||
|
|
||||||
tty, err := terminal.NewLocalWsSession(cols, rows, wsConn, slave, false)
|
tty, err := terminal.NewLocalWsSession(cols, rows, wsConn, slave, false)
|
||||||
@@ -141,83 +132,68 @@ func (b *BaseApi) RedisWsSsh(c *gin.Context) {
|
|||||||
<-quitChan
|
<-quitChan
|
||||||
|
|
||||||
global.LOG.Info("websocket finished")
|
global.LOG.Info("websocket finished")
|
||||||
if wshandleError(wsConn, err) {
|
dt := time.Now().Add(time.Second)
|
||||||
return
|
_ = wsConn.WriteControl(websocket.CloseMessage, nil, dt)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseApi) ContainerWsSsh(c *gin.Context) {
|
func loadRedisInitCmd(c *gin.Context) (string, []string, error) {
|
||||||
wsConn, err := upGrader.Upgrade(c.Writer, c.Request, nil)
|
name := c.Query("name")
|
||||||
|
from := c.Query("from")
|
||||||
|
commands := []string{"exec", "-it"}
|
||||||
|
database, err := databaseService.Get(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
global.LOG.Errorf("gin context http handler failed, err: %v", err)
|
return "", nil, fmt.Errorf("no such database in db, err: %v", err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
defer wsConn.Close()
|
if from == "local" {
|
||||||
|
redisInfo, err := appInstallService.LoadConnInfo(dto.OperationWithNameAndType{Name: name, Type: "redis"})
|
||||||
if global.CONF.System.IsDemo {
|
if err != nil {
|
||||||
if wshandleError(wsConn, errors.New(" demo server, prohibit this operation!")) {
|
return "", nil, fmt.Errorf("no such app in db, err: %v", err)
|
||||||
return
|
}
|
||||||
|
name = redisInfo.ContainerName
|
||||||
|
commands = append(commands, []string{name, "redis-cli"}...)
|
||||||
|
if len(database.Password) != 0 {
|
||||||
|
commands = append(commands, []string{"-a", database.Password, "--no-auth-warning"}...)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
name = "1Panel-redis-cli-tools"
|
||||||
|
commands = append(commands, []string{name, "redis-cli", "-h", database.Address, "-p", fmt.Sprintf("%v", database.Port)}...)
|
||||||
|
if len(database.Password) != 0 {
|
||||||
|
commands = append(commands, []string{"-a", database.Password, "--no-auth-warning"}...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return name, commands, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func loadOllamaInitCmd(c *gin.Context) (string, []string, error) {
|
||||||
|
name := c.Query("name")
|
||||||
|
if cmd.CheckIllegal(name) {
|
||||||
|
return "", nil, fmt.Errorf("ollama model %s contains illegal characters", name)
|
||||||
|
}
|
||||||
|
ollamaInfo, err := appInstallService.LoadConnInfo(dto.OperationWithNameAndType{Name: "", Type: "ollama"})
|
||||||
|
if err != nil {
|
||||||
|
return "", nil, fmt.Errorf("no such app in db, err: %v", err)
|
||||||
|
}
|
||||||
|
containerName := ollamaInfo.ContainerName
|
||||||
|
return containerName, []string{"exec", "-it", containerName, "ollama", "run", name}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func loadContainerInitCmd(c *gin.Context) (string, []string, error) {
|
||||||
containerID := c.Query("containerid")
|
containerID := c.Query("containerid")
|
||||||
command := c.Query("command")
|
command := c.Query("command")
|
||||||
user := c.Query("user")
|
user := c.Query("user")
|
||||||
if len(command) == 0 || len(containerID) == 0 {
|
|
||||||
if wshandleError(wsConn, errors.New("error param of command or containerID")) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cols, err := strconv.Atoi(c.DefaultQuery("cols", "80"))
|
|
||||||
if wshandleError(wsConn, errors.WithMessage(err, "invalid param cols in request")) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
rows, err := strconv.Atoi(c.DefaultQuery("rows", "40"))
|
|
||||||
if wshandleError(wsConn, errors.WithMessage(err, "invalid param rows in request")) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
cmds := []string{"exec", containerID, command}
|
|
||||||
if len(user) != 0 {
|
|
||||||
cmds = []string{"exec", "-u", user, containerID, command}
|
|
||||||
}
|
|
||||||
if cmd.CheckIllegal(user, containerID, command) {
|
if cmd.CheckIllegal(user, containerID, command) {
|
||||||
if wshandleError(wsConn, errors.New(" The command contains illegal characters.")) {
|
return "", nil, fmt.Errorf("the command contains illegal characters. command: %s, user: %s, containerID: %s", command, user, containerID)
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
stdout, err := cmd.ExecWithCheck("docker", cmds...)
|
if len(command) == 0 || len(containerID) == 0 {
|
||||||
if wshandleError(wsConn, errors.WithMessage(err, stdout)) {
|
return "", nil, fmt.Errorf("error param of command: %s or containerID: %s", command, containerID)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
commands := []string{"exec", "-it", containerID, command}
|
commands := []string{"exec", "-it", containerID, command}
|
||||||
if len(user) != 0 {
|
if len(user) != 0 {
|
||||||
commands = []string{"exec", "-it", "-u", user, containerID, command}
|
commands = []string{"exec", "-it", "-u", user, containerID, command}
|
||||||
}
|
}
|
||||||
pidMap := loadMapFromDockerTop(containerID)
|
|
||||||
slave, err := terminal.NewCommand(commands)
|
|
||||||
if wshandleError(wsConn, err) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
defer killBash(containerID, command, pidMap)
|
|
||||||
defer slave.Close()
|
|
||||||
|
|
||||||
tty, err := terminal.NewLocalWsSession(cols, rows, wsConn, slave, true)
|
return containerID, commands, nil
|
||||||
if wshandleError(wsConn, err) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
quitChan := make(chan bool, 3)
|
|
||||||
tty.Start(quitChan)
|
|
||||||
go slave.Wait(quitChan)
|
|
||||||
|
|
||||||
<-quitChan
|
|
||||||
|
|
||||||
global.LOG.Info("websocket finished")
|
|
||||||
if wshandleError(wsConn, err) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func wshandleError(ws *websocket.Conn, err error) bool {
|
func wshandleError(ws *websocket.Conn, err error) bool {
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import (
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Load upgrade info
|
// @Summary Load upgrade info
|
||||||
// @Description 系统更新信息
|
|
||||||
// @Success 200 {object} dto.UpgradeInfo
|
// @Success 200 {object} dto.UpgradeInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/upgrade [get]
|
// @Router /settings/upgrade [get]
|
||||||
func (b *BaseApi) GetUpgradeInfo(c *gin.Context) {
|
func (b *BaseApi) GetUpgradeInfo(c *gin.Context) {
|
||||||
info, err := upgradeService.SearchUpgrade()
|
info, err := upgradeService.SearchUpgrade()
|
||||||
@@ -24,11 +24,11 @@ func (b *BaseApi) GetUpgradeInfo(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Load release notes by version
|
// @Summary Load release notes by version
|
||||||
// @Description 获取版本 release notes
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.Upgrade true "request"
|
// @Param request body dto.Upgrade true "request"
|
||||||
// @Success 200
|
// @Success 200 {string} notes
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/upgrade [get]
|
// @Router /settings/upgrade [get]
|
||||||
func (b *BaseApi) GetNotesByVersion(c *gin.Context) {
|
func (b *BaseApi) GetNotesByVersion(c *gin.Context) {
|
||||||
var req dto.Upgrade
|
var req dto.Upgrade
|
||||||
@@ -46,11 +46,11 @@ func (b *BaseApi) GetNotesByVersion(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags System Setting
|
// @Tags System Setting
|
||||||
// @Summary Upgrade
|
// @Summary Upgrade
|
||||||
// @Description 系统更新
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.Upgrade true "request"
|
// @Param request body dto.Upgrade true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /settings/upgrade [post]
|
// @Router /settings/upgrade [post]
|
||||||
// @x-panel-log {"bodyKeys":["version"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新系统 => [version]","formatEN":"upgrade system => [version]"}
|
// @x-panel-log {"bodyKeys":["version"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新系统 => [version]","formatEN":"upgrade system => [version]"}
|
||||||
func (b *BaseApi) Upgrade(c *gin.Context) {
|
func (b *BaseApi) Upgrade(c *gin.Context) {
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Page websites
|
// @Summary Page websites
|
||||||
// @Description 获取网站列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteSearch true "request"
|
// @Param request body request.WebsiteSearch true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/search [post]
|
// @Router /websites/search [post]
|
||||||
func (b *BaseApi) PageWebsite(c *gin.Context) {
|
func (b *BaseApi) PageWebsite(c *gin.Context) {
|
||||||
var req request.WebsiteSearch
|
var req request.WebsiteSearch
|
||||||
@@ -36,9 +36,9 @@ func (b *BaseApi) PageWebsite(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary List websites
|
// @Summary List websites
|
||||||
// @Description 获取网站列表
|
|
||||||
// @Success 200 {array} response.WebsiteDTO
|
// @Success 200 {array} response.WebsiteDTO
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/list [get]
|
// @Router /websites/list [get]
|
||||||
func (b *BaseApi) GetWebsites(c *gin.Context) {
|
func (b *BaseApi) GetWebsites(c *gin.Context) {
|
||||||
websites, err := websiteService.GetWebsites()
|
websites, err := websiteService.GetWebsites()
|
||||||
@@ -51,9 +51,9 @@ func (b *BaseApi) GetWebsites(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary List website names
|
// @Summary List website names
|
||||||
// @Description 获取网站列表
|
// @Success 200 {array} response.WebsiteOption
|
||||||
// @Success 200 {array} string
|
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/options [get]
|
// @Router /websites/options [get]
|
||||||
func (b *BaseApi) GetWebsiteOptions(c *gin.Context) {
|
func (b *BaseApi) GetWebsiteOptions(c *gin.Context) {
|
||||||
websites, err := websiteService.GetWebsiteOptions()
|
websites, err := websiteService.GetWebsiteOptions()
|
||||||
@@ -66,11 +66,11 @@ func (b *BaseApi) GetWebsiteOptions(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Create website
|
// @Summary Create website
|
||||||
// @Description 创建网站
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteCreate true "request"
|
// @Param request body request.WebsiteCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites [post]
|
// @Router /websites [post]
|
||||||
// @x-panel-log {"bodyKeys":["primaryDomain"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 [primaryDomain]","formatEN":"Create website [primaryDomain]"}
|
// @x-panel-log {"bodyKeys":["primaryDomain"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 [primaryDomain]","formatEN":"Create website [primaryDomain]"}
|
||||||
func (b *BaseApi) CreateWebsite(c *gin.Context) {
|
func (b *BaseApi) CreateWebsite(c *gin.Context) {
|
||||||
@@ -96,11 +96,11 @@ func (b *BaseApi) CreateWebsite(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Operate website
|
// @Summary Operate website
|
||||||
// @Description 操作网站
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteOp true "request"
|
// @Param request body request.WebsiteOp true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/operate [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) OpWebsite(c *gin.Context) {
|
||||||
@@ -118,11 +118,11 @@ func (b *BaseApi) OpWebsite(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Delete website
|
// @Summary Delete website
|
||||||
// @Description 删除网站
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteDelete true "request"
|
// @Param request body request.WebsiteDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteWebsite(c *gin.Context) {
|
||||||
@@ -140,11 +140,11 @@ func (b *BaseApi) DeleteWebsite(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Update website
|
// @Summary Update website
|
||||||
// @Description 更新网站
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteUpdate true "request"
|
// @Param request body request.WebsiteUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/update [post]
|
// @Router /websites/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["primaryDomain"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新网站 [primaryDomain]","formatEN":"Update website [primaryDomain]"}
|
// @x-panel-log {"bodyKeys":["primaryDomain"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新网站 [primaryDomain]","formatEN":"Update website [primaryDomain]"}
|
||||||
func (b *BaseApi) UpdateWebsite(c *gin.Context) {
|
func (b *BaseApi) UpdateWebsite(c *gin.Context) {
|
||||||
@@ -161,12 +161,12 @@ func (b *BaseApi) UpdateWebsite(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Search website by id
|
// @Summary Search website by id
|
||||||
// @Description 通过 id 查询网站
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param id path integer true "request"
|
// @Param id path integer true "request"
|
||||||
// @Success 200 {object} response.WebsiteDTO
|
// @Success 200 {object} response.WebsiteDTO
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /websites/:id [get]
|
// @Security Timestamp
|
||||||
|
// @Router /websites/{id} [get]
|
||||||
func (b *BaseApi) GetWebsite(c *gin.Context) {
|
func (b *BaseApi) GetWebsite(c *gin.Context) {
|
||||||
id, err := helper.GetParamID(c)
|
id, err := helper.GetParamID(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -183,12 +183,13 @@ func (b *BaseApi) GetWebsite(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website Nginx
|
// @Tags Website Nginx
|
||||||
// @Summary Search website nginx by id
|
// @Summary Search website nginx by id
|
||||||
// @Description 通过 id 查询网站 nginx
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param id path integer true "request"
|
// @Param id path integer true "request"
|
||||||
|
// @Param type path string true "type"
|
||||||
// @Success 200 {object} response.FileInfo
|
// @Success 200 {object} response.FileInfo
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /websites/:id/config/:type [get]
|
// @Security Timestamp
|
||||||
|
// @Router /websites/{id}/config/{type} [get]
|
||||||
func (b *BaseApi) GetWebsiteNginx(c *gin.Context) {
|
func (b *BaseApi) GetWebsiteNginx(c *gin.Context) {
|
||||||
id, err := helper.GetParamID(c)
|
id, err := helper.GetParamID(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -207,11 +208,11 @@ func (b *BaseApi) GetWebsiteNginx(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website Nginx
|
// @Tags Website Nginx
|
||||||
// @Summary Load nginx conf
|
// @Summary Load nginx conf
|
||||||
// @Description 获取 nginx 配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxScopeReq true "request"
|
// @Param request body request.NginxScopeReq true "request"
|
||||||
// @Success 200 {object} response.WebsiteNginxConfig
|
// @Success 200 {object} response.WebsiteNginxConfig
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/config [post]
|
// @Router /websites/config [post]
|
||||||
func (b *BaseApi) GetNginxConfig(c *gin.Context) {
|
func (b *BaseApi) GetNginxConfig(c *gin.Context) {
|
||||||
var req request.NginxScopeReq
|
var req request.NginxScopeReq
|
||||||
@@ -228,11 +229,11 @@ func (b *BaseApi) GetNginxConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website Nginx
|
// @Tags Website Nginx
|
||||||
// @Summary Update nginx conf
|
// @Summary Update nginx conf
|
||||||
// @Description 更新 nginx 配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxConfigUpdate true "request"
|
// @Param request body request.NginxConfigUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/config/update [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdateNginxConfig(c *gin.Context) {
|
||||||
@@ -249,12 +250,12 @@ func (b *BaseApi) UpdateNginxConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website HTTPS
|
// @Tags Website HTTPS
|
||||||
// @Summary Load https conf
|
// @Summary Load https conf
|
||||||
// @Description 获取 https 配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param id path integer true "request"
|
// @Param id path integer true "request"
|
||||||
// @Success 200 {object} response.WebsiteHTTPS
|
// @Success 200 {object} response.WebsiteHTTPS
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /websites/:id/https [get]
|
// @Security Timestamp
|
||||||
|
// @Router /websites/{id}/https [get]
|
||||||
func (b *BaseApi) GetHTTPSConfig(c *gin.Context) {
|
func (b *BaseApi) GetHTTPSConfig(c *gin.Context) {
|
||||||
id, err := helper.GetParamID(c)
|
id, err := helper.GetParamID(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -271,12 +272,13 @@ func (b *BaseApi) GetHTTPSConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website HTTPS
|
// @Tags Website HTTPS
|
||||||
// @Summary Update https conf
|
// @Summary Update https conf
|
||||||
// @Description 更新 https 配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
|
// @Param id path integer true "request"
|
||||||
// @Param request body request.WebsiteHTTPSOp true "request"
|
// @Param request body request.WebsiteHTTPSOp true "request"
|
||||||
// @Success 200 {object} response.WebsiteHTTPS
|
// @Success 200 {object} response.WebsiteHTTPS
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /websites/:id/https [post]
|
// @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"}
|
// @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) {
|
func (b *BaseApi) UpdateHTTPSConfig(c *gin.Context) {
|
||||||
var req request.WebsiteHTTPSOp
|
var req request.WebsiteHTTPSOp
|
||||||
@@ -296,11 +298,11 @@ func (b *BaseApi) UpdateHTTPSConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Check before create website
|
// @Summary Check before create website
|
||||||
// @Description 网站创建前检查
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteInstallCheckReq true "request"
|
// @Param request body request.WebsiteInstallCheckReq true "request"
|
||||||
// @Success 200 {array} response.WebsitePreInstallCheck
|
// @Success 200 {array} response.WebsitePreInstallCheck
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/check [post]
|
// @Router /websites/check [post]
|
||||||
func (b *BaseApi) CreateWebsiteCheck(c *gin.Context) {
|
func (b *BaseApi) CreateWebsiteCheck(c *gin.Context) {
|
||||||
var req request.WebsiteInstallCheckReq
|
var req request.WebsiteInstallCheckReq
|
||||||
@@ -317,11 +319,11 @@ func (b *BaseApi) CreateWebsiteCheck(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website Nginx
|
// @Tags Website Nginx
|
||||||
// @Summary Update website nginx conf
|
// @Summary Update website nginx conf
|
||||||
// @Description 更新 网站 nginx 配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteNginxUpdate true "request"
|
// @Param request body request.WebsiteNginxUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/nginx/update [post]
|
// @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"}
|
// @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) {
|
func (b *BaseApi) UpdateWebsiteNginxConfig(c *gin.Context) {
|
||||||
@@ -338,11 +340,11 @@ func (b *BaseApi) UpdateWebsiteNginxConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Operate website log
|
// @Summary Operate website log
|
||||||
// @Description 操作网站日志
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteLogReq true "request"
|
// @Param request body request.WebsiteLogReq true "request"
|
||||||
// @Success 200 {object} response.WebsiteLog
|
// @Success 200 {object} response.WebsiteLog
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/log [post]
|
// @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"}
|
// @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) {
|
func (b *BaseApi) OpWebsiteLog(c *gin.Context) {
|
||||||
@@ -360,11 +362,11 @@ func (b *BaseApi) OpWebsiteLog(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Change default server
|
// @Summary Change default server
|
||||||
// @Description 操作网站日志
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteDefaultUpdate true "request"
|
// @Param request body request.WebsiteDefaultUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/default/server [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) ChangeDefaultServer(c *gin.Context) {
|
||||||
@@ -381,12 +383,12 @@ func (b *BaseApi) ChangeDefaultServer(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Load website php conf
|
// @Summary Load website php conf
|
||||||
// @Description 获取网站 php 配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param id path integer true "request"
|
// @Param id path integer true "request"
|
||||||
// @Success 200 {object} response.PHPConfig
|
// @Success 200 {object} response.PHPConfig
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /websites/php/config/:id [get]
|
// @Security Timestamp
|
||||||
|
// @Router /websites/php/config/{id} [get]
|
||||||
func (b *BaseApi) GetWebsitePHPConfig(c *gin.Context) {
|
func (b *BaseApi) GetWebsitePHPConfig(c *gin.Context) {
|
||||||
id, err := helper.GetParamID(c)
|
id, err := helper.GetParamID(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -403,11 +405,11 @@ func (b *BaseApi) GetWebsitePHPConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website PHP
|
// @Tags Website PHP
|
||||||
// @Summary Update website php conf
|
// @Summary Update website php conf
|
||||||
// @Description 更新 网站 PHP 配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsitePHPConfigUpdate true "request"
|
// @Param request body request.WebsitePHPConfigUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/php/config [post]
|
// @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"}
|
// @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) {
|
func (b *BaseApi) UpdateWebsitePHPConfig(c *gin.Context) {
|
||||||
@@ -424,11 +426,11 @@ func (b *BaseApi) UpdateWebsitePHPConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website PHP
|
// @Tags Website PHP
|
||||||
// @Summary Update php conf
|
// @Summary Update php conf
|
||||||
// @Description 更新 php 配置文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsitePHPFileUpdate true "request"
|
// @Param request body request.WebsitePHPFileUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/php/update [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdatePHPFile(c *gin.Context) {
|
||||||
@@ -445,11 +447,11 @@ func (b *BaseApi) UpdatePHPFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website PHP
|
// @Tags Website PHP
|
||||||
// @Summary Update php version
|
// @Summary Update php version
|
||||||
// @Description 变更 php 版本
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsitePHPVersionReq true "request"
|
// @Param request body request.WebsitePHPVersionReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/php/version [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) ChangePHPVersion(c *gin.Context) {
|
||||||
@@ -466,11 +468,11 @@ func (b *BaseApi) ChangePHPVersion(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Get rewrite conf
|
// @Summary Get rewrite conf
|
||||||
// @Description 获取伪静态配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxRewriteReq true "request"
|
// @Param request body request.NginxRewriteReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} response.NginxRewriteRes
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/rewrite [post]
|
// @Router /websites/rewrite [post]
|
||||||
func (b *BaseApi) GetRewriteConfig(c *gin.Context) {
|
func (b *BaseApi) GetRewriteConfig(c *gin.Context) {
|
||||||
var req request.NginxRewriteReq
|
var req request.NginxRewriteReq
|
||||||
@@ -487,11 +489,11 @@ func (b *BaseApi) GetRewriteConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Update rewrite conf
|
// @Summary Update rewrite conf
|
||||||
// @Description 更新伪静态配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxRewriteUpdate true "request"
|
// @Param request body request.NginxRewriteUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/rewrite/update [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdateRewriteConfig(c *gin.Context) {
|
||||||
@@ -508,11 +510,11 @@ func (b *BaseApi) UpdateRewriteConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Update Site Dir
|
// @Summary Update Site Dir
|
||||||
// @Description 更新网站目录
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteUpdateDir true "request"
|
// @Param request body request.WebsiteUpdateDir true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/dir/update [post]
|
// @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"}
|
// @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) {
|
func (b *BaseApi) UpdateSiteDir(c *gin.Context) {
|
||||||
@@ -529,11 +531,11 @@ func (b *BaseApi) UpdateSiteDir(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Update Site Dir permission
|
// @Summary Update Site Dir permission
|
||||||
// @Description 更新网站目录权限
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteUpdateDirPermission true "request"
|
// @Param request body request.WebsiteUpdateDirPermission true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/dir/permission [post]
|
// @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"}
|
// @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) {
|
func (b *BaseApi) UpdateSiteDirPermission(c *gin.Context) {
|
||||||
@@ -550,11 +552,11 @@ func (b *BaseApi) UpdateSiteDirPermission(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Get proxy conf
|
// @Summary Get proxy conf
|
||||||
// @Description 获取反向代理配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteProxyReq true "request"
|
// @Param request body request.WebsiteProxyReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {array} request.WebsiteProxyConfig
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/proxies [post]
|
// @Router /websites/proxies [post]
|
||||||
func (b *BaseApi) GetProxyConfig(c *gin.Context) {
|
func (b *BaseApi) GetProxyConfig(c *gin.Context) {
|
||||||
var req request.WebsiteProxyReq
|
var req request.WebsiteProxyReq
|
||||||
@@ -569,13 +571,35 @@ func (b *BaseApi) GetProxyConfig(c *gin.Context) {
|
|||||||
helper.SuccessWithData(c, res)
|
helper.SuccessWithData(c, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Tags Website
|
||||||
|
// @Summary Delete proxy conf
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body request.WebsiteProxyDel true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /websites/proxies/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 domain [domain] proxy config"}
|
||||||
|
func (b *BaseApi) DeleteProxyConfig(c *gin.Context) {
|
||||||
|
var req request.WebsiteProxyDel
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err := websiteService.DeleteProxy(req)
|
||||||
|
if err != nil {
|
||||||
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithOutData(c)
|
||||||
|
}
|
||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Update proxy conf
|
// @Summary Update proxy conf
|
||||||
// @Description 修改反向代理配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteProxyConfig true "request"
|
// @Param request body request.WebsiteProxyConfig true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/proxies/update [post]
|
// @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"}
|
// @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) {
|
func (b *BaseApi) UpdateProxyConfig(c *gin.Context) {
|
||||||
@@ -593,11 +617,11 @@ func (b *BaseApi) UpdateProxyConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Update proxy file
|
// @Summary Update proxy file
|
||||||
// @Description 更新反向代理文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxProxyUpdate true "request"
|
// @Param request body request.NginxProxyUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/proxy/file [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdateProxyConfigFile(c *gin.Context) {
|
||||||
@@ -614,11 +638,11 @@ func (b *BaseApi) UpdateProxyConfigFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Get AuthBasic conf
|
// @Summary Get AuthBasic conf
|
||||||
// @Description 获取密码访问配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxAuthReq true "request"
|
// @Param request body request.NginxAuthReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} response.NginxAuthRes
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/auths [post]
|
// @Router /websites/auths [post]
|
||||||
func (b *BaseApi) GetAuthConfig(c *gin.Context) {
|
func (b *BaseApi) GetAuthConfig(c *gin.Context) {
|
||||||
var req request.NginxAuthReq
|
var req request.NginxAuthReq
|
||||||
@@ -635,11 +659,11 @@ func (b *BaseApi) GetAuthConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Get AuthBasic conf
|
// @Summary Get AuthBasic conf
|
||||||
// @Description 更新密码访问配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxAuthUpdate true "request"
|
// @Param request body request.NginxAuthUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/auths/update [post]
|
// @Router /websites/auths/update [post]
|
||||||
func (b *BaseApi) UpdateAuthConfig(c *gin.Context) {
|
func (b *BaseApi) UpdateAuthConfig(c *gin.Context) {
|
||||||
var req request.NginxAuthUpdate
|
var req request.NginxAuthUpdate
|
||||||
@@ -655,11 +679,11 @@ func (b *BaseApi) UpdateAuthConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Get AntiLeech conf
|
// @Summary Get AntiLeech conf
|
||||||
// @Description 获取防盗链配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxCommonReq true "request"
|
// @Param request body request.NginxCommonReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} response.NginxAntiLeechRes
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/leech [post]
|
// @Router /websites/leech [post]
|
||||||
func (b *BaseApi) GetAntiLeech(c *gin.Context) {
|
func (b *BaseApi) GetAntiLeech(c *gin.Context) {
|
||||||
var req request.NginxCommonReq
|
var req request.NginxCommonReq
|
||||||
@@ -675,12 +699,12 @@ func (b *BaseApi) GetAntiLeech(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Update AntiLeech
|
// @Summary Update AntiLeech conf
|
||||||
// @Description 更新防盗链配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxAntiLeechUpdate true "request"
|
// @Param request body request.NginxAntiLeechUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/leech/update [post]
|
// @Router /websites/leech/update [post]
|
||||||
func (b *BaseApi) UpdateAntiLeech(c *gin.Context) {
|
func (b *BaseApi) UpdateAntiLeech(c *gin.Context) {
|
||||||
var req request.NginxAntiLeechUpdate
|
var req request.NginxAntiLeechUpdate
|
||||||
@@ -696,11 +720,11 @@ func (b *BaseApi) UpdateAntiLeech(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Update redirect conf
|
// @Summary Update redirect conf
|
||||||
// @Description 修改重定向配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxRedirectReq true "request"
|
// @Param request body request.NginxRedirectReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/redirect/update [post]
|
// @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"}
|
// @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) {
|
func (b *BaseApi) UpdateRedirectConfig(c *gin.Context) {
|
||||||
@@ -718,11 +742,11 @@ func (b *BaseApi) UpdateRedirectConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Get redirect conf
|
// @Summary Get redirect conf
|
||||||
// @Description 获取重定向配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteProxyReq true "request"
|
// @Param request body request.WebsiteProxyReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {array} response.NginxRedirectConfig
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/redirect [post]
|
// @Router /websites/redirect [post]
|
||||||
func (b *BaseApi) GetRedirectConfig(c *gin.Context) {
|
func (b *BaseApi) GetRedirectConfig(c *gin.Context) {
|
||||||
var req request.WebsiteRedirectReq
|
var req request.WebsiteRedirectReq
|
||||||
@@ -739,11 +763,11 @@ func (b *BaseApi) GetRedirectConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Update redirect file
|
// @Summary Update redirect file
|
||||||
// @Description 更新重定向文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.NginxRedirectUpdate true "request"
|
// @Param request body request.NginxRedirectUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/redirect/file [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdateRedirectConfigFile(c *gin.Context) {
|
||||||
@@ -760,11 +784,11 @@ func (b *BaseApi) UpdateRedirectConfigFile(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Get website dir
|
// @Summary Get website dir
|
||||||
// @Description 获取网站目录配置
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteCommonReq true "request"
|
// @Param request body request.WebsiteCommonReq true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} response.WebsiteDirConfig
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/dir [post]
|
// @Router /websites/dir [post]
|
||||||
func (b *BaseApi) GetDirConfig(c *gin.Context) {
|
func (b *BaseApi) GetDirConfig(c *gin.Context) {
|
||||||
var req request.WebsiteCommonReq
|
var req request.WebsiteCommonReq
|
||||||
@@ -781,11 +805,12 @@ func (b *BaseApi) GetDirConfig(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Get default html
|
// @Summary Get default html
|
||||||
// @Description 获取默认 html
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Success 200 {object} response.FileInfo
|
// @Param type path string true "type"
|
||||||
|
// @Success 200 {object} response.WebsiteHtmlRes
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /websites/default/html/:type [get]
|
// @Security Timestamp
|
||||||
|
// @Router /websites/default/html/{type} [get]
|
||||||
func (b *BaseApi) GetDefaultHtml(c *gin.Context) {
|
func (b *BaseApi) GetDefaultHtml(c *gin.Context) {
|
||||||
resourceType, err := helper.GetStrParamByKey(c, "type")
|
resourceType, err := helper.GetStrParamByKey(c, "type")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -802,11 +827,11 @@ func (b *BaseApi) GetDefaultHtml(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website
|
// @Tags Website
|
||||||
// @Summary Update default html
|
// @Summary Update default html
|
||||||
// @Description 更新默认 html
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteHtmlUpdate true "request"
|
// @Param request body request.WebsiteHtmlUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/default/html/update [post]
|
// @Router /websites/default/html/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新默认 html","formatEN":"Update default html"}
|
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新默认 html","formatEN":"Update default html"}
|
||||||
func (b *BaseApi) UpdateDefaultHtml(c *gin.Context) {
|
func (b *BaseApi) UpdateDefaultHtml(c *gin.Context) {
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Website Acme
|
// @Tags Website Acme
|
||||||
// @Summary Page website acme accounts
|
// @Summary Page website acme accounts
|
||||||
// @Description 获取网站 acme 列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PageInfo true "request"
|
// @Param request body dto.PageInfo true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/acme/search [post]
|
// @Router /websites/acme/search [post]
|
||||||
func (b *BaseApi) PageWebsiteAcmeAccount(c *gin.Context) {
|
func (b *BaseApi) PageWebsiteAcmeAccount(c *gin.Context) {
|
||||||
var req dto.PageInfo
|
var req dto.PageInfo
|
||||||
@@ -34,11 +34,11 @@ func (b *BaseApi) PageWebsiteAcmeAccount(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website Acme
|
// @Tags Website Acme
|
||||||
// @Summary Create website acme account
|
// @Summary Create website acme account
|
||||||
// @Description 创建网站 acme
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteAcmeAccountCreate true "request"
|
// @Param request body request.WebsiteAcmeAccountCreate true "request"
|
||||||
// @Success 200 {object} response.WebsiteAcmeAccountDTO
|
// @Success 200 {object} response.WebsiteAcmeAccountDTO
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/acme [post]
|
// @Router /websites/acme [post]
|
||||||
// @x-panel-log {"bodyKeys":["email"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 acme [email]","formatEN":"Create website acme [email]"}
|
// @x-panel-log {"bodyKeys":["email"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 acme [email]","formatEN":"Create website acme [email]"}
|
||||||
func (b *BaseApi) CreateWebsiteAcmeAccount(c *gin.Context) {
|
func (b *BaseApi) CreateWebsiteAcmeAccount(c *gin.Context) {
|
||||||
@@ -56,11 +56,11 @@ func (b *BaseApi) CreateWebsiteAcmeAccount(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website Acme
|
// @Tags Website Acme
|
||||||
// @Summary Delete website acme account
|
// @Summary Delete website acme account
|
||||||
// @Description 删除网站 acme
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteResourceReq true "request"
|
// @Param request body request.WebsiteResourceReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/acme/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteWebsiteAcmeAccount(c *gin.Context) {
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Website CA
|
// @Tags Website CA
|
||||||
// @Summary Page website ca
|
// @Summary Page website ca
|
||||||
// @Description 获取网站 ca 列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteCASearch true "request"
|
// @Param request body request.WebsiteCASearch true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ca/search [post]
|
// @Router /websites/ca/search [post]
|
||||||
func (b *BaseApi) PageWebsiteCA(c *gin.Context) {
|
func (b *BaseApi) PageWebsiteCA(c *gin.Context) {
|
||||||
var req request.WebsiteCASearch
|
var req request.WebsiteCASearch
|
||||||
@@ -37,11 +37,11 @@ func (b *BaseApi) PageWebsiteCA(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website CA
|
// @Tags Website CA
|
||||||
// @Summary Create website ca
|
// @Summary Create website ca
|
||||||
// @Description 创建网站 ca
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteCACreate true "request"
|
// @Param request body request.WebsiteCACreate true "request"
|
||||||
// @Success 200 {object} request.WebsiteCACreate
|
// @Success 200 {object} request.WebsiteCACreate
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ca [post]
|
// @Router /websites/ca [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 ca [name]","formatEN":"Create website ca [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 ca [name]","formatEN":"Create website ca [name]"}
|
||||||
func (b *BaseApi) CreateWebsiteCA(c *gin.Context) {
|
func (b *BaseApi) CreateWebsiteCA(c *gin.Context) {
|
||||||
@@ -59,11 +59,11 @@ func (b *BaseApi) CreateWebsiteCA(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website CA
|
// @Tags Website CA
|
||||||
// @Summary Get website ca
|
// @Summary Get website ca
|
||||||
// @Description 获取网站 ca
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param id path int true "id"
|
// @Param id path int true "id"
|
||||||
// @Success 200 {object} response.WebsiteCADTO
|
// @Success 200 {object} response.WebsiteCADTO
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ca/{id} [get]
|
// @Router /websites/ca/{id} [get]
|
||||||
func (b *BaseApi) GetWebsiteCA(c *gin.Context) {
|
func (b *BaseApi) GetWebsiteCA(c *gin.Context) {
|
||||||
id, err := helper.GetParamID(c)
|
id, err := helper.GetParamID(c)
|
||||||
@@ -80,11 +80,11 @@ func (b *BaseApi) GetWebsiteCA(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website CA
|
// @Tags Website CA
|
||||||
// @Summary Delete website ca
|
// @Summary Delete website ca
|
||||||
// @Description 删除网站 ca
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteCommonReq true "request"
|
// @Param request body request.WebsiteCommonReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ca/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteWebsiteCA(c *gin.Context) {
|
||||||
@@ -101,11 +101,11 @@ func (b *BaseApi) DeleteWebsiteCA(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website CA
|
// @Tags Website CA
|
||||||
// @Summary Obtain SSL
|
// @Summary Obtain SSL
|
||||||
// @Description 自签 SSL 证书
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteCAObtain true "request"
|
// @Param request body request.WebsiteCAObtain true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ca/obtain [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) ObtainWebsiteCA(c *gin.Context) {
|
||||||
@@ -121,12 +121,12 @@ func (b *BaseApi) ObtainWebsiteCA(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Website CA
|
// @Tags Website CA
|
||||||
// @Summary Obtain SSL
|
// @Summary Renew Obtain SSL
|
||||||
// @Description 续签 SSL 证书
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteCAObtain true "request"
|
// @Param request body request.WebsiteCAObtain true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ca/renew [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) RenewWebsiteCA(c *gin.Context) {
|
||||||
@@ -148,11 +148,11 @@ func (b *BaseApi) RenewWebsiteCA(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website CA
|
// @Tags Website CA
|
||||||
// @Summary Download CA file
|
// @Summary Download CA file
|
||||||
// @Description 下载 CA 证书文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteResourceReq true "request"
|
// @Param request body request.WebsiteResourceReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ca/download [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DownloadCAFile(c *gin.Context) {
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Website DNS
|
// @Tags Website DNS
|
||||||
// @Summary Page website dns accounts
|
// @Summary Page website dns accounts
|
||||||
// @Description 获取网站 dns 列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body dto.PageInfo true "request"
|
// @Param request body dto.PageInfo true "request"
|
||||||
// @Success 200 {object} dto.PageResult
|
// @Success 200 {object} dto.PageResult
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/dns/search [post]
|
// @Router /websites/dns/search [post]
|
||||||
func (b *BaseApi) PageWebsiteDnsAccount(c *gin.Context) {
|
func (b *BaseApi) PageWebsiteDnsAccount(c *gin.Context) {
|
||||||
var req dto.PageInfo
|
var req dto.PageInfo
|
||||||
@@ -34,11 +34,11 @@ func (b *BaseApi) PageWebsiteDnsAccount(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website DNS
|
// @Tags Website DNS
|
||||||
// @Summary Create website dns account
|
// @Summary Create website dns account
|
||||||
// @Description 创建网站 dns
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteDnsAccountCreate true "request"
|
// @Param request body request.WebsiteDnsAccountCreate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/dns [post]
|
// @Router /websites/dns [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 dns [name]","formatEN":"Create website dns [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 dns [name]","formatEN":"Create website dns [name]"}
|
||||||
func (b *BaseApi) CreateWebsiteDnsAccount(c *gin.Context) {
|
func (b *BaseApi) CreateWebsiteDnsAccount(c *gin.Context) {
|
||||||
@@ -55,11 +55,11 @@ func (b *BaseApi) CreateWebsiteDnsAccount(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website DNS
|
// @Tags Website DNS
|
||||||
// @Summary Update website dns account
|
// @Summary Update website dns account
|
||||||
// @Description 更新网站 dns
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteDnsAccountUpdate true "request"
|
// @Param request body request.WebsiteDnsAccountUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/dns/update [post]
|
// @Router /websites/dns/update [post]
|
||||||
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新网站 dns [name]","formatEN":"Update website dns [name]"}
|
// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"更新网站 dns [name]","formatEN":"Update website dns [name]"}
|
||||||
func (b *BaseApi) UpdateWebsiteDnsAccount(c *gin.Context) {
|
func (b *BaseApi) UpdateWebsiteDnsAccount(c *gin.Context) {
|
||||||
@@ -76,11 +76,11 @@ func (b *BaseApi) UpdateWebsiteDnsAccount(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website DNS
|
// @Tags Website DNS
|
||||||
// @Summary Delete website dns account
|
// @Summary Delete website dns account
|
||||||
// @Description 删除网站 dns
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteResourceReq true "request"
|
// @Param request body request.WebsiteResourceReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/dns/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteWebsiteDnsAccount(c *gin.Context) {
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Website Domain
|
// @Tags Website Domain
|
||||||
// @Summary Delete website domain
|
// @Summary Delete website domain
|
||||||
// @Description 删除网站域名
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteDomainDelete true "request"
|
// @Param request body request.WebsiteDomainDelete true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/domains/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteWebDomain(c *gin.Context) {
|
||||||
@@ -30,11 +30,11 @@ func (b *BaseApi) DeleteWebDomain(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website Domain
|
// @Tags Website Domain
|
||||||
// @Summary Create website domain
|
// @Summary Create website domain
|
||||||
// @Description 创建网站域名
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteDomainCreate true "request"
|
// @Param request body request.WebsiteDomainCreate true "request"
|
||||||
// @Success 200 {object} model.WebsiteDomain
|
// @Success 200 {array} model.WebsiteDomain
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/domains [post]
|
// @Router /websites/domains [post]
|
||||||
// @x-panel-log {"bodyKeys":["domain"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建域名 [domain]","formatEN":"Create domain [domain]"}
|
// @x-panel-log {"bodyKeys":["domain"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建域名 [domain]","formatEN":"Create domain [domain]"}
|
||||||
func (b *BaseApi) CreateWebDomain(c *gin.Context) {
|
func (b *BaseApi) CreateWebDomain(c *gin.Context) {
|
||||||
@@ -52,12 +52,12 @@ func (b *BaseApi) CreateWebDomain(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website Domain
|
// @Tags Website Domain
|
||||||
// @Summary Search website domains by websiteId
|
// @Summary Search website domains by websiteId
|
||||||
// @Description 通过网站 id 查询域名
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param websiteId path integer true "request"
|
// @Param websiteId path integer true "request"
|
||||||
// @Success 200 {array} model.WebsiteDomain
|
// @Success 200 {array} model.WebsiteDomain
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /websites/domains/:websiteId [get]
|
// @Security Timestamp
|
||||||
|
// @Router /websites/domains/{websiteId} [get]
|
||||||
func (b *BaseApi) GetWebDomains(c *gin.Context) {
|
func (b *BaseApi) GetWebDomains(c *gin.Context) {
|
||||||
websiteId, err := helper.GetIntParamByKey(c, "websiteId")
|
websiteId, err := helper.GetIntParamByKey(c, "websiteId")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ import (
|
|||||||
|
|
||||||
// @Tags Website SSL
|
// @Tags Website SSL
|
||||||
// @Summary Page website ssl
|
// @Summary Page website ssl
|
||||||
// @Description 获取网站 ssl 列表分页
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteSSLSearch true "request"
|
// @Param request body request.WebsiteSSLSearch true "request"
|
||||||
// @Success 200
|
// @Success 200 {array} response.WebsiteSSLDTO
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ssl/search [post]
|
// @Router /websites/ssl/search [post]
|
||||||
func (b *BaseApi) PageWebsiteSSL(c *gin.Context) {
|
func (b *BaseApi) PageWebsiteSSL(c *gin.Context) {
|
||||||
var req request.WebsiteSSLSearch
|
var req request.WebsiteSSLSearch
|
||||||
@@ -48,11 +48,11 @@ func (b *BaseApi) PageWebsiteSSL(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website SSL
|
// @Tags Website SSL
|
||||||
// @Summary Create website ssl
|
// @Summary Create website ssl
|
||||||
// @Description 创建网站 ssl
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteSSLCreate true "request"
|
// @Param request body request.WebsiteSSLCreate true "request"
|
||||||
// @Success 200 {object} request.WebsiteSSLCreate
|
// @Success 200 {object} request.WebsiteSSLCreate
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ssl [post]
|
// @Router /websites/ssl [post]
|
||||||
// @x-panel-log {"bodyKeys":["primaryDomain"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 ssl [primaryDomain]","formatEN":"Create website ssl [primaryDomain]"}
|
// @x-panel-log {"bodyKeys":["primaryDomain"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建网站 ssl [primaryDomain]","formatEN":"Create website ssl [primaryDomain]"}
|
||||||
func (b *BaseApi) CreateWebsiteSSL(c *gin.Context) {
|
func (b *BaseApi) CreateWebsiteSSL(c *gin.Context) {
|
||||||
@@ -70,11 +70,11 @@ func (b *BaseApi) CreateWebsiteSSL(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website SSL
|
// @Tags Website SSL
|
||||||
// @Summary Apply ssl
|
// @Summary Apply ssl
|
||||||
// @Description 申请证书
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteSSLApply true "request"
|
// @Param request body request.WebsiteSSLApply true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ssl/obtain [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) ApplyWebsiteSSL(c *gin.Context) {
|
||||||
@@ -91,11 +91,11 @@ func (b *BaseApi) ApplyWebsiteSSL(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website SSL
|
// @Tags Website SSL
|
||||||
// @Summary Resolve website ssl
|
// @Summary Resolve website ssl
|
||||||
// @Description 解析网站 ssl
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteDNSReq true "request"
|
// @Param request body request.WebsiteDNSReq true "request"
|
||||||
// @Success 200 {array} response.WebsiteDNSRes
|
// @Success 200 {array} response.WebsiteDNSRes
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ssl/resolve [post]
|
// @Router /websites/ssl/resolve [post]
|
||||||
func (b *BaseApi) GetDNSResolve(c *gin.Context) {
|
func (b *BaseApi) GetDNSResolve(c *gin.Context) {
|
||||||
var req request.WebsiteDNSReq
|
var req request.WebsiteDNSReq
|
||||||
@@ -112,11 +112,11 @@ func (b *BaseApi) GetDNSResolve(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website SSL
|
// @Tags Website SSL
|
||||||
// @Summary Delete website ssl
|
// @Summary Delete website ssl
|
||||||
// @Description 删除网站 ssl
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteBatchDelReq true "request"
|
// @Param request body request.WebsiteBatchDelReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ssl/del [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DeleteWebsiteSSL(c *gin.Context) {
|
||||||
@@ -133,12 +133,12 @@ func (b *BaseApi) DeleteWebsiteSSL(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website SSL
|
// @Tags Website SSL
|
||||||
// @Summary Search website ssl by website id
|
// @Summary Search website ssl by website id
|
||||||
// @Description 通过网站 id 查询 ssl
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param websiteId path integer true "request"
|
// @Param websiteId path integer true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} response.WebsiteSSLDTO
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /websites/ssl/website/:websiteId [get]
|
// @Security Timestamp
|
||||||
|
// @Router /websites/ssl/website/{websiteId} [get]
|
||||||
func (b *BaseApi) GetWebsiteSSLByWebsiteId(c *gin.Context) {
|
func (b *BaseApi) GetWebsiteSSLByWebsiteId(c *gin.Context) {
|
||||||
websiteId, err := helper.GetIntParamByKey(c, "websiteId")
|
websiteId, err := helper.GetIntParamByKey(c, "websiteId")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -155,12 +155,12 @@ func (b *BaseApi) GetWebsiteSSLByWebsiteId(c *gin.Context) {
|
|||||||
|
|
||||||
// @Tags Website SSL
|
// @Tags Website SSL
|
||||||
// @Summary Search website ssl by id
|
// @Summary Search website ssl by id
|
||||||
// @Description 通过 id 查询 ssl
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param id path integer true "request"
|
// @Param id path integer true "request"
|
||||||
// @Success 200
|
// @Success 200 {object} response.WebsiteSSLDTO
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
// @Router /websites/ssl/:id [get]
|
// @Security Timestamp
|
||||||
|
// @Router /websites/ssl/{id} [get]
|
||||||
func (b *BaseApi) GetWebsiteSSLById(c *gin.Context) {
|
func (b *BaseApi) GetWebsiteSSLById(c *gin.Context) {
|
||||||
id, err := helper.GetParamID(c)
|
id, err := helper.GetParamID(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -176,12 +176,12 @@ func (b *BaseApi) GetWebsiteSSLById(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Website SSL
|
// @Tags Website SSL
|
||||||
// @Summary Update ssl
|
// @Summary Update Website ssl
|
||||||
// @Description 更新 ssl
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteSSLUpdate true "request"
|
// @Param request body request.WebsiteSSLUpdate true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ssl/update [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) UpdateWebsiteSSL(c *gin.Context) {
|
||||||
@@ -197,12 +197,12 @@ func (b *BaseApi) UpdateWebsiteSSL(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Website SSL
|
// @Tags Website SSL
|
||||||
// @Summary Upload ssl
|
// @Summary Upload Website ssl
|
||||||
// @Description 上传 ssl
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteSSLUpload true "request"
|
// @Param request body request.WebsiteSSLUpload true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ssl/upload [post]
|
// @Router /websites/ssl/upload [post]
|
||||||
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"上传 ssl [type]","formatEN":"Upload ssl [type]"}
|
// @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"上传 ssl [type]","formatEN":"Upload ssl [type]"}
|
||||||
func (b *BaseApi) UploadWebsiteSSL(c *gin.Context) {
|
func (b *BaseApi) UploadWebsiteSSL(c *gin.Context) {
|
||||||
@@ -218,12 +218,12 @@ func (b *BaseApi) UploadWebsiteSSL(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Tags Website SSL
|
// @Tags Website SSL
|
||||||
// @Summary Download SSL file
|
// @Summary Download SSL file
|
||||||
// @Description 下载证书文件
|
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body request.WebsiteResourceReq true "request"
|
// @Param request body request.WebsiteResourceReq true "request"
|
||||||
// @Success 200
|
// @Success 200
|
||||||
// @Security ApiKeyAuth
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
// @Router /websites/ssl/download [post]
|
// @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]"}
|
// @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) {
|
func (b *BaseApi) DownloadWebsiteSSL(c *gin.Context) {
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package dto
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
type OllamaModelInfo struct {
|
||||||
|
ID uint `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Size string `json:"size"`
|
||||||
|
From string `json:"from"`
|
||||||
|
LogFileExist bool `json:"logFileExist"`
|
||||||
|
|
||||||
|
Status string `json:"status"`
|
||||||
|
Message string `json:"message"`
|
||||||
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type OllamaModelDropList struct {
|
||||||
|
ID uint `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type OllamaModelName struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type OllamaBindDomain struct {
|
||||||
|
Domain string `json:"domain" validate:"required"`
|
||||||
|
AppInstallID uint `json:"appInstallID" validate:"required"`
|
||||||
|
SSLID uint `json:"sslID"`
|
||||||
|
WebsiteID uint `json:"websiteID"`
|
||||||
|
IPList string `json:"ipList"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type OllamaBindDomainReq struct {
|
||||||
|
AppInstallID uint `json:"appInstallID" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type OllamaBindDomainRes struct {
|
||||||
|
Domain string `json:"domain"`
|
||||||
|
SSLID uint `json:"sslID"`
|
||||||
|
AcmeAccountID uint `json:"acmeAccountID"`
|
||||||
|
AllowIPs []string `json:"allowIPs"`
|
||||||
|
WebsiteID uint `json:"websiteID"`
|
||||||
|
ConnUrl string `json:"connUrl"`
|
||||||
|
}
|
||||||
@@ -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"`
|
||||||
|
}
|
||||||
+24
-11
@@ -1,9 +1,5 @@
|
|||||||
package dto
|
package dto
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/1Panel-dev/1Panel/backend/app/model"
|
|
||||||
)
|
|
||||||
|
|
||||||
type AppDatabase struct {
|
type AppDatabase struct {
|
||||||
ServiceName string `json:"PANEL_DB_HOST"`
|
ServiceName string `json:"PANEL_DB_HOST"`
|
||||||
DbName string `json:"PANEL_DB_NAME"`
|
DbName string `json:"PANEL_DB_NAME"`
|
||||||
@@ -62,7 +58,7 @@ type AppDefine struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type LocalAppAppDefine struct {
|
type LocalAppAppDefine struct {
|
||||||
AppProperty model.App `json:"additionalProperties" yaml:"additionalProperties"`
|
AppProperty AppProperty `json:"additionalProperties" yaml:"additionalProperties"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LocalAppParam struct {
|
type LocalAppParam struct {
|
||||||
@@ -82,8 +78,9 @@ type AppProperty struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
Tags []string `json:"tags"`
|
Tags []string `json:"tags"`
|
||||||
ShortDescZh string `json:"shortDescZh"`
|
ShortDescZh string `json:"shortDescZh" yaml:"shortDescZh"`
|
||||||
ShortDescEn string `json:"shortDescEn"`
|
ShortDescEn string `json:"shortDescEn" yaml:"shortDescEn"`
|
||||||
|
Description Locale `json:"description"`
|
||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
Required []string `json:"Required"`
|
Required []string `json:"Required"`
|
||||||
CrossVersionUpdate bool `json:"crossVersionUpdate"`
|
CrossVersionUpdate bool `json:"crossVersionUpdate"`
|
||||||
@@ -92,6 +89,8 @@ type AppProperty struct {
|
|||||||
Website string `json:"website"`
|
Website string `json:"website"`
|
||||||
Github string `json:"github"`
|
Github string `json:"github"`
|
||||||
Document string `json:"document"`
|
Document string `json:"document"`
|
||||||
|
Version float64 `json:"version"`
|
||||||
|
GpuSupport bool `json:"gpuSupport"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppConfigVersion struct {
|
type AppConfigVersion struct {
|
||||||
@@ -103,19 +102,33 @@ type AppConfigVersion struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Tag struct {
|
type Tag struct {
|
||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Sort int `json:"sort"`
|
Sort int `json:"sort"`
|
||||||
|
Locales Locale `json:"locales"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Locale struct {
|
||||||
|
En string `json:"en"`
|
||||||
|
Ja string `json:"ja"`
|
||||||
|
Ms string `json:"ms"`
|
||||||
|
PtBr string `json:"pt-br" yaml:"pt-br"`
|
||||||
|
Ru string `json:"ru"`
|
||||||
|
ZhHant string `json:"zh-hant" yaml:"zh-hant"`
|
||||||
|
Zh string `json:"zh"`
|
||||||
|
Ko string `json:"ko"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppForm struct {
|
type AppForm struct {
|
||||||
FormFields []AppFormFields `json:"formFields"`
|
FormFields []AppFormFields `json:"formFields"`
|
||||||
|
SupportVersion float64 `json:"supportVersion"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppFormFields struct {
|
type AppFormFields struct {
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
LabelZh string `json:"labelZh"`
|
LabelZh string `json:"labelZh"`
|
||||||
LabelEn string `json:"labelEn"`
|
LabelEn string `json:"labelEn"`
|
||||||
|
Label Locale `json:"label"`
|
||||||
Required bool `json:"required"`
|
Required bool `json:"required"`
|
||||||
Default interface{} `json:"default"`
|
Default interface{} `json:"default"`
|
||||||
EnvKey string `json:"envKey"`
|
EnvKey string `json:"envKey"`
|
||||||
|
|||||||
+11
-7
@@ -23,13 +23,12 @@ type MfaCredential struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Login struct {
|
type Login struct {
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
Password string `json:"password" validate:"required"`
|
Password string `json:"password" validate:"required"`
|
||||||
IgnoreCaptcha bool `json:"ignoreCaptcha"`
|
Captcha string `json:"captcha"`
|
||||||
Captcha string `json:"captcha"`
|
CaptchaID string `json:"captchaID"`
|
||||||
CaptchaID string `json:"captchaID"`
|
AuthMethod string `json:"authMethod" validate:"required,oneof=jwt session"`
|
||||||
AuthMethod string `json:"authMethod" validate:"required,oneof=jwt session"`
|
Language string `json:"language" validate:"required,oneof=zh en tw ja ko ru ms 'pt-BR'"`
|
||||||
Language string `json:"language" validate:"required,oneof=zh en tw"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type MFALogin struct {
|
type MFALogin struct {
|
||||||
@@ -38,3 +37,8 @@ type MFALogin struct {
|
|||||||
Code string `json:"code" validate:"required"`
|
Code string `json:"code" validate:"required"`
|
||||||
AuthMethod string `json:"authMethod"`
|
AuthMethod string `json:"authMethod"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type LoginSetting struct {
|
||||||
|
NeedCaptcha bool `json:"needCaptcha"`
|
||||||
|
Language string `json:"language"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ type BackupInfo struct {
|
|||||||
Vars string `json:"vars"`
|
Vars string `json:"vars"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type BackupFile struct {
|
||||||
|
ID uint `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Size int64 `json:"size"`
|
||||||
|
}
|
||||||
|
|
||||||
type OneDriveInfo struct {
|
type OneDriveInfo struct {
|
||||||
ClientID string `json:"client_id"`
|
ClientID string `json:"client_id"`
|
||||||
ClientSecret string `json:"client_secret"`
|
ClientSecret string `json:"client_secret"`
|
||||||
@@ -36,6 +42,7 @@ type CommonBackup struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
DetailName string `json:"detailName"`
|
DetailName string `json:"detailName"`
|
||||||
Secret string `json:"secret"`
|
Secret string `json:"secret"`
|
||||||
|
FileName string `json:"fileName"`
|
||||||
}
|
}
|
||||||
type CommonRecover struct {
|
type CommonRecover struct {
|
||||||
Source string `json:"source" validate:"required,oneof=OSS S3 SFTP MINIO LOCAL COS KODO OneDrive WebDAV"`
|
Source string `json:"source" validate:"required,oneof=OSS S3 SFTP MINIO LOCAL COS KODO OneDrive WebDAV"`
|
||||||
@@ -65,7 +72,6 @@ type BackupRecords struct {
|
|||||||
BackupType string `json:"backupType"`
|
BackupType string `json:"backupType"`
|
||||||
FileDir string `json:"fileDir"`
|
FileDir string `json:"fileDir"`
|
||||||
FileName string `json:"fileName"`
|
FileName string `json:"fileName"`
|
||||||
Size int64 `json:"size"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type DownloadRecord struct {
|
type DownloadRecord struct {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ type ClamInfo struct {
|
|||||||
LastHandleDate string `json:"lastHandleDate"`
|
LastHandleDate string `json:"lastHandleDate"`
|
||||||
Spec string `json:"spec"`
|
Spec string `json:"spec"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
|
AlertCount uint `json:"alertCount"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ClamLogSearch struct {
|
type ClamLogSearch struct {
|
||||||
@@ -71,6 +72,8 @@ type ClamCreate struct {
|
|||||||
InfectedDir string `json:"infectedDir"`
|
InfectedDir string `json:"infectedDir"`
|
||||||
Spec string `json:"spec"`
|
Spec string `json:"spec"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
|
AlertCount uint `json:"alertCount"`
|
||||||
|
AlertTitle string `json:"alertTitle"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ClamUpdate struct {
|
type ClamUpdate struct {
|
||||||
@@ -82,6 +85,8 @@ type ClamUpdate struct {
|
|||||||
InfectedDir string `json:"infectedDir"`
|
InfectedDir string `json:"infectedDir"`
|
||||||
Spec string `json:"spec"`
|
Spec string `json:"spec"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
|
AlertCount uint `json:"alertCount"`
|
||||||
|
AlertTitle string `json:"alertTitle"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ClamUpdateStatus struct {
|
type ClamUpdateStatus struct {
|
||||||
|
|||||||
@@ -52,3 +52,8 @@ type OperationWithNameAndType struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Type string `json:"type" validate:"required"`
|
Type string `json:"type" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ForceDelete struct {
|
||||||
|
IDs []uint `json:"ids"`
|
||||||
|
ForceDelete bool `json:"forceDelete"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ type PortHelper struct {
|
|||||||
|
|
||||||
type ContainerOperation struct {
|
type ContainerOperation struct {
|
||||||
Names []string `json:"names" validate:"required"`
|
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 {
|
type ContainerRename struct {
|
||||||
@@ -200,6 +200,7 @@ type ComposeInfo struct {
|
|||||||
Workdir string `json:"workdir"`
|
Workdir string `json:"workdir"`
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Containers []ComposeContainer `json:"containers"`
|
Containers []ComposeContainer `json:"containers"`
|
||||||
|
Env []string `json:"env"`
|
||||||
}
|
}
|
||||||
type ComposeContainer struct {
|
type ComposeContainer struct {
|
||||||
ContainerID string `json:"containerID"`
|
ContainerID string `json:"containerID"`
|
||||||
@@ -208,22 +209,24 @@ type ComposeContainer struct {
|
|||||||
State string `json:"state"`
|
State string `json:"state"`
|
||||||
}
|
}
|
||||||
type ComposeCreate struct {
|
type ComposeCreate struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
From string `json:"from" validate:"required,oneof=edit path template"`
|
From string `json:"from" validate:"required,oneof=edit path template"`
|
||||||
File string `json:"file"`
|
File string `json:"file"`
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Template uint `json:"template"`
|
Template uint `json:"template"`
|
||||||
|
Env []string `json:"env"`
|
||||||
}
|
}
|
||||||
type ComposeOperation struct {
|
type ComposeOperation struct {
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
Path string `json:"path" validate:"required"`
|
Path string `json:"path"`
|
||||||
Operation string `json:"operation" validate:"required,oneof=start stop down"`
|
Operation string `json:"operation" validate:"required,oneof=up start stop down delete"`
|
||||||
WithFile bool `json:"withFile"`
|
WithFile bool `json:"withFile"`
|
||||||
}
|
}
|
||||||
type ComposeUpdate struct {
|
type ComposeUpdate struct {
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
Path string `json:"path" validate:"required"`
|
Path string `json:"path" validate:"required"`
|
||||||
Content string `json:"content" validate:"required"`
|
Content string `json:"content" validate:"required"`
|
||||||
|
Env []string `json:"env"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ContainerLog struct {
|
type ContainerLog struct {
|
||||||
|
|||||||
@@ -31,10 +31,13 @@ type CronjobCreate struct {
|
|||||||
DefaultDownload string `json:"defaultDownload"`
|
DefaultDownload string `json:"defaultDownload"`
|
||||||
RetainCopies int `json:"retainCopies" validate:"number,min=1"`
|
RetainCopies int `json:"retainCopies" validate:"number,min=1"`
|
||||||
Secret string `json:"secret"`
|
Secret string `json:"secret"`
|
||||||
|
AlertCount uint `json:"alertCount"`
|
||||||
|
AlertTitle string `json:"alertTitle"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CronjobUpdate struct {
|
type CronjobUpdate struct {
|
||||||
ID uint `json:"id" validate:"required"`
|
ID uint `json:"id" validate:"required"`
|
||||||
|
Type string `json:"type" validate:"required"`
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
Spec string `json:"spec" validate:"required"`
|
Spec string `json:"spec" validate:"required"`
|
||||||
|
|
||||||
@@ -53,6 +56,8 @@ type CronjobUpdate struct {
|
|||||||
DefaultDownload string `json:"defaultDownload"`
|
DefaultDownload string `json:"defaultDownload"`
|
||||||
RetainCopies int `json:"retainCopies" validate:"number,min=1"`
|
RetainCopies int `json:"retainCopies" validate:"number,min=1"`
|
||||||
Secret string `json:"secret"`
|
Secret string `json:"secret"`
|
||||||
|
AlertCount uint `json:"alertCount"`
|
||||||
|
AlertTitle string `json:"alertTitle"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CronjobUpdateStatus struct {
|
type CronjobUpdateStatus struct {
|
||||||
@@ -66,14 +71,16 @@ type CronjobDownload struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CronjobClean struct {
|
type CronjobClean struct {
|
||||||
IsDelete bool `json:"isDelete"`
|
IsDelete bool `json:"isDelete"`
|
||||||
CleanData bool `json:"cleanData"`
|
CleanData bool `json:"cleanData"`
|
||||||
CronjobID uint `json:"cronjobID" validate:"required"`
|
CleanRemoteData bool `json:"cleanRemoteData"`
|
||||||
|
CronjobID uint `json:"cronjobID" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CronjobBatchDelete struct {
|
type CronjobBatchDelete struct {
|
||||||
CleanData bool `json:"cleanData"`
|
CleanData bool `json:"cleanData"`
|
||||||
IDs []uint `json:"ids" validate:"required"`
|
CleanRemoteData bool `json:"cleanRemoteData"`
|
||||||
|
IDs []uint `json:"ids" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CronjobInfo struct {
|
type CronjobInfo struct {
|
||||||
@@ -99,6 +106,7 @@ type CronjobInfo struct {
|
|||||||
LastRecordTime string `json:"lastRecordTime"`
|
LastRecordTime string `json:"lastRecordTime"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
Secret string `json:"secret"`
|
Secret string `json:"secret"`
|
||||||
|
AlertCount uint `json:"alertCount"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SearchRecord struct {
|
type SearchRecord struct {
|
||||||
|
|||||||
@@ -16,10 +16,11 @@ type DashboardBase struct {
|
|||||||
KernelArch string `json:"kernelArch"`
|
KernelArch string `json:"kernelArch"`
|
||||||
KernelVersion string `json:"kernelVersion"`
|
KernelVersion string `json:"kernelVersion"`
|
||||||
VirtualizationSystem string `json:"virtualizationSystem"`
|
VirtualizationSystem string `json:"virtualizationSystem"`
|
||||||
|
IpV4Addr string `json:"ipv4Addr"`
|
||||||
CPUCores int `json:"cpuCores"`
|
SystemProxy string `json:"SystemProxy"`
|
||||||
CPULogicalCores int `json:"cpuLogicalCores"`
|
CPUCores int `json:"cpuCores"`
|
||||||
CPUModelName string `json:"cpuModelName"`
|
CPULogicalCores int `json:"cpuLogicalCores"`
|
||||||
|
CPUModelName string `json:"cpuModelName"`
|
||||||
|
|
||||||
CurrentInfo DashboardCurrent `json:"currentInfo"`
|
CurrentInfo DashboardCurrent `json:"currentInfo"`
|
||||||
}
|
}
|
||||||
@@ -34,6 +35,12 @@ type OsInfo struct {
|
|||||||
DiskSize int64 `json:"diskSize"`
|
DiskSize int64 `json:"diskSize"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DashboardReq struct {
|
||||||
|
Scope string `json:"scope"`
|
||||||
|
IoOption string `json:"ioOption"`
|
||||||
|
NetOption string `json:"netOption"`
|
||||||
|
}
|
||||||
|
|
||||||
type DashboardCurrent struct {
|
type DashboardCurrent struct {
|
||||||
Uptime uint64 `json:"uptime"`
|
Uptime uint64 `json:"uptime"`
|
||||||
TimeSinceUptime string `json:"timeSinceUptime"`
|
TimeSinceUptime string `json:"timeSinceUptime"`
|
||||||
@@ -72,6 +79,7 @@ type DashboardCurrent struct {
|
|||||||
NetBytesRecv uint64 `json:"netBytesRecv"`
|
NetBytesRecv uint64 `json:"netBytesRecv"`
|
||||||
|
|
||||||
GPUData []GPUInfo `json:"gpuData"`
|
GPUData []GPUInfo `json:"gpuData"`
|
||||||
|
XPUData []XPUInfo `json:"xpuData"`
|
||||||
|
|
||||||
ShotTime time.Time `json:"shotTime"`
|
ShotTime time.Time `json:"shotTime"`
|
||||||
}
|
}
|
||||||
@@ -105,3 +113,13 @@ type GPUInfo struct {
|
|||||||
MemTotal string `json:"memTotal"`
|
MemTotal string `json:"memTotal"`
|
||||||
FanSpeed string `json:"fanSpeed"`
|
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,7 +19,7 @@ type Fail2BanSearch struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Fail2BanUpdate struct {
|
type Fail2BanUpdate struct {
|
||||||
Key string `json:"key" validate:"required,oneof=port bantime findtime maxretry banaction logpath port"`
|
Key string `json:"key" validate:"required,oneof=port bantime findtime maxretry banaction logpath"`
|
||||||
Value string `json:"value"`
|
Value string `json:"value"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ type PortRuleOperate struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ForwardRuleOperate struct {
|
type ForwardRuleOperate struct {
|
||||||
Rules []struct {
|
ForceDelete bool `json:"forceDelete"`
|
||||||
|
Rules []struct {
|
||||||
Operation string `json:"operation" validate:"required,oneof=add remove"`
|
Operation string `json:"operation" validate:"required,oneof=add remove"`
|
||||||
Num string `json:"num"`
|
Num string `json:"num"`
|
||||||
Protocol string `json:"protocol" validate:"required,oneof=tcp udp tcp/udp"`
|
Protocol string `json:"protocol" validate:"required,oneof=tcp udp tcp/udp"`
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ type ImageRepoCreate struct {
|
|||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
DownloadUrl string `json:"downloadUrl"`
|
DownloadUrl string `json:"downloadUrl"`
|
||||||
Protocol string `json:"protocol"`
|
Protocol string `json:"protocol"`
|
||||||
Username string `json:"username" validate:"max=256"`
|
Username string `json:"username"`
|
||||||
Password string `json:"password" validate:"max=256"`
|
Password string `json:"password"`
|
||||||
Auth bool `json:"auth"`
|
Auth bool `json:"auth"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,8 +15,8 @@ type ImageRepoUpdate struct {
|
|||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
DownloadUrl string `json:"downloadUrl"`
|
DownloadUrl string `json:"downloadUrl"`
|
||||||
Protocol string `json:"protocol"`
|
Protocol string `json:"protocol"`
|
||||||
Username string `json:"username" validate:"max=256"`
|
Username string `json:"username"`
|
||||||
Password string `json:"password" validate:"max=256"`
|
Password string `json:"password"`
|
||||||
Auth bool `json:"auth"`
|
Auth bool `json:"auth"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package dto
|
||||||
|
|
||||||
|
type DockerComposeService struct {
|
||||||
|
Image string `yaml:"image"`
|
||||||
|
ContainerName string `yaml:"container_name"`
|
||||||
|
Restart string `yaml:"restart"`
|
||||||
|
Ports []string `yaml:"ports"`
|
||||||
|
Environment []string `yaml:"environment"`
|
||||||
|
Command []string `yaml:"command"`
|
||||||
|
}
|
||||||
@@ -33,6 +33,7 @@ type AppContainerConfig struct {
|
|||||||
DockerCompose string `json:"dockerCompose"`
|
DockerCompose string `json:"dockerCompose"`
|
||||||
HostMode bool `json:"hostMode"`
|
HostMode bool `json:"hostMode"`
|
||||||
PullImage bool `json:"pullImage"`
|
PullImage bool `json:"pullImage"`
|
||||||
|
GpuConfig bool `json:"gpuConfig"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppInstalledSearch struct {
|
type AppInstalledSearch struct {
|
||||||
|
|||||||
@@ -76,7 +76,12 @@ type FileRename struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FilePathCheck struct {
|
type FilePathCheck struct {
|
||||||
Path string `json:"path" validate:"required"`
|
Path string `json:"path" validate:"required"`
|
||||||
|
WithInit bool `json:"withInit"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FilePathsCheck struct {
|
||||||
|
Paths []string `json:"paths" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type FileWget struct {
|
type FileWget struct {
|
||||||
@@ -87,11 +92,12 @@ type FileWget struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FileMove struct {
|
type FileMove struct {
|
||||||
Type string `json:"type" validate:"required"`
|
Type string `json:"type" validate:"required"`
|
||||||
OldPaths []string `json:"oldPaths" validate:"required"`
|
OldPaths []string `json:"oldPaths" validate:"required"`
|
||||||
NewPath string `json:"newPath" validate:"required"`
|
NewPath string `json:"newPath" validate:"required"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Cover bool `json:"cover"`
|
Cover bool `json:"cover"`
|
||||||
|
CoverPaths []string `json:"coverPaths"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type FileDownload struct {
|
type FileDownload struct {
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package request
|
||||||
|
|
||||||
|
import "github.com/1Panel-dev/1Panel/backend/app/dto"
|
||||||
|
|
||||||
|
type McpServerSearch struct {
|
||||||
|
dto.PageInfo
|
||||||
|
Name string `json:"name"`
|
||||||
|
Sync bool `json:"sync"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type McpServerCreate struct {
|
||||||
|
Name string `json:"name" validate:"required"`
|
||||||
|
Command string `json:"command" validate:"required"`
|
||||||
|
Environments []Environment `json:"environments"`
|
||||||
|
Volumes []Volume `json:"volumes"`
|
||||||
|
Port int `json:"port" validate:"required"`
|
||||||
|
ContainerName string `json:"containerName"`
|
||||||
|
BaseURL string `json:"baseUrl"`
|
||||||
|
SsePath string `json:"ssePath"`
|
||||||
|
HostIP string `json:"hostIP"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type McpServerUpdate struct {
|
||||||
|
ID uint `json:"id" validate:"required"`
|
||||||
|
McpServerCreate
|
||||||
|
}
|
||||||
|
|
||||||
|
type Environment struct {
|
||||||
|
Key string `json:"key"`
|
||||||
|
Value string `json:"value"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Volume struct {
|
||||||
|
Source string `json:"source"`
|
||||||
|
Target string `json:"target"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type McpServerDelete struct {
|
||||||
|
ID uint `json:"id" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type McpServerOperate struct {
|
||||||
|
ID uint `json:"id" validate:"required"`
|
||||||
|
Operate string `json:"operate" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type McpBindDomain struct {
|
||||||
|
Domain string `json:"domain" validate:"required"`
|
||||||
|
SSLID uint `json:"sslID"`
|
||||||
|
IPList string `json:"ipList"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type McpBindDomainUpdate struct {
|
||||||
|
WebsiteID uint `json:"websiteID" validate:"required"`
|
||||||
|
SSLID uint `json:"sslID"`
|
||||||
|
IPList string `json:"ipList"`
|
||||||
|
}
|
||||||
@@ -175,21 +175,27 @@ type WebsiteUpdateDirPermission struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type WebsiteProxyConfig struct {
|
type WebsiteProxyConfig struct {
|
||||||
ID uint `json:"id" validate:"required"`
|
ID uint `json:"id" validate:"required"`
|
||||||
Operate string `json:"operate" validate:"required"`
|
Operate string `json:"operate" validate:"required"`
|
||||||
Enable bool `json:"enable" `
|
Enable bool `json:"enable" `
|
||||||
Cache bool `json:"cache" `
|
Cache bool `json:"cache" `
|
||||||
CacheTime int `json:"cacheTime" `
|
CacheTime int `json:"cacheTime" `
|
||||||
CacheUnit string `json:"cacheUnit"`
|
CacheUnit string `json:"cacheUnit"`
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
Modifier string `json:"modifier"`
|
Modifier string `json:"modifier"`
|
||||||
Match string `json:"match" validate:"required"`
|
Match string `json:"match" validate:"required"`
|
||||||
ProxyPass string `json:"proxyPass" validate:"required"`
|
ProxyPass string `json:"proxyPass" validate:"required"`
|
||||||
ProxyHost string `json:"proxyHost" validate:"required"`
|
ProxyHost string `json:"proxyHost" validate:"required"`
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
FilePath string `json:"filePath"`
|
FilePath string `json:"filePath"`
|
||||||
Replaces map[string]string `json:"replaces"`
|
Replaces map[string]string `json:"replaces"`
|
||||||
SNI bool `json:"sni"`
|
SNI bool `json:"sni"`
|
||||||
|
ProxySSLName string `json:"proxySSLName"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type WebsiteProxyDel struct {
|
||||||
|
ID uint `json:"id" validate:"required"`
|
||||||
|
Name string `json:"name" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type WebsiteProxyReq struct {
|
type WebsiteProxyReq struct {
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ type WebsiteSSLApply struct {
|
|||||||
ID uint `json:"ID" validate:"required"`
|
ID uint `json:"ID" validate:"required"`
|
||||||
SkipDNSCheck bool `json:"skipDNSCheck"`
|
SkipDNSCheck bool `json:"skipDNSCheck"`
|
||||||
Nameservers []string `json:"nameservers"`
|
Nameservers []string `json:"nameservers"`
|
||||||
|
DisableLog bool `json:"disableLog"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type WebsiteAcmeAccountCreate struct {
|
type WebsiteAcmeAccountCreate struct {
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type AppRes struct {
|
type AppRes struct {
|
||||||
Items []*AppDto `json:"items"`
|
Items []*AppItem `json:"items"`
|
||||||
Total int64 `json:"total"`
|
Total int64 `json:"total"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppUpdateRes struct {
|
type AppUpdateRes struct {
|
||||||
@@ -23,29 +23,31 @@ type AppUpdateRes struct {
|
|||||||
|
|
||||||
type AppDTO struct {
|
type AppDTO struct {
|
||||||
model.App
|
model.App
|
||||||
Installed bool `json:"installed"`
|
Installed bool `json:"installed"`
|
||||||
Versions []string `json:"versions"`
|
Versions []string `json:"versions"`
|
||||||
Tags []model.Tag `json:"tags"`
|
Tags []TagDTO `json:"tags"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppDto struct {
|
type AppItem struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
ShortDescZh string `json:"shortDescZh"`
|
Description string `json:"description"`
|
||||||
ShortDescEn string `json:"shortDescEn"`
|
Icon string `json:"icon"`
|
||||||
Icon string `json:"icon"`
|
Type string `json:"type"`
|
||||||
Type string `json:"type"`
|
Status string `json:"status"`
|
||||||
Status string `json:"status"`
|
Resource string `json:"resource"`
|
||||||
Resource string `json:"resource"`
|
Installed bool `json:"installed"`
|
||||||
Installed bool `json:"installed"`
|
Versions []string `json:"versions"`
|
||||||
Versions []string `json:"versions"`
|
Limit int `json:"limit"`
|
||||||
Limit int `json:"limit"`
|
Tags []TagDTO `json:"tags"`
|
||||||
Tags []model.Tag `json:"tags"`
|
GpuSupport bool `json:"gpuSupport"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TagDTO struct {
|
type TagDTO struct {
|
||||||
model.Tag
|
ID uint `json:"id"`
|
||||||
|
Key string `json:"key"`
|
||||||
|
Name string `json:"name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppInstalledCheck struct {
|
type AppInstalledCheck struct {
|
||||||
@@ -65,10 +67,11 @@ type AppInstalledCheck struct {
|
|||||||
|
|
||||||
type AppDetailDTO struct {
|
type AppDetailDTO struct {
|
||||||
model.AppDetail
|
model.AppDetail
|
||||||
Enable bool `json:"enable"`
|
Enable bool `json:"enable"`
|
||||||
Params interface{} `json:"params"`
|
Params interface{} `json:"params"`
|
||||||
Image string `json:"image"`
|
Image string `json:"image"`
|
||||||
HostMode bool `json:"hostMode"`
|
HostMode bool `json:"hostMode"`
|
||||||
|
GpuSupport bool `json:"gpuSupport"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type IgnoredApp struct {
|
type IgnoredApp struct {
|
||||||
@@ -89,9 +92,10 @@ type AppInstalledDTO struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type AppDetail struct {
|
type AppDetail struct {
|
||||||
Website string `json:"website"`
|
Website string `json:"website"`
|
||||||
Document string `json:"document"`
|
Document string `json:"document"`
|
||||||
Github string `json:"github"`
|
Github string `json:"github"`
|
||||||
|
GpuSupport bool `json:"gpuSupport"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppInstallDTO struct {
|
type AppInstallDTO struct {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package response
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/1Panel-dev/1Panel/backend/utils/files"
|
"github.com/1Panel-dev/1Panel/backend/utils/files"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type FileInfo struct {
|
type FileInfo struct {
|
||||||
@@ -36,12 +37,21 @@ type FileWgetRes struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FileLineContent struct {
|
type FileLineContent struct {
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
End bool `json:"end"`
|
End bool `json:"end"`
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Total int `json:"total"`
|
Total int `json:"total"`
|
||||||
|
Lines []string `json:"lines"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type FileExist struct {
|
type FileExist struct {
|
||||||
Exist bool `json:"exist"`
|
Exist bool `json:"exist"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ExistFileInfo struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Path string `json:"path"`
|
||||||
|
Size float64 `json:"size"`
|
||||||
|
ModTime time.Time `json:"modTime"`
|
||||||
|
IsDir bool `json:"isDir"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package response
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/app/dto/request"
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/app/model"
|
||||||
|
)
|
||||||
|
|
||||||
|
type McpServersRes struct {
|
||||||
|
Items []McpServerDTO `json:"items"`
|
||||||
|
Total int64 `json:"total"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type McpServerDTO struct {
|
||||||
|
model.McpServer
|
||||||
|
Environments []request.Environment `json:"environments"`
|
||||||
|
Volumes []request.Volume `json:"volumes"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type McpBindDomainRes struct {
|
||||||
|
Domain string `json:"domain"`
|
||||||
|
SSLID uint `json:"sslID"`
|
||||||
|
AcmeAccountID uint `json:"acmeAccountID"`
|
||||||
|
AllowIPs []string `json:"allowIPs"`
|
||||||
|
WebsiteID uint `json:"websiteID"`
|
||||||
|
ConnUrl string `json:"connUrl"`
|
||||||
|
}
|
||||||
@@ -30,6 +30,8 @@ type WebsiteRes struct {
|
|||||||
RuntimeName string `json:"runtimeName"`
|
RuntimeName string `json:"runtimeName"`
|
||||||
SSLExpireDate time.Time `json:"sslExpireDate"`
|
SSLExpireDate time.Time `json:"sslExpireDate"`
|
||||||
SSLStatus string `json:"sslStatus"`
|
SSLStatus string `json:"sslStatus"`
|
||||||
|
AppInstallID uint `json:"appInstallId"`
|
||||||
|
RuntimeType string `json:"runtimeType"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type WebsiteOption struct {
|
type WebsiteOption struct {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ type SettingInfo struct {
|
|||||||
ServerPort string `json:"serverPort"`
|
ServerPort string `json:"serverPort"`
|
||||||
SSL string `json:"ssl"`
|
SSL string `json:"ssl"`
|
||||||
SSLType string `json:"sslType"`
|
SSLType string `json:"sslType"`
|
||||||
|
AutoRestart string `json:"autoRestart"`
|
||||||
BindDomain string `json:"bindDomain"`
|
BindDomain string `json:"bindDomain"`
|
||||||
AllowIPs string `json:"allowIPs"`
|
AllowIPs string `json:"allowIPs"`
|
||||||
SecurityEntrance string `json:"securityEntrance"`
|
SecurityEntrance string `json:"securityEntrance"`
|
||||||
@@ -65,6 +66,12 @@ type SettingInfo struct {
|
|||||||
ProxyUser string `json:"proxyUser"`
|
ProxyUser string `json:"proxyUser"`
|
||||||
ProxyPasswd string `json:"proxyPasswd"`
|
ProxyPasswd string `json:"proxyPasswd"`
|
||||||
ProxyPasswdKeep string `json:"proxyPasswdKeep"`
|
ProxyPasswdKeep string `json:"proxyPasswdKeep"`
|
||||||
|
|
||||||
|
ApiInterfaceStatus string `json:"apiInterfaceStatus"`
|
||||||
|
ApiKey string `json:"apiKey"`
|
||||||
|
IpWhiteList string `json:"ipWhiteList"`
|
||||||
|
ApiKeyValidityTime string `json:"apiKeyValidityTime"`
|
||||||
|
LicenseVerify string `json:"licenseVerify"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SettingUpdate struct {
|
type SettingUpdate struct {
|
||||||
@@ -73,12 +80,13 @@ type SettingUpdate struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SSLUpdate struct {
|
type SSLUpdate struct {
|
||||||
SSLType string `json:"sslType" validate:"required,oneof=self select import import-paste import-local"`
|
SSLType string `json:"sslType" validate:"required,oneof=self select import import-paste import-local"`
|
||||||
Domain string `json:"domain"`
|
Domain string `json:"domain"`
|
||||||
SSL string `json:"ssl" validate:"required,oneof=enable disable"`
|
SSL string `json:"ssl" validate:"required,oneof=enable disable"`
|
||||||
Cert string `json:"cert"`
|
Cert string `json:"cert"`
|
||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
SSLID uint `json:"sslID"`
|
SSLID uint `json:"sslID"`
|
||||||
|
AutoRestart string `json:"autoRestart"`
|
||||||
}
|
}
|
||||||
type SSLInfo struct {
|
type SSLInfo struct {
|
||||||
Domain string `json:"domain"`
|
Domain string `json:"domain"`
|
||||||
@@ -98,6 +106,12 @@ type PortUpdate struct {
|
|||||||
ServerPort uint `json:"serverPort" validate:"required,number,max=65535,min=1"`
|
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 {
|
type SnapshotStatus struct {
|
||||||
Panel string `json:"panel"`
|
Panel string `json:"panel"`
|
||||||
PanelInfo string `json:"panelInfo"`
|
PanelInfo string `json:"panelInfo"`
|
||||||
@@ -141,9 +155,8 @@ type SnapshotInfo struct {
|
|||||||
DefaultDownload string `json:"defaultDownload"`
|
DefaultDownload string `json:"defaultDownload"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
CreatedAt time.Time `json:"createdAt"`
|
CreatedAt time.Time `json:"created_at"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
Size int64 `json:"size"`
|
|
||||||
|
|
||||||
InterruptStep string `json:"interruptStep"`
|
InterruptStep string `json:"interruptStep"`
|
||||||
RecoverStatus string `json:"recoverStatus"`
|
RecoverStatus string `json:"recoverStatus"`
|
||||||
@@ -154,6 +167,12 @@ type SnapshotInfo struct {
|
|||||||
LastRollbackedAt string `json:"lastRollbackedAt"`
|
LastRollbackedAt string `json:"lastRollbackedAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SnapshotFile struct {
|
||||||
|
ID uint `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Size int64 `json:"size"`
|
||||||
|
}
|
||||||
|
|
||||||
type UpgradeInfo struct {
|
type UpgradeInfo struct {
|
||||||
TestVersion string `json:"testVersion"`
|
TestVersion string `json:"testVersion"`
|
||||||
NewVersion string `json:"newVersion"`
|
NewVersion string `json:"newVersion"`
|
||||||
@@ -218,3 +237,10 @@ type XpackHideMenu struct {
|
|||||||
Path string `json:"path,omitempty"`
|
Path string `json:"path,omitempty"`
|
||||||
Children []XpackHideMenu `json:"children,omitempty"`
|
Children []XpackHideMenu `json:"children,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ApiInterfaceConfig struct {
|
||||||
|
ApiInterfaceStatus string `json:"apiInterfaceStatus"`
|
||||||
|
ApiKey string `json:"apiKey"`
|
||||||
|
IpWhiteList string `json:"ipWhiteList"`
|
||||||
|
ApiKeyValidityTime string `json:"apiKeyValidityTime"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
type OllamaModel struct {
|
||||||
|
BaseModel
|
||||||
|
|
||||||
|
Name string `json:"name"`
|
||||||
|
Size string `json:"size"`
|
||||||
|
From string `json:"from"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
Message string `json:"message"`
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user