|
320 | 320 | "command": "mdb.copyConnectionString", |
321 | 321 | "title": "Copy Connection String" |
322 | 322 | }, |
| 323 | + { |
| 324 | + "command": "mdb.editPresetConnections", |
| 325 | + "title": "Edit Preset Connections..." |
| 326 | + }, |
323 | 327 | { |
324 | 328 | "command": "mdb.renameConnection", |
325 | 329 | "title": "Rename Connection..." |
|
489 | 493 | }, |
490 | 494 | { |
491 | 495 | "command": "mdb.addConnection", |
492 | | - "when": "view == mongoDBConnectionExplorer" |
| 496 | + "when": "view == mongoDBConnectionExplorer", |
| 497 | + "group": "1@1" |
493 | 498 | }, |
494 | 499 | { |
495 | 500 | "command": "mdb.addConnectionWithURI", |
496 | | - "when": "view == mongoDBConnectionExplorer" |
| 501 | + "when": "view == mongoDBConnectionExplorer", |
| 502 | + "group": "1@2" |
| 503 | + }, |
| 504 | + { |
| 505 | + "command": "mdb.editPresetConnections", |
| 506 | + "when": "view == mongoDBConnectionExplorer", |
| 507 | + "group": "2@1" |
497 | 508 | } |
498 | 509 | ], |
499 | 510 | "view/item/context": [ |
500 | 511 | { |
501 | 512 | "command": "mdb.addDatabase", |
502 | | - "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem && mdb.isAtlasStreams == false", |
| 513 | + "when": "view == mongoDBConnectionExplorer && (viewItem == connectedConnectionTreeItem || viewItem == connectedPresetConnectionTreeItem) && mdb.isAtlasStreams == false", |
503 | 514 | "group": "inline" |
504 | 515 | }, |
505 | 516 | { |
506 | 517 | "command": "mdb.addDatabase", |
507 | | - "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem && mdb.isAtlasStreams == false", |
| 518 | + "when": "view == mongoDBConnectionExplorer && (viewItem == connectedConnectionTreeItem || viewItem == connectedPresetConnectionTreeItem) && mdb.isAtlasStreams == false", |
508 | 519 | "group": "1@1" |
509 | 520 | }, |
510 | 521 | { |
511 | 522 | "command": "mdb.addStreamProcessor", |
512 | | - "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem && mdb.isAtlasStreams == true", |
| 523 | + "when": "view == mongoDBConnectionExplorer && (viewItem == connectedConnectionTreeItem || viewItem == connectedPresetConnectionTreeItem) && mdb.isAtlasStreams == true", |
513 | 524 | "group": "inline" |
514 | 525 | }, |
515 | 526 | { |
516 | 527 | "command": "mdb.addStreamProcessor", |
517 | | - "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem && mdb.isAtlasStreams == true", |
| 528 | + "when": "view == mongoDBConnectionExplorer && (viewItem == connectedConnectionTreeItem || viewItem == connectedPresetConnectionTreeItem) && mdb.isAtlasStreams == true", |
518 | 529 | "group": "1@1" |
519 | 530 | }, |
520 | 531 | { |
521 | 532 | "command": "mdb.refreshConnection", |
522 | | - "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", |
| 533 | + "when": "view == mongoDBConnectionExplorer && (viewItem == connectedConnectionTreeItem || viewItem == connectedPresetConnectionTreeItem)", |
523 | 534 | "group": "1@2" |
524 | 535 | }, |
525 | 536 | { |
526 | 537 | "command": "mdb.treeViewOpenMongoDBShell", |
527 | | - "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", |
| 538 | + "when": "view == mongoDBConnectionExplorer && (viewItem == connectedConnectionTreeItem || viewItem == connectedPresetConnectionTreeItem)", |
528 | 539 | "group": "2@1" |
529 | 540 | }, |
530 | 541 | { |
|
537 | 548 | "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", |
538 | 549 | "group": "3@2" |
539 | 550 | }, |
| 551 | + { |
| 552 | + "command": "mdb.editPresetConnections", |
| 553 | + "when": "view == mongoDBConnectionExplorer && viewItem == connectedPresetConnectionTreeItem", |
| 554 | + "group": "3@2" |
| 555 | + }, |
540 | 556 | { |
541 | 557 | "command": "mdb.copyConnectionString", |
542 | | - "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", |
| 558 | + "when": "view == mongoDBConnectionExplorer && (viewItem == connectedConnectionTreeItem || viewItem == connectedPresetConnectionTreeItem)", |
543 | 559 | "group": "4@1" |
544 | 560 | }, |
545 | 561 | { |
546 | 562 | "command": "mdb.disconnectFromConnectionTreeItem", |
547 | | - "when": "view == mongoDBConnectionExplorer && viewItem == connectedConnectionTreeItem", |
| 563 | + "when": "view == mongoDBConnectionExplorer && (viewItem == connectedConnectionTreeItem || viewItem == connectedPresetConnectionTreeItem)", |
548 | 564 | "group": "5@1" |
549 | 565 | }, |
550 | 566 | { |
|
559 | 575 | }, |
560 | 576 | { |
561 | 577 | "command": "mdb.connectToConnectionTreeItem", |
562 | | - "when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem", |
| 578 | + "when": "view == mongoDBConnectionExplorer && (viewItem == disconnectedConnectionTreeItem || viewItem == disconnectedPresetConnectionTreeItem)", |
563 | 579 | "group": "1@1" |
564 | 580 | }, |
565 | 581 | { |
|
572 | 588 | "when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem", |
573 | 589 | "group": "2@2" |
574 | 590 | }, |
| 591 | + { |
| 592 | + "command": "mdb.editPresetConnections", |
| 593 | + "when": "view == mongoDBConnectionExplorer && viewItem == disconnectedPresetConnectionTreeItem", |
| 594 | + "group": "2@2" |
| 595 | + }, |
575 | 596 | { |
576 | 597 | "command": "mdb.copyConnectionString", |
577 | | - "when": "view == mongoDBConnectionExplorer && viewItem == disconnectedConnectionTreeItem", |
| 598 | + "when": "view == mongoDBConnectionExplorer && (viewItem == disconnectedConnectionTreeItem || viewItem == disconnectedPresetConnectionTreeItem)", |
578 | 599 | "group": "3@1" |
579 | 600 | }, |
580 | 601 | { |
|
1171 | 1192 | "type": "string", |
1172 | 1193 | "default": "", |
1173 | 1194 | "description": "Specify a shell command that is run to start the browser for authenticating with the OIDC identity provider for the server connection. Leave this empty for default browser." |
| 1195 | + }, |
| 1196 | + "mdb.presetConnections": { |
| 1197 | + "scope": "window", |
| 1198 | + "type": "array", |
| 1199 | + "description": "Defines preset connections. Can be used to share connection configurations in a workspace or global scope. Do not store sensitive credentials here.", |
| 1200 | + "examples": [ |
| 1201 | + [ |
| 1202 | + { |
| 1203 | + "name": "Preset Connection", |
| 1204 | + "connectionString": "mongodb://localhost:27017" |
| 1205 | + } |
| 1206 | + ] |
| 1207 | + ], |
| 1208 | + "items": { |
| 1209 | + "type": "object", |
| 1210 | + "examples": [ |
| 1211 | + { |
| 1212 | + "name": "Preset Connection", |
| 1213 | + "connectionString": "mongodb://localhost:27017" |
| 1214 | + } |
| 1215 | + ], |
| 1216 | + "properties": { |
| 1217 | + "name": { |
| 1218 | + "type": "string", |
| 1219 | + "description": "Name of the connection." |
| 1220 | + }, |
| 1221 | + "connectionString": { |
| 1222 | + "type": "string", |
| 1223 | + "description": "Connection string. Do not store sensitive credentials here." |
| 1224 | + } |
| 1225 | + }, |
| 1226 | + "required": [ |
| 1227 | + "name", |
| 1228 | + "connectionString" |
| 1229 | + ] |
| 1230 | + } |
1174 | 1231 | } |
1175 | 1232 | } |
1176 | 1233 | }, |
|
0 commit comments