From c09e577d2c67bbe9ab511e8655e59d000969462f Mon Sep 17 00:00:00 2001 From: Jan Horvath Date: Thu, 17 Oct 2024 08:00:01 +0200 Subject: [PATCH] Open in OCI Console command --- .../modules/cloud/oracle/OCINode.java | 2 +- .../cloud/oracle/bucket/BucketItem.java | 22 +++++++++++- .../cloud/oracle/compute/ClusterItem.java | 21 ++++++++++- .../oracle/compute/ComputeInstanceItem.java | 20 ++++++++++- .../cloud/oracle/database/DatabaseItem.java | 21 ++++++++++- .../modules/cloud/oracle/items/OCIItem.java | 18 ++++++++++ .../modules/cloud/oracle/vault/KeyItem.java | 30 ++++++++++++++-- .../modules/cloud/oracle/vault/KeyNode.java | 1 + .../cloud/oracle/vault/SecretItem.java | 31 ++++++++++++++-- .../cloud/oracle/vault/SecretNode.java | 1 + .../modules/cloud/oracle/vault/VaultItem.java | 21 ++++++++++- .../LspAssetsDecorationProvider.java | 36 ++++++++++++------- java/java.lsp.server/vscode/package.json | 19 ++++++++-- java/java.lsp.server/vscode/src/extension.ts | 8 +++++ 14 files changed, 226 insertions(+), 25 deletions(-) diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OCINode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OCINode.java index 5b406e307241..3cc6d626f2a3 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OCINode.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/OCINode.java @@ -64,7 +64,7 @@ private OCINode(CloudChildFactory factory, OCIItem item, OCISessionInitiator ses } public OCINode(OCIItem item, Children children) { - super(children, Lookups.fixed(item, OCIManager.getDefault().getActiveProfile(item))); + super(children, Lookups.fixed(item)); setName(item.getName()); this.item = item; this.factory = null; diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/bucket/BucketItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/bucket/BucketItem.java index c4f08dce7156..7aa6c2b418de 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/bucket/BucketItem.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/bucket/BucketItem.java @@ -18,14 +18,20 @@ */ package org.netbeans.modules.cloud.oracle.bucket; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import org.netbeans.modules.cloud.oracle.adm.URLProvider; import org.netbeans.modules.cloud.oracle.items.OCID; import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.openide.util.Exceptions; /** * * @author Jan Horvath */ -public final class BucketItem extends OCIItem { +public final class BucketItem extends OCIItem implements URLProvider { private String namespace; @@ -47,4 +53,18 @@ public int maxInProject() { return Integer.MAX_VALUE; } + @Override + public URL getURL() { + if (getKey().getValue() != null && getRegion() != null) { + try { + URI uri = new URI(String.format("https://cloud.oracle.com/object-storage/buckets/%s/%s/objects?region=%s", + getNamespace(), getName(), getRegion())); + return uri.toURL(); + } catch (MalformedURLException | URISyntaxException ex) { + Exceptions.printStackTrace(ex); + } + } + return null; + } + } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ClusterItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ClusterItem.java index d736fdf363be..16caacffba27 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ClusterItem.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ClusterItem.java @@ -22,9 +22,14 @@ import com.oracle.bmc.containerengine.requests.CreateKubeconfigRequest; import com.oracle.bmc.containerengine.responses.CreateKubeconfigResponse; import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; import java.nio.charset.Charset; import org.netbeans.modules.cloud.oracle.OCIManager; import org.netbeans.modules.cloud.oracle.OCIProfile; +import org.netbeans.modules.cloud.oracle.adm.URLProvider; import org.netbeans.modules.cloud.oracle.items.OCID; import org.netbeans.modules.cloud.oracle.items.OCIItem; import org.openide.util.Exceptions; @@ -33,7 +38,7 @@ * * @author Jan Horvath */ -public final class ClusterItem extends OCIItem { +public final class ClusterItem extends OCIItem implements URLProvider{ private String config = null; private String namespace = "default"; //NOI8N @@ -80,4 +85,18 @@ public void update() { Exceptions.printStackTrace(ex); } } + + @Override + public URL getURL() { + if (getKey().getValue() != null && getRegion() != null) { + try { + URI uri = new URI(String.format("https://cloud.oracle.com/containers/clusters/%s?region=%s", getKey().getValue(), getRegion())); + return uri.toURL(); + } catch (MalformedURLException | URISyntaxException ex) { + Exceptions.printStackTrace(ex); + } + } + return null; + } + } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceItem.java index 1fa5f04ef367..8bf09cd44169 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceItem.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/compute/ComputeInstanceItem.java @@ -18,14 +18,20 @@ */ package org.netbeans.modules.cloud.oracle.compute; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import org.netbeans.modules.cloud.oracle.adm.URLProvider; import org.netbeans.modules.cloud.oracle.items.OCID; import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.openide.util.Exceptions; /** * * @author Jan Horvath */ -public final class ComputeInstanceItem extends OCIItem { +public final class ComputeInstanceItem extends OCIItem implements URLProvider { private String publicIp = null; private String processorDescription; private String username; @@ -70,4 +76,16 @@ void setPublicId(String publicIp) { this.publicIp = publicIp; } + @Override + public URL getURL() { + if (getKey().getValue() != null && getRegion() != null) { + try { + URI uri = new URI(String.format("https://cloud.oracle.com/compute/instances/%s?region=%s", getKey().getValue(), getRegion())); + return uri.toURL(); + } catch (MalformedURLException | URISyntaxException ex) { + Exceptions.printStackTrace(ex); + } + } + return null; + } } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseItem.java index 5c1155965768..246d3898bd54 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseItem.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/database/DatabaseItem.java @@ -18,21 +18,27 @@ */ package org.netbeans.modules.cloud.oracle.database; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.netbeans.api.db.explorer.ConnectionManager; import org.netbeans.api.db.explorer.DatabaseConnection; +import org.netbeans.modules.cloud.oracle.adm.URLProvider; import org.netbeans.modules.cloud.oracle.assets.CloudAssets; import org.netbeans.modules.cloud.oracle.items.OCID; import org.netbeans.modules.cloud.oracle.items.OCIItem; import org.netbeans.modules.cloud.oracle.vault.SensitiveData; +import org.openide.util.Exceptions; /** * * @author Jan Horvath */ -public class DatabaseItem extends OCIItem implements SensitiveData { +public class DatabaseItem extends OCIItem implements SensitiveData, URLProvider { private static final String DEFAULT_REF_NAME = "DEFAULT"; private final String serviceUrl; private final String connectionName; @@ -106,4 +112,17 @@ public DatabaseConnection getCorrespondingConnection() { } return null; } + + @Override + public URL getURL() { + if (getKey().getValue() != null && getRegion() != null) { + try { + URI uri = new URI(String.format("https://cloud.oracle.com/db/adbs/%s?region=%s", getKey().getValue(), getRegion())); + return uri.toURL(); + } catch (MalformedURLException | URISyntaxException ex) { + Exceptions.printStackTrace(ex); + } + } + return null; + } } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/OCIItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/OCIItem.java index 31bb0a8dc713..161321132414 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/OCIItem.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/items/OCIItem.java @@ -18,9 +18,12 @@ */ package org.netbeans.modules.cloud.oracle.items; +import com.oracle.bmc.Region; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.Objects; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Represents Oracle Cloud Resource identified by Oracle Cloud Identifier (OCID) @@ -28,6 +31,9 @@ * @author Jan Horvath */ public abstract class OCIItem { + + private static final Logger LOG = Logger.getLogger(OCIItem.class.getName()); + final OCID id; final String name; final String compartmentId; @@ -188,4 +194,16 @@ public void fireRefNameChanged(String oldRefName, String referenceName) { changeSupport.firePropertyChange("referenceName", oldRefName, referenceName); } + public String getRegion() { + if (getRegionCode() != null) { + try { + Region region = Region.fromRegionCodeOrId(getRegionCode()); + return region.getRegionId(); + } catch (IllegalArgumentException e) { + LOG.log(Level.INFO, "Unknown Region Code", e); + } + } + return null; + } + } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyItem.java index 430515952200..506e47263553 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyItem.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyItem.java @@ -18,26 +18,52 @@ */ package org.netbeans.modules.cloud.oracle.vault; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import org.netbeans.modules.cloud.oracle.adm.URLProvider; import org.netbeans.modules.cloud.oracle.items.OCID; import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.openide.util.Exceptions; /** * * @author Jan Horvath */ -public class KeyItem extends OCIItem { +public class KeyItem extends OCIItem implements URLProvider { - public KeyItem(OCID id, String compartmentId, String name, String tenancyId, String regionCode) { + private String vaultId; + + public KeyItem(OCID id, String compartmentId, String name, String vaultId, String tenancyId, String regionCode) { super(id, compartmentId, name, tenancyId, regionCode); + this.vaultId = vaultId; } public KeyItem() { super(); } + public String getVaultId() { + return vaultId; + } + @Override public int maxInProject() { return Integer.MAX_VALUE; } + @Override + public URL getURL() { + if (getKey().getValue() != null && getRegion() != null) { + try { + URI uri = new URI(String.format("https://cloud.oracle.com/security/kms/vaults/%s/keys/%s?region=%s", getVaultId(), getKey().getValue(), getRegion())); + return uri.toURL(); + } catch (MalformedURLException | URISyntaxException ex) { + Exceptions.printStackTrace(ex); + } + } + return null; + } + } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyNode.java index 1943a05174b4..2a81089e9df7 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyNode.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/KeyNode.java @@ -82,6 +82,7 @@ public static ChildrenProvider.SessionAware getKeys() { OCID.of(d.getId(), "Vault/Key"), //NOI18N d.getCompartmentId(), d.getDisplayName(), + vault.getKey().getValue(), tenancyId, regionCode) ) diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretItem.java index f27f3a8390aa..c04a375ccc79 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretItem.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretItem.java @@ -18,23 +18,31 @@ */ package org.netbeans.modules.cloud.oracle.vault; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; import java.util.Date; +import org.netbeans.modules.cloud.oracle.adm.URLProvider; import org.netbeans.modules.cloud.oracle.items.OCID; import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.openide.util.Exceptions; /** * * @author Jan Horvath */ -public class SecretItem extends OCIItem { +public class SecretItem extends OCIItem implements URLProvider { private String lifecycleState; private Date deletionTime; + private String vaultId; - public SecretItem(OCID id, String compartmentId, String name, String lifecycleState, Date deletionTime, String tenancyId, String regionCode) { + public SecretItem(OCID id, String compartmentId, String name, String lifecycleState, Date deletionTime, String vaultId, String tenancyId, String regionCode) { super(id, compartmentId, name, tenancyId, regionCode); this.lifecycleState = lifecycleState; this.deletionTime = deletionTime; + this.vaultId = vaultId; } public SecretItem() { @@ -51,6 +59,10 @@ public int maxInProject() { public Date getDeletionTime() { return this.deletionTime; } + + public String getVaultId() { + return vaultId; + } void setDeletionTime(Date deletionTime) { this.deletionTime = deletionTime; @@ -63,4 +75,19 @@ public String getLifecycleState() { void setLifecycleState(String lifecycleState) { this.lifecycleState = lifecycleState; } + + @Override + public URL getURL() { + if (getKey().getValue() != null && getRegion() != null) { + try { + URI uri = new URI(String.format("https://cloud.oracle.com/security/kms/vaults/%s/secrets/%s?region=%s", + getVaultId(), getKey().getValue(), getRegion())); + return uri.toURL(); + } catch (MalformedURLException | URISyntaxException ex) { + Exceptions.printStackTrace(ex); + } + } + return null; + } + } diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretNode.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretNode.java index a594d6095eac..eb6c01001712 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretNode.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretNode.java @@ -211,6 +211,7 @@ public static ChildrenProvider.SessionAware getSecrets() d.getSecretName(), d.getLifecycleState().getValue(), d.getTimeOfDeletion(), + vault.getKey().getValue(), tenancyId, regionCode) ) diff --git a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultItem.java b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultItem.java index 6d38767103bc..baefdafb53d9 100644 --- a/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultItem.java +++ b/enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/VaultItem.java @@ -18,14 +18,20 @@ */ package org.netbeans.modules.cloud.oracle.vault; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import org.netbeans.modules.cloud.oracle.adm.URLProvider; import org.netbeans.modules.cloud.oracle.items.OCID; import org.netbeans.modules.cloud.oracle.items.OCIItem; +import org.openide.util.Exceptions; /** * * @author Jan Horvath */ -public class VaultItem extends OCIItem { +public class VaultItem extends OCIItem implements URLProvider { private String managementEndpoint; public VaultItem(OCID id, String compartment, String name, String managementEndpoint, String tenancyId, String regionCode) { @@ -46,4 +52,17 @@ public int maxInProject() { return 1; } + @Override + public URL getURL() { + if (getKey().getValue() != null && getRegion() != null) { + try { + URI uri = new URI(String.format("https://cloud.oracle.com/security/kms/vaults/%s?region=%s", getKey().getValue(), getRegion())); + return uri.toURL(); + } catch (MalformedURLException | URISyntaxException ex) { + Exceptions.printStackTrace(ex); + } + } + return null; + } + } diff --git a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspAssetsDecorationProvider.java b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspAssetsDecorationProvider.java index 038dcb02e023..6a3daa7bd5c7 100644 --- a/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspAssetsDecorationProvider.java +++ b/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspAssetsDecorationProvider.java @@ -18,8 +18,10 @@ */ package org.netbeans.modules.nbcode.integration; +import java.net.URL; import java.util.Optional; import java.util.logging.Logger; +import org.netbeans.modules.cloud.oracle.adm.URLProvider; import org.netbeans.modules.cloud.oracle.assets.CloudAssets; import org.netbeans.modules.cloud.oracle.bucket.BucketItem; import org.netbeans.modules.cloud.oracle.compute.ClusterItem; @@ -36,7 +38,6 @@ import org.openide.nodes.Node; import org.openide.util.lookup.ServiceProvider; - /** * * @author Jan Horvath @@ -44,7 +45,7 @@ @ServiceProvider(service = TreeDataProvider.Factory.class, path = "Explorers/cloud.assets") public class LspAssetsDecorationProvider implements TreeDataProvider.Factory { private static final Logger LOG = Logger.getLogger(LspAssetsDecorationProvider.class.getName()); - + public static final String CTXVALUE_CAP_REFERENCE_NAME = "cap:refName"; // NOI18N public static final String CTXVALUE_PREFIX_REFERENCE_NAME = "cloudAssetsReferenceName:"; // NOI18N public static final String CTXVALUE_PREFIX_PUBLIC_IP = "publicIp:"; // NOI18N @@ -54,12 +55,13 @@ public class LspAssetsDecorationProvider implements TreeDataProvider.Factory { public static final String CTXVALUE_PREFIX_REPOSITORY_PUBLIC = "repositoryPublic:"; // NOI18N public static final String CTXVALUE_PREFIX_SECRET_LIFECYCLE_STATE = "lifecycleState:"; // NOI18N public static final String CTXVALUE_PREFIX_CLUSTER_NAMESPACE = "clusterNamespace:"; // NOI18N + public static final String CTXVALUE_PREFIX_CONSOLE_URL = "consoleUrl:"; // NOI18N @Override public synchronized TreeDataProvider createProvider(String treeId) { return new ProviderImpl(null); } - + static class ProviderImpl implements TreeDataProvider { public ProviderImpl(NodeLookupContextValues lookupValues) { } @@ -69,11 +71,18 @@ public TreeItemData createDecorations(Node n, boolean expanded) { TreeItemData d = new TreeItemData(); String refName; boolean set = false; - + OCIItem item = n.getLookup().lookup(OCIItem.class); if (item == null) { return null; } + if (item instanceof URLProvider) { + URL consoleURL = ((URLProvider) item).getURL(); + if (consoleURL != null) { + d.addContextValues(CTXVALUE_PREFIX_CONSOLE_URL + consoleURL.toExternalForm()); + set = true; + } + } refName = CloudAssets.getDefault().getReferenceName(item); if (refName != null) { d.addContextValues(CTXVALUE_PREFIX_REFERENCE_NAME + refName); @@ -107,36 +116,39 @@ public TreeItemData createDecorations(Node n, boolean expanded) { } else { ClusterItem cluster = CloudAssets.getDefault().getItem(ClusterItem.class); if (cluster != null) { - d.addContextValues(CTXVALUE_PREFIX_CLUSTER_NAME + cluster.getName()); + d.addContextValues(CTXVALUE_PREFIX_CLUSTER_NAME + cluster.getName()); } } d.addContextValues(CTXVALUE_PREFIX_IMAGE_URL + imageUrl); set = true; } - if (item instanceof BucketItem + if (item instanceof BucketItem || item instanceof DatabaseItem) { d.addContextValues(CTXVALUE_CAP_REFERENCE_NAME); set = true; } - + if (item instanceof SecretItem) { - d.addContextValues(CTXVALUE_PREFIX_SECRET_LIFECYCLE_STATE + ((SecretItem)item).getLifecycleState()); + d.addContextValues(CTXVALUE_PREFIX_SECRET_LIFECYCLE_STATE + ((SecretItem) item).getLifecycleState()); set = true; } return set ? d : null; } @Override - public void addTreeItemDataListener(TreeDataListener l) { + public void addTreeItemDataListener(TreeDataListener l + ) { } @Override - public void removeTreeItemDataListener(TreeDataListener l) { + public void removeTreeItemDataListener(TreeDataListener l + ) { } @Override - public void nodeReleased(Node n) { + public void nodeReleased(Node n + ) { } - + } } diff --git a/java/java.lsp.server/vscode/package.json b/java/java.lsp.server/vscode/package.json index ac61857d1df4..162fc52f353c 100644 --- a/java/java.lsp.server/vscode/package.json +++ b/java/java.lsp.server/vscode/package.json @@ -520,6 +520,10 @@ "command": "nbls.cloud.publicIp.copy", "title": "Copy the public IP address" }, + { + "command": "nbls.cloud.openConsole", + "title": "Open in OCI Console" + }, { "command": "nbls.cloud.imageUrl.copy", "title": "Copy pull command" @@ -868,6 +872,10 @@ "command": "nbls.cloud.publicIp.copy", "when": "false" }, + { + "command": "nbls.cloud.openConsole", + "when": "false" + }, { "command": "nbls.cloud.imageUrl.copy", "when": "false" @@ -1118,7 +1126,12 @@ { "command": "nbls.cloud.publicIp.copy", "when": "viewItem =~ /publicIp:.*/ && viewItem =~ /^(?!.*imageUrl:).*/", - "group": "oci@1000" + "group": "instance@1500" + }, + { + "command": "nbls.cloud.openConsole", + "when": "viewItem =~ /consoleUrl:.*/", + "group": "oci@2000" }, { "command": "nbls.cloud.imageUrl.copy", @@ -1153,7 +1166,7 @@ { "command": "nbls.cloud.assets.buildPushNativeImage", "when": "viewItem =~ /class:oracle.developer.ContainerRepositoryItem/", - "group": "oci@1000" + "group": "container@1000" }, { "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.AddRepository", @@ -1163,7 +1176,7 @@ { "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.CreateBuildRun", "when": "viewItem =~ /class:oracle.devops.BuildPipelineItem/", - "group": "inline@12" + "group": "container@12" }, { "command": "nbls:Tools:org.netbeans.modules.cloud.oracle.actions.AddToProject", diff --git a/java/java.lsp.server/vscode/src/extension.ts b/java/java.lsp.server/vscode/src/extension.ts index a040b2487359..b378f9c549a9 100644 --- a/java/java.lsp.server/vscode/src/extension.ts +++ b/java/java.lsp.server/vscode/src/extension.ts @@ -904,6 +904,14 @@ export function activate(context: ExtensionContext): VSNetBeansAPI { } )); + context.subscriptions.push(commands.registerCommand(COMMAND_PREFIX + '.cloud.openConsole', + async (node) => { + const consoleUrl = getValueAfterPrefix(node.contextValue, 'consoleUrl:'); + const url = vscode.Uri.parse(consoleUrl); + vscode.env.openExternal(url); + } + )); + context.subscriptions.push(commands.registerCommand(COMMAND_PREFIX + '.cloud.imageUrl.copy', async (node) => { const imageUrl = getValueAfterPrefix(node.contextValue, 'imageUrl:');