tool-manager.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>工具管理器</title>
  6. <style>
  7. body {
  8. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  9. margin: 0;
  10. padding: 20px;
  11. background: #2a2a2a;
  12. color: #e0e0e0;
  13. }
  14. .container {
  15. display: flex;
  16. flex-direction: column;
  17. height: calc(100vh - 40px);
  18. gap: 20px;
  19. max-width: 1200px;
  20. margin: 0 auto;
  21. overflow-y: auto;
  22. padding-right: 8px;
  23. }
  24. /* 容器滚动条样式 */
  25. .container::-webkit-scrollbar {
  26. width: 8px;
  27. }
  28. .container::-webkit-scrollbar-track {
  29. background: #2a2a2a;
  30. border-radius: 4px;
  31. }
  32. .container::-webkit-scrollbar-thumb {
  33. background: #5a5a5a;
  34. border-radius: 4px;
  35. }
  36. .container::-webkit-scrollbar-thumb:hover {
  37. background: #6a6a6a;
  38. }
  39. .header {
  40. display: flex;
  41. justify-content: space-between;
  42. align-items: center;
  43. padding: 20px 24px;
  44. background: linear-gradient(135deg, #3a3a3a 0%, #2d2d2d 100%);
  45. border: 1px solid #4a4a4a;
  46. border-radius: 8px;
  47. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  48. flex-shrink: 0;
  49. }
  50. .header h2 {
  51. margin: 0;
  52. font-size: 20px;
  53. font-weight: 600;
  54. color: #ffffff;
  55. }
  56. .config-section {
  57. background: linear-gradient(135deg, #323232 0%, #2a2a2a 100%);
  58. border: 1px solid #4a4a4a;
  59. border-radius: 8px;
  60. padding: 20px;
  61. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  62. flex-shrink: 0;
  63. }
  64. .config-header {
  65. display: flex;
  66. justify-content: space-between;
  67. align-items: center;
  68. margin-bottom: 16px;
  69. padding-bottom: 12px;
  70. border-bottom: 2px solid #4a4a4a;
  71. }
  72. .config-title {
  73. font-weight: 600;
  74. font-size: 16px;
  75. color: #ffffff;
  76. }
  77. .config-controls {
  78. display: flex;
  79. gap: 10px;
  80. flex-wrap: wrap;
  81. }
  82. .config-selector {
  83. display: flex;
  84. gap: 12px;
  85. margin-bottom: 20px;
  86. align-items: center;
  87. flex-wrap: wrap;
  88. }
  89. .config-selector select {
  90. flex: 1;
  91. min-width: 200px;
  92. padding: 10px 12px;
  93. border: 1px solid #5a5a5a;
  94. border-radius: 6px;
  95. background: #3a3a3a;
  96. color: #e0e0e0;
  97. font-size: 14px;
  98. transition: all 0.2s;
  99. }
  100. .config-selector select:focus {
  101. outline: none;
  102. border-color: #007acc;
  103. box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
  104. }
  105. .btn {
  106. padding: 8px 16px;
  107. border: 1px solid #5a5a5a;
  108. border-radius: 6px;
  109. background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
  110. color: #e0e0e0;
  111. cursor: pointer;
  112. font-size: 13px;
  113. font-weight: 500;
  114. transition: all 0.2s;
  115. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  116. white-space: nowrap;
  117. min-width: fit-content;
  118. }
  119. .btn:hover {
  120. background: linear-gradient(135deg, #5a5a5a 0%, #4a4a4a 100%);
  121. border-color: #6a6a6a;
  122. transform: translateY(-1px);
  123. box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  124. }
  125. .btn:active {
  126. transform: translateY(0);
  127. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  128. }
  129. .btn-primary {
  130. background: linear-gradient(135deg, #007acc 0%, #005a9e 100%);
  131. color: white;
  132. border-color: #007acc;
  133. }
  134. .btn-primary:hover {
  135. background: linear-gradient(135deg, #0088e6 0%, #0066cc 100%);
  136. border-color: #0088e6;
  137. }
  138. .btn-danger {
  139. background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
  140. color: white;
  141. border-color: #d32f2f;
  142. }
  143. .btn-danger:hover {
  144. background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  145. border-color: #f44336;
  146. }
  147. .tools-container {
  148. display: grid;
  149. grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  150. gap: 16px;
  151. height: calc(100vh - 400px);
  152. min-height: 400px;
  153. overflow-y: auto;
  154. padding: 4px;
  155. }
  156. .tool-category {
  157. background: linear-gradient(135deg, #383838 0%, #2f2f2f 100%);
  158. border: 1px solid #4a4a4a;
  159. border-radius: 8px;
  160. padding: 16px;
  161. box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  162. transition: all 0.2s;
  163. }
  164. .tool-category:hover {
  165. border-color: #5a5a5a;
  166. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  167. transform: translateY(-2px);
  168. }
  169. .category-header {
  170. display: flex;
  171. justify-content: space-between;
  172. align-items: center;
  173. margin-bottom: 12px;
  174. padding-bottom: 10px;
  175. border-bottom: 2px solid #4a4a4a;
  176. }
  177. .category-name {
  178. font-weight: 600;
  179. font-size: 14px;
  180. color: #ffffff;
  181. }
  182. .category-toggle {
  183. display: flex;
  184. align-items: center;
  185. gap: 4px;
  186. }
  187. .tool-list {
  188. display: flex;
  189. flex-direction: column;
  190. gap: 6px;
  191. }
  192. .tool-item {
  193. display: flex;
  194. justify-content: space-between;
  195. align-items: center;
  196. padding: 8px 12px;
  197. margin: 4px 0;
  198. background: rgba(255, 255, 255, 0.02);
  199. border-radius: 6px;
  200. transition: all 0.2s;
  201. }
  202. .tool-item:hover {
  203. background: rgba(255, 255, 255, 0.05);
  204. transform: translateX(2px);
  205. }
  206. .tool-info {
  207. flex: 1;
  208. margin-right: 12px;
  209. min-width: 0;
  210. }
  211. .tool-name {
  212. font-size: 13px;
  213. font-weight: 500;
  214. color: #e0e0e0;
  215. white-space: nowrap;
  216. overflow: hidden;
  217. text-overflow: ellipsis;
  218. }
  219. .tool-description {
  220. font-size: 12px;
  221. color: #b0b0b0;
  222. margin-top: 4px;
  223. line-height: 1.4;
  224. overflow: hidden;
  225. text-overflow: ellipsis;
  226. display: -webkit-box;
  227. -webkit-line-clamp: 2;
  228. -webkit-box-orient: vertical;
  229. }
  230. .tool-toggle {
  231. display: flex;
  232. align-items: center;
  233. flex-shrink: 0;
  234. }
  235. .checkbox {
  236. width: 18px;
  237. height: 18px;
  238. cursor: pointer;
  239. accent-color: #007acc;
  240. }
  241. .status-bar {
  242. display: flex;
  243. justify-content: space-between;
  244. align-items: center;
  245. padding: 16px 20px;
  246. background: linear-gradient(135deg, #323232 0%, #2a2a2a 100%);
  247. border: 1px solid #4a4a4a;
  248. border-radius: 8px;
  249. font-size: 13px;
  250. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  251. flex-shrink: 0;
  252. }
  253. .status-info {
  254. display: flex;
  255. gap: 20px;
  256. color: #b0b0b0;
  257. flex-wrap: wrap;
  258. }
  259. .status-info span {
  260. font-weight: 500;
  261. }
  262. .modal {
  263. display: none;
  264. position: fixed;
  265. top: 0;
  266. left: 0;
  267. width: 100%;
  268. height: 100%;
  269. background: rgba(0, 0, 0, 0.7);
  270. backdrop-filter: blur(4px);
  271. z-index: 1000;
  272. }
  273. .modal-content {
  274. position: absolute;
  275. top: 50%;
  276. left: 50%;
  277. transform: translate(-50%, -50%);
  278. background: linear-gradient(135deg, #3a3a3a 0%, #2d2d2d 100%);
  279. border: 1px solid #5a5a5a;
  280. border-radius: 12px;
  281. padding: 24px;
  282. min-width: 400px;
  283. max-width: 600px;
  284. box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  285. backdrop-filter: blur(8px);
  286. }
  287. .modal-header {
  288. display: flex;
  289. justify-content: space-between;
  290. align-items: center;
  291. margin-bottom: 20px;
  292. padding-bottom: 12px;
  293. border-bottom: 2px solid #4a4a4a;
  294. }
  295. .modal-title {
  296. font-weight: 600;
  297. font-size: 18px;
  298. color: #ffffff;
  299. }
  300. .modal-close {
  301. background: none;
  302. border: none;
  303. font-size: 20px;
  304. cursor: pointer;
  305. color: #b0b0b0;
  306. padding: 4px;
  307. border-radius: 4px;
  308. transition: all 0.2s;
  309. }
  310. .modal-close:hover {
  311. color: #ffffff;
  312. background: rgba(255, 255, 255, 0.1);
  313. }
  314. .form-group {
  315. margin-bottom: 16px;
  316. }
  317. .form-label {
  318. display: block;
  319. margin-bottom: 6px;
  320. font-size: 13px;
  321. font-weight: 500;
  322. color: #e0e0e0;
  323. }
  324. .form-input {
  325. width: 100%;
  326. padding: 10px 12px;
  327. border: 1px solid #5a5a5a;
  328. border-radius: 6px;
  329. background: #3a3a3a;
  330. color: #e0e0e0;
  331. font-size: 14px;
  332. transition: all 0.2s;
  333. box-sizing: border-box;
  334. }
  335. .form-input:focus {
  336. outline: none;
  337. border-color: #007acc;
  338. box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
  339. }
  340. .form-textarea {
  341. width: 100%;
  342. padding: 10px 12px;
  343. border: 1px solid #5a5a5a;
  344. border-radius: 6px;
  345. background: #3a3a3a;
  346. color: #e0e0e0;
  347. font-size: 14px;
  348. resize: vertical;
  349. min-height: 80px;
  350. transition: all 0.2s;
  351. box-sizing: border-box;
  352. }
  353. .form-textarea:focus {
  354. outline: none;
  355. border-color: #007acc;
  356. box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
  357. }
  358. .modal-actions {
  359. display: flex;
  360. justify-content: flex-end;
  361. gap: 8px;
  362. margin-top: 16px;
  363. }
  364. .empty-state {
  365. text-align: center;
  366. padding: 60px 20px;
  367. color: #b0b0b0;
  368. background: linear-gradient(135deg, #383838 0%, #2f2f2f 100%);
  369. border: 2px dashed #4a4a4a;
  370. border-radius: 12px;
  371. margin: 20px 0;
  372. }
  373. .empty-state h3 {
  374. margin: 0 0 12px 0;
  375. font-size: 18px;
  376. color: #e0e0e0;
  377. font-weight: 600;
  378. }
  379. .empty-state p {
  380. margin: 0;
  381. font-size: 14px;
  382. line-height: 1.5;
  383. }
  384. /* 滚动条样式 */
  385. .tools-container::-webkit-scrollbar {
  386. width: 8px;
  387. }
  388. .tools-container::-webkit-scrollbar-track {
  389. background: #2a2a2a;
  390. border-radius: 4px;
  391. }
  392. .tools-container::-webkit-scrollbar-thumb {
  393. background: #5a5a5a;
  394. border-radius: 4px;
  395. }
  396. .tools-container::-webkit-scrollbar-thumb:hover {
  397. background: #6a6a6a;
  398. }
  399. /* 工具管理区域标题 */
  400. .tools-section-header {
  401. display: flex;
  402. justify-content: space-between;
  403. align-items: center;
  404. margin-bottom: 16px;
  405. padding: 16px 20px;
  406. background: linear-gradient(135deg, #323232 0%, #2a2a2a 100%);
  407. border: 1px solid #4a4a4a;
  408. border-radius: 8px;
  409. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  410. }
  411. .tools-section-title {
  412. font-weight: 600;
  413. font-size: 16px;
  414. color: #ffffff;
  415. }
  416. .tools-section-controls {
  417. display: flex;
  418. gap: 10px;
  419. flex-wrap: wrap;
  420. }
  421. .loading {
  422. text-align: center;
  423. padding: 40px 20px;
  424. color: #b0b0b0;
  425. font-size: 14px;
  426. }
  427. .error {
  428. background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
  429. color: white;
  430. padding: 12px 16px;
  431. border-radius: 6px;
  432. font-size: 13px;
  433. margin-bottom: 16px;
  434. border: 1px solid #f44336;
  435. }
  436. /* 响应式设计 */
  437. @media (max-width: 768px) {
  438. .container {
  439. padding: 10px;
  440. gap: 15px;
  441. }
  442. .header {
  443. flex-direction: column;
  444. gap: 15px;
  445. align-items: stretch;
  446. }
  447. .config-controls {
  448. justify-content: center;
  449. }
  450. .config-selector {
  451. flex-direction: column;
  452. align-items: stretch;
  453. }
  454. .config-selector select {
  455. min-width: auto;
  456. }
  457. .tools-container {
  458. grid-template-columns: 1fr;
  459. height: calc(100vh - 350px);
  460. }
  461. .status-bar {
  462. flex-direction: column;
  463. gap: 10px;
  464. align-items: stretch;
  465. }
  466. .status-info {
  467. justify-content: center;
  468. }
  469. }
  470. </style>
  471. </head>
  472. <body>
  473. <div class="container">
  474. <!-- 头部 -->
  475. <div class="header">
  476. <h2 id="panelTitle">工具管理器</h2>
  477. <div class="config-controls">
  478. <button class="btn btn-primary" id="createConfigBtn">新建配置</button>
  479. <button class="btn" id="importConfigBtn">导入配置</button>
  480. <button class="btn" id="exportConfigBtn">导出配置</button>
  481. </div>
  482. </div>
  483. <!-- 配置选择器 -->
  484. <div class="config-section">
  485. <div class="config-header">
  486. <div class="config-title">当前配置</div>
  487. <div class="config-controls">
  488. <button class="btn" id="editConfigBtn">编辑</button>
  489. <button class="btn btn-danger" id="deleteConfigBtn">删除</button>
  490. </div>
  491. </div>
  492. <div class="config-selector">
  493. <select id="configSelector">
  494. <option value="">选择配置...</option>
  495. </select>
  496. <button class="btn btn-primary" id="applyConfigBtn">应用</button>
  497. </div>
  498. </div>
  499. <!-- 工具列表 -->
  500. <div class="config-section">
  501. <div class="tools-section-header">
  502. <div class="tools-section-title">工具管理</div>
  503. <div class="tools-section-controls">
  504. <button class="btn" id="selectAllBtn">全选</button>
  505. <button class="btn" id="deselectAllBtn">取消全选</button>
  506. </div>
  507. </div>
  508. <div id="toolsContainer" class="tools-container">
  509. <div class="loading">加载中...</div>
  510. </div>
  511. </div>
  512. <!-- 状态栏 -->
  513. <div class="status-bar">
  514. <div class="status-info">
  515. <span>总工具数: <span id="totalToolsCount">0</span></span>
  516. <span>已启用: <span id="enabledToolsCount">0</span></span>
  517. <span>已禁用: <span id="disabledToolsCount">0</span></span>
  518. </div>
  519. <div>
  520. <button class="btn" id="saveChangesBtn">保存更改</button>
  521. </div>
  522. </div>
  523. </div>
  524. <!-- 新建/编辑配置模态框 -->
  525. <div id="configModal" class="modal">
  526. <div class="modal-content">
  527. <div class="modal-header">
  528. <div class="modal-title" id="modalTitle">新建配置</div>
  529. <button class="modal-close" id="closeModal">&times;</button>
  530. </div>
  531. <form id="configForm">
  532. <div class="form-group">
  533. <label class="form-label" for="configName">配置名称 *</label>
  534. <input type="text" id="configName" class="form-input" required>
  535. </div>
  536. <div class="form-group">
  537. <label class="form-label" for="configDescription">描述</label>
  538. <textarea id="configDescription" class="form-textarea" placeholder="可选:添加配置描述"></textarea>
  539. </div>
  540. <div class="modal-actions">
  541. <button type="button" class="btn" id="cancelConfigBtn">取消</button>
  542. <button type="submit" class="btn btn-primary" id="saveConfigBtn">保存</button>
  543. </div>
  544. </form>
  545. </div>
  546. </div>
  547. <!-- 导入配置模态框 -->
  548. <div id="importModal" class="modal">
  549. <div class="modal-content">
  550. <div class="modal-header">
  551. <div class="modal-title">导入配置</div>
  552. <button class="modal-close" id="closeImportModal">&times;</button>
  553. </div>
  554. <div class="form-group">
  555. <label class="form-label" for="importConfigJson">配置JSON</label>
  556. <textarea id="importConfigJson" class="form-textarea" placeholder="粘贴配置JSON内容"></textarea>
  557. </div>
  558. <div class="modal-actions">
  559. <button type="button" class="btn" id="cancelImportBtn">取消</button>
  560. <button type="button" class="btn btn-primary" id="confirmImportBtn">导入</button>
  561. </div>
  562. </div>
  563. </div>
  564. <script>
  565. // 这里将包含面板的JavaScript逻辑
  566. </script>
  567. </body>
  568. </html>