GUAC-932: Fully-working connection editor. Initial migration of users and connection groups to own edit pages. Add support for CSS classes on notification actions.

This commit is contained in:
Michael Jumper
2014-12-22 03:19:24 -08:00
parent 07a2a2da54
commit 8b53797b30
18 changed files with 477 additions and 473 deletions

View File

@@ -1,4 +1,4 @@
<span class="name" ng-click="context.editConnectionGroup(item.wrappedItem)">
<a ng-href="#/manage/connectionGroups/{{item.identifier}}">
<!--
Copyright (C) 2014 Glyptodon LLC
@@ -22,4 +22,4 @@
-->
{{item.name}}
</span>
</a>

View File

@@ -1,79 +0,0 @@
<!--
Copyright 2014 Glyptodon LLC.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!-- Dialog container for the modal -->
<div class="dialog-container">
<div class="dialog edit">
<!-- Connection group name -->
<div class="header">
<h2>{{connectionGroup.name}}</h2>
</div>
<!-- Main connection group edit section -->
<div class="body">
<div class="form">
<div class="settings section">
<dl>
<dd>
<table class="fields section">
<!-- Edit connection group name -->
<tr>
<th>{{'manage.edit.connectionGroup.name' | translate}}</th>
<td><input type="text" ng-model="connectionGroup.name"/></td>
</tr>
<!-- Edit connection group location -->
<tr>
<th>{{'manage.edit.connectionGroup.location' | translate}}</th>
<td>
<location-chooser value="connectionGroup.parentIdentifier" root-group="rootGroup"/>
</td>
</tr>
<!-- Edit connection group type -->
<tr>
<th>{{'manage.edit.connectionGroup.type.label' | translate}}</th>
<td>
<select ng-model="connectionGroup.type" ng-options="type.value as 'manage.edit.connectionGroup.type.' + type.label | translate for type in types | orderBy: name"></select>
</td>
</tr>
</table>
</dd>
</dl>
</div>
</div>
</div>
<!-- Control buttons -->
<div class="footer">
<button ng-click="save()">{{'manage.edit.connectionGroup.save' | translate}}</button>
<button ng-click="close()">{{'manage.edit.connectionGroup.cancel' | translate}}</button>
<button ng-click="delete()" class="danger">{{'manage.edit.connectionGroup.delete' | translate}}</button>
</div>
</div>
</div>

View File

@@ -1,141 +0,0 @@
<!--
Copyright 2014 Glyptodon LLC.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!-- Hierarchical connection and connection group permission selector -->
<script type="text/ng-template" id="nestedUserPermissionEditGroup.html">
<!-- Connection -->
<div class="choice" ng-show="item.isConnection">
<input type="checkbox" ng-model="connectionPermissions[item.identifier]" ng-change="markConnectionPermissionModified(item.identifier)"/>
<div class="connection list-item">
<div class="caption">
<div class="protocol">
<div class="icon" ng-class="item.protocol"></div>
</div><span class="name">{{item.name}}</span>
</div>
</div>
</div>
<!-- Connection group -->
<div class="choice" ng-show="!item.isConnection">
<input type="checkbox" ng-model="connectionGroupPermissions[item.identifier]" ng-change="markConnectionGroupPermissionModified(item.identifier)"/>
<div class="group empty list-item balancer">
<div class="caption">
<div class="icon group" ng-click="toggleExpanded(item)" ng-class="{expanded: item.expanded, empty: !item.children.length, balancer: item.balancer && !item.children.length}"></div>
<span class="name">{{item.name}}</span>
</div>
<!-- Connection group children -->
<div class="children" ng-show="item.expanded">
<div ng-repeat="item in item.children | orderBy : 'name'" ng-include="'nestedUserPermissionEditGroup.html'">
</div>
</div>
</div>
</script>
<!-- User edit modal -->
<div class="dialog-container">
<div class="dialog edit">
<div class="header">
<h2>{{user.username}}</h2>
</div>
<div class="body">
<div class="form">
<div class="settings section">
<dl>
<!-- User properties section -->
<dt>{{'manage.edit.user.properties' | translate}}</dt>
<dd>
<table class="fields section">
<tr>
<th>{{'manage.edit.user.password' | translate}}</th>
<td><input ng-model="user.password" type="password" /></td>
</tr>
<tr>
<th>{{'manage.edit.user.passwordMatch' | translate}}</th>
<td><input ng-model="passwordMatch" type="password" /></td>
</tr>
</table>
</dd>
<!-- System permissions section -->
<dt>{{'manage.edit.user.permissions' | translate}}</dt>
<dd>
<table class="permissions section">
<tr>
<th>{{'manage.edit.user.administerSystem' | translate}}</th>
<td><input type="checkbox" ng-model="systemPermissions.ADMINISTER" ng-change="markSystemPermissionModified('ADMINISTER')" /></td>
</tr>
<tr>
<th>{{'manage.edit.user.createUser' | translate}}</th>
<td><input type="checkbox" ng-model="systemPermissions.CREATE_USER" ng-change="markSystemPermissionModified('CREATE_USER')" /></td>
</tr>
<tr>
<th>{{'manage.edit.user.createConnection' | translate}}</th>
<td><input type="checkbox" ng-model="systemPermissions.CREATE_CONNECTION" ng-change="markSystemPermissionModified('CREATE_CONNECTION')" /></td>
</tr>
<tr>
<th>{{'manage.edit.user.createConnectionGroup' | translate}}</th>
<td><input type="checkbox" ng-model="systemPermissions.CREATE_CONNECTION_GROUP" ng-change="markSystemPermissionModified('CREATE_CONNECTION_GROUP')" /></td>
</tr>
</table>
</dd>
<!-- Connection and connection group permission section -->
<dt>{{'manage.edit.user.connections' | translate}}</dt>
<dd>
<div class="group-view">
<div class="list">
<div ng-repeat="item in rootGroup.children | orderBy : 'name'" ng-include="'nestedUserPermissionEditGroup.html'"></div>
</div>
</div>
</dd>
</dl>
</div>
</div>
</div>
<!-- Form controls -->
<div class="footer">
<button ng-click="save()">{{'manage.edit.user.save' | translate}}</button>
<button ng-click="close()">{{'manage.edit.user.cancel' | translate}}</button>
<button ng-click="delete()" class="danger">{{'manage.edit.user.delete' | translate}}</button>
</div>
</div>
</div>

View File

@@ -40,11 +40,11 @@ THE SOFTWARE.
</div>
<!-- List of users this user has access to -->
<div class="user-list" ng-class="{loading: loadingUsers}">
<div ng-click="editUser(user)" ng-repeat="user in users | orderBy : 'username'" class="list-item">
<div class="user-list" ng-class="{loading: !users}">
<div ng-repeat="user in users | orderBy : 'username'" class="user list-item">
<div class="caption">
<div class="icon user"></div>
<span class="name">{{user.username}}</span>
<a class="name" ng-href="#/manage/users/{{user.username}}">{{user.username}}</a>
</div>
</div>
</div>
@@ -58,11 +58,11 @@ THE SOFTWARE.
<!-- Control to create a new connection or group -->
<div class="connection-add-form">
<a class="add-connection button" href="#/manage/connections/">{{'manage.newConnection' | translate}}</a>
<button ng-click="newConnectionGroup()" class="add-connection-group">{{'manage.newGroup' | translate}}</button>
<a class="add-connection-group button" href="#/manage/connectionGroups/">{{'manage.newGroup' | translate}}</a>
</div>
<!-- List of connections and groups this user has access to -->
<div class="connection-list" ng-class="{loading: loadingConnections}">
<div class="connection-list" ng-class="{loading: !rootGroup}">
<guac-group-list
context="groupListContext"
connection-group="rootGroup"

View File

@@ -29,7 +29,7 @@ THE SOFTWARE.
<h2>{{'manage.edit.connection.title' | translate}}</h2>
<!-- Main connection edit section -->
<div class="info">
<div class="properties">
<table>
<!-- Edit connection name -->
@@ -62,7 +62,7 @@ THE SOFTWARE.
<!-- Connection parameters -->
<h2>{{'manage.edit.connection.parameters' | translate}}</h2>
<div class="parameters" ng-class="{loading: !parameters}">
<div class="properties" ng-class="{loading: !parameters}">
<table class="fields">
<!-- All the different possible editable field types -->
@@ -77,9 +77,9 @@ THE SOFTWARE.
<!-- Form action buttons -->
<div class="action-buttons">
<button ng-click="save()">{{'manage.edit.connection.save' | translate}}</button>
<button ng-click="close()">{{'manage.edit.connection.cancel' | translate}}</button>
<button ng-click="delete()" class="danger">{{'manage.edit.connection.delete' | translate}}</button>
<button ng-click="saveConnection()">{{'manage.edit.connection.save' | translate}}</button>
<button ng-click="cancel()">{{'manage.edit.connection.cancel' | translate}}</button>
<button ng-click="deleteConnection()" class="danger">{{'manage.edit.connection.delete' | translate}}</button>
</div>
<!-- History connection area -->

View File

@@ -0,0 +1,65 @@
<!--
Copyright 2014 Glyptodon LLC.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<div class="logout-panel">
<a class="back button" href="#/manage/">{{'manage.back' | translate}}</a>
<a class="logout button" ng-click="logout()">{{'home.logout' | translate}}</a>
</div>
<!-- Connection group name -->
<h2>{{connectionGroup.name}}</h2>
<div class="properties">
<table>
<!-- Edit connection group name -->
<tr>
<th>{{'manage.edit.connectionGroup.name' | translate}}</th>
<td><input type="text" ng-model="connectionGroup.name"/></td>
</tr>
<!-- Edit connection group location -->
<tr>
<th>{{'manage.edit.connectionGroup.location' | translate}}</th>
<td>
<location-chooser value="connectionGroup.parentIdentifier" root-group="rootGroup"/>
</td>
</tr>
<!-- Edit connection group type -->
<tr>
<th>{{'manage.edit.connectionGroup.type.label' | translate}}</th>
<td>
<select ng-model="connectionGroup.type" ng-options="type.value as 'manage.edit.connectionGroup.type.' + type.label | translate for type in types | orderBy: name"></select>
</td>
</tr>
</table>
</div>
<!-- Control buttons -->
<div class="action-buttons">
<button ng-click="save()">{{'manage.edit.connectionGroup.save' | translate}}</button>
<button ng-click="close()">{{'manage.edit.connectionGroup.cancel' | translate}}</button>
<button ng-click="delete()" class="danger">{{'manage.edit.connectionGroup.delete' | translate}}</button>
</div>

View File

@@ -0,0 +1,125 @@
<!--
Copyright 2014 Glyptodon LLC.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!-- Hierarchical connection and connection group permission selector -->
<script type="text/ng-template" id="nestedUserPermissionEditGroup.html">
<!-- Connection -->
<div class="choice" ng-show="item.isConnection">
<input type="checkbox" ng-model="connectionPermissions[item.identifier]" ng-change="markConnectionPermissionModified(item.identifier)"/>
<div class="connection list-item">
<div class="caption">
<div class="protocol">
<div class="icon" ng-class="item.protocol"></div>
</div><span class="name">{{item.name}}</span>
</div>
</div>
</div>
<!-- Connection group -->
<div class="choice" ng-show="!item.isConnection">
<input type="checkbox" ng-model="connectionGroupPermissions[item.identifier]" ng-change="markConnectionGroupPermissionModified(item.identifier)"/>
<div class="group empty list-item balancer">
<div class="caption">
<div class="icon group" ng-click="toggleExpanded(item)" ng-class="{expanded: item.expanded, empty: !item.children.length, balancer: item.balancer && !item.children.length}"></div>
<span class="name">{{item.name}}</span>
</div>
<!-- Connection group children -->
<div class="children" ng-show="item.expanded">
<div ng-repeat="item in item.children | orderBy : 'name'" ng-include="'nestedUserPermissionEditGroup.html'">
</div>
</div>
</div>
</script>
<div class="logout-panel">
<a class="back button" href="#/manage/">{{'manage.back' | translate}}</a>
<a class="logout button" ng-click="logout()">{{'home.logout' | translate}}</a>
</div>
<!-- User edit modal -->
<h2>{{user.username}}</h2>
<div class="properties">
<table>
<tr>
<th>{{'manage.edit.user.password' | translate}}</th>
<td><input ng-model="user.password" type="password" /></td>
</tr>
<tr>
<th>{{'manage.edit.user.passwordMatch' | translate}}</th>
<td><input ng-model="passwordMatch" type="password" /></td>
</tr>
</table>
</div>
<!-- System permissions section -->
<h2>{{'manage.edit.user.permissions' | translate}}</h2>
<div class="properties">
<table>
<tr>
<th>{{'manage.edit.user.administerSystem' | translate}}</th>
<td><input type="checkbox" ng-model="systemPermissions.ADMINISTER" ng-change="markSystemPermissionModified('ADMINISTER')" /></td>
</tr>
<tr>
<th>{{'manage.edit.user.createUser' | translate}}</th>
<td><input type="checkbox" ng-model="systemPermissions.CREATE_USER" ng-change="markSystemPermissionModified('CREATE_USER')" /></td>
</tr>
<tr>
<th>{{'manage.edit.user.createConnection' | translate}}</th>
<td><input type="checkbox" ng-model="systemPermissions.CREATE_CONNECTION" ng-change="markSystemPermissionModified('CREATE_CONNECTION')" /></td>
</tr>
<tr>
<th>{{'manage.edit.user.createConnectionGroup' | translate}}</th>
<td><input type="checkbox" ng-model="systemPermissions.CREATE_CONNECTION_GROUP" ng-change="markSystemPermissionModified('CREATE_CONNECTION_GROUP')" /></td>
</tr>
</table>
</div>
<!-- Connection and connection group permission section -->
<h2>{{'manage.edit.user.connections' | translate}}</h2>
<div>
<div class="group-view">
<div class="list">
<div ng-repeat="item in rootGroup.children | orderBy : 'name'" ng-include="'nestedUserPermissionEditGroup.html'"></div>
</div>
</div>
</div>
<!-- Form controls -->
<div class="action-buttons">
<button ng-click="save()">{{'manage.edit.user.save' | translate}}</button>
<button ng-click="close()">{{'manage.edit.user.cancel' | translate}}</button>
<button ng-click="delete()" class="danger">{{'manage.edit.user.delete' | translate}}</button>
</div>