mcp-config-manager 1.0.3 → 1.0.5
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.
- package/package.json +1 -1
- package/public/index.html +7 -7
- package/public/js/kanbanView.js +18 -5
- package/src/config-manager.js +6 -3
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -314,12 +314,12 @@
|
|
|
314
314
|
</div>
|
|
315
315
|
</div>
|
|
316
316
|
|
|
317
|
-
<script type="module" src="js/utils.js"></script>
|
|
318
|
-
<script type="module" src="js/api.js"></script>
|
|
319
|
-
<script type="module" src="js/modals.js"></script>
|
|
320
|
-
<script type="module" src="js/clientView.js"></script>
|
|
321
|
-
<script type="module" src="js/kanbanView.js"></script>
|
|
322
|
-
<script type="module" src="js/serverView.js"></script>
|
|
323
|
-
<script type="module" src="js/main.js"></script>
|
|
317
|
+
<script type="module" src="js/utils.js?v=2"></script>
|
|
318
|
+
<script type="module" src="js/api.js?v=2"></script>
|
|
319
|
+
<script type="module" src="js/modals.js?v=2"></script>
|
|
320
|
+
<script type="module" src="js/clientView.js?v=2"></script>
|
|
321
|
+
<script type="module" src="js/kanbanView.js?v=2"></script>
|
|
322
|
+
<script type="module" src="js/serverView.js?v=2"></script>
|
|
323
|
+
<script type="module" src="js/main.js?v=2"></script>
|
|
324
324
|
</body>
|
|
325
325
|
</html>
|
package/public/js/kanbanView.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import { getClientConfigApi, copyServerApi } from './api.js';
|
|
2
|
-
import { showServerModal, editServer,
|
|
1
|
+
import { getClientConfigApi, copyServerApi, deleteServerApi } from './api.js';
|
|
2
|
+
import { showServerModal, editServer, copyToClipboard, exportServer } from './modals.js';
|
|
3
3
|
|
|
4
4
|
let clients = []; // This will be passed from main.js
|
|
5
5
|
let draggedServer = null;
|
|
6
6
|
let draggedFromClient = null;
|
|
7
7
|
let loadClientsCallback = null; // Callback to main.js to reload all clients
|
|
8
|
+
let listenersAttached = false; // Track if event listeners have been attached
|
|
8
9
|
|
|
9
10
|
export function initKanbanView(allClients, loadClientsFn) {
|
|
10
11
|
clients = allClients;
|
|
11
12
|
loadClientsCallback = loadClientsFn;
|
|
12
|
-
|
|
13
|
+
if (!listenersAttached) {
|
|
14
|
+
attachKanbanViewEventListeners();
|
|
15
|
+
listenersAttached = true;
|
|
16
|
+
}
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
// Simple hash function to generate a consistent color from a string
|
|
@@ -199,13 +203,22 @@ export const editServerKanban = (clientId, serverName, event) => {
|
|
|
199
203
|
editServer(serverName, renderKanbanBoard, clientId, loadClientsCallback);
|
|
200
204
|
};
|
|
201
205
|
|
|
202
|
-
export const deleteServerKanban = (clientId, serverName, event) => {
|
|
206
|
+
export const deleteServerKanban = async (clientId, serverName, event) => {
|
|
203
207
|
event.stopPropagation();
|
|
204
208
|
if (!confirm(`Are you sure you want to delete the server "${serverName}" from ${clients.find(c => c.id === clientId).name}?`)) {
|
|
205
209
|
return;
|
|
206
210
|
}
|
|
207
211
|
|
|
208
|
-
|
|
212
|
+
try {
|
|
213
|
+
const response = await deleteServerApi(clientId, serverName);
|
|
214
|
+
if (response.success) {
|
|
215
|
+
await window.loadClients();
|
|
216
|
+
} else {
|
|
217
|
+
throw new Error('Failed to delete server');
|
|
218
|
+
}
|
|
219
|
+
} catch (error) {
|
|
220
|
+
alert('Failed to delete server: ' + error.message);
|
|
221
|
+
}
|
|
209
222
|
};
|
|
210
223
|
|
|
211
224
|
export const exportServerKanban = (clientId, serverName, event) => {
|
package/src/config-manager.js
CHANGED
|
@@ -129,10 +129,11 @@ export class MCPConfigManager {
|
|
|
129
129
|
configHash: this.getServerConfigHash(serverConfig || {})
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
+
const configPath = await this.getConfigPath(clientId);
|
|
132
133
|
allServers[serverName].clients.push({
|
|
133
134
|
id: clientId,
|
|
134
135
|
name: clientInfo.name,
|
|
135
|
-
configPath
|
|
136
|
+
configPath
|
|
136
137
|
});
|
|
137
138
|
// If a server exists globally and in a client, mark it as global
|
|
138
139
|
if (globalServers[serverName]) {
|
|
@@ -180,19 +181,21 @@ export class MCPConfigManager {
|
|
|
180
181
|
try {
|
|
181
182
|
const config = await this.readConfig(key);
|
|
182
183
|
const serverCount = Object.keys(config.servers).length;
|
|
184
|
+
const configPath = await this.getConfigPath(key);
|
|
183
185
|
clientsWithConfigs.push({
|
|
184
186
|
id: key,
|
|
185
187
|
name: client.name,
|
|
186
|
-
configPath
|
|
188
|
+
configPath,
|
|
187
189
|
serverCount,
|
|
188
190
|
exists: true
|
|
189
191
|
});
|
|
190
192
|
} catch (error) {
|
|
191
193
|
console.error(`Error processing client ${key}:`, error.message);
|
|
194
|
+
const configPath = await this.getConfigPath(key);
|
|
192
195
|
clientsWithConfigs.push({
|
|
193
196
|
id: key,
|
|
194
197
|
name: client.name,
|
|
195
|
-
configPath
|
|
198
|
+
configPath,
|
|
196
199
|
serverCount: 0,
|
|
197
200
|
exists: false
|
|
198
201
|
});
|