Skip to content

Commit a171802

Browse files
committed
add modal window to auditlog
1 parent 038af18 commit a171802

3 files changed

Lines changed: 79 additions & 8 deletions

File tree

OpenFlow/src/public/Auditlogs.html

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h1 translate lib="web">auditlogs</h1>
4747
<i ng-class="model.fa2">
4848

4949
</td>
50-
<td>{{model.name}}</td>
50+
<td class="btn-cell"><a href ng-click="ctrl.ShowAudit(model)" class="table-btn">{{model.name}}</a></td>
5151
<td>{{model.type}}</td>
5252
<td>{{model.impostorname}}</td>
5353
<td>{{model.clientagent}}</td>
@@ -57,4 +57,70 @@ <h1 translate lib="web">auditlogs</h1>
5757
</td>
5858
</tr>
5959
</tbody>
60-
</table>
60+
</table>
61+
62+
63+
64+
<div class="modal" tabindex="-1" role="dialog" id="exampleModal">
65+
<div class="modal-dialog" role="document">
66+
<div class="modal-content">
67+
<div class="modal-header">
68+
<h5 class="modal-title">{{ctrl.model.name}} </h5>
69+
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
70+
<span aria-hidden="true">&times;</span>
71+
</button>
72+
</div>
73+
<div class="modal-body">
74+
<table>
75+
<tr>
76+
<td>success</td>
77+
<td>{{ctrl.model.success}}</td>
78+
</tr>
79+
<tr>
80+
<td>type</td>
81+
<td>{{ctrl.model.type}}</td>
82+
</tr>
83+
<tr>
84+
<td>provider</td>
85+
<td>{{ctrl.model.provider}}</td>
86+
</tr>
87+
<tr>
88+
<td>userid</td>
89+
<td>{{ctrl.model.userid}}</td>
90+
</tr>
91+
<tr>
92+
<td>username</td>
93+
<td>{{ctrl.model.username}}</td>
94+
</tr>
95+
<tr>
96+
<td>remoteip</td>
97+
<td>{{ctrl.model.remoteip}}</td>
98+
</tr>
99+
<tr>
100+
<td>impostoruserid</td>
101+
<td>{{ctrl.model.impostoruserid}}</td>
102+
</tr>
103+
<tr>
104+
<td>impostorname</td>
105+
<td>{{ctrl.model.impostorname}}</td>
106+
</tr>
107+
<tr>
108+
<td>impostorusername</td>
109+
<td>{{ctrl.model.impostorusername}}</td>
110+
</tr>
111+
<tr>
112+
<td>clientagent</td>
113+
<td>{{ctrl.model.clientagent}}</td>
114+
</tr>
115+
<tr>
116+
<td>clientversion</td>
117+
<td>{{ctrl.model.clientversion}}</td>
118+
</tr>
119+
</table>
120+
</div>
121+
<div class="modal-footer">
122+
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
123+
</div>
124+
</div>
125+
</div>
126+
</div>

OpenFlow/src/public/Controllers.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2669,6 +2669,7 @@ module openflow {
26692669

26702670

26712671
export class AuditlogsCtrl extends entitiesCtrl<openflow.Role> {
2672+
public model: openflow.Role;
26722673
constructor(
26732674
public $scope: ng.IScope,
26742675
public $location: ng.ILocationService,
@@ -2712,11 +2713,15 @@ module openflow {
27122713
if (!this.$scope.$$phase) { this.$scope.$apply(); }
27132714
}
27142715

2715-
async DeleteOne(model: any): Promise<any> {
2716-
this.loading = true;
2717-
await this.api.Delete(this.collection, model);
2718-
this.models = this.models.filter(function (m: any): boolean { return m._id !== model._id; });
2719-
this.loading = false;
2716+
async ShowAudit(model: any): Promise<any> {
2717+
this.model = null;
2718+
var modal: any = $("#exampleModal");
2719+
modal.modal();
2720+
if (!this.$scope.$$phase) { this.$scope.$apply(); }
2721+
var arr = await this.api.Query(this.collection, { _id: model._id }, null, null, 1);
2722+
if (arr.length == 1) {
2723+
this.model = arr[0];
2724+
}
27202725
if (!this.$scope.$$phase) { this.$scope.$apply(); }
27212726
}
27222727
}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.459
1+
0.0.460

0 commit comments

Comments
 (0)