diff options
Diffstat (limited to 'web/templates/admin/components')
-rw-r--r-- | web/templates/admin/components/global.tmpl | 45 | ||||
-rw-r--r-- | web/templates/admin/components/permissions.tmpl | 424 | ||||
-rw-r--r-- | web/templates/admin/components/templates.tmpl | 10 | ||||
-rw-r--r-- | web/templates/admin/components/users.tmpl | 226 |
4 files changed, 705 insertions, 0 deletions
diff --git a/web/templates/admin/components/global.tmpl b/web/templates/admin/components/global.tmpl new file mode 100644 index 0000000..c0a5fe0 --- /dev/null +++ b/web/templates/admin/components/global.tmpl @@ -0,0 +1,45 @@ +{{define "viewGlobal"}} + <div class="col-12 mt-4"> + <div class="card"> + <div class="card-header" style="padding-left: 8px; padding-right: 8px; padding-top: 4px; padding-bottom: 4px;font-weight:bold;font-size:13px;"> + <i class="fa fa-caret-right" aria-hidden="true" style="margin-right:5px;cursor: pointer"></i> Global 2FA Settings (coming soon) + <i class="fa fa-pencil float-right mt-1 text-muted d-none" aria-hidden="true" style="margin-right:5px;"></i> + </div> + <div class="card-body d-none"> + <div class="row"> + <div class="col-sm-6 text-muted"> + Force 2FA to login (coming soon) + <i class="fa fa-times float-right mr-3 p-1" style="color: darkred;" aria-hidden="true"></i> + </div> + <div class="col-sm-6 text-muted"> + Force 2FA to release GLSA (coming soon) + <i class="fa fa-times float-right mr-3 p-1" style="color: darkred;" aria-hidden="true"></i> + </div> + </div> + </div> + </div> + </div> +{{end}} + +{{define "editGlobal"}} + <div class="col-12 mt-4"> + <div class="card"> + <div class="card-header" style="padding-left: 8px; padding-right: 8px; padding-top: 4px; padding-bottom: 4px;font-weight:bold;font-size:13px;"> + <i class="fa fa-caret-down" aria-hidden="true" style="margin-right:5px;cursor: pointer"></i> Global 2FA Settings + <i class="fa fa-pencil float-right mt-1" aria-hidden="true" style="margin-right:5px;cursor: pointer"></i> + </div> + <div class="card-body"> + <div class="row"> + <div class="col-sm-6"> + Force 2FA to login + <i class="fa fa-times float-right mr-3 p-1" style="color: darkred;" aria-hidden="true"></i> + </div> + <div class="col-sm-6 text-muted"> + Force 2FA to release GLSA (coming soon) + <i class="fa fa-times float-right mr-3 p-1" style="color: darkred;" aria-hidden="true"></i> + </div> + </div> + </div> + </div> + </div> +{{end}} diff --git a/web/templates/admin/components/permissions.tmpl b/web/templates/admin/components/permissions.tmpl new file mode 100644 index 0000000..32b7dc6 --- /dev/null +++ b/web/templates/admin/components/permissions.tmpl @@ -0,0 +1,424 @@ +{{define "viewPermissions"}} + <div class="col-12 mt-4"> + <div class="card"> + <div class="card-header" style="padding-left: 8px; padding-right: 8px; padding-top: 4px; padding-bottom: 4px;font-weight:bold;font-size:13px;"> + <a onclick="this.getElementsByTagName('i')[0].classList.toggle('fa-caret-down');this.getElementsByTagName('i')[0].classList.toggle('fa-caret-right');" style="outline : none;text-decoration: none;color:#000;" data-toggle="collapse" href="#collapsePermissionSettings"><i class="fa fa-caret-down" aria-hidden="true" style="margin-right:5px;cursor: pointer"></i> User Permissions</a> + <a href="/admin/edit/permissions"><i class="fa fa-pencil float-right mt-1" aria-hidden="true" style="margin-right:5px;cursor: pointer;color:black;"></i></a> + </div> + <div class="card-body collapse show" id="collapsePermissionSettings"> + <table class="table table-striped"> + <thead> + <tr> + <td style="border-top:none;"></td> + <th colspan="11" class="border-0">GLSA</th> + <th colspan="6" class="border-0">CVE</th> + <th colspan="4" class="border-0">Admin</th> + </tr> + <tr> + <th>User</th> + <!-- GLSA Permissions --> + <th title="View GLSAs"> + <i class="fa fa-eye" aria-hidden="true"></i> + </th> + <th title="Manually trigger an update of the Bug data"> + <i class="fa fa-refresh" aria-hidden="true"></i> + </th> + <th title="Add comments to GLSAs"> + <i class="fa fa-commenting-o" aria-hidden="true"></i> + </th> + <th title="Add GLSAs"> + <i class="fa fa-plus" aria-hidden="true"></i> + </th> + <th title="Edit GLSAs"> + <i class="fa fa-pencil" aria-hidden="true"></i> + </th> + <th title="Delete GLSAs"> + <i class="fa fa-trash-o" aria-hidden="true"></i> + </th> + <th title="Approve GLSAs"> + <i class="fa fa-thumbs-o-up" aria-hidden="true"></i> + </th> + <th title="Approve own GLSAs"> + <i class="fa fa-thumbs-up" aria-hidden="true"></i> + </th> + <th title="Decline GLSAs"> + <i class="fa fa-thumbs-o-down" aria-hidden="true"></i> + </th> + <th title="Release GLSAs"> + <i class="fa fa-paper-plane-o" aria-hidden="true"></i> + </th> + <th title="View confidential GLSAs"> + <i class="fa fa-user-secret" aria-hidden="true"></i> + </th> + <!-- CVE Permissions --> + <th title="View the CVETool"> + <i class="fa fa-eye" aria-hidden="true"></i> + </th> + <th title="Manually trigger an update of the CVE data"> + <i class="fa fa-refresh" aria-hidden="true"></i> + </th> + <th title="Add comments to CVEs"> + <i class="fa fa-commenting-o" aria-hidden="true"></i> + </th> + <th title="Add packages to CVEs"> + <i class="fa fa-hdd-o" aria-hidden="true"></i> + </th> + <th title="Change the State of CVEs"> + <i class="fa fa-random" aria-hidden="true"></i> + </th> + <th title="Assign and Create Bugs using the CVETool"> + <i class="fa fa-bug" aria-hidden="true"></i> + </th> + <!-- Admin Permissions --> + <th title="View Admin Area"> + <i class="fa fa-eye" aria-hidden="true"></i> + </th> + <th title="Manage Templates"> + <i class="fa fa-files-o" aria-hidden="true"></i> + </th> + <th title="Manage Global Settings"> + <i class="fa fa-globe" aria-hidden="true"></i> + </th> + <th title="Manage Users"> + <i class="fa fa-users" aria-hidden="true"></i> + </th> + </tr> + </thead> + <tbody> + {{range .Users}} + <tr> + <td>{{.Email}}</td> + <!-- GLSA Permissions --> + <td> + {{if .Permissions.Glsa.View}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.Glsa.UpdateBugs}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.Glsa.Comment}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.Glsa.Create}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.Glsa.Edit}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.Glsa.Delete}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.Glsa.Approve}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.Glsa.ApproveOwnGlsa}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.Glsa.Decline}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.Glsa.Release}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.Glsa.Confidential}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <!-- CVE Permissions --> + <td> + {{if .Permissions.CVETool.View}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.CVETool.UpdateCVEs}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.CVETool.Comment}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.CVETool.AddPackage}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.CVETool.ChangeState}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.CVETool.AssignBug}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <!-- Admin Permissions --> + <td> + {{if .Permissions.Admin.View}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.Admin.CreateTemplates}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.Admin.GlobalSettings}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Permissions.Admin.ManageUsers}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + </tr> + {{end}} + + </tbody> + </table> + </div> + </div> + </div> +{{end}} + + + +{{define "editPermissions"}} + <div class="col-12 mt-4"> + <form action="/admin/edit/permissions" method="post"> + <input value="1" name="edit" hidden /> + <div class="card"> + <div class="card-header" style="padding-left: 8px; padding-right: 8px; padding-top: 4px; padding-bottom: 4px;font-weight:bold;font-size:13px;"> + <i class="fa fa-caret-down" aria-hidden="true" style="margin-right:5px;cursor: pointer"></i> User Permissions + <button type="submit" class="btn btn-sm p-0 float-right"><i class="fa fa-save float-right mt-1" aria-hidden="true" style="margin-right:5px;cursor: pointer;color:black;"></i></button> + </div> + <div class="card-body"> + <table class="table"> + <thead> + <tr> + <td style="border-top:none;"></td> + <th colspan="11" class="border-0">GLSA</th> + <th colspan="6" class="border-0">CVE</th> + <th colspan="4" class="border-0">Admin</th> + </tr> + <tr> + <th>User</th> + <!-- GLSA Permissions --> + <th title="View GLSAs"> + <i class="fa fa-eye" aria-hidden="true"></i> + </th> + <th title="Manually trigger an update of the Bug data"> + <i class="fa fa-refresh" aria-hidden="true"></i> + </th> + <th title="Add comments to GLSAs"> + <i class="fa fa-commenting-o" aria-hidden="true"></i> + </th> + <th title="Add GLSAs"> + <i class="fa fa-plus" aria-hidden="true"></i> + </th> + <th title="Edit GLSAs"> + <i class="fa fa-pencil" aria-hidden="true"></i> + </th> + <th title="Delete GLSAs"> + <i class="fa fa-trash-o" aria-hidden="true"></i> + </th> + <th title="Approve GLSAs"> + <i class="fa fa-thumbs-o-up" aria-hidden="true"></i> + </th> + <th title="Approve own GLSAs"> + <i class="fa fa-thumbs-up" aria-hidden="true"></i> + </th> + <th title="Decline GLSAs"> + <i class="fa fa-thumbs-o-down" aria-hidden="true"></i> + </th> + <th title="Release GLSAs"> + <i class="fa fa-paper-plane-o" aria-hidden="true"></i> + </th> + <th title="View confidential GLSAs"> + <i class="fa fa-user-secret" aria-hidden="true"></i> + </th> + <!-- CVE Permissions --> + <th title="View the CVETool"> + <i class="fa fa-eye" aria-hidden="true"></i> + </th> + <th title="Manually trigger an update of the CVE data"> + <i class="fa fa-refresh" aria-hidden="true"></i> + </th> + <th title="Add comments to CVEs"> + <i class="fa fa-commenting-o" aria-hidden="true"></i> + </th> + <th title="Add packages to CVEs"> + <i class="fa fa-hdd-o" aria-hidden="true"></i> + </th> + <th title="Change the State of CVEs"> + <i class="fa fa-random" aria-hidden="true"></i> + </th> + <th title="Assign and Create Bugs using the CVETool"> + <i class="fa fa-bug" aria-hidden="true"></i> + </th> + <!-- Admin Permissions --> + <th title="View Admin Area"> + <i class="fa fa-eye" aria-hidden="true"></i> + </th> + <th title="Manage Templates"> + <i class="fa fa-files-o" aria-hidden="true"></i> + </th> + <th title="Manage Global Settings"> + <i class="fa fa-globe" aria-hidden="true"></i> + </th> + <th title="Manage Users"> + <i class="fa fa-users" aria-hidden="true"></i> + </th> + </tr> + </thead> + <tbody> + {{range .Users}} + <tr> + <td> + <input name="user" type="text" value="{{.Id}}" hidden/> + {{.Email}} + </td> + <!-- GLSA Permissions --> + <td> + <input name="glsa-view" type="checkbox" value="{{.Id}}" {{if .Permissions.Glsa.View}}checked{{end}}/> + </td> + <td> + <input name="glsa-updateBugs" type="checkbox" value="{{.Id}}" {{if .Permissions.Glsa.UpdateBugs}}checked{{end}}/> + </td> + <td> + <input name="glsa-comment" type="checkbox" value="{{.Id}}" {{if .Permissions.Glsa.Comment}}checked{{end}}/> + </td> + <td> + <input name="glsa-create" type="checkbox" value="{{.Id}}" {{if .Permissions.Glsa.Create}}checked{{end}}/> + </td> + <td> + <input name="glsa-edit" type="checkbox" value="{{.Id}}" {{if .Permissions.Glsa.Edit}}checked{{end}}/> + </td> + <td> + <input name="glsa-delete" type="checkbox" value="{{.Id}}" {{if .Permissions.Glsa.Delete}}checked{{end}}/> + </td> + <td> + <input name="glsa-approve" type="checkbox" value="{{.Id}}" {{if .Permissions.Glsa.Approve}}checked{{end}}/> + </td> + <td> + <input name="glsa-approveOwnGlsa" type="checkbox" value="{{.Id}}" {{if .Permissions.Glsa.ApproveOwnGlsa}}checked{{end}}/> + </td> + <td> + <input name="glsa-decline" type="checkbox" value="{{.Id}}" {{if .Permissions.Glsa.Decline}}checked{{end}}/> + </td> + <td> + <input name="glsa-release" type="checkbox" value="{{.Id}}" {{if .Permissions.Glsa.Release}}checked{{end}}/> + </td> + <td> + <input name="glsa-confidential" type="checkbox" value="{{.Id}}" {{if .Permissions.Glsa.Confidential}}checked{{end}}/> + </td> + <!-- CVE Permissions --> + <td> + <input name="cve-view" type="checkbox" value="{{.Id}}" {{if .Permissions.CVETool.View}}checked{{end}}/> + </td> + <td> + <input name="cve-updateCVEs" type="checkbox" value="{{.Id}}" {{if .Permissions.CVETool.UpdateCVEs}}checked{{end}}/> + </td> + <td> + <input name="cve-comment" type="checkbox" value="{{.Id}}" {{if .Permissions.CVETool.Comment}}checked{{end}}/> + </td> + <td> + <input name="cve-addPackage" type="checkbox" value="{{.Id}}" {{if .Permissions.CVETool.AddPackage}}checked{{end}}/> + </td> + <td> + <input name="cve-changeState" type="checkbox" value="{{.Id}}" {{if .Permissions.CVETool.ChangeState}}checked{{end}}/> + </td> + <td> + <input name="cve-assignBug" type="checkbox" value="{{.Id}}" {{if .Permissions.CVETool.AssignBug}}checked{{end}}/> + </td> + <!-- Admin Permissions --> + <td> + <input name="admin-view" type="checkbox" value="{{.Id}}" {{if .Permissions.Admin.View}}checked{{end}}/> + </td> + <td> + <input name="admin-createTemplates" type="checkbox" value="{{.Id}}" {{if .Permissions.Admin.CreateTemplates}}checked{{end}}/> + </td> + <td> + <input name="admin-globalSettings" type="checkbox" value="{{.Id}}" {{if .Permissions.Admin.GlobalSettings}}checked{{end}}/> + </td> + <td> + <input name="admin-manageUsers" type="checkbox" value="{{.Id}}" {{if .Permissions.Admin.ManageUsers}}checked{{end}}/> + </td> + </tr> + {{end}} + + </tbody> + </table> + </div> + </div> + </form> + </div> +{{end}} + diff --git a/web/templates/admin/components/templates.tmpl b/web/templates/admin/components/templates.tmpl new file mode 100644 index 0000000..470b229 --- /dev/null +++ b/web/templates/admin/components/templates.tmpl @@ -0,0 +1,10 @@ +{{define "viewTemplates"}} + <div class="col-12 mt-4"> + <div class="card"> + <div class="card-header" style="padding-left: 8px; padding-right: 8px; padding-top: 4px; padding-bottom: 4px;font-weight:bold;font-size:13px;"> + <i class="fa fa-caret-right" aria-hidden="true" style="margin-right:5px;cursor: pointer"></i> Template Management (coming soon) + <i class="fa fa-pencil float-right mt-1 text-muted d-none" aria-hidden="true" style="margin-right:5px;"></i> + </div> + </div> + </div> +{{end}} diff --git a/web/templates/admin/components/users.tmpl b/web/templates/admin/components/users.tmpl new file mode 100644 index 0000000..b7b2e87 --- /dev/null +++ b/web/templates/admin/components/users.tmpl @@ -0,0 +1,226 @@ + +{{define "viewUsers"}} + + <div class="col-12 mt-4"> + <div class="card"> + <div class="card-header" style="padding-left: 8px; padding-right: 8px; padding-top: 4px; padding-bottom: 4px;font-weight:bold;font-size:13px;"> + <a onclick="this.getElementsByTagName('i')[0].classList.toggle('fa-caret-down');this.getElementsByTagName('i')[0].classList.toggle('fa-caret-right');" style="outline : none;text-decoration: none;color:#000;" data-toggle="collapse" href="#collapseUserSettings"><i class="fa fa-caret-down" aria-hidden="true" style="margin-right:5px;cursor: pointer"></i> User Management</a> + <a href="/admin/edit/users"><i class="fa fa-pencil float-right mt-1" aria-hidden="true" style="margin-right:5px;cursor: pointer;color:black;"></i></a> + </div> + <div class="card-body collapse show" id="collapseUserSettings"> + <table class="table"> + <thead> + <tr> + <th class="border-0" title="Badge of the user">Badge</th> + <th class="border-0" title="Nickname of the user">Nick</th> + <th class="border-0" title="Full name of the user">Name</th> + <th class="border-0" title="E-Mail address of the user">Email</th> + <th class="border-0" title="Does the user use TOTP?">TOTP</th> + <th class="border-0" title="Does the user use WebAuthn?">WebAuthn</th> + <th class="border-0" title="User is forced to rotate the password at the next login">Rotate Password</th> + <th class="border-0" title="User is forced to use either TOTP or WebAuthn">Force 2FA</th> + <th class="border-0" title="Is the user-account active? If disabled ">Active</th> + </tr> + </thead> + <tbody> + {{range .Users}} + <tr> + <td> + + <span class="badge badge-secondary float-left mr-2" style="background: none;border: 1px solid {{.Badge.Color}};"> + <i class="fa fa-user mr-1" aria-hidden="true" style="font-size: 0.8rem;color: {{.Badge.Color}};"></i> + <span class="text-uppercase" style="color:{{.Badge.Color}};">{{.Badge.Name}}</span> + </span> + + </td> + <td>{{.Nick}}</td> + <td>{{.Name}}</td> + <td>{{.Email}}</td> + <td> + {{if .IsUsingTOTP}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .IsUsingWebAuthn}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .ForcePasswordRotation}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .Force2FA}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if not .Disabled}} + <i class="fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + </tr> + {{end}} + </tbody> + </table> + + {{if .NewUserNick}} + <div class="alert alert-success" role="alert"> + The User <i>{{.NewUserNick}}</i> has been successfully created. The temporary password <i>{{.NewUserPassword}}</i> has been generated for this account. The user has to change the password during the next login. + </div> + {{end}} + + </div> + </div> + </div> + +{{end}} + + + +{{define "editUsers"}} + + <div class="col-12 mt-4"> + <form action="/admin/edit/users" method="post"> + <input value="1" name="edit" hidden /> + <div class="card"> + <div class="card-header" style="padding-left: 8px; padding-right: 8px; padding-top: 4px; padding-bottom: 4px;font-weight:bold;font-size:13px;"> + <i class="fa fa-caret-down" aria-hidden="true" style="margin-right:5px;cursor: pointer"></i> User Management + <a href="/admin"><i class="fa fa-times float-right mt-1" aria-hidden="true" style="margin-right:5px;cursor: pointer;color:black;"></i></a> + <button type="submit" class="btn btn-sm mr-1 p-0 float-right"><i class="fa fa-save float-right mt-1" aria-hidden="true" style="margin-right:5px;cursor: pointer;color:black;"></i></button> + </div> + <div class="card-body"> + <table class="table"> + <thead> + <tr> + <th class="border-0" title="Badge of the user">Badge</th> + <th class="border-0" title="Nickname of the user">Nick</th> + <th class="border-0" title="Full name of the user">Name</th> + <th class="border-0" title="E-Mail address of the user">Email</th> + <th class="border-0" title="Does the user use TOTP?">TOTP</th> + <th class="border-0" title="Does the user use WebAuthn?">WebAuthn</th> + <th class="border-0" title="User is forced to rotate the password at the next login">Rotate Password</th> + <th class="border-0" title="User is forced to use either TOTP or WebAuthn">Force 2FA</th> + <th class="border-0" title="Is the user-account active? If disabled ">Active</th> + <th class="border-0"></th> + </tr> + </thead> + <tbody id="userList"> + {{range .Users}} + <tr> + <td> + <span class="my-1 badge badge-secondary float-left mr-2" style="background: none;border: 1px solid {{.Badge.Color}};"> + <i class="fa fa-user mr-1" aria-hidden="true" style="font-size: 0.8rem;color: {{.Badge.Color}};"></i> + <span class="text-uppercase" style="color:{{.Badge.Color}};">{{.Badge.Name}}</span> + </span> + </td> + <td> + <input name="userId" type="text" value="{{.Id}}" hidden/> + <input name="userNick" class="form-control form-control-sm" value="{{.Nick}}" style="max-width: 150px;"/> + </td> + <td> + <input name="userName" class="form-control form-control-sm" value="{{.Name}}" style="max-width: 150px;"/> + </td> + <td> + <input name="userEmail" class="form-control form-control-sm" value="{{.Email}}" style="max-width: 150px;"/> + </td> + <td> + {{if .IsUsingTOTP}} + <i class="my-2 fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="my-2 fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + {{if .IsUsingWebAuthn}} + <i class="my-2 fa fa-check" style="color: green;" aria-hidden="true"></i> + {{else}} + <i class="my-2 fa fa-times" style="color: darkred;" aria-hidden="true"></i> + {{end}} + </td> + <td> + <input name="userPasswordRotation" class="m-2" type="checkbox" value="{{.Id}}" {{if .ForcePasswordRotation}}checked{{end}}/> + </td> + <td> + <input name="userForce2FA" class="m-2" type="checkbox" value="{{.Id}}" {{if .Force2FA}}checked{{end}}/> + </td> + <td> + <input name="userActive" class="m-2" type="checkbox" value="{{.Id}}" {{if not .Disabled}}checked{{end}}/> + </td> + <td> + + + <div class="dropdown"> + + <button type="button" class="float-right my-1 py-0 btn btn-outline-secondary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Actions</button> + + <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> + <a class="dropdown-item" href="/admin/edit/password/reset/{{.Id}}">Reset Password</a> + </div> + </div> + + + </td> + </tr> + {{end}} + + </tbody> + + <tbody id="addUserForm" class="border-0 pt-2"> + <tr> + <td> + <span class="badge badge-secondary float-left mr-2" style="background: none;border: 1px solid grey;"> + <i class="fa fa-user mr-1" aria-hidden="true" style="font-size: 0.8rem;color: grey;"></i> + <span class="text-uppercase" style="color:grey;">user</span> + </span> + </td> + <td> + <input id="newNick" class="form-control form-control-sm" placeholder="nickname" value="" style="max-width: 150px;"/> + </td> + <td> + <input id="newName" class="form-control form-control-sm" placeholder="full name" value="" style="max-width: 150px;"/> + </td> + <td> + <input id="newEmail" class="form-control form-control-sm" placeholder="email" value="" style="max-width: 150px;"/> + </td> + <td> + <i class="my-2 fa fa-times" style="color: darkred;" aria-hidden="true"></i> + </td> + <td> + <i class="my-2 fa fa-times" style="color: darkred;" aria-hidden="true"></i> + </td> + <td> + <input class="m-2" type="checkbox" checked disabled/> + </td> + <td> + <input class="m-2" type="checkbox"/> + </td> + <td> + <input class="m-2" type="checkbox" /> + </td> + <td> + <button id="addUser" type="button" class="float-right my-1 py-0 btn btn-outline-success btn-sm">Add</button> + </td> + </tr> + </tbody> + + </table> + </div> + </div> + </form> + </div> + +{{end}} + |