GUACAMOLE-360: Add interface for connecting to active connections from "Active Sessions" tab.
diff --git a/guacamole/src/main/webapp/app/settings/directives/guacSettingsSessions.js b/guacamole/src/main/webapp/app/settings/directives/guacSettingsSessions.js
index 5e1774d..30b8bde 100644
--- a/guacamole/src/main/webapp/app/settings/directives/guacSettingsSessions.js
+++ b/guacamole/src/main/webapp/app/settings/directives/guacSettingsSessions.js
@@ -35,6 +35,7 @@
// Required types
var ActiveConnectionWrapper = $injector.get('ActiveConnectionWrapper');
+ var ClientIdentifier = $injector.get('ClientIdentifier');
var ConnectionGroup = $injector.get('ConnectionGroup');
var SortOrder = $injector.get('SortOrder');
@@ -336,7 +337,37 @@
'actions' : [ DELETE_ACTION, CANCEL_ACTION]
});
};
-
+
+ /**
+ * 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.
*
diff --git a/guacamole/src/main/webapp/app/settings/templates/settingsSessions.html b/guacamole/src/main/webapp/app/settings/templates/settingsSessions.html
index 184ff0b..698582c 100644
--- a/guacamole/src/main/webapp/app/settings/templates/settingsSessions.html
+++ b/guacamole/src/main/webapp/app/settings/templates/settingsSessions.html
@@ -40,7 +40,9 @@
<td><guac-user-item username="wrapper.activeConnection.username"></guac-user-item></td>
<td>{{wrapper.startDate}}</td>
<td>{{wrapper.activeConnection.remoteHost}}</td>
- <td>{{wrapper.name}}</td>
+ <td><a ng-href="{{
+ getClientURL(wrapper.dataSource, wrapper.activeConnection)
+ }}">{{wrapper.name}}</a></td>
</tr>
</tbody>
</table>