Remote access connect button in cockpit-widget

Hello all,

I need to move the “connect” button for remote access endpoints into a cockpit widget. Is it possible and when yes, how to do it?

thx

greets
Helmut

1 Like

Hi Helumt,

what is meant with “Connect”? Web SSH session or VNC session?
If so I think you can just use the URL to the web terminal and assign it to a button.

Example:
https://<yourTenantURL>/apps/devicemanagement/remoteAccess/clients/terminal/index.html?paramsId=remoteConnection_<sourceId>_<configurationID>

So you actually don’t need any widget but of course can build you one that is calcualting the correct URL and opening the terminal in a window like it is done in the device management.

I don’t think the component used in device management remote access is available for the cockpit to be used but maybe someone else knows more?!

Hi @hgansmueller,

to get the remote access functionality in cockpit you could add the following import into your ng1.ts file in case you are doing custom builds of cockpit:

import '@c8y/ng1-modules/remoteAccess/cumulocity.json';

The button that links to https://<yourTenantURL>/apps/devicemanagement/remoteAccess/clients/terminal/index.html?paramsId=remoteConnection_<sourceId>_<configurationID> , which @Stefan_Witschel suggested, will probably not work as some additional stuff is happening in the background as well…

Regards,
Tristan

1 Like

Hello,

as so far, I think it works like this in device management:
If I klick on Connect button vor example a vnc connection, then an operation for the device get created and the client get started in a new browser window. This is not a request, it is just a call to a function which creates the new window and start the right client with the parameters, where it has to connect. Is this right?

greets
Helmut

Hi @hgansmueller,

When you press the connect button, the UI opens a new browser window and passes the connection details to it.
The newly opened browser window establishes a WebSocket connection to the remoteaccess microservice with the parameters it previously received.
Once the microservice receives the request for the WebSocket connection from the UI, it will create the device operation.

So with the current UI, you could open /apps/devicemanagement/remoteAccess/clients/terminal/index.html?paramsId=remoteConnection_<deviceId>_<remoteAccessConfigurationId> for an SSH connection and it would try to establish the WebSocket connection.
The remoteConnection_<deviceId>_<remoteAccessConfigurationId> actually refers to an entry in your browsers local storage, which is used to provide some connection details to the new window.

Note that the UI for these views might change in the future, as these views will be migrated from angularJS to angular.

Regards,
Tristan