mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-360: Add interface for connecting to active connections from "Active Sessions" tab.
This commit is contained in:
@@ -35,6 +35,7 @@ angular.module('settings').directive('guacSettingsSessions', [function guacSetti
|
|||||||
|
|
||||||
// Required types
|
// Required types
|
||||||
var ActiveConnectionWrapper = $injector.get('ActiveConnectionWrapper');
|
var ActiveConnectionWrapper = $injector.get('ActiveConnectionWrapper');
|
||||||
|
var ClientIdentifier = $injector.get('ClientIdentifier');
|
||||||
var ConnectionGroup = $injector.get('ConnectionGroup');
|
var ConnectionGroup = $injector.get('ConnectionGroup');
|
||||||
var SortOrder = $injector.get('SortOrder');
|
var SortOrder = $injector.get('SortOrder');
|
||||||
|
|
||||||
@@ -337,6 +338,36 @@ angular.module('settings').directive('guacSettingsSessions', [function guacSetti
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the relative URL of the client page which accesses the
|
||||||
|
* given active connection. If the active connection is not
|
||||||
|
* connectable, null is returned.
|
||||||
|
*
|
||||||
|
* @param {String} dataSource
|
||||||
|
* The unique identifier of the data source containing the
|
||||||
|
* active connection.
|
||||||
|
*
|
||||||
|
* @param {String} activeConnection
|
||||||
|
* The active connection to determine the relative URL of.
|
||||||
|
*
|
||||||
|
* @returns {String}
|
||||||
|
* The relative URL of the client page which accesses the given
|
||||||
|
* active connection, or null if the active connection is not
|
||||||
|
* connectable.
|
||||||
|
*/
|
||||||
|
$scope.getClientURL = function getClientURL(dataSource, activeConnection) {
|
||||||
|
|
||||||
|
if (!activeConnection.connectable)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return '#/client/' + encodeURIComponent(ClientIdentifier.toString({
|
||||||
|
dataSource : dataSource,
|
||||||
|
type : ClientIdentifier.Types.ACTIVE_CONNECTION,
|
||||||
|
id : activeConnection.identifier
|
||||||
|
}));
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the selected sessions can be deleted.
|
* Returns whether the selected sessions can be deleted.
|
||||||
*
|
*
|
||||||
|
@@ -40,7 +40,9 @@
|
|||||||
<td><guac-user-item username="wrapper.activeConnection.username"></guac-user-item></td>
|
<td><guac-user-item username="wrapper.activeConnection.username"></guac-user-item></td>
|
||||||
<td>{{wrapper.startDate}}</td>
|
<td>{{wrapper.startDate}}</td>
|
||||||
<td>{{wrapper.activeConnection.remoteHost}}</td>
|
<td>{{wrapper.activeConnection.remoteHost}}</td>
|
||||||
<td>{{wrapper.name}}</td>
|
<td><a ng-href="{{
|
||||||
|
getClientURL(wrapper.dataSource, wrapper.activeConnection)
|
||||||
|
}}">{{wrapper.name}}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
Reference in New Issue
Block a user