forked from opensourceBIM/bimvie.ws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dashboard.html
90 lines (81 loc) · 3.08 KB
/
dashboard.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<div class="dashboard">
<table class="logTable table table-striped table-hover initialhide">
<thead>
<tr>
<th>When</th>
<th>Type</th>
<th>User</th>
<th>Access Method</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<script>
function Dashboard(main) {
var othis = this;
this.close = function() {
Global.bimServerApi.unregister(othis.newLogAction);
};
this.show = function(){
};
this.createProjectLink = function(poid) {
var link = $("<a>Loading...</a>");
link.attr("poid", poid);
link.click(function(){
main.showProject(poid, null, true);
});
loadProject(link);
return link;
};
this.newLogAction = function(uuid, logAction, serviceIdentifier, profileIdentifier, token, apiUrl) {
var tr = $("<tr></tr>");
tr.append("<td><span title=\"" + formatDateTime(new Date(logAction.date)) + "\" class=\"timespan\" datetime=\"" + logAction.date + "\">" + formatTimeSpan(new Date().getTime() - logAction.date, false) + "</span></td>");
tr.append("<td>" + logAction.__type.substring(1) + "</td>");
var userTd = $("<td></td>");
userTd.append(createUserLink(main, logAction.executorId));
tr.append(userTd);
tr.append("<td>" + formatAccessMethod(logAction.accessMethod) + "</td>");
var descriptionTd = $("<td></td>");
tr.append(descriptionTd);
if (logAction.__type == "SNewUserAdded") {
descriptionTd.append(createUserLink(main, logAction.userId));
} else if (logAction.__type == "SNewProjectAdded") {
descriptionTd.append(othis.createProjectLink(logAction.projectId));
} else if (logAction.__type == "SRevisionBranched") {
} else if (logAction.__type == "SNewRevisionAdded") {
} else if (logAction.__type == "SNewCheckoutAdded") {
} else if (logAction.__type == "SSettingsSaved") {
} else if (logAction.__type == "SUserAddedToProject") {
} else if (logAction.__type == "SDownload") {
} else if (logAction.__type == "SUserRemovedFromProject") {
} else if (logAction.__type == "SProjectDeleted") {
} else if (logAction.__type == "SUserDeleted") {
} else if (logAction.__type == "SPasswordReset") {
} else if (logAction.__type == "SDatabaseCreated") {
} else if (logAction.__type == "SServerStarted") {
} else if (logAction.__type == "SProjectUpdated") {
} else if (logAction.__type == "SUserUndeleted") {
} else if (logAction.__type == "SProjectUndeleted") {
} else if (logAction.__type == "SRevisionUpdated") {
} else if (logAction.__type == "SGeoTagUpdated") {
} else if (logAction.__type == "SPasswordChanged") {
} else if (logAction.__type == "SUserChanged") {
} else if (logAction.__type == "SExtendedDataAddedToProject") {
} else if (logAction.__type == "SExtendedDataAddedToRevision") {
} else {
descriptionTd.append(logAction.__type);
}
$(".logTable tbody").prepend(tr);
}
Global.bimServerApi.call("AdminInterface", "getLogs", {uoid: main.user.oid}, function(data){
data.forEach(function(logAction){
othis.newLogAction("", logAction);
});
$(".logTable").show();
});
Global.bimServerApi.register("NotificationInterface", "newLogAction", othis.newLogAction);
}
</script>