@samanhappy/mcphub 0.12.17 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.fr.md +1 -1
  2. package/dist/services/mcpService.js +42 -10
  3. package/dist/services/mcpService.js.map +1 -1
  4. package/dist/services/sseService.js +5 -3
  5. package/dist/services/sseService.js.map +1 -1
  6. package/frontend/dist/assets/ActivityPage-VwilVMvp.js +2 -0
  7. package/frontend/dist/assets/ActivityPage-VwilVMvp.js.map +1 -0
  8. package/frontend/dist/assets/ConfirmDialog-CxlizGia.js +2 -0
  9. package/frontend/dist/assets/ConfirmDialog-CxlizGia.js.map +1 -0
  10. package/frontend/dist/assets/Dashboard-DuBJTbbA.js +2 -0
  11. package/frontend/dist/assets/Dashboard-DuBJTbbA.js.map +1 -0
  12. package/frontend/dist/assets/DeleteDialog-DRbWonMu.js +2 -0
  13. package/frontend/dist/assets/DeleteDialog-DRbWonMu.js.map +1 -0
  14. package/frontend/dist/assets/EndpointCopy-C59moJ3Y.js +2 -0
  15. package/frontend/dist/assets/EndpointCopy-C59moJ3Y.js.map +1 -0
  16. package/frontend/dist/assets/GroupsPage-Bhg51kbu.js +33 -0
  17. package/frontend/dist/assets/GroupsPage-Bhg51kbu.js.map +1 -0
  18. package/frontend/dist/assets/LoginPage-C8RkMoJN.js +2 -0
  19. package/frontend/dist/assets/LoginPage-C8RkMoJN.js.map +1 -0
  20. package/frontend/dist/assets/LogsPage-HBGNLtyN.js +2 -0
  21. package/frontend/dist/assets/LogsPage-HBGNLtyN.js.map +1 -0
  22. package/frontend/dist/assets/MarketPage-C5ATZ4WS.js +3 -0
  23. package/frontend/dist/assets/MarketPage-C5ATZ4WS.js.map +1 -0
  24. package/frontend/dist/assets/{Pagination-y-gVO8ms.js → Pagination-BFi-X7qY.js} +2 -2
  25. package/frontend/dist/assets/{Pagination-y-gVO8ms.js.map → Pagination-BFi-X7qY.js.map} +1 -1
  26. package/frontend/dist/assets/PromptsPage-DUge8OO4.js +2 -0
  27. package/frontend/dist/assets/PromptsPage-DUge8OO4.js.map +1 -0
  28. package/frontend/dist/assets/ResourcesPage-5J3JYGVC.js +2 -0
  29. package/frontend/dist/assets/ResourcesPage-5J3JYGVC.js.map +1 -0
  30. package/frontend/dist/assets/ServersPage-DtnlfwJF.js +37 -0
  31. package/frontend/dist/assets/ServersPage-DtnlfwJF.js.map +1 -0
  32. package/frontend/dist/assets/SettingsPage-BeLZKC1d.js +12 -0
  33. package/frontend/dist/assets/SettingsPage-BeLZKC1d.js.map +1 -0
  34. package/frontend/dist/assets/StatusDot-DR803YdX.js +2 -0
  35. package/frontend/dist/assets/StatusDot-DR803YdX.js.map +1 -0
  36. package/frontend/dist/assets/{ToggleGroup-HfxdlkGi.js → ToggleGroup-DE8t8Ni4.js} +2 -2
  37. package/frontend/dist/assets/{ToggleGroup-HfxdlkGi.js.map → ToggleGroup-DE8t8Ni4.js.map} +1 -1
  38. package/frontend/dist/assets/UsersPage-CMscqAmn.js +2 -0
  39. package/frontend/dist/assets/UsersPage-CMscqAmn.js.map +1 -0
  40. package/frontend/dist/assets/{framework-vendor-_OBebcuv.js → framework-vendor-BUhDPOUZ.js} +2 -2
  41. package/frontend/dist/assets/{framework-vendor-_OBebcuv.js.map → framework-vendor-BUhDPOUZ.js.map} +1 -1
  42. package/frontend/dist/assets/{i18n-vendor-MQ921plD.js → i18n-vendor-Kbr87Ofu.js} +2 -2
  43. package/frontend/dist/assets/{i18n-vendor-MQ921plD.js.map → i18n-vendor-Kbr87Ofu.js.map} +1 -1
  44. package/frontend/dist/assets/icons-vendor-CKgJB3SC.js +292 -0
  45. package/frontend/dist/assets/icons-vendor-CKgJB3SC.js.map +1 -0
  46. package/frontend/dist/assets/index-B9cW2F0H.js +3 -0
  47. package/frontend/dist/assets/index-B9cW2F0H.js.map +1 -0
  48. package/frontend/dist/assets/index-Crcbkt8x.css +1 -0
  49. package/frontend/dist/assets/{resourceService-BfCTSBsr.js → resourceService-BFMkDDIh.js} +2 -2
  50. package/frontend/dist/assets/{resourceService-BfCTSBsr.js.map → resourceService-BFMkDDIh.js.map} +1 -1
  51. package/frontend/dist/assets/useServerData-BnLmpLAC.js +2 -0
  52. package/frontend/dist/assets/{useServerData-QZqQTYcv.js.map → useServerData-BnLmpLAC.js.map} +1 -1
  53. package/frontend/dist/assets/useSettingsData-Cqi9d7Ug.js +2 -0
  54. package/frontend/dist/assets/{useSettingsData-D3VROqS7.js.map → useSettingsData-Cqi9d7Ug.js.map} +1 -1
  55. package/frontend/dist/assets/variableDetection-BigiltQM.js +16 -0
  56. package/frontend/dist/assets/variableDetection-BigiltQM.js.map +1 -0
  57. package/frontend/dist/index.html +5 -5
  58. package/package.json +1 -1
  59. package/frontend/dist/assets/ActivityPage-ClgKeihP.js +0 -2
  60. package/frontend/dist/assets/ActivityPage-ClgKeihP.js.map +0 -1
  61. package/frontend/dist/assets/Badge-Ck2fhRdl.js +0 -2
  62. package/frontend/dist/assets/Badge-Ck2fhRdl.js.map +0 -1
  63. package/frontend/dist/assets/ConfirmDialog-uYjffH4V.js +0 -2
  64. package/frontend/dist/assets/ConfirmDialog-uYjffH4V.js.map +0 -1
  65. package/frontend/dist/assets/Dashboard-BIXrLobn.js +0 -2
  66. package/frontend/dist/assets/Dashboard-BIXrLobn.js.map +0 -1
  67. package/frontend/dist/assets/DeleteDialog-BAfrV8EB.js +0 -2
  68. package/frontend/dist/assets/DeleteDialog-BAfrV8EB.js.map +0 -1
  69. package/frontend/dist/assets/GroupsPage-BjrvyHwu.js +0 -33
  70. package/frontend/dist/assets/GroupsPage-BjrvyHwu.js.map +0 -1
  71. package/frontend/dist/assets/LoginPage-BBHt_TfF.js +0 -2
  72. package/frontend/dist/assets/LoginPage-BBHt_TfF.js.map +0 -1
  73. package/frontend/dist/assets/LogsPage-D8Znq5NB.js +0 -2
  74. package/frontend/dist/assets/LogsPage-D8Znq5NB.js.map +0 -1
  75. package/frontend/dist/assets/MarketPage-haRuzjCw.js +0 -3
  76. package/frontend/dist/assets/MarketPage-haRuzjCw.js.map +0 -1
  77. package/frontend/dist/assets/PromptsPage-ByHWPyGe.js +0 -2
  78. package/frontend/dist/assets/PromptsPage-ByHWPyGe.js.map +0 -1
  79. package/frontend/dist/assets/ResourcesPage-Bodw5OY9.js +0 -2
  80. package/frontend/dist/assets/ResourcesPage-Bodw5OY9.js.map +0 -1
  81. package/frontend/dist/assets/ServersPage-CtS1I4yS.js +0 -37
  82. package/frontend/dist/assets/ServersPage-CtS1I4yS.js.map +0 -1
  83. package/frontend/dist/assets/SettingsPage-DxVigf7p.js +0 -12
  84. package/frontend/dist/assets/SettingsPage-DxVigf7p.js.map +0 -1
  85. package/frontend/dist/assets/UsersPage-Bipw33cS.js +0 -2
  86. package/frontend/dist/assets/UsersPage-Bipw33cS.js.map +0 -1
  87. package/frontend/dist/assets/icons-vendor-B67NtVuR.js +0 -172
  88. package/frontend/dist/assets/icons-vendor-B67NtVuR.js.map +0 -1
  89. package/frontend/dist/assets/index-CmnA4an8.js +0 -5
  90. package/frontend/dist/assets/index-CmnA4an8.js.map +0 -1
  91. package/frontend/dist/assets/index-DfFHVARX.css +0 -1
  92. package/frontend/dist/assets/useGroupData-DLhbP6zd.js +0 -2
  93. package/frontend/dist/assets/useGroupData-DLhbP6zd.js.map +0 -1
  94. package/frontend/dist/assets/useServerData-QZqQTYcv.js +0 -2
  95. package/frontend/dist/assets/useSettingsData-D3VROqS7.js +0 -2
  96. package/frontend/dist/assets/variableDetection-C3Xi21av.js +0 -16
  97. package/frontend/dist/assets/variableDetection-C3Xi21av.js.map +0 -1
@@ -9,11 +9,11 @@
9
9
  <link rel="preconnect" href="https://fonts.googleapis.com">
10
10
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11
11
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
12
- <script type="module" crossorigin src="./assets/index-CmnA4an8.js"></script>
13
- <link rel="modulepreload" crossorigin href="./assets/framework-vendor-_OBebcuv.js">
14
- <link rel="modulepreload" crossorigin href="./assets/i18n-vendor-MQ921plD.js">
15
- <link rel="modulepreload" crossorigin href="./assets/icons-vendor-B67NtVuR.js">
16
- <link rel="stylesheet" crossorigin href="./assets/index-DfFHVARX.css">
12
+ <script type="module" crossorigin src="./assets/index-B9cW2F0H.js"></script>
13
+ <link rel="modulepreload" crossorigin href="./assets/framework-vendor-BUhDPOUZ.js">
14
+ <link rel="modulepreload" crossorigin href="./assets/i18n-vendor-Kbr87Ofu.js">
15
+ <link rel="modulepreload" crossorigin href="./assets/icons-vendor-CKgJB3SC.js">
16
+ <link rel="stylesheet" crossorigin href="./assets/index-Crcbkt8x.css">
17
17
  </head>
18
18
 
19
19
  <body class="bg-gray-100">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samanhappy/mcphub",
3
- "version": "0.12.17",
3
+ "version": "1.0.0",
4
4
  "description": "A hub server for mcp servers",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,2 +0,0 @@
1
- import{r,j as e}from"./framework-vendor-_OBebcuv.js";import{q as Y,r as Z,s as ee,t as te,v as ae}from"./index-CmnA4an8.js";import{P as se}from"./Pagination-y-gVO8ms.js";import{u as re}from"./i18n-vendor-MQ921plD.js";import"./icons-vendor-B67NtVuR.js";const R=["success","error"],le=a=>R.includes(a),xe=()=>{const{t:a}=re(),[v,T]=r.useState([]),[d,V]=r.useState(null),[l,$]=r.useState(null),[c,I]=r.useState(null),[n,o]=r.useState(1),[b,J]=r.useState(10),[j,P]=r.useState(!0),[A,f]=r.useState(null),[i,W]=r.useState(null),[G,F]=r.useState(!1),[z,B]=r.useState({}),[h,w]=r.useState(""),[u,k]=r.useState(""),[x,N]=r.useState(""),[y,S]=r.useState(""),[p,C]=r.useState(""),L=r.useCallback(async()=>{P(!0),f(null);try{const t={...z},[s,m,g]=await Promise.all([Y(n,b,t),Z(t),ee()]);s!=null&&s.success&&Array.isArray(s.data)&&(T(s.data),s.pagination&&I(s.pagination)),m!=null&&m.success&&m.data&&V(m.data),g!=null&&g.success&&g.data&&$(g.data)}catch(t){console.error("Error fetching activity data:",t),f(a("activity.fetchError"))}finally{P(!1)}},[n,b,z,a]);r.useEffect(()=>{L()},[L]),r.useEffect(()=>{if(!c)return;const t=Math.max(1,c.totalPages||1);n>t&&o(t)},[c,n]);const H=async t=>{try{const s=await ae(t.id);s!=null&&s.success&&s.data&&(W(s.data),F(!0))}catch(s){console.error("Error fetching activity details:",s)}},K=async()=>{var t;if(window.confirm(a("activity.confirmCleanup")))try{const s=await te(30);s!=null&&s.success&&(alert(a("activity.cleanupSuccess",{count:((t=s.data)==null?void 0:t.deletedCount)||0})),L())}catch(s){console.error("Error cleaning up activities:",s),alert(a("activity.cleanupError"))}},O=()=>{const t={};h&&(t.server=h),u&&(t.tool=u),x&&le(x)&&(t.status=x),y&&(t.group=y),p&&(t.keyName=p),B(t),o(1)},q=()=>{w(""),k(""),N(""),S(""),C(""),B({}),o(1)},M=t=>t<1e3?`${t}ms`:t<6e4?`${(t/1e3).toFixed(2)}s`:`${(t/6e4).toFixed(2)}m`,D=t=>new Date(t).toLocaleString(),E=t=>{if(!t)return null;try{return JSON.parse(t)}catch{return t}},U=()=>d?e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm px-4 py-3 mb-4",children:e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap",children:a("activity.totalCalls")}),e.jsx("div",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:d.totalCalls})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap",children:a("activity.successCount")}),e.jsx("div",{className:"text-lg font-semibold text-green-600",children:d.successCount})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap",children:a("activity.errorCount")}),e.jsx("div",{className:"text-lg font-semibold text-red-600",children:d.errorCount})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap",children:a("activity.avgDuration")}),e.jsx("div",{className:"text-lg font-semibold text-blue-600",children:M(d.avgDuration)})]})]})}):null,_=()=>e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm px-4 py-3 mb-4",children:e.jsxs("div",{className:"flex flex-wrap gap-3 items-end",children:[e.jsxs("div",{className:"flex-1 min-w-[140px]",children:[e.jsx("label",{className:"sr-only",htmlFor:"activity-server",children:a("activity.server")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"activity-server",type:"text",value:h,onChange:t=>w(t.target.value),placeholder:a("activity.searchServer"),className:"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9",list:"server-options"}),h&&e.jsx("button",{onClick:()=>w(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":a("common.clear"),type:"button",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),(l==null?void 0:l.servers)&&e.jsx("datalist",{id:"server-options",children:l.servers.map(t=>e.jsx("option",{value:t},t))})]}),e.jsxs("div",{className:"flex-1 min-w-[140px]",children:[e.jsx("label",{className:"sr-only",htmlFor:"activity-tool",children:a("activity.tool")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"activity-tool",type:"text",value:u,onChange:t=>k(t.target.value),placeholder:a("activity.searchTool"),className:"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9",list:"tool-options"}),u&&e.jsx("button",{onClick:()=>k(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":a("common.clear"),type:"button",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),(l==null?void 0:l.tools)&&e.jsx("datalist",{id:"tool-options",children:l.tools.map(t=>e.jsx("option",{value:t},t))})]}),e.jsxs("div",{className:"flex-1 min-w-[140px]",children:[e.jsx("label",{className:"sr-only",htmlFor:"activity-status",children:a("activity.status")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"activity-status",type:"text",value:x,onChange:t=>N(t.target.value.toLowerCase()),placeholder:a("activity.searchStatus"),className:"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9",list:"activity-status-options"}),x&&e.jsx("button",{onClick:()=>N(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":a("common.clear"),type:"button",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),e.jsx("datalist",{id:"activity-status-options",children:R.map(t=>e.jsx("option",{value:t},t))})]}),e.jsxs("div",{className:"flex-1 min-w-[140px]",children:[e.jsx("label",{className:"sr-only",htmlFor:"activity-group",children:a("activity.group")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"activity-group",type:"text",value:y,onChange:t=>S(t.target.value),placeholder:a("activity.searchGroup"),className:"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9",list:"group-options"}),y&&e.jsx("button",{onClick:()=>S(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":a("common.clear"),type:"button",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),(l==null?void 0:l.groups)&&e.jsx("datalist",{id:"group-options",children:l.groups.map(t=>e.jsx("option",{value:t},t))})]}),e.jsxs("div",{className:"flex-1 min-w-[140px]",children:[e.jsx("label",{className:"sr-only",htmlFor:"activity-keyname",children:a("activity.keyName")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"activity-keyname",type:"text",value:p,onChange:t=>C(t.target.value),placeholder:a("activity.searchKeyName"),className:"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9",list:"keyname-options"}),p&&e.jsx("button",{onClick:()=>C(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":a("common.clear"),type:"button",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),(l==null?void 0:l.keyNames)&&e.jsx("datalist",{id:"keyname-options",children:l.keyNames.map(t=>e.jsx("option",{value:t},t))})]}),e.jsxs("div",{className:"flex-shrink-0 flex items-center gap-2",children:[e.jsxs("button",{onClick:O,className:"h-10 px-3 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200 whitespace-nowrap",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})}),a("common.search")]}),e.jsxs("button",{onClick:q,className:"h-10 px-3 bg-gray-100 text-gray-800 rounded hover:bg-gray-200 flex items-center btn-secondary transition-all duration-200 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600 whitespace-nowrap",children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{strokeLinecap:"round",d:"M9 9l6 6M15 9l-6 6"})]}),a("common.clear")]})]})]})}),Q=()=>v.length===0?e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow p-8 text-center text-gray-500 dark:text-gray-400",children:a("activity.noData")}):e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[e.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.timestamp")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.server")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.tool")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.duration")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.status")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.group")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.key")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("common.actions")})]})}),e.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:v.map(t=>e.jsxs("tr",{className:"hover:bg-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700",children:[e.jsx("td",{className:"px-4 py-3 text-sm text-gray-900 dark:text-gray-200 whitespace-nowrap",children:D(t.timestamp)}),e.jsx("td",{className:"px-4 py-3 text-sm text-gray-900 dark:text-gray-200",children:e.jsx("span",{className:"font-mono bg-gray-100 dark:bg-gray-700 px-2 py-1 rounded text-xs",children:t.server})}),e.jsx("td",{className:"px-4 py-3 text-sm text-gray-900 dark:text-gray-200",children:e.jsx("span",{className:"font-mono bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 px-2 py-1 rounded text-xs",children:t.tool})}),e.jsx("td",{className:"px-4 py-3 text-sm text-gray-900 dark:text-gray-200 whitespace-nowrap",children:M(t.duration)}),e.jsx("td",{className:"px-4 py-3 text-sm whitespace-nowrap",children:e.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${t.status==="success"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:t.status==="success"?a("activity.statusSuccess"):a("activity.statusError")})}),e.jsx("td",{className:"px-4 py-3 text-sm text-gray-500 dark:text-gray-400",children:t.group||"-"}),e.jsx("td",{className:"px-4 py-3 text-sm text-gray-500 dark:text-gray-400",children:t.keyName||"-"}),e.jsx("td",{className:"px-4 py-3 text-sm",children:e.jsx("button",{onClick:()=>H(t),className:"text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",children:a("common.view")})})]},t.id))})]})})}),X=()=>{if(!G||!i)return null;const t=E(i.input),s=E(i.output);return e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-4xl w-full mx-4 max-h-[90vh] overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:[e.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white",children:a("activity.details")}),e.jsx("button",{onClick:()=>F(!1),className:"text-gray-400 hover:text-gray-500 dark:hover:text-gray-300",children:e.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"px-6 py-4 overflow-y-auto max-h-[calc(90vh-120px)]",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.timestamp")}),e.jsx("p",{className:"text-gray-900 dark:text-white",children:D(i.timestamp)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.duration")}),e.jsx("p",{className:"text-gray-900 dark:text-white",children:M(i.duration)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.server")}),e.jsx("p",{className:"text-gray-900 dark:text-white font-mono",children:i.server})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.tool")}),e.jsx("p",{className:"text-gray-900 dark:text-white font-mono",children:i.tool})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.status")}),e.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${i.status==="success"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:i.status==="success"?a("activity.statusSuccess"):a("activity.statusError")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.group")}),e.jsx("p",{className:"text-gray-900 dark:text-white",children:i.group||"-"})]}),i.keyName&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.key")}),e.jsx("p",{className:"text-gray-900 dark:text-white",children:i.keyName})]})]}),i.errorMessage&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-red-500 mb-1",children:a("activity.errorMessage")}),e.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 rounded p-3 text-sm text-red-800 dark:text-red-200",children:i.errorMessage})]}),t&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:a("activity.input")}),e.jsx("pre",{className:"bg-gray-100 dark:bg-gray-700 rounded p-3 text-sm overflow-x-auto max-h-64",children:typeof t=="string"?t:JSON.stringify(t,null,2)})]}),s&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:a("activity.output")}),e.jsx("pre",{className:"bg-gray-100 dark:bg-gray-700 rounded p-3 text-sm overflow-x-auto max-h-64",children:typeof s=="string"?s:JSON.stringify(s,null,2)})]})]})]})})};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:a("activity.title")}),e.jsx("div",{className:"flex space-x-4",children:e.jsxs("button",{onClick:K,className:"px-4 py-2 bg-red-100 text-red-800 rounded hover:bg-red-200 flex items-center transition-all duration-200",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})}),a("activity.cleanup")]})})]}),A&&e.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-red-700",children:A}),e.jsx("button",{onClick:()=>f(null),className:"ml-4 text-gray-500 hover:text-gray-700",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{strokeLinecap:"round",d:"M9 9l6 6M15 9l-6 6"})]})})]})}),j&&v.length===0?e.jsx("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:a("app.loading")})]})}):e.jsxs(e.Fragment,{children:[U(),_(),Q(),e.jsxs("div",{className:"flex items-center mt-6",children:[e.jsx("div",{className:"flex-[2] text-sm text-gray-500 dark:text-gray-400",children:c&&a("common.showing",{start:(c.page-1)*c.limit+1,end:Math.min(c.page*c.limit,c.total),total:c.total})}),e.jsx("div",{className:"flex-[4] flex justify-center",children:c&&c.totalPages>1&&e.jsx(se,{currentPage:n,totalPages:c.totalPages,onPageChange:o,disabled:j})}),e.jsxs("div",{className:"flex-[2] flex items-center justify-end space-x-2",children:[e.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-500 dark:text-gray-400",children:[a("common.itemsPerPage"),":"]}),e.jsxs("select",{id:"perPage",value:b,onChange:t=>{J(Number(t.target.value)),o(1)},disabled:j,className:"border border-gray-300 dark:border-gray-600 rounded p-1 text-sm dark:bg-gray-700 dark:text-white outline-none disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx("option",{value:10,children:"10"}),e.jsx("option",{value:20,children:"20"}),e.jsx("option",{value:50,children:"50"}),e.jsx("option",{value:100,children:"100"})]})]})]})]}),X()]})};export{xe as default};
2
- //# sourceMappingURL=ActivityPage-ClgKeihP.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ActivityPage-ClgKeihP.js","sources":["../../src/pages/ActivityPage.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n Activity,\n ActivityStats,\n ActivityFilter,\n ActivityFilterOptions,\n ActivityStatus,\n} from '@/types';\nimport {\n getActivities,\n getActivityById,\n getActivityStats,\n getActivityFilterOptions,\n deleteOldActivities,\n} from '@/services/activityService';\nimport Pagination from '@/components/ui/Pagination';\n\n// Pagination info type\ninterface PaginationInfo {\n page: number;\n limit: number;\n total: number;\n totalPages: number;\n hasNextPage: boolean;\n hasPrevPage: boolean;\n}\n\nconst STATUS_OPTIONS: ActivityStatus[] = ['success', 'error'];\n\nconst isValidStatus = (value: string): value is ActivityStatus =>\n STATUS_OPTIONS.includes(value as ActivityStatus);\n\nconst ActivityPage: React.FC = () => {\n const { t } = useTranslation();\n\n // State\n const [activities, setActivities] = useState<Activity[]>([]);\n const [stats, setStats] = useState<ActivityStats | null>(null);\n const [filterOptions, setFilterOptions] = useState<ActivityFilterOptions | null>(null);\n const [pagination, setPagination] = useState<PaginationInfo | null>(null);\n const [currentPage, setCurrentPage] = useState(1);\n const [itemsPerPage, setItemsPerPage] = useState(10);\n const [isLoading, setIsLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n const [selectedActivity, setSelectedActivity] = useState<Activity | null>(null);\n const [showDetailModal, setShowDetailModal] = useState(false);\n\n // Filter state\n const [appliedFilters, setAppliedFilters] = useState<ActivityFilter>({});\n const [searchServer, setSearchServer] = useState('');\n const [searchTool, setSearchTool] = useState('');\n const [searchStatus, setSearchStatus] = useState<string>('');\n const [searchGroup, setSearchGroup] = useState('');\n const [searchKeyName, setSearchKeyName] = useState('');\n\n // Fetch data\n const fetchData = useCallback(async () => {\n setIsLoading(true);\n setError(null);\n\n try {\n // Use appliedFilters directly for fetching\n const currentFilter = { ...appliedFilters };\n\n // Fetch activities, stats, and filter options in parallel\n const [activitiesRes, statsRes, optionsRes] = await Promise.all([\n getActivities(currentPage, itemsPerPage, currentFilter),\n getActivityStats(currentFilter),\n getActivityFilterOptions(),\n ]);\n\n if (activitiesRes?.success && Array.isArray(activitiesRes.data)) {\n setActivities(activitiesRes.data);\n if (activitiesRes.pagination) {\n setPagination(activitiesRes.pagination);\n }\n }\n\n if (statsRes?.success && statsRes.data) {\n setStats(statsRes.data);\n }\n\n if (optionsRes?.success && optionsRes.data) {\n setFilterOptions(optionsRes.data);\n }\n } catch (err) {\n console.error('Error fetching activity data:', err);\n setError(t('activity.fetchError'));\n } finally {\n setIsLoading(false);\n }\n }, [currentPage, itemsPerPage, appliedFilters, t]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (!pagination) {\n return;\n }\n\n const totalPages = Math.max(1, pagination.totalPages || 1);\n if (currentPage > totalPages) {\n setCurrentPage(totalPages);\n }\n }, [pagination, currentPage]);\n\n // Handle view activity details\n const handleViewDetails = async (activity: Activity) => {\n try {\n const response = await getActivityById(activity.id);\n if (response?.success && response.data) {\n setSelectedActivity(response.data);\n setShowDetailModal(true);\n }\n } catch (err) {\n console.error('Error fetching activity details:', err);\n }\n };\n\n // Handle cleanup old activities\n const handleCleanup = async () => {\n if (!window.confirm(t('activity.confirmCleanup'))) {\n return;\n }\n\n try {\n const response = await deleteOldActivities(30);\n if (response?.success) {\n alert(t('activity.cleanupSuccess', { count: response.data?.deletedCount || 0 }));\n fetchData();\n }\n } catch (err) {\n console.error('Error cleaning up activities:', err);\n alert(t('activity.cleanupError'));\n }\n };\n\n // Handle search\n const handleSearch = () => {\n const filters: ActivityFilter = {};\n if (searchServer) filters.server = searchServer;\n if (searchTool) filters.tool = searchTool;\n if (searchStatus && isValidStatus(searchStatus)) {\n filters.status = searchStatus;\n }\n if (searchGroup) filters.group = searchGroup;\n if (searchKeyName) filters.keyName = searchKeyName;\n\n setAppliedFilters(filters);\n setCurrentPage(1);\n };\n\n // Handle clear filters\n const handleClearFilters = () => {\n setSearchServer('');\n setSearchTool('');\n setSearchStatus('');\n setSearchGroup('');\n setSearchKeyName('');\n setAppliedFilters({});\n setCurrentPage(1);\n };\n\n // Format duration\n const formatDuration = (ms: number): string => {\n if (ms < 1000) return `${ms}ms`;\n if (ms < 60000) return `${(ms / 1000).toFixed(2)}s`;\n return `${(ms / 60000).toFixed(2)}m`;\n };\n\n // Format timestamp\n const formatTimestamp = (timestamp: string): string => {\n return new Date(timestamp).toLocaleString();\n };\n\n // Parse JSON safely\n const safeParseJSON = (str: string | undefined): any => {\n if (!str) return null;\n try {\n return JSON.parse(str);\n } catch {\n return str;\n }\n };\n\n // Render stats cards\n const renderStats = () => {\n if (!stats) return null;\n\n return (\n <div className=\"bg-white dark:bg-gray-800 rounded-lg shadow-sm px-4 py-3 mb-4\">\n <div className=\"grid grid-cols-2 md:grid-cols-4 gap-3\">\n <div className=\"flex items-center gap-2\">\n <div className=\"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap\">\n {t('activity.totalCalls')}\n </div>\n <div className=\"text-lg font-semibold text-gray-900 dark:text-white\">\n {stats.totalCalls}\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap\">\n {t('activity.successCount')}\n </div>\n <div className=\"text-lg font-semibold text-green-600\">{stats.successCount}</div>\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap\">\n {t('activity.errorCount')}\n </div>\n <div className=\"text-lg font-semibold text-red-600\">{stats.errorCount}</div>\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap\">\n {t('activity.avgDuration')}\n </div>\n <div className=\"text-lg font-semibold text-blue-600\">\n {formatDuration(stats.avgDuration)}\n </div>\n </div>\n </div>\n </div>\n );\n };\n\n // Render filters\n const renderFilters = () => {\n return (\n <div className=\"bg-white dark:bg-gray-800 rounded-lg shadow-sm px-4 py-3 mb-4\">\n <div className=\"flex flex-wrap gap-3 items-end\">\n <div className=\"flex-1 min-w-[140px]\">\n <label className=\"sr-only\" htmlFor=\"activity-server\">\n {t('activity.server')}\n </label>\n <div className=\"relative\">\n <input\n id=\"activity-server\"\n type=\"text\"\n value={searchServer}\n onChange={(e) => setSearchServer(e.target.value)}\n placeholder={t('activity.searchServer')}\n className=\"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9\"\n list=\"server-options\"\n />\n {searchServer && (\n <button\n onClick={() => setSearchServer('')}\n className=\"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300\"\n aria-label={t('common.clear')}\n type=\"button\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-4 w-4\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </button>\n )}\n </div>\n {filterOptions?.servers && (\n <datalist id=\"server-options\">\n {filterOptions.servers.map((s) => (\n <option key={s} value={s} />\n ))}\n </datalist>\n )}\n </div>\n <div className=\"flex-1 min-w-[140px]\">\n <label className=\"sr-only\" htmlFor=\"activity-tool\">\n {t('activity.tool')}\n </label>\n <div className=\"relative\">\n <input\n id=\"activity-tool\"\n type=\"text\"\n value={searchTool}\n onChange={(e) => setSearchTool(e.target.value)}\n placeholder={t('activity.searchTool')}\n className=\"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9\"\n list=\"tool-options\"\n />\n {searchTool && (\n <button\n onClick={() => setSearchTool('')}\n className=\"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300\"\n aria-label={t('common.clear')}\n type=\"button\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-4 w-4\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </button>\n )}\n </div>\n {filterOptions?.tools && (\n <datalist id=\"tool-options\">\n {filterOptions.tools.map((t) => (\n <option key={t} value={t} />\n ))}\n </datalist>\n )}\n </div>\n <div className=\"flex-1 min-w-[140px]\">\n <label className=\"sr-only\" htmlFor=\"activity-status\">\n {t('activity.status')}\n </label>\n <div className=\"relative\">\n <input\n id=\"activity-status\"\n type=\"text\"\n value={searchStatus}\n onChange={(e) => setSearchStatus(e.target.value.toLowerCase())}\n placeholder={t('activity.searchStatus')}\n className=\"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9\"\n list=\"activity-status-options\"\n />\n {searchStatus && (\n <button\n onClick={() => setSearchStatus('')}\n className=\"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300\"\n aria-label={t('common.clear')}\n type=\"button\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-4 w-4\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </button>\n )}\n </div>\n <datalist id=\"activity-status-options\">\n {STATUS_OPTIONS.map((status) => (\n <option key={status} value={status} />\n ))}\n </datalist>\n </div>\n <div className=\"flex-1 min-w-[140px]\">\n <label className=\"sr-only\" htmlFor=\"activity-group\">\n {t('activity.group')}\n </label>\n <div className=\"relative\">\n <input\n id=\"activity-group\"\n type=\"text\"\n value={searchGroup}\n onChange={(e) => setSearchGroup(e.target.value)}\n placeholder={t('activity.searchGroup')}\n className=\"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9\"\n list=\"group-options\"\n />\n {searchGroup && (\n <button\n onClick={() => setSearchGroup('')}\n className=\"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300\"\n aria-label={t('common.clear')}\n type=\"button\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-4 w-4\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </button>\n )}\n </div>\n {filterOptions?.groups && (\n <datalist id=\"group-options\">\n {filterOptions.groups.map((g) => (\n <option key={g} value={g} />\n ))}\n </datalist>\n )}\n </div>\n <div className=\"flex-1 min-w-[140px]\">\n <label className=\"sr-only\" htmlFor=\"activity-keyname\">\n {t('activity.keyName')}\n </label>\n <div className=\"relative\">\n <input\n id=\"activity-keyname\"\n type=\"text\"\n value={searchKeyName}\n onChange={(e) => setSearchKeyName(e.target.value)}\n placeholder={t('activity.searchKeyName')}\n className=\"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9\"\n list=\"keyname-options\"\n />\n {searchKeyName && (\n <button\n onClick={() => setSearchKeyName('')}\n className=\"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300\"\n aria-label={t('common.clear')}\n type=\"button\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-4 w-4\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </button>\n )}\n </div>\n {filterOptions?.keyNames && (\n <datalist id=\"keyname-options\">\n {filterOptions.keyNames.map((k) => (\n <option key={k} value={k} />\n ))}\n </datalist>\n )}\n </div>\n <div className=\"flex-shrink-0 flex items-center gap-2\">\n <button\n onClick={handleSearch}\n className=\"h-10 px-3 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200 whitespace-nowrap\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-4 w-4 mr-2\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z\"\n clipRule=\"evenodd\"\n />\n </svg>\n {t('common.search')}\n </button>\n <button\n onClick={handleClearFilters}\n className=\"h-10 px-3 bg-gray-100 text-gray-800 rounded hover:bg-gray-200 flex items-center btn-secondary transition-all duration-200 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600 whitespace-nowrap\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-4 w-4 mr-2\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path strokeLinecap=\"round\" d=\"M9 9l6 6M15 9l-6 6\" />\n </svg>\n {t('common.clear')}\n </button>\n </div>\n </div>\n </div>\n );\n };\n\n // Render activity table\n const renderActivityTable = () => {\n if (activities.length === 0) {\n return (\n <div className=\"bg-white dark:bg-gray-800 rounded-lg shadow p-8 text-center text-gray-500 dark:text-gray-400\">\n {t('activity.noData')}\n </div>\n );\n }\n\n return (\n <div className=\"bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden\">\n <div className=\"overflow-x-auto\">\n <table className=\"min-w-full divide-y divide-gray-200 dark:divide-gray-700\">\n <thead className=\"bg-gray-50 dark:bg-gray-700\">\n <tr>\n <th className=\"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider\">\n {t('activity.timestamp')}\n </th>\n <th className=\"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider\">\n {t('activity.server')}\n </th>\n <th className=\"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider\">\n {t('activity.tool')}\n </th>\n <th className=\"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider\">\n {t('activity.duration')}\n </th>\n <th className=\"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider\">\n {t('activity.status')}\n </th>\n <th className=\"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider\">\n {t('activity.group')}\n </th>\n <th className=\"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider\">\n {t('activity.key')}\n </th>\n <th className=\"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider\">\n {t('common.actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700\">\n {activities.map((activity) => (\n <tr key={activity.id} className=\"hover:bg-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700\">\n <td className=\"px-4 py-3 text-sm text-gray-900 dark:text-gray-200 whitespace-nowrap\">\n {formatTimestamp(activity.timestamp)}\n </td>\n <td className=\"px-4 py-3 text-sm text-gray-900 dark:text-gray-200\">\n <span className=\"font-mono bg-gray-100 dark:bg-gray-700 px-2 py-1 rounded text-xs\">\n {activity.server}\n </span>\n </td>\n <td className=\"px-4 py-3 text-sm text-gray-900 dark:text-gray-200\">\n <span className=\"font-mono bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 px-2 py-1 rounded text-xs\">\n {activity.tool}\n </span>\n </td>\n <td className=\"px-4 py-3 text-sm text-gray-900 dark:text-gray-200 whitespace-nowrap\">\n {formatDuration(activity.duration)}\n </td>\n <td className=\"px-4 py-3 text-sm whitespace-nowrap\">\n <span\n className={`px-2 py-1 rounded text-xs font-medium ${\n activity.status === 'success'\n ? 'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200'\n : 'bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200'\n }`}\n >\n {activity.status === 'success'\n ? t('activity.statusSuccess')\n : t('activity.statusError')}\n </span>\n </td>\n <td className=\"px-4 py-3 text-sm text-gray-500 dark:text-gray-400\">\n {activity.group || '-'}\n </td>\n <td className=\"px-4 py-3 text-sm text-gray-500 dark:text-gray-400\">\n {activity.keyName || '-'}\n </td>\n <td className=\"px-4 py-3 text-sm\">\n <button\n onClick={() => handleViewDetails(activity)}\n className=\"text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300\"\n >\n {t('common.view')}\n </button>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n );\n };\n\n // Render detail modal\n const renderDetailModal = () => {\n if (!showDetailModal || !selectedActivity) return null;\n\n const inputData = safeParseJSON(selectedActivity.input);\n const outputData = safeParseJSON(selectedActivity.output);\n\n return (\n <div className=\"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50\">\n <div className=\"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-4xl w-full mx-4 max-h-[90vh] overflow-hidden\">\n <div className=\"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700\">\n <h3 className=\"text-lg font-medium text-gray-900 dark:text-white\">\n {t('activity.details')}\n </h3>\n <button\n onClick={() => setShowDetailModal(false)}\n className=\"text-gray-400 hover:text-gray-500 dark:hover:text-gray-300\"\n >\n <svg className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </button>\n </div>\n <div className=\"px-6 py-4 overflow-y-auto max-h-[calc(90vh-120px)]\">\n <div className=\"grid grid-cols-2 gap-4 mb-4\">\n <div>\n <label className=\"block text-sm font-medium text-gray-500 dark:text-gray-400\">\n {t('activity.timestamp')}\n </label>\n <p className=\"text-gray-900 dark:text-white\">\n {formatTimestamp(selectedActivity.timestamp)}\n </p>\n </div>\n <div>\n <label className=\"block text-sm font-medium text-gray-500 dark:text-gray-400\">\n {t('activity.duration')}\n </label>\n <p className=\"text-gray-900 dark:text-white\">\n {formatDuration(selectedActivity.duration)}\n </p>\n </div>\n <div>\n <label className=\"block text-sm font-medium text-gray-500 dark:text-gray-400\">\n {t('activity.server')}\n </label>\n <p className=\"text-gray-900 dark:text-white font-mono\">{selectedActivity.server}</p>\n </div>\n <div>\n <label className=\"block text-sm font-medium text-gray-500 dark:text-gray-400\">\n {t('activity.tool')}\n </label>\n <p className=\"text-gray-900 dark:text-white font-mono\">{selectedActivity.tool}</p>\n </div>\n <div>\n <label className=\"block text-sm font-medium text-gray-500 dark:text-gray-400\">\n {t('activity.status')}\n </label>\n <span\n className={`px-2 py-1 rounded text-xs font-medium ${\n selectedActivity.status === 'success'\n ? 'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200'\n : 'bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200'\n }`}\n >\n {selectedActivity.status === 'success'\n ? t('activity.statusSuccess')\n : t('activity.statusError')}\n </span>\n </div>\n <div>\n <label className=\"block text-sm font-medium text-gray-500 dark:text-gray-400\">\n {t('activity.group')}\n </label>\n <p className=\"text-gray-900 dark:text-white\">{selectedActivity.group || '-'}</p>\n </div>\n {selectedActivity.keyName && (\n <div>\n <label className=\"block text-sm font-medium text-gray-500 dark:text-gray-400\">\n {t('activity.key')}\n </label>\n <p className=\"text-gray-900 dark:text-white\">{selectedActivity.keyName}</p>\n </div>\n )}\n </div>\n\n {selectedActivity.errorMessage && (\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium text-red-500 mb-1\">\n {t('activity.errorMessage')}\n </label>\n <div className=\"bg-red-50 dark:bg-red-900/20 rounded p-3 text-sm text-red-800 dark:text-red-200\">\n {selectedActivity.errorMessage}\n </div>\n </div>\n )}\n\n {inputData && (\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium text-gray-500 dark:text-gray-400 mb-1\">\n {t('activity.input')}\n </label>\n <pre className=\"bg-gray-100 dark:bg-gray-700 rounded p-3 text-sm overflow-x-auto max-h-64\">\n {typeof inputData === 'string' ? inputData : JSON.stringify(inputData, null, 2)}\n </pre>\n </div>\n )}\n\n {outputData && (\n <div>\n <label className=\"block text-sm font-medium text-gray-500 dark:text-gray-400 mb-1\">\n {t('activity.output')}\n </label>\n <pre className=\"bg-gray-100 dark:bg-gray-700 rounded p-3 text-sm overflow-x-auto max-h-64\">\n {typeof outputData === 'string'\n ? outputData\n : JSON.stringify(outputData, null, 2)}\n </pre>\n </div>\n )}\n </div>\n </div>\n </div>\n );\n };\n\n return (\n <div>\n <div className=\"flex justify-between items-center mb-6\">\n <h1 className=\"text-2xl font-bold text-gray-900 dark:text-white\">{t('activity.title')}</h1>\n <div className=\"flex space-x-4\">\n <button\n onClick={handleCleanup}\n className=\"px-4 py-2 bg-red-100 text-red-800 rounded hover:bg-red-200 flex items-center transition-all duration-200\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-4 w-4 mr-2\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z\"\n clipRule=\"evenodd\"\n />\n </svg>\n {t('activity.cleanup')}\n </button>\n </div>\n </div>\n\n {error && (\n <div className=\"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm\">\n <div className=\"flex items-center justify-between\">\n <p className=\"text-red-700\">{error}</p>\n <button\n onClick={() => setError(null)}\n className=\"ml-4 text-gray-500 hover:text-gray-700\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-4 w-4 mr-2\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.8\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path strokeLinecap=\"round\" d=\"M9 9l6 6M15 9l-6 6\" />\n </svg>\n </button>\n </div>\n </div>\n )}\n\n {isLoading && activities.length === 0 ? (\n <div className=\"bg-white dark:bg-gray-800 shadow rounded-lg p-6 flex items-center justify-center\">\n <div className=\"flex flex-col items-center\">\n <svg\n className=\"animate-spin h-10 w-10 text-blue-500 mb-4\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <p className=\"text-gray-500 dark:text-gray-400\">{t('app.loading')}</p>\n </div>\n </div>\n ) : (\n <>\n {renderStats()}\n {renderFilters()}\n {renderActivityTable()}\n\n {/* Pagination */}\n <div className=\"flex items-center mt-6\">\n <div className=\"flex-[2] text-sm text-gray-500 dark:text-gray-400\">\n {pagination &&\n t('common.showing', {\n start: (pagination.page - 1) * pagination.limit + 1,\n end: Math.min(pagination.page * pagination.limit, pagination.total),\n total: pagination.total,\n })}\n </div>\n <div className=\"flex-[4] flex justify-center\">\n {pagination && pagination.totalPages > 1 && (\n <Pagination\n currentPage={currentPage}\n totalPages={pagination.totalPages}\n onPageChange={setCurrentPage}\n disabled={isLoading}\n />\n )}\n </div>\n <div className=\"flex-[2] flex items-center justify-end space-x-2\">\n <label htmlFor=\"perPage\" className=\"text-sm text-gray-500 dark:text-gray-400\">\n {t('common.itemsPerPage')}:\n </label>\n <select\n id=\"perPage\"\n value={itemsPerPage}\n onChange={(e) => {\n setItemsPerPage(Number(e.target.value));\n setCurrentPage(1);\n }}\n disabled={isLoading}\n className=\"border border-gray-300 dark:border-gray-600 rounded p-1 text-sm dark:bg-gray-700 dark:text-white outline-none disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n <option value={10}>10</option>\n <option value={20}>20</option>\n <option value={50}>50</option>\n <option value={100}>100</option>\n </select>\n </div>\n </div>\n </>\n )}\n\n {renderDetailModal()}\n </div>\n );\n};\n\nexport default ActivityPage;\n"],"names":["STATUS_OPTIONS","isValidStatus","value","ActivityPage","t","useTranslation","activities","setActivities","useState","stats","setStats","filterOptions","setFilterOptions","pagination","setPagination","currentPage","setCurrentPage","itemsPerPage","setItemsPerPage","isLoading","setIsLoading","error","setError","selectedActivity","setSelectedActivity","showDetailModal","setShowDetailModal","appliedFilters","setAppliedFilters","searchServer","setSearchServer","searchTool","setSearchTool","searchStatus","setSearchStatus","searchGroup","setSearchGroup","searchKeyName","setSearchKeyName","fetchData","useCallback","currentFilter","activitiesRes","statsRes","optionsRes","getActivities","getActivityStats","getActivityFilterOptions","err","useEffect","totalPages","handleViewDetails","activity","response","getActivityById","handleCleanup","deleteOldActivities","_a","handleSearch","filters","handleClearFilters","formatDuration","ms","formatTimestamp","timestamp","safeParseJSON","str","renderStats","jsxs","jsx","renderFilters","e","s","status","g","k","renderActivityTable","renderDetailModal","inputData","outputData","Fragment","Pagination"],"mappings":"4PA4BA,MAAMA,EAAmC,CAAC,UAAW,OAAO,EAEtDC,GAAiBC,GACrBF,EAAe,SAASE,CAAuB,EAE3CC,GAAyB,IAAM,CACnC,KAAM,CAAE,EAAAC,CAAA,EAAMC,G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AAAA,KAAC,SAAA,CACC,GAAG,UACH,MAAOnD,EACP,SAAWsD,GAAM,CACfrD,EAAgB,OAAOqD,EAAE,OAAO,KAAK,CAAC,EACtCvD,EAAe,CAAC,CAClB,EACA,SAAUG,EACV,UAAU,gKAEV,SAAA,CAAAkD,EAAAA,IAAC,SAAA,CAAO,MAAO,GAAI,SAAA,KAAE,EACrBA,EAAAA,IAAC,SAAA,CAAO,MAAO,GAAI,SAAA,KAAE,EACrBA,EAAAA,IAAC,SAAA,CAAO,MAAO,GAAI,SAAA,KAAE,EACrBA,EAAAA,IAAC,SAAA,CAAO,MAAO,IAAK,SAAA,KAAA,CAAG,CAAA,CAAA,CAAA,CACzB,CAAA,CACF,CAAA,CAAA,CACF,CAAA,EACF,EAGDQ,EAAA,CAAkB,EACrB,CAEJ"}
@@ -1,2 +0,0 @@
1
- import{j as n}from"./framework-vendor-_OBebcuv.js";import{l as d}from"./index-CmnA4an8.js";import{u}from"./i18n-vendor-MQ921plD.js";const c={default:"bg-blue-500 text-white hover:bg-blue-600",secondary:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600",outline:"bg-transparent border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800",destructive:"bg-red-500 text-white hover:bg-red-600"};function x({children:e,variant:t="default",className:r,onClick:o}){return n.jsx("span",{className:d("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",c[t],o?"cursor-pointer":"",r),onClick:o,children:e})}const f=({status:e,onAuthClick:t})=>{const{t:r}=u(),o={connecting:"status-badge-connecting",connected:"status-badge-online",disconnected:"status-badge-offline",oauth_required:"status-badge-oauth-required"},s={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting",oauth_required:"status.oauthRequired"},a=e==="oauth_required";return n.jsxs("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${o[e]} ${a&&t?"cursor-pointer hover:opacity-80":""}`,onClick:a&&t?i=>t(i):void 0,title:a?r("status.clickToAuthorize"):void 0,children:[a&&"🔐 ",r(s[e]||e)]})};export{x as B,f as S};
2
- //# sourceMappingURL=Badge-Ck2fhRdl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Badge-Ck2fhRdl.js","sources":["../../src/components/ui/Badge.tsx"],"sourcesContent":["import React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cn } from '../../utils/cn';\n\ntype BadgeVariant = 'default' | 'secondary' | 'outline' | 'destructive';\n\ntype BadgeProps = {\n children: React.ReactNode;\n variant?: BadgeVariant;\n className?: string;\n onClick?: () => void;\n};\n\nconst badgeVariants = {\n default: 'bg-blue-500 text-white hover:bg-blue-600',\n secondary:\n 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600',\n outline:\n 'bg-transparent border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800',\n destructive: 'bg-red-500 text-white hover:bg-red-600',\n};\n\nexport function Badge({ children, variant = 'default', className, onClick }: BadgeProps) {\n return (\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors',\n badgeVariants[variant],\n onClick ? 'cursor-pointer' : '',\n className,\n )}\n onClick={onClick}\n >\n {children}\n </span>\n );\n}\n\n// For backward compatibility with existing code\nexport const StatusBadge = ({\n status,\n onAuthClick,\n}: {\n status: 'connected' | 'disconnected' | 'connecting' | 'oauth_required';\n onAuthClick?: (e: React.MouseEvent) => void;\n}) => {\n const { t } = useTranslation();\n\n const colors = {\n connecting: 'status-badge-connecting',\n connected: 'status-badge-online',\n disconnected: 'status-badge-offline',\n oauth_required: 'status-badge-oauth-required',\n };\n\n // Map status to translation keys\n const statusTranslations = {\n connected: 'status.online',\n disconnected: 'status.offline',\n connecting: 'status.connecting',\n oauth_required: 'status.oauthRequired',\n };\n\n const isOAuthRequired = status === 'oauth_required';\n\n return (\n <span\n className={`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${colors[status]} ${isOAuthRequired && onAuthClick ? 'cursor-pointer hover:opacity-80' : ''}`}\n onClick={isOAuthRequired && onAuthClick ? (e) => onAuthClick(e) : undefined}\n title={isOAuthRequired ? t('status.clickToAuthorize') : undefined}\n >\n {isOAuthRequired && '🔐 '}\n {t(statusTranslations[status] || status)}\n </span>\n );\n};\n"],"names":["badgeVariants","Badge","children","variant","className","onClick","jsx","cn","StatusBadge","status","onAuthClick","t","useTranslation","colors","statusTranslations","isOAuthRequired","jsxs","e"],"mappings":"oIAaA,MAAMA,EAAgB,CACpB,QAAS,2CACT,UACE,yGACF,QACE,uIACF,YAAa,wCACf,EAEO,SAASC,EAAM,CAAE,SAAAC,EAAU,QAAAC,EAAU,UAAW,UAAAC,EAAW,QAAAC,GAAuB,CACvF,OACEC,EAAAA,IAAC,OAAA,CACC,UAAWC,EACT,8FACAP,EAAcG,CAAO,EACrBE,EAAU,iBAAmB,GAC7BD,CAAA,EAEF,QAAAC,EAEC,SAAAH,CAAA,CAAA,CAGP,CAGO,MAAMM,EAAc,CAAC,CAC1B,OAAAC,EACA,YAAAC,CACF,IAGM,CACJ,KAAM,CAAE,EAAAC,CAAA,EAAMC,EAAA,EAERC,EAAS,CACb,WAAY,0BACZ,UAAW,sBACX,aAAc,uBACd,eAAgB,6BAAA,EAIZC,EAAqB,CACzB,UAAW,gBACX,aAAc,iBACd,WAAY,oBACZ,eAAgB,sBAAA,EAGZC,EAAkBN,IAAW,iBAEnC,OACEO,EAAAA,KAAC,OAAA,CACC,UAAW,iEAAiEH,EAAOJ,CAAM,CAAC,IAAIM,GAAmBL,EAAc,kCAAoC,EAAE,GACrK,QAASK,GAAmBL,EAAeO,GAAMP,EAAYO,CAAC,EAAI,OAClE,MAAOF,EAAkBJ,EAAE,yBAAyB,EAAI,OAEvD,SAAA,CAAAI,GAAmB,MACnBJ,EAAEG,EAAmBL,CAAM,GAAKA,CAAM,CAAA,CAAA,CAAA,CAG7C"}
@@ -1,2 +0,0 @@
1
- import{j as e}from"./framework-vendor-_OBebcuv.js";import{u as f}from"./i18n-vendor-MQ921plD.js";const w=({isOpen:l,onClose:n,onConfirm:t,title:o,message:c,confirmText:d,cancelText:m,variant:s="warning"})=>{const{t:i}=f();if(!l)return null;const x=()=>{switch(s){case"danger":return{icon:e.jsx("svg",{className:"w-6 h-6 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),confirmClass:"bg-red-600 hover:bg-red-700 text-white"};case"warning":return{icon:e.jsx("svg",{className:"w-6 h-6 text-yellow-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),confirmClass:"bg-yellow-600 hover:bg-yellow-700 text-white"};case"info":return{icon:e.jsx("svg",{className:"w-6 h-6 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),confirmClass:"bg-blue-600 hover:bg-blue-700 text-white"};default:return{icon:null,confirmClass:"bg-blue-600 hover:bg-blue-700 text-white"}}},{icon:a,confirmClass:u}=x(),h=r=>{r.target===r.currentTarget&&n()},g=r=>{r.key==="Escape"?n():r.key==="Enter"&&t()};return e.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4",onClick:h,onKeyDown:g,tabIndex:-1,children:e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full transform transition-all duration-200 ease-out",role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-message",children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-start space-x-3",children:[a&&e.jsx("div",{className:"flex-shrink-0",children:a}),e.jsxs("div",{className:"flex-1",children:[o&&e.jsx("h3",{id:"confirm-dialog-title",className:"text-lg font-medium text-gray-900 mb-2",children:o}),e.jsx("p",{id:"confirm-dialog-message",className:"text-gray-600 leading-relaxed",children:c})]})]}),e.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[e.jsx("button",{onClick:n,className:"px-4 py-2 text-gray-600 hover:text-gray-800 hover:bg-gray-100 dark:bg-gray-800 rounded-md transition-colors duration-150 btn-secondary",autoFocus:!0,children:m||i("common.cancel")}),e.jsx("button",{onClick:t,className:`px-4 py-2 rounded-md transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-offset-2 ${u} ${s==="danger"?"btn-danger":s==="warning"?"btn-warning":"btn-primary"}`,children:d||i("common.confirm")})]})]})})})};export{w as C};
2
- //# sourceMappingURL=ConfirmDialog-uYjffH4V.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConfirmDialog-uYjffH4V.js","sources":["../../src/components/ui/ConfirmDialog.tsx"],"sourcesContent":["import React from 'react';\nimport { useTranslation } from 'react-i18next';\n\ninterface ConfirmDialogProps {\n isOpen: boolean;\n onClose: () => void;\n onConfirm: () => void;\n title?: string;\n message: string;\n confirmText?: string;\n cancelText?: string;\n variant?: 'danger' | 'warning' | 'info';\n}\n\nconst ConfirmDialog: React.FC<ConfirmDialogProps> = ({\n isOpen,\n onClose,\n onConfirm,\n title,\n message,\n confirmText,\n cancelText,\n variant = 'warning'\n}) => {\n const { t } = useTranslation();\n\n if (!isOpen) return null;\n\n const getVariantStyles = () => {\n switch (variant) {\n case 'danger':\n return {\n icon: (\n <svg className=\"w-6 h-6 text-red-600\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z\" />\n </svg>\n ),\n confirmClass: 'bg-red-600 hover:bg-red-700 text-white',\n };\n case 'warning':\n return {\n icon: (\n <svg className=\"w-6 h-6 text-yellow-600\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z\" />\n </svg>\n ),\n confirmClass: 'bg-yellow-600 hover:bg-yellow-700 text-white',\n };\n case 'info':\n return {\n icon: (\n <svg className=\"w-6 h-6 text-blue-600\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n ),\n confirmClass: 'bg-blue-600 hover:bg-blue-700 text-white',\n };\n default:\n return {\n icon: null,\n confirmClass: 'bg-blue-600 hover:bg-blue-700 text-white',\n };\n }\n };\n\n const { icon, confirmClass } = getVariantStyles();\n\n const handleBackdropClick = (e: React.MouseEvent) => {\n if (e.target === e.currentTarget) {\n onClose();\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose();\n } else if (e.key === 'Enter') {\n onConfirm();\n }\n };\n\n return (\n <div\n className=\"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4\"\n onClick={handleBackdropClick}\n onKeyDown={handleKeyDown}\n tabIndex={-1}\n >\n <div\n className=\"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full transform transition-all duration-200 ease-out\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"confirm-dialog-title\"\n aria-describedby=\"confirm-dialog-message\"\n >\n <div className=\"p-6\">\n <div className=\"flex items-start space-x-3\">\n {icon && (\n <div className=\"flex-shrink-0\">\n {icon}\n </div>\n )}\n <div className=\"flex-1\">\n {title && (\n <h3\n id=\"confirm-dialog-title\"\n className=\"text-lg font-medium text-gray-900 mb-2\"\n >\n {title}\n </h3>\n )}\n <p\n id=\"confirm-dialog-message\"\n className=\"text-gray-600 leading-relaxed\"\n >\n {message}\n </p>\n </div>\n </div>\n\n <div className=\"flex justify-end space-x-3 mt-6\">\n <button\n onClick={onClose}\n className=\"px-4 py-2 text-gray-600 hover:text-gray-800 hover:bg-gray-100 dark:bg-gray-800 rounded-md transition-colors duration-150 btn-secondary\"\n autoFocus\n >\n {cancelText || t('common.cancel')}\n </button>\n <button\n onClick={onConfirm}\n className={`px-4 py-2 rounded-md transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-offset-2 ${confirmClass} ${variant === 'danger' ? 'btn-danger' : variant === 'warning' ? 'btn-warning' : 'btn-primary'}`}\n >\n {confirmText || t('common.confirm')}\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default ConfirmDialog;\n"],"names":["ConfirmDialog","isOpen","onClose","onConfirm","title","message","confirmText","cancelText","variant","t","useTranslation","getVariantStyles","jsx","icon","confirmClass","handleBackdropClick","e","handleKeyDown","jsxs"],"mappings":"iGAcA,MAAMA,EAA8C,CAAC,CACnD,OAAAC,EACA,QAAAC,EACA,UAAAC,EACA,MAAAC,EACA,QAAAC,EACA,YAAAC,EACA,WAAAC,EACA,QAAAC,EAAU,SACZ,IAAM,CACJ,KAA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SAAAM,EAAAA,KAAC,MAAA,CAAI,UAAU,MACb,SAAA,CAAAA,EAAAA,KAAC,MAAA,CAAI,UAAU,6BACZ,SAAA,CAAAL,GACCD,EAAAA,IAAC,MAAA,CAAI,UAAU,gBACZ,SAAAC,EACH,EAEFK,EAAAA,KAAC,MAAA,CAAI,UAAU,SACZ,SAAA,CAAAd,GACCQ,EAAAA,IAAC,KAAA,CACC,GAAG,uBACH,UAAU,yCAET,SAAAR,CAAA,CAAA,EAGLQ,EAAAA,IAAC,IAAA,CACC,GAAG,yBACH,UAAU,gCAET,SAAAP,CAAA,CAAA,CACH,CAAA,CACF,CAAA,EACF,EAEAa,EAAAA,KAAC,MAAA,CAAI,UAAU,kCACb,SAAA,CAAAN,EAAAA,IAAC,SAAA,CACC,QAASV,EACT,UAAU,yIACV,UAAS,GAER,SAAAK,GAAcE,EAAE,eAAe,CAAA,CAAA,EAElCG,EAAAA,IAAC,SAAA,CACC,QAAST,EACT,UAAW,2GAA2GW,CAAY,IAAIN,IAAY,SAAW,aAAeA,IAAY,UAAY,cAAgB,aAAa,GAEhO,SAAAF,GAAeG,EAAE,gBAAgB,CAAA,CAAA,CACpC,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAGN"}
@@ -1,2 +0,0 @@
1
- import{R as i,j as e}from"./framework-vendor-_OBebcuv.js";import{u as b}from"./useServerData-QZqQTYcv.js";import{u as w}from"./i18n-vendor-MQ921plD.js";import"./index-CmnA4an8.js";import"./icons-vendor-B67NtVuR.js";const L=()=>{const{t:a}=w(),{allServers:t,error:d,setError:u,isLoading:o}=b({refreshOnMount:!0}),[p,c]=i.useState(!1),x=i.useRef(!1);i.useEffect(()=>{if(o){x.current=!0;return}if(x.current){c(!0);return}(t.length>0||d)&&c(!0)},[o,t.length,d]);const n=!p,r={total:t.length,online:t.filter(s=>s.status==="connected").length,disabled:t.filter(s=>s.enabled===!1).length,offline:t.filter(s=>s.status==="disconnected"&&s.enabled!==!1).length,connecting:t.filter(s=>s.status==="connecting").length,oauthRequired:t.filter(s=>s.status==="oauth_required").length},j={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting",oauth_required:"status.oauthRequired"};return e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:a("pages.dashboard.title")}),d&&e.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-status-red text-lg font-medium",children:a("app.error")}),e.jsx("p",{className:"text-gray-600 mt-1",children:d})]}),e.jsx("button",{onClick:()=>u(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200","aria-label":a("app.closeButton"),children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 011.414 0L10 8.586l4.293-4.293a1 1 111.414 1.414L11.414 10l4.293 4.293a1 1 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 01-1.414-1.414L8.586 10 4.293 5.707a1 1 010-1.414z",clipRule:"evenodd"})})})]})}),n&&e.jsxs("div",{className:"space-y-8","aria-busy":"true","aria-live":"polite",children:[e.jsx("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-5",children:Array.from({length:5}).map((s,l)=>e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow p-6 dashboard-card",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"h-14 w-14 rounded-full bg-gray-200 animate-pulse"}),e.jsxs("div",{className:"ml-4 flex-1 space-y-3",children:[e.jsx("div",{className:"h-4 w-32 rounded bg-gray-200 animate-pulse"}),e.jsx("div",{className:"h-8 w-20 rounded bg-gray-200 animate-pulse"})]})]})},`stats-skeleton-${l}`))}),e.jsxs("div",{children:[e.jsx("div",{className:"h-6 w-40 rounded bg-gray-200 animate-pulse mb-4"}),e.jsx("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden table-container",children:e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:Array.from({length:5}).map((s,l)=>e.jsx("div",{className:"px-6 py-4",children:e.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[e.jsx("div",{className:"h-4 w-28 rounded bg-gray-200 animate-pulse"}),e.jsx("div",{className:"h-4 w-24 rounded bg-gray-200 animate-pulse"}),e.jsx("div",{className:"h-4 w-12 rounded bg-gray-200 animate-pulse"}),e.jsx("div",{className:"h-4 w-12 rounded bg-gray-200 animate-pulse"}),e.jsx("div",{className:"h-4 w-12 rounded bg-gray-200 animate-pulse"}),e.jsx("div",{className:"h-4 w-10 rounded bg-gray-200 animate-pulse"})]})},`row-skeleton-${l}`))})})]})]}),!n&&e.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-5",children:[e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow p-6 dashboard-card",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"p-3 rounded-full bg-blue-100 text-blue-800 icon-container status-icon-blue",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"})})}),e.jsxs("div",{className:"ml-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-700",children:a("pages.dashboard.totalServers")}),e.jsx("p",{className:"text-3xl font-bold text-gray-900",children:r.total})]})]})}),e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow p-6 dashboard-card",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"p-3 rounded-full bg-green-100 text-green-800 icon-container status-icon-green",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsxs("div",{className:"ml-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-700",children:a("pages.dashboard.onlineServers")}),e.jsx("p",{className:"text-3xl font-bold text-gray-900",children:r.online})]})]})}),e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow p-6 dashboard-card",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"p-3 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-700 icon-container",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsxs("div",{className:"ml-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-700",children:a("pages.dashboard.disabledServers")}),e.jsx("p",{className:"text-3xl font-bold text-gray-900",children:r.disabled})]})]})}),e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow p-6 dashboard-card",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"p-3 rounded-full bg-red-100 text-red-800 icon-container status-icon-red",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsxs("div",{className:"ml-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-700",children:a("pages.dashboard.offlineServers")}),e.jsx("p",{className:"text-3xl font-bold text-gray-900",children:r.offline})]})]})}),e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow p-6 dashboard-card",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"p-3 rounded-full bg-yellow-100 text-yellow-800 icon-container status-icon-yellow",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsxs("div",{className:"ml-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-700",children:a("pages.dashboard.connectingServers")}),e.jsx("p",{className:"text-3xl font-bold text-gray-900",children:r.connecting})]})]})})]}),t.length>0&&!n&&e.jsxs("div",{className:"mt-8",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:a("pages.dashboard.recentServers")}),e.jsx("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden table-container",children:e.jsxs("table",{className:"min-w-full",children:[e.jsx("thead",{className:"bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.name")}),e.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.status")}),e.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.tools")}),e.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.prompts")}),e.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("nav.resources")}),e.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.enabled")})]})}),e.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:t.slice(0,5).map((s,l)=>{var h,g,m;return e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:s.name}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:e.jsxs("span",{className:`px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full ${s.status==="connected"?"status-badge-online":s.status==="disconnected"?"status-badge-offline":s.status==="oauth_required"?"status-badge-oauth-required":"status-badge-connecting"}`,children:[s.status==="oauth_required"&&"🔐 ",a(j[s.status]||s.status)]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((h=s.tools)==null?void 0:h.length)||0}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((g=s.prompts)==null?void 0:g.length)||0}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((m=s.resources)==null?void 0:m.length)||0}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:s.enabled!==!1?e.jsx("span",{className:"text-green-600",children:"✓"}):e.jsx("span",{className:"text-gray-500","aria-label":a("pages.dashboard.disabledServers"),children:"⏸"})})]},l)})})]})})]})]})};export{L as default};
2
- //# sourceMappingURL=Dashboard-BIXrLobn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Dashboard-BIXrLobn.js","sources":["../../src/pages/Dashboard.tsx"],"sourcesContent":["import React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useServerData } from '@/hooks/useServerData';\nimport { Server } from '@/types';\n\nconst DashboardPage: React.FC = () => {\n const { t } = useTranslation();\n const { allServers, error, setError, isLoading } = useServerData({ refreshOnMount: true });\n\n const [hasLoaded, setHasLoaded] = React.useState(false);\n const loadingStartedRef = React.useRef(false);\n\n React.useEffect(() => {\n if (isLoading) {\n loadingStartedRef.current = true;\n return;\n }\n\n if (loadingStartedRef.current) {\n setHasLoaded(true);\n return;\n }\n\n if (allServers.length > 0 || error) {\n setHasLoaded(true);\n }\n }, [isLoading, allServers.length, error]);\n\n const showSkeleton = !hasLoaded;\n\n // Calculate server statistics using allServers (not paginated)\n const serverStats = {\n total: allServers.length,\n online: allServers.filter((server: Server) => server.status === 'connected').length,\n disabled: allServers.filter((server: Server) => server.enabled === false).length,\n offline: allServers.filter(\n (server: Server) => server.status === 'disconnected' && server.enabled !== false,\n ).length,\n connecting: allServers.filter((server: Server) => server.status === 'connecting').length,\n oauthRequired: allServers.filter((server: Server) => server.status === 'oauth_required').length,\n };\n\n // Map status to translation keys\n const statusTranslations: Record<string, string> = {\n connected: 'status.online',\n disconnected: 'status.offline',\n connecting: 'status.connecting',\n oauth_required: 'status.oauthRequired',\n };\n\n return (\n <div>\n <h1 className=\"text-2xl font-bold text-gray-900 mb-8\">{t('pages.dashboard.title')}</h1>\n\n {error && (\n <div className=\"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h3 className=\"text-status-red text-lg font-medium\">{t('app.error')}</h3>\n <p className=\"text-gray-600 mt-1\">{error}</p>\n </div>\n <button\n onClick={() => setError(null)}\n className=\"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200\"\n aria-label={t('app.closeButton')}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-5 w-5\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 011.414 0L10 8.586l4.293-4.293a1 1 111.414 1.414L11.414 10l4.293 4.293a1 1 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 01-1.414-1.414L8.586 10 4.293 5.707a1 1 010-1.414z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </button>\n </div>\n </div>\n )}\n\n {showSkeleton && (\n <div className=\"space-y-8\" aria-busy=\"true\" aria-live=\"polite\">\n <div className=\"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-5\">\n {Array.from({ length: 5 }).map((_, index) => (\n <div\n key={`stats-skeleton-${index}`}\n className=\"bg-white dark:bg-gray-800 rounded-lg shadow p-6 dashboard-card\"\n >\n <div className=\"flex items-center\">\n <div className=\"h-14 w-14 rounded-full bg-gray-200 animate-pulse\" />\n <div className=\"ml-4 flex-1 space-y-3\">\n <div className=\"h-4 w-32 rounded bg-gray-200 animate-pulse\" />\n <div className=\"h-8 w-20 rounded bg-gray-200 animate-pulse\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n\n <div>\n <div className=\"h-6 w-40 rounded bg-gray-200 animate-pulse mb-4\" />\n <div className=\"bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden table-container\">\n <div className=\"divide-y divide-gray-200 dark:divide-gray-700\">\n {Array.from({ length: 5 }).map((_, index) => (\n <div key={`row-skeleton-${index}`} className=\"px-6 py-4\">\n <div className=\"grid grid-cols-6 gap-6\">\n <div className=\"h-4 w-28 rounded bg-gray-200 animate-pulse\" />\n <div className=\"h-4 w-24 rounded bg-gray-200 animate-pulse\" />\n <div className=\"h-4 w-12 rounded bg-gray-200 animate-pulse\" />\n <div className=\"h-4 w-12 rounded bg-gray-200 animate-pulse\" />\n <div className=\"h-4 w-12 rounded bg-gray-200 animate-pulse\" />\n <div className=\"h-4 w-10 rounded bg-gray-200 animate-pulse\" />\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n </div>\n )}\n\n {!showSkeleton && (\n <div className=\"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-5\">\n {/* Total servers */}\n <div className=\"bg-white dark:bg-gray-800 rounded-lg shadow p-6 dashboard-card\">\n <div className=\"flex items-center\">\n <div className=\"p-3 rounded-full bg-blue-100 text-blue-800 icon-container status-icon-blue\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-8 w-8\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01\"\n />\n </svg>\n </div>\n <div className=\"ml-4\">\n <h2 className=\"text-lg font-semibold text-gray-700\">\n {t('pages.dashboard.totalServers')}\n </h2>\n <p className=\"text-3xl font-bold text-gray-900\">{serverStats.total}</p>\n </div>\n </div>\n </div>\n\n {/* Online servers */}\n <div className=\"bg-white dark:bg-gray-800 rounded-lg shadow p-6 dashboard-card\">\n <div className=\"flex items-center\">\n <div className=\"p-3 rounded-full bg-green-100 text-green-800 icon-container status-icon-green\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-8 w-8\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n </div>\n <div className=\"ml-4\">\n <h2 className=\"text-lg font-semibold text-gray-700\">\n {t('pages.dashboard.onlineServers')}\n </h2>\n <p className=\"text-3xl font-bold text-gray-900\">{serverStats.online}</p>\n </div>\n </div>\n </div>\n\n {/* Disabled servers */}\n <div className=\"bg-white dark:bg-gray-800 rounded-lg shadow p-6 dashboard-card\">\n <div className=\"flex items-center\">\n <div className=\"p-3 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-700 icon-container\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-8 w-8\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n </div>\n <div className=\"ml-4\">\n <h2 className=\"text-lg font-semibold text-gray-700\">\n {t('pages.dashboard.disabledServers')}\n </h2>\n <p className=\"text-3xl font-bold text-gray-900\">{serverStats.disabled}</p>\n </div>\n </div>\n </div>\n\n {/* Offline servers */}\n <div className=\"bg-white dark:bg-gray-800 rounded-lg shadow p-6 dashboard-card\">\n <div className=\"flex items-center\">\n <div className=\"p-3 rounded-full bg-red-100 text-red-800 icon-container status-icon-red\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-8 w-8\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n </div>\n <div className=\"ml-4\">\n <h2 className=\"text-lg font-semibold text-gray-700\">\n {t('pages.dashboard.offlineServers')}\n </h2>\n <p className=\"text-3xl font-bold text-gray-900\">{serverStats.offline}</p>\n </div>\n </div>\n </div>\n\n {/* Connecting servers */}\n <div className=\"bg-white dark:bg-gray-800 rounded-lg shadow p-6 dashboard-card\">\n <div className=\"flex items-center\">\n <div className=\"p-3 rounded-full bg-yellow-100 text-yellow-800 icon-container status-icon-yellow\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-8 w-8\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n </div>\n <div className=\"ml-4\">\n <h2 className=\"text-lg font-semibold text-gray-700\">\n {t('pages.dashboard.connectingServers')}\n </h2>\n <p className=\"text-3xl font-bold text-gray-900\">{serverStats.connecting}</p>\n </div>\n </div>\n </div>\n </div>\n )}\n\n {/* Recent activity list */}\n {allServers.length > 0 && !showSkeleton && (\n <div className=\"mt-8\">\n <h2 className=\"text-xl font-semibold text-gray-900 mb-4\">\n {t('pages.dashboard.recentServers')}\n </h2>\n <div className=\"bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden table-container\">\n <table className=\"min-w-full\">\n <thead className=\"bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700\">\n <tr>\n <th\n scope=\"col\"\n className=\"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\"\n >\n {t('server.name')}\n </th>\n <th\n scope=\"col\"\n className=\"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\"\n >\n {t('server.status')}\n </th>\n <th\n scope=\"col\"\n className=\"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\"\n >\n {t('server.tools')}\n </th>\n <th\n scope=\"col\"\n className=\"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\"\n >\n {t('server.prompts')}\n </th>\n <th\n scope=\"col\"\n className=\"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\"\n >\n {t('nav.resources')}\n </th>\n <th\n scope=\"col\"\n className=\"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\"\n >\n {t('server.enabled')}\n </th>\n </tr>\n </thead>\n <tbody className=\"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700\">\n {allServers.slice(0, 5).map((server, index) => (\n <tr key={index}>\n <td className=\"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900\">\n {server.name}\n </td>\n <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-500\">\n <span\n className={`px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full ${\n server.status === 'connected'\n ? 'status-badge-online'\n : server.status === 'disconnected'\n ? 'status-badge-offline'\n : server.status === 'oauth_required'\n ? 'status-badge-oauth-required'\n : 'status-badge-connecting'\n }`}\n >\n {server.status === 'oauth_required' && '🔐 '}\n {t(statusTranslations[server.status] || server.status)}\n </span>\n </td>\n <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-500\">\n {server.tools?.length || 0}\n </td>\n <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-500\">\n {server.prompts?.length || 0}\n </td>\n <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-500\">\n {server.resources?.length || 0}\n </td>\n <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-500\">\n {server.enabled !== false ? (\n <span className=\"text-green-600\">✓</span>\n ) : (\n <span\n className=\"text-gray-500\"\n aria-label={t('pages.dashboard.disabledServers')}\n >\n ⏸\n </span>\n )}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n )}\n </div>\n );\n};\n\nexport default DashboardPage;\n"],"names":["DashboardPage","t","useTranslation","allServers","error","setError","isLoading","useServerData","hasLoaded","setHasLoaded","React","loadingStartedRef","showSkeleton","serverStats","server","statusTranslations","jsx","jsxs","_","index","_a","_b","_c"],"mappings":"uNAKA,MAAMA,EAA0B,IAAM,CACpC,KAAM,CAAE,EAAAC,CAAA,EAAMC,EAAA,EACR,CAAE,WAAAC,EAAY,MAAAC,EAAO,SAAAC,EAAU,UAAAC,CAAA,EAAcC,EAAc,CAAE,eAAgB,GAAM,EAEnF,CAACC,EAAWC,CAAY,EAAIC,EAAM,SAAS,EAAK,EAChDC,EAAoBD,EAAM,OAAO,EAAK,EAE5CA,EAAM,UAAU,IAAM,CACpB,GAAIJ,EAAW,CACbK,EAAkB,QAAU,GAC5B,MACF,CAEA,GAAIA,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ACF,EACAA,EAAAA,IAAC,QAAA,CAAM,UAAU,0EACd,WAAW,MAAM,EAAG,CAAC,EAAE,IAAI,CAACF,EAAQK,IAAA,yBAClC,KAAA,CACC,SAAA,CAAAH,EAAAA,IAAC,KAAA,CAAG,UAAU,gEACX,SAAAF,EAAO,KACV,EACAE,EAAAA,IAAC,KAAA,CAAG,UAAU,oDACZ,SAAAC,EAAAA,KAAC,OAAA,CACC,UAAW,sEACTH,EAAO,SAAW,YACd,sBACAA,EAAO,SAAW,eAChB,uBACAA,EAAO,SAAW,iBAChB,8BACA,yBACV,GAEC,SAAA,CAAAA,EAAO,SAAW,kBAAoB,MACtCb,EAAEc,EAAmBD,EAAO,MAAM,GAAKA,EAAO,MAAM,CAAA,CAAA,CAAA,EAEzD,QACC,KAAA,CAAG,UAAU,oDACX,WAAAM,EAAAN,EAAO,QAAP,YAAAM,EAAc,SAAU,EAC3B,QACC,KAAA,CAAG,UAAU,oDACX,WAAAC,EAAAP,EAAO,UAAP,YAAAO,EAAgB,SAAU,EAC7B,QACC,KAAA,CAAG,UAAU,oDACX,WAAAC,EAAAR,EAAO,YAAP,YAAAQ,EAAkB,SAAU,EAC/B,EACAN,EAAAA,IAAC,KAAA,CAAG,UAAU,oDACX,SAAAF,EAAO,UAAY,GAClBE,EAAAA,IAAC,OAAA,CAAK,UAAU,iBAAiB,SAAA,GAAA,CAAC,EAElCA,EAAAA,IAAC,OAAA,CACC,UAAU,gBACV,aAAYf,EAAE,iCAAiC,EAChD,SAAA,GAAA,CAAA,CAED,CAEJ,CAAA,CAAA,EAxCOkB,CAyCT,EACD,CAAA,CACH,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAAA,CACF,CAAA,EAEJ,CAEJ"}
@@ -1,2 +0,0 @@
1
- import{j as s}from"./framework-vendor-_OBebcuv.js";import{u as i}from"./i18n-vendor-MQ921plD.js";const m=({isOpen:a,onClose:l,onConfirm:c,serverName:t,isGroup:n=!1,isUser:r=!1})=>{const{t:e}=i();return a?s.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:s.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:s.jsxs("div",{className:"p-6",children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:e(r?"users.confirmDelete":n?"groups.confirmDelete":"server.confirmDelete")}),s.jsx("p",{className:"text-gray-500 mb-6",children:r?e("users.deleteWarning",{username:t}):n?e("groups.deleteWarning",{name:t}):e("server.deleteWarning",{name:t})}),s.jsxs("div",{className:"flex justify-end space-x-3",children:[s.jsx("button",{onClick:l,className:"px-4 py-2 text-gray-600 hover:text-gray-800 btn-secondary",children:e("common.cancel")}),s.jsx("button",{onClick:c,className:"px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600 btn-danger",children:e("common.delete")})]})]})})}):null};export{m as D};
2
- //# sourceMappingURL=DeleteDialog-BAfrV8EB.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeleteDialog-BAfrV8EB.js","sources":["../../src/components/ui/DeleteDialog.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\n\ninterface DeleteDialogProps {\n isOpen: boolean\n onClose: () => void\n onConfirm: () => void\n serverName: string\n isGroup?: boolean\n isUser?: boolean\n}\n\nconst DeleteDialog = ({ isOpen, onClose, onConfirm, serverName, isGroup = false, isUser = false }: DeleteDialogProps) => {\n const { t } = useTranslation()\n\n if (!isOpen) return null\n\n return (\n <div className=\"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4\">\n <div className=\"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full\">\n <div className=\"p-6\">\n <h3 className=\"text-lg font-medium text-gray-900 mb-3\">\n {isUser\n ? t('users.confirmDelete')\n : isGroup\n ? t('groups.confirmDelete')\n : t('server.confirmDelete')}\n </h3>\n <p className=\"text-gray-500 mb-6\">\n {isUser\n ? t('users.deleteWarning', { username: serverName })\n : isGroup\n ? t('groups.deleteWarning', { name: serverName })\n : t('server.deleteWarning', { name: serverName })}\n </p>\n <div className=\"flex justify-end space-x-3\">\n <button\n onClick={onClose}\n className=\"px-4 py-2 text-gray-600 hover:text-gray-800 btn-secondary\"\n >\n {t('common.cancel')}\n </button>\n <button\n onClick={onConfirm}\n className=\"px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600 btn-danger\"\n >\n {t('common.delete')}\n </button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default DeleteDialog"],"names":["DeleteDialog","isOpen","onClose","onConfirm","serverName","isGroup","isUser","t","useTranslation","jsx","jsxs"],"mappings":"iGAWA,MAAMA,EAAe,CAAC,CAAE,OAAAC,EAAQ,QAAAC,EAAS,UAAAC,EAAW,WAAAC,EAAY,QAAAC,EAAU,GAAO,OAAAC,EAAS,MAA+B,CACvH,KAAM,CAAE,EAAAC,CAAA,EAAMC,EAAA,EAEd,OAAKP,EAGHQ,EAAAA,IAAC,MAAA,CAAI,UAAU,oFACb,SAAAA,EAAAA,IAAC,MAAA,CAAI,UAAU,iEACb,SAAAC,EAAAA,KAAC,MAAA,CAAI,UAAU,MACb,SAAA,CAAAD,EAAAA,IAAC,KAAA,CAAG,UAAU,yCACX,SACGF,EADHD,EACK,sBACFD,EACI,uBACA,sBAHmB,EAI7B,EACAI,EAAAA,IAAC,IAAA,CAAE,UAAU,qBACV,SAAAH,EACGC,EAAE,sBAAuB,CAAE,SAAUH,CAAA,CAAY,EACjDC,EACEE,EAAE,uBAAwB,CAAE,KAAMH,CAAA,CAAY,EAC9CG,EAAE,uBAAwB,CAAE,KAAMH,CAAA,CAAY,CAAA,CACtD,EACAM,EAAAA,KAAC,MAAA,CAAI,UAAU,6BACb,SAAA,CAAAD,EAAAA,IAAC,SAAA,CACC,QAASP,EACT,UAAU,4DAET,WAAE,eAAe,CAAA,CAAA,EAEpBO,EAAAA,IAAC,SAAA,CACC,QAASN,EACT,UAAU,sEAET,WAAE,eAAe,CAAA,CAAA,CACpB,CAAA,CACF,CAAA,CAAA,CACF,EACF,EACF,EApCkB,IAsCtB"}
@@ -1,33 +0,0 @@
1
- import{r as b,R as Y,j as e}from"./framework-vendor-_OBebcuv.js";import{u as Z}from"./useGroupData-DLhbP6zd.js";import{u as Q}from"./useServerData-QZqQTYcv.js";import{l as ae,h as xe,d as X}from"./index-CmnA4an8.js";import{u as oe}from"./useSettingsData-D3VROqS7.js";import{u as L}from"./i18n-vendor-MQ921plD.js";import{W as ie,b as ce,F as de,C as ue,g as le,j as ge,l as he,m as be,h as fe,T as ye}from"./icons-vendor-B67NtVuR.js";import{D as je}from"./DeleteDialog-BAfrV8EB.js";const ve={tools:[],prompts:[],resources:[]},ne={tools:"all",prompts:"all",resources:"all"},me=({servers:p,value:I,onChange:s,className:m})=>{const{t:x}=L(),{nameSeparator:z}=oe(),[f,S]=b.useState(new Set),h=Y.useMemo(()=>I.map(t=>typeof t=="string"?{name:t,...ne}:{...t,tools:t.tools||"all",prompts:t.prompts||"all",resources:t.resources||"all"}),[I]),u=Y.useMemo(()=>p.filter(t=>t.enabled!==!1),[p]);Y.useEffect(()=>{const t=new Set(h.map(r=>r.name)),c=new Set(u.map(r=>r.name));S(r=>{const N=new Set;return r.forEach(k=>{(t.has(k)||c.has(k))&&N.add(k)}),N})},[h,u]);const C=t=>{if(h.findIndex(r=>r.name===t)>=0){const r=h.filter(N=>N.name!==t);s(r)}else{const r=[...h,{name:t,...ne}];s(r)}},j=t=>{S(c=>{const r=new Set(c);return r.has(t)?r.delete(t):r.add(t),r})},E=t=>["tools","prompts","resources"].some(c=>{const r=t[c];return r==="all"||Array.isArray(r)&&r.length>0}),w=(t,c,r,N=!1)=>{const k=h.find(d=>d.name===t),a={...k?{...k}:{name:t,...ve},[c]:r};if(!E(a)){const d=h.filter(D=>D.name!==t);s(d),N||S(D=>{const $=new Set(D);return $.delete(t),$});return}if(k){s(h.map(d=>d.name===t?a:d));return}s([...h,a])},R=(t,c)=>{const r=`${t}${z}`;return c.startsWith(r)?c.slice(r.length):c},n=(t,c)=>c==="tools"?(t.tools||[]).filter(r=>r.enabled!==!1).map(r=>({key:r.name,value:R(t.name,r.name),description:r.description})):c==="prompts"?(t.prompts||[]).filter(r=>r.enabled!==!1).map(r=>({key:r.name,value:R(t.name,r.name),description:r.description})):(t.resources||[]).filter(r=>r.enabled!==!1).map(r=>({key:r.uri,value:r.uri,description:r.description})),o=(t,c,r)=>{const N=u.find(d=>d.name===t);if(!N)return;const k=n(N,c).map(d=>d.value),g=h.find(d=>d.name===t);if(!g){w(t,c,[r]);return}const a=g[c];if(a==="all"){const d=k.filter(D=>D!==r);w(t,c,d);return}if(Array.isArray(a)){if(a.includes(r)){w(t,c,a.filter(D=>D!==r));return}const d=[...a,r];w(t,c,d.length===k.length?"all":d);return}w(t,c,[r])},v=t=>{const c=h.find(r=>r.name===t);return!!(c&&E(c))},l=t=>{const c=h.find(r=>r.name===t);return c?["tools","prompts","resources"].some(r=>{const N=c[r];return Array.isArray(N)&&N.length>0}):!1},i=(t,c,r)=>{const N=h.find(g=>g.name===t);if(!N)return!1;const k=N[c];return k==="all"?!0:Array.isArray(k)?k.includes(r):!1},A=(t,c)=>{const r=h.find(g=>g.name===t.name);if(!r)return 0;const N=n(t,c),k=r[c];if(k==="all")return N.length;if(Array.isArray(k)){const g=new Set(N.map(a=>a.value));return k.filter(a=>g.has(a)).length}return 0},T=[{key:"tools",titleKey:"groups.toolSelection",countKey:"groups.toolsSelected",allKey:"groups.allTools"},{key:"prompts",titleKey:"groups.promptSelection",countKey:"groups.promptsSelected",allKey:"groups.allPrompts"},{key:"resources",titleKey:"groups.resourceSelection",countKey:"groups.resourcesSelected",allKey:"groups.allResources"}],P=t=>T.map(({key:c})=>({key:c,count:A(t,c)})).filter(c=>c.count>0);return e.jsxs("div",{className:ae("space-y-4",m),children:[e.jsx("div",{className:"space-y-3",children:u.map(t=>{const c=v(t.name),r=l(t.name),N=f.has(t.name),k=h.find(d=>d.name===t.name),g=P(t),a=T.filter(({key:d})=>n(t,d).length>0);return e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg hover:border-gray-300 hover:bg-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer rounded-lg transition-colors",onClick:()=>j(t.name),children:[e.jsxs("div",{className:"flex items-center space-x-3",onClick:d=>{d.stopPropagation(),C(t.name)},children:[e.jsx("input",{type:"checkbox",checked:c||r,onChange:()=>C(t.name),className:"w-4 h-4 text-blue-600 bg-gray-100 dark:bg-gray-800 border-gray-300 rounded focus:ring-blue-500"}),e.jsx("span",{className:"font-medium text-gray-900 cursor-pointer select-none",children:t.name})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[g.map(({key:d,count:D})=>e.jsxs("span",{className:"text-sm text-green-600 flex items-center gap-1",children:[d==="tools"?e.jsx(ie,{size:14}):d==="prompts"?e.jsx(ce,{size:14}):e.jsx(de,{size:14})," ",D]},d)),a.length>0&&e.jsx("button",{type:"button",className:"p-1 text-gray-400 hover:text-gray-600 transition-colors",children:e.jsx("svg",{className:ae("w-5 h-5 transition-transform",N&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]}),N&&a.length>0&&e.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800 p-3",children:e.jsx("div",{className:"space-y-4",children:a.map(({key:d,titleKey:D,countKey:$,allKey:q})=>{const O=n(t,d),V=A(t,d),B=(k==null?void 0:k[d])==="all"||V===O.length;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700",children:x(D)}),e.jsxs("div",{className:"flex items-center gap-3",children:[k&&e.jsx("span",{className:"text-xs text-green-600",children:B?`(${x(q)} ${O.length}/${O.length})`:`(${x($)} ${V}/${O.length})`}),e.jsx("button",{type:"button",onClick:()=>{w(t.name,d,B?[]:"all",!0)},className:"text-sm text-blue-600 hover:text-blue-800 transition-colors",children:x(B?"groups.selectNone":"groups.selectAll")})]})]}),e.jsx("div",{className:"grid grid-cols-1 gap-2 max-h-32 overflow-y-auto",children:O.map(G=>{const M=i(t.name,d,G.value);return e.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[e.jsx("input",{type:"checkbox",checked:M,onChange:()=>o(t.name,d,G.value),className:"w-3 h-3 text-blue-600 bg-gray-100 dark:bg-gray-800 border-gray-300 rounded focus:ring-blue-500"}),e.jsx("span",{className:"text-gray-700 break-all whitespace-nowrap",children:G.value}),G.description&&e.jsx("span",{className:"text-gray-400 text-xs truncate",children:G.description})]},G.key)})})]},d)})})})]},t.name)})}),u.length===0&&e.jsx("p",{className:"text-gray-500 text-sm",children:x("groups.noServerOptions")})]})},Ne=({onAdd:p,onCancel:I})=>{const{t:s}=L(),{createGroup:m}=Z(),{allServers:x}=Q(),[z,f]=b.useState([]),[S,h]=b.useState(null),[u,C]=b.useState(!1),[j,E]=b.useState({name:"",description:"",servers:[]});b.useEffect(()=>{f(x.filter(n=>n.enabled!==!1))},[x]);const w=n=>{const{name:o,value:v}=n.target;E(l=>({...l,[o]:v}))},R=async n=>{n.preventDefault(),C(!0),h(null);try{if(!j.name.trim()){h(s("groups.nameRequired")),C(!1);return}const o=await m(j.name,j.description,j.servers);if(!o||!o.success){h((o==null?void 0:o.message)||s("groups.createError")),C(!1);return}p()}catch(o){h(o instanceof Error?o.message:String(o)),C(!1)}};return e.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-3xl w-full max-h-[90vh] flex flex-col",children:[e.jsxs("div",{className:"p-6 flex-shrink-0",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:s("groups.addNew")}),S&&e.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200 dark:border-gray-700",children:S})]}),e.jsxs("form",{onSubmit:R,className:"flex flex-col flex-1 min-h-0",children:[e.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[s("groups.name")," *"]}),e.jsx("input",{type:"text",id:"name",name:"name",value:j.name,onChange:w,className:"w-full border border-gray-300 rounded-md px-3 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:s("groups.namePlaceholder"),required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:s("groups.configureCapabilities")}),e.jsx(me,{servers:z,value:j.servers,onChange:n=>E(o=>({...o,servers:n})),className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4 bg-gray-50 dark:bg-gray-800"})]})]})}),e.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 dark:border-gray-700 flex-shrink-0",children:[e.jsx("button",{type:"button",onClick:I,className:"px-4 py-2 text-gray-600 hover:text-gray-800 border border-gray-300 rounded-md hover:bg-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 transition-colors",disabled:u,children:s("common.cancel")}),e.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 disabled:opacity-50 transition-colors",disabled:u,children:s(u?"common.submitting":"common.create")})]})]})]})})},we=({group:p,onEdit:I,onCancel:s})=>{const{t:m}=L(),{updateGroup:x}=Z(),{allServers:z}=Q(),[f,S]=b.useState([]),[h,u]=b.useState(null),[C,j]=b.useState(!1),[E,w]=b.useState({name:p.name,description:p.description||"",servers:p.servers||[]});b.useEffect(()=>{S(z.filter(o=>o.enabled!==!1))},[z]);const R=o=>{const{name:v,value:l}=o.target;w(i=>({...i,[v]:l}))},n=async o=>{o.preventDefault(),j(!0),u(null);try{if(!E.name.trim()){u(m("groups.nameRequired")),j(!1);return}const v=await x(p.id,{name:E.name,description:E.description,servers:E.servers});if(!v||!v.success){u((v==null?void 0:v.message)||m("groups.updateError")),j(!1);return}I()}catch(v){u(v instanceof Error?v.message:String(v)),j(!1)}};return e.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-3xl w-full max-h-[90vh] flex flex-col",children:[e.jsxs("div",{className:"p-6 flex-shrink-0",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:m("groups.edit")}),h&&e.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200 dark:border-gray-700",children:h})]}),e.jsxs("form",{onSubmit:n,className:"flex flex-col flex-1 min-h-0",children:[e.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[m("groups.name")," *"]}),e.jsx("input",{type:"text",id:"name",name:"name",value:E.name,onChange:R,className:"w-full border border-gray-300 rounded-md px-3 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:m("groups.namePlaceholder"),required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:m("groups.configureCapabilities")}),e.jsx(me,{servers:f,value:E.servers,onChange:o=>w(v=>({...v,servers:o})),className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4 bg-gray-50 dark:bg-gray-800"})]})]})}),e.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 dark:border-gray-700 flex-shrink-0",children:[e.jsx("button",{type:"button",onClick:s,className:"px-4 py-2 text-gray-600 hover:text-gray-800 border border-gray-300 rounded-md hover:bg-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 transition-colors",disabled:C,children:m("common.cancel")}),e.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 disabled:opacity-50 transition-colors",disabled:C,children:m(C?"common.submitting":"common.save")})]})]})]})})},Se=({group:p,servers:I,onEdit:s,onDelete:m})=>{const{t:x}=L(),{showToast:z}=xe(),{installConfig:f,nameSeparator:S}=oe(),[h,u]=b.useState(!1),[C,j]=b.useState(!1),[E,w]=b.useState(!1),[R,n]=b.useState(null),o=b.useRef(null);b.useEffect(()=>{const g=a=>{o.current&&!o.current.contains(a.target)&&w(!1)};return document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[]);const v=()=>{s(p)},l=()=>{u(!0)},i=()=>{m(p.id),u(!1)},A=g=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(g).then(()=>{j(!0),w(!1),z(x("common.copySuccess"),"success"),setTimeout(()=>j(!1),2e3)});else{const a=document.createElement("textarea");a.value=g,a.style.position="fixed",a.style.left="-9999px",document.body.appendChild(a),a.focus(),a.select();try{document.execCommand("copy"),j(!0),w(!1),z(x("common.copySuccess"),"success"),setTimeout(()=>j(!1),2e3)}catch(d){z(x("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",d)}document.body.removeChild(a)}},T=()=>{A(p.id)},P=()=>{A(`${f.baseUrl}/mcp/${p.id}`)},t=()=>{const g={mcpServers:{mcphub:{url:`${f.baseUrl}/mcp/${p.id}`,headers:{Authorization:"Bearer <your-access-token>"}}}};A(JSON.stringify(g,null,2))},c=g=>g.map(a=>typeof a=="string"?a:a.name),r=g=>{const a=p.servers.find(d=>typeof d=="string"?d===g:d.name===g);return typeof a=="string"?{name:a,tools:"all",prompts:"all",resources:"all"}:a},N=c(p.servers),k=I.filter(g=>N.includes(g.name));return e.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-800",children:p.name}),e.jsxs("div",{className:"flex items-center ml-3",children:[e.jsx("span",{className:"text-xs text-gray-500 mr-1",children:p.id}),e.jsxs("div",{className:"relative",ref:o,children:[e.jsxs("button",{onClick:()=>w(!E),className:"p-1 text-gray-400 hover:text-gray-600 transition-colors flex items-center",title:x("common.copy"),children:[C?e.jsx(ue,{size:14,className:"text-green-500"}):e.jsx(le,{size:14}),e.jsx(ge,{size:12,className:"ml-1"})]}),E&&e.jsxs("div",{className:"absolute top-full left-0 mt-1 bg-white dark:bg-gray-800 shadow-lg rounded-md border border-gray-200 dark:border-gray-700 py-1 z-10 min-w-[140px]",children:[e.jsxs("button",{onClick:T,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center",children:[e.jsx(le,{size:12,className:"mr-2"}),x("common.copyId")]}),e.jsxs("button",{onClick:P,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center",children:[e.jsx(he,{size:12,className:"mr-2"}),x("common.copyUrl")]}),e.jsxs("button",{onClick:t,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center",children:[e.jsx(be,{size:12,className:"mr-2"}),x("common.copyJson")]})]})]})]})]}),p.description&&e.jsx("p",{className:"text-gray-600 text-sm mt-1",children:p.description})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"bg-blue-50 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300 px-3 py-1 rounded-full text-sm btn-secondary",children:x("groups.serverCount",{count:p.servers.length})}),e.jsx("button",{onClick:v,className:"text-gray-500 hover:text-gray-700",title:x("groups.edit"),children:e.jsx(fe,{size:18})}),e.jsx("button",{onClick:l,className:"text-gray-500 hover:text-red-600",title:x("groups.delete"),children:e.jsx(ye,{size:18})})]})]}),e.jsx("div",{className:"",children:k.length===0?e.jsx("p",{className:"text-gray-500 italic",children:x("groups.noServers")}):e.jsx("div",{className:"flex flex-wrap gap-2",children:k.map(g=>{const a=r(g.name),d=a&&a.tools!=="all"&&Array.isArray(a.tools),D=a&&a.prompts!=="all"&&Array.isArray(a.prompts),$=a&&a.resources!=="all"&&Array.isArray(a.resources),q=(g.tools||[]).filter(y=>y.enabled!==!1),O=(g.prompts||[]).filter(y=>y.enabled!==!1),V=(g.resources||[]).filter(y=>y.enabled!==!1),B=y=>{const F=`${g.name}${S}`;return y.startsWith(F)?y.slice(F.length):y},G=y=>{const F=`${g.name}${S}`;return y.startsWith(F)?y.slice(F.length):y},M=q.map(y=>B(y.name)),U=O.map(y=>G(y.name)),J=V.map(y=>y.uri),ee=new Set(M),se=new Set(U),te=new Set(J),K=d&&Array.isArray(a==null?void 0:a.tools)?a.tools.filter(y=>ee.has(y)).length:M.length,H=D&&Array.isArray(a==null?void 0:a.prompts)?a.prompts.filter(y=>se.has(y)).length:U.length,W=$&&Array.isArray(a==null?void 0:a.resources)?a.resources.filter(y=>te.has(y)).length:J.length,re=R===g.name,_=y=>y==="tools"?d&&Array.isArray(a==null?void 0:a.tools)?a.tools.filter(F=>ee.has(F)):M:y==="prompts"?D&&Array.isArray(a==null?void 0:a.prompts)?a.prompts.filter(F=>se.has(F)):U:$&&Array.isArray(a==null?void 0:a.resources)?a.resources.filter(F=>te.has(F)):J,pe=()=>{n(re?null:g.name)};return e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex items-center space-x-2 bg-gray-50 dark:bg-gray-800 rounded-lg px-3 py-2 cursor-pointer hover:bg-gray-100 transition-colors",onClick:pe,children:[e.jsx("span",{className:"font-medium text-gray-700 text-sm",children:g.name}),e.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${g.status==="connected"?"bg-green-500":g.status==="connecting"?"bg-yellow-500":"bg-red-500"}`}),K>0&&e.jsxs("span",{className:"text-xs text-blue-600 bg-blue-100 dark:bg-blue-900/40 dark:text-blue-300 px-2 py-0.5 rounded flex items-center gap-1",children:[e.jsx(ie,{size:12}),K]}),H>0&&e.jsxs("span",{className:"text-xs text-purple-600 bg-purple-100 dark:bg-purple-900/40 dark:text-purple-300 px-2 py-0.5 rounded flex items-center gap-1",children:[e.jsx(ce,{size:12}),H]}),W>0&&e.jsxs("span",{className:"text-xs text-emerald-600 bg-emerald-100 dark:bg-emerald-900/40 dark:text-emerald-300 px-2 py-0.5 rounded flex items-center gap-1",children:[e.jsx(de,{size:12}),W]})]}),re&&e.jsx("div",{className:"absolute top-full left-0 mt-1 bg-white dark:bg-gray-800 shadow-lg rounded-md border border-gray-200 dark:border-gray-700 p-3 z-10 min-w-[300px] max-w-[400px]",children:e.jsxs("div",{className:"space-y-3",children:[K>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"text-gray-600 text-xs mb-2",children:[x(d?"groups.selectedTools":"groups.allTools"),":"]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:_("tools").map((y,F)=>e.jsx("span",{className:"inline-block bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300 px-2 py-1 rounded text-xs",children:y},`tool-${F}`))})]}),H>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"text-gray-600 text-xs mb-2",children:[x(D?"groups.selectedPrompts":"groups.allPrompts"),":"]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:_("prompts").map((y,F)=>e.jsx("span",{className:"inline-block bg-purple-50 text-purple-700 dark:bg-purple-900/40 dark:text-purple-300 px-2 py-1 rounded text-xs",children:y},`prompt-${F}`))})]}),W>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"text-gray-600 text-xs mb-2",children:[x($?"groups.selectedResources":"groups.allResources"),":"]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:_("resources").map((y,F)=>e.jsx("span",{className:"inline-block bg-emerald-50 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300 px-2 py-1 rounded text-xs break-all",children:y},`resource-${F}`))})]})]})})]},g.name)})})}),e.jsx(je,{isOpen:h,onClose:()=>u(!1),onConfirm:i,serverName:p.name,isGroup:!0})]})},ke=({onSuccess:p,onCancel:I})=>{const{t:s}=L(),[m,x]=b.useState(""),[z,f]=b.useState(null),[S,h]=b.useState(!1),[u,C]=b.useState(null),j=`{
2
- "groups": [
3
- {
4
- "name": "AI Assistants",
5
- "servers": ["openai-server", "anthropic-server"]
6
- },
7
- {
8
- "name": "Development Tools",
9
- "servers": [
10
- {
11
- "name": "github-server",
12
- "tools": ["create_issue", "list_repos"],
13
- "prompts": ["triage_prompt"],
14
- "resources": ["resource://docs/repo-guide"]
15
- },
16
- {
17
- "name": "gitlab-server",
18
- "tools": "all",
19
- "prompts": "all",
20
- "resources": "all"
21
- }
22
- ]
23
- }
24
- ]
25
- }
26
-
27
- Supports:
28
- - Simple server list: ["server1", "server2"]
29
- - Advanced server config: [{"name": "server1", "tools": ["tool1"], "prompts": ["prompt1"], "resources": ["resource://docs/guide"]}]
30
- - All groups will be imported in a single efficient batch operation.`,E=l=>{try{const i=JSON.parse(l.trim());if(!i.groups||!Array.isArray(i.groups))return f(s("groupImport.invalidFormat")),null;for(const A of i.groups)if(!A.name||typeof A.name!="string")return f(s("groupImport.missingName")),null;return i}catch{return f(s("groupImport.parseError")),null}},w=()=>{f(null);const l=E(m);l&&C(l.groups)},R=async()=>{if(u){h(!0),f(null);try{const l=await X("/groups/batch",{groups:u});if(l.success){const{successCount:i,failureCount:A,results:T}=l;if(A>0){const P=T.filter(t=>!t.success).map(t=>`${t.name}: ${t.message||s("groupImport.addFailed")}`);f(s("groupImport.partialSuccess",{count:i,total:u.length})+`
31
- `+P.join(`
32
- `))}i>0&&p()}else f(l.message||s("groupImport.importFailed"))}catch(l){console.error("Import error:",l),f(s("groupImport.importFailed"))}finally{h(!1)}}},n=l=>e.jsx("span",{className:"text-gray-500 ml-2",children:s(`groups.${l}`)}),o=(l,i)=>{if(!i||i==="all")return null;const A=Array.isArray(i)?i.join(", "):i;return e.jsx("span",{className:"text-gray-500 ml-2",children:s(`groups.${l}`,{items:A})})},v=l=>!l||l.length===0?e.jsx("span",{className:"text-gray-500",children:s("groups.noServers")}):e.jsx("div",{className:"space-y-1",children:l.map((i,A)=>typeof i=="string"?e.jsxs("div",{className:"text-sm",children:["• ",i]},A):e.jsxs("div",{className:"text-sm",children:["• ",i.name,i.tools&&i.tools!=="all"&&e.jsxs("span",{className:"text-gray-500 ml-2",children:["(",Array.isArray(i.tools)?i.tools.join(", "):i.tools,")"]}),i.tools==="all"&&n("previewAllTools"),o("previewPrompts",i.prompts),i.prompts==="all"&&n("previewAllPrompts"),o("previewResources",i.resources),i.resources==="all"&&n("previewAllResources")]},A))});return e.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:s("groupImport.title")}),e.jsx("button",{onClick:I,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),z&&e.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:e.jsx("p",{className:"text-red-700 whitespace-pre-wrap",children:z})}),u?e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:s("groupImport.previewTitle")}),e.jsx("div",{className:"space-y-3",children:u.map((l,i)=>e.jsx("div",{className:"bg-gray-50 dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700",children:e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-medium text-gray-900",children:l.name}),l.description&&e.jsx("p",{className:"text-sm text-gray-600 mt-1",children:l.description}),e.jsxs("div",{className:"mt-2 text-sm text-gray-600",children:[e.jsxs("strong",{children:[s("groups.servers"),":"]}),e.jsx("div",{className:"mt-1",children:v(l.servers)})]})]})})},i))})]}),e.jsxs("div",{className:"flex justify-end space-x-4",children:[e.jsx("button",{onClick:()=>C(null),disabled:S,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:s("common.back")}),e.jsx("button",{onClick:R,disabled:S,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:S?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),s("groupImport.importing")]}):s("groupImport.import")})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:s("groupImport.inputLabel")}),e.jsx("textarea",{value:m,onChange:l=>x(l.target.value),className:"w-full h-96 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-sm",placeholder:j}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:s("groupImport.inputHelp")})]}),e.jsxs("div",{className:"flex justify-end space-x-4",children:[e.jsx("button",{onClick:I,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:s("common.cancel")}),e.jsx("button",{onClick:w,disabled:!m.trim(),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 btn-primary",children:s("groupImport.preview")})]})]})]})})},Ce=({groups:p,onCancel:I})=>{const{t:s}=L(),[m,x]=b.useState(""),[z,f]=b.useState(""),[S,h]=b.useState([]),[u,C]=b.useState(!1),[j,E]=b.useState(!1),[w,R]=b.useState(null),n=l=>{h(i=>i.includes(l)?i.filter(A=>A!==l):[...i,l])},o=()=>{S.length===p.length?h([]):h(p.map(l=>l.id))},v=async()=>{if(!m.trim()){R(s("template.nameRequired"));return}E(!0),R(null);try{const l=await X("/templates/export",{name:m.trim(),description:z.trim()||void 0,groupIds:S.length>0?S:void 0,includeDisabledServers:u});if(l.success&&l.data){const i=l.data,A=new Blob([JSON.stringify(i,null,2)],{type:"application/json"}),T=URL.createObjectURL(A),P=document.createElement("a");P.href=T,P.download=`${i.name.replace(/[^a-zA-Z0-9-_]/g,"_")}.mcphub-template.json`,document.body.appendChild(P),P.click(),document.body.removeChild(P),URL.revokeObjectURL(T),I()}else R(l.message||s("template.exportFailed"))}catch(l){console.error("Export error:",l),R(s("template.exportFailed"))}finally{E(!1)}};return e.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6 w-full max-w-3xl max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:s("template.exportTitle")}),e.jsx("button",{onClick:I,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),w&&e.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:e.jsx("p",{className:"text-red-700",children:w})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[s("template.name")," *"]}),e.jsx("input",{type:"text",value:m,onChange:l=>x(l.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:s("template.namePlaceholder")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:s("template.description")}),e.jsx("input",{type:"text",value:z,onChange:l=>f(l.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:s("template.descriptionPlaceholder")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:s("template.selectGroups")}),e.jsx("button",{onClick:o,className:"text-sm text-blue-600 hover:text-blue-800",children:S.length===p.length?s("template.deselectAll"):s("template.selectAll")})]}),e.jsx("p",{className:"text-xs text-gray-500 mb-2",children:s("template.selectGroupsHelp")}),e.jsx("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md max-h-48 overflow-y-auto",children:p.map(l=>e.jsxs("label",{className:"flex items-center px-3 py-2 hover:bg-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:S.includes(l.id),onChange:()=>n(l.id),className:"mr-3 h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-gray-900",children:l.name}),l.description&&e.jsx("span",{className:"text-xs text-gray-500 ml-2",children:l.description})]})]},l.id))})]}),e.jsxs("label",{className:"flex items-center space-x-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:u,onChange:l=>C(l.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),e.jsx("span",{className:"text-sm text-gray-700",children:s("template.includeDisabled")})]})]}),e.jsx("div",{className:"mt-4 p-3 bg-blue-50 border border-blue-200 rounded-md",children:e.jsx("p",{className:"text-sm text-blue-700",children:s("template.exportNote")})}),e.jsxs("div",{className:"flex justify-end space-x-4 mt-6",children:[e.jsx("button",{onClick:I,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:s("common.cancel")}),e.jsx("button",{onClick:v,disabled:j||!m.trim(),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed btn-primary",children:s(j?"template.exporting":"template.export")})]})]})})},Ae=({onSuccess:p,onCancel:I})=>{const{t:s}=L(),[m,x]=b.useState(null),[z,f]=b.useState(null),[S,h]=b.useState(!1),[u,C]=b.useState(null),j=b.useRef(null),E=n=>{var l;f(null),x(null),C(null);const o=(l=n.target.files)==null?void 0:l[0];if(!o)return;const v=new FileReader;v.onload=i=>{var A;try{const T=JSON.parse((A=i.target)==null?void 0:A.result);if(!T.version||!T.name||!T.servers||!T.groups){f(s("template.invalidFormat"));return}x(T)}catch{f(s("template.parseError"))}},v.readAsText(o)},w=n=>{if(f(null),x(null),C(null),!!n.trim())try{const o=JSON.parse(n.trim());if(!o.version||!o.name||!o.servers||!o.groups){f(s("template.invalidFormat"));return}x(o)}catch{f(s("template.parseError"))}},R=async()=>{if(m){h(!0),f(null);try{const n=await X("/templates/import",m);n.data?(C(n.data),n.data.success&&p()):f(n.message||s("template.importFailed"))}catch(n){console.error("Import error:",n),f(s("template.importFailed"))}finally{h(!1)}}};return e.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:s("template.importTitle")}),e.jsx("button",{onClick:I,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),z&&e.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:e.jsx("p",{className:"text-red-700",children:z})}),u&&e.jsxs("div",{className:`mb-4 p-4 rounded border-l-4 ${u.success?"bg-green-50 border-green-500":"bg-yellow-50 border-yellow-500"}`,children:[e.jsx("p",{className:u.success?"text-green-700":"text-yellow-700",children:s("template.importResult",{serversCreated:u.serversCreated,serversSkipped:u.serversSkipped,groupsCreated:u.groupsCreated,groupsSkipped:u.groupsSkipped})}),u.requiredEnvVars.length>0&&e.jsxs("div",{className:"mt-2 p-2 bg-orange-50 border border-orange-200 rounded",children:[e.jsx("p",{className:"text-sm font-medium text-orange-800",children:s("template.envVarsNeeded")}),e.jsx("ul",{className:"mt-1 text-sm text-orange-700",children:u.requiredEnvVars.map(n=>e.jsx("li",{className:"font-mono",children:n},n))})]})]}),m?e.jsxs("div",{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-800 rounded-md",children:[e.jsx("h3",{className:"font-medium text-gray-900",children:m.name}),m.description&&e.jsx("p",{className:"text-sm text-gray-600 mt-1",children:m.description}),e.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[s("template.version"),": ",m.version," | ",s("template.createdAt"),":"," ",new Date(m.createdAt).toLocaleDateString()]})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:[s("template.servers")," (",Object.keys(m.servers).length,")"]}),e.jsx("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md divide-y divide-gray-200 dark:divide-gray-700 max-h-40 overflow-y-auto",children:Object.entries(m.servers).map(([n,o])=>e.jsxs("div",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900",children:n}),e.jsx("span",{className:"text-xs text-gray-500 ml-2",children:o.type||"stdio"})]},n))})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:[s("template.groups")," (",m.groups.length,")"]}),e.jsx("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md divide-y divide-gray-200 dark:divide-gray-700 max-h-40 overflow-y-auto",children:m.groups.map((n,o)=>e.jsxs("div",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900",children:n.name}),n.description&&e.jsx("span",{className:"text-xs text-gray-500 ml-2",children:n.description}),e.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[n.servers.length," ",s("template.serversInGroup")]})]},o))})]}),m.requiredEnvVars.length>0&&e.jsxs("div",{className:"p-3 bg-orange-50 border border-orange-200 rounded-md",children:[e.jsx("h4",{className:"text-sm font-medium text-orange-800",children:s("template.envVarsNeeded")}),e.jsx("ul",{className:"mt-1 text-sm text-orange-700 font-mono",children:m.requiredEnvVars.map(n=>e.jsx("li",{children:n},n))})]})]}),e.jsxs("div",{className:"flex justify-end space-x-4 mt-6",children:[e.jsx("button",{onClick:()=>{x(null),C(null),j.current&&(j.current.value="")},className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:s("common.back")}),e.jsx("button",{onClick:R,disabled:S,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed btn-primary",children:s(S?"template.importing":"template.import")})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsx("label",{className:"block text-sm font-medium text-gray-700",children:s("template.uploadFile")})}),e.jsx("div",{className:"flex items-center space-x-4",children:e.jsx("input",{ref:j,type:"file",accept:".json",onChange:E,className:"block text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100"})})]}),e.jsxs("div",{className:"relative my-4",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-300"})}),e.jsx("div",{className:"relative flex justify-center text-sm",children:e.jsx("span",{className:"bg-white dark:bg-gray-800 px-2 text-gray-500",children:s("template.or")})})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:s("template.pasteJson")}),e.jsx("textarea",{className:"w-full h-64 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-sm",placeholder:s("template.pastePlaceholder"),onChange:n=>w(n.target.value)})]}),e.jsx("div",{className:"flex justify-end space-x-4",children:e.jsx("button",{onClick:I,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:s("common.cancel")})})]})]})})},$e=()=>{const{t:p}=L(),{groups:I,loading:s,error:m,setError:x,deleteGroup:z,triggerRefresh:f}=Z(),{allServers:S}=Q({refreshOnMount:!0}),[h,u]=b.useState(null),[C,j]=b.useState(!1),[E,w]=b.useState(!1),[R,n]=b.useState(!1),[o,v]=b.useState(!1),l=r=>{u(r)},i=()=>{u(null),f()},A=async r=>{const N=await z(r);(!N||!N.success)&&x((N==null?void 0:N.message)||p("groups.deleteError"))},T=()=>{j(!0)},P=()=>{j(!1),f()},t=()=>{w(!1),f()},c=()=>{v(!1),f()};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:p("pages.groups.title")}),e.jsxs("div",{className:"flex space-x-4",children:[e.jsxs("button",{onClick:T,className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 00-1 1v5H4a1 1 0 100 2h5v5a1 1 0 102 0v-5h5a1 1 0 100-2h-5V4a1 1 0 00-1-1z",clipRule:"evenodd"})}),p("groups.add")]}),e.jsxs("button",{onClick:()=>w(!0),className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"})}),p("groupImport.button")]}),e.jsxs("button",{onClick:()=>n(!0),className:"px-4 py-2 bg-green-100 text-green-800 rounded hover:bg-green-200 flex items-center btn-primary transition-all duration-200",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM6.293 6.707a1 1 0 010-1.414l3-3a1 1 0 011.414 0l3 3a1 1 0 01-1.414 1.414L11 5.414V13a1 1 0 11-2 0V5.414L7.707 6.707a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),p("template.exportButton")]}),e.jsxs("button",{onClick:()=>v(!0),className:"px-4 py-2 bg-green-100 text-green-800 rounded hover:bg-green-200 flex items-center btn-primary transition-all duration-200",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"})}),p("template.importButton")]})]})]}),m&&e.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:e.jsx("p",{children:m})}),s?e.jsx("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6 loading-container",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e.jsx("p",{className:"text-gray-600",children:p("app.loading")})]})}):I.length===0?e.jsx("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6 empty-state",children:e.jsx("p",{className:"text-gray-600",children:p("groups.noGroups")})}):e.jsx("div",{className:"space-y-6",children:I.map(r=>e.jsx(Se,{group:r,servers:S,onEdit:l,onDelete:A},r.id))}),C&&e.jsx(Ne,{onAdd:P,onCancel:P}),E&&e.jsx(ke,{onSuccess:t,onCancel:()=>w(!1)}),h&&e.jsx(we,{group:h,onEdit:i,onCancel:()=>u(null)}),R&&e.jsx(Ce,{groups:I,onCancel:()=>n(!1)}),o&&e.jsx(Ae,{onSuccess:c,onCancel:()=>v(!1)})]})};export{$e as default};
33
- //# sourceMappingURL=GroupsPage-BjrvyHwu.js.map