forked from opensourceBIM/bimvie.ws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverinfo.html
297 lines (277 loc) · 13.9 KB
/
serverinfo.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<div class="serverinfo">
<div class="tabbable tabs-left">
<ul class="nav nav-tabs">
<li><a class="link systemLink" data-toggle="tab" href="#system">System</a></li>
<li><a class="link javaLink" data-toggle="tab" href="#java">Java</a></li>
<li><a class="link bimserverLink" data-toggle="tab" href="#bimserver">BIMserver</a></li>
<li><a class="link databaseLink" data-toggle="tab" href="#database">Database</a></li>
<li><a class="link webservicesLink" data-toggle="tab" href="#webservices">Web Services</a></li>
<li><a class="link metricsLink" data-toggle="tab" href="#metrics">Metrics</a></li>
<li><a class="link transactionsLink" data-toggle="tab" href="#transactions">Transactions</a></li>
<li><a class="link longrunningactionsLink" data-toggle="tab" href="#longrunningactions">Long running actions</a></li>
<li><a class="link logLink" data-toggle="tab" href="#log">Log</a></li>
</ul>
<div class="tab-content col-lg-9">
<div id="system" class="tab-pane system">
<table class="table">
<thead></thead>
<tbody></tbody>
</table>
</div>
<div id="java" class="tab-pane java">
<table class="table">
<thead></thead>
<tbody></tbody>
</table>
</div>
<div id="bimserver" class="tab-pane bimserver">
<table class="table">
<thead></thead>
<tbody></tbody>
</table>
</div>
<div id="database" class="tab-pane database">
<table class="table">
<thead></thead>
<tbody></tbody>
</table>
</div>
<div id="webservices" class="tab-pane webservices">
<table class="table">
<thead></thead>
<tbody></tbody>
</table>
</div>
<div id="metrics" class="tab-pane metrics">
<table class="table">
<thead></thead>
<tbody></tbody>
</table>
</div>
<div id="transactions" class="tab-pane transactions">
<table class="table">
<thead></thead>
<tbody></tbody>
</table>
</div>
<div id="longrunningactions" class="tab-pane longrunningactions">
<table class="table">
<thead></thead>
<tbody></tbody>
</table>
</div>
<div id="log" class="tab-pane log">
</div>
</div>
</div>
</div>
<script>
function ServerInfo(containerDiv, main) {
var othis = this;
othis.containerDiv = containerDiv;
this.show = function(){
var history = History.getState().data;
if (history.page == "ServerInfo" && history.subpage != null) {
$(".serverinfo .link[href=\"#" + history.subpage + "\"]").click();
if (history.subpage == "log") {
othis.loadLog();
}
} else {
$(".serverinfo .systemLink").click();
}
this.loadData();
};
this.close = function(){
Global.bimServerApi.unregisterChangeProgressServerHandler(othis.newChangeProgressHandler, othis.closedChangeProgressHandler);
};
this.loadData = function() {
Global.bimServerApi.call("AdminInterface", "getDatabaseInformation", {}, function(data){
$(".database table tbody").append("<tr><td colspan=\"2\" class=\"header\">General Information</td></tr>");
$(".database table tbody").append("<tr><td>Size</td><td>" + bytesToSize(data.databaseSizeInBytes) + "</td></tr>");
$(".database table tbody").append("<tr><td>Type</td><td>" + data.type + "</td></tr>");
$(".database table tbody").append("<tr><td>Created</td><td>" + formatDateTime(new Date(data.created)) + "</td></tr>");
$(".database table tbody").append("<tr><td>Location</td><td>" + data.location + "</td></tr>");
$(".database table tbody").append("<tr><td>Schema version</td><td>" + data.schemaVersion + "</td></tr>");
data.categories.forEach(function(category){
$(".database table tbody").append("<tr><td colspan=\"2\" class=\"header\">" + category.title + "</td></tr>");
category.items.forEach(function(item){
$(".database table tbody").append("<tr><td>" + item.key + "</td><td>" + item.value + "</td></tr>");
});
});
});
Global.bimServerApi.call("AdminInterface", "getSystemInfo", {}, function(data){
$(".system table tbody").append("<tr><td colspan=\"2\" class=\"header\">Machine</td></tr>");
$(".system table tbody").append("<tr><td>Number of cores</td><td>" + data.cpucores + "</td></tr>");
$(".system table tbody").append("<tr><td>Current date/time</td><td>" + formatDateTime(new Date(data.datetime)) + "</td></tr>");
$(".system table tbody").append("<tr><td colspan=\"2\" class=\"header\">Operating System</td></tr>");
$(".system table tbody").append("<tr><td>OS name</td><td>" + data.osname + "</td></tr>");
$(".system table tbody").append("<tr><td>OS version</td><td>" + data.osversion + "</td></tr>");
$(".system table tbody").append("<tr><td colspan=\"2\" class=\"header\">User</td></tr>");
$(".system table tbody").append("<tr><td>User name</td><td>" + data.userName + "</td></tr>");
$(".system table tbody").append("<tr><td>User home</td><td>" + data.userHome + "</td></tr>");
$(".system table tbody").append("<tr><td>User dir</td><td>" + data.userDir + "</td></tr>");
});
Global.bimServerApi.call("AdminInterface", "getJavaInfo", {}, function(data){
$(".java table tbody").append("<tr><td colspan=\"2\" class=\"header\">Heap memory</td></tr>");
$(".java table tbody").append("<tr><td>Total</td><td>" + getHumanSize(data.heapTotal) + "</td></tr>");
$(".java table tbody").append("<tr><td>Used</td><td>" + getHumanSize(data.heapUsed) + "</td></tr>");
$(".java table tbody").append("<tr><td>Free</td><td>" + getHumanSize(data.heapFree) + "</td></tr>");
$(".java table tbody").append("<tr><td>Max</td><td>" + getHumanSize(data.heapMax) + "</td></tr>");
$(".java table tbody").append("<tr><td colspan=\"2\" class=\"header\">Threads</td></tr>");
$(".java table tbody").append("<tr><td>Active threads</td><td>" + data.threads + "</td></tr>");
$(".java table tbody").append("<tr><td colspan=\"2\" class=\"header\">Java</td></tr>");
$(".java table tbody").append("<tr><td>Home</td><td>" + data.javaHome + "</td></tr>");
$(".java table tbody").append("<tr><td>Version</td><td>" + data.javaVersion + "</td></tr>");
$(".java table tbody").append("<tr><td>Vendor</td><td>" + data.javaVendor + "</td></tr>");
$(".java table tbody").append("<tr><td>Vendor URL</td><td>" + data.javaVendorurl + "</td></tr>");
$(".java table tbody").append("<tr><td colspan=\"2\" class=\"header\">Java Virtual Machine</td></tr>");
$(".java table tbody").append("<tr><td>Version</td><td>" + data.javavmVersion + "</td></tr>");
$(".java table tbody").append("<tr><td>Vendor</td><td>" + data.javavmVendor + "</td></tr>");
$(".java table tbody").append("<tr><td>Name</td><td>" + data.javavmName + "</td></tr>");
$(".java table tbody").append("<tr><td colspan=\"2\" class=\"header\">Java Specification</td></tr>");
$(".java table tbody").append("<tr><td>Version</td><td>" + data.javaspecVersion + "</td></tr>");
$(".java table tbody").append("<tr><td>Vendor</td><td>" + data.javaspecVendor + "</td></tr>");
$(".java table tbody").append("<tr><td>Name</td><td>" + data.javaspecName + "</td></tr>");
$(".java table tbody").append("<tr><td colspan=\"2\" class=\"header\">Java Other</td></tr>");
$(".java table tbody").append("<tr><td>Class version</td><td>" + data.javaClassVersion + "</td></tr>");
var classpath = $("<div class=\"classpath\">");
data.javaClasspath.forEach(function(cp){
classpath.append(cp + "<br/>");
});
var tr = $("<tr>");
tr.append("<td>Class path</td>");
tr.append($("<td>").append(classpath));
$(".java table tbody").append(tr);
var librarypath = $("<div class=\"classpath\">");
data.javaLibrarypath.forEach(function(cp){
librarypath.append(cp + "<br/>");
});
tr = $("<tr>");
tr.append("<td>Library path</td>");
tr.append($("<td>").append(librarypath));
$(".java table tbody").append(tr);
$(".java table tbody").append("<tr><td>IO Tmp</td><td>" + data.javaIoTmp + "</td></tr>");
$(".java table tbody").append("<tr><td>Ext dir</td><td>" + data.javaExtdir + "</td></tr>");
$(".java table tbody").append("<tr><td>File separator</td><td>" + data.javaFileSeparator + "</td></tr>");
$(".java table tbody").append("<tr><td>Path separator</td><td>" + data.javaPathSeparator + "</td></tr>");
$(".java table tbody").append("<tr><td>Line separator</td><td>" + data.javaLineSeparator + "</td></tr>");
});
Global.bimServerApi.call("AdminInterface", "getBimServerInfo", {}, function(data){
$(".bimserver table tbody").append("<tr><td colspan=\"2\" class=\"header\">Current version</td></tr>");
$(".bimserver table tbody").append("<tr><td>Current version</td><td>" + data.currentVersion + "</td></tr>");
$(".bimserver table tbody").append("<tr><td>Current version date</td><td>" + formatDate(new Date(data.currentDate)) + "</td></tr>");
$(".bimserver table tbody").append("<tr><td>Schema version</td><td>" + data.schemaVersion + "</td></tr>");
$(".bimserver table tbody").append("<tr><td colspan=\"2\" class=\"header\">Counts</td></tr>");
$(".bimserver table tbody").append("<tr><td>Projects</td><td>" + data.projects + "</td></tr>");
$(".bimserver table tbody").append("<tr><td>Revisions</td><td>" + data.revisions + "</td></tr>");
$(".bimserver table tbody").append("<tr><td>Users</td><td>" + data.users + "</td></tr>");
$(".bimserver table tbody").append("<tr><td>Checkouts</td><td>" + data.checkouts + "</td></tr>");
$(".bimserver table tbody").append("<tr><td colspan=\"2\" class=\"header\">Other</td></tr>");
$(".bimserver table tbody").append("<tr><td>Server log</td><td><a href=\"" + data.serverLogUrl + "\">Log</a></td></tr>");
$(".bimserver table tbody").append("<tr><td>Started</td><td>" + formatDateTime(new Date(data.started)) + "</td></tr>");
$(".bimserver table tbody").append("<tr><td>Uptime</td><td>" + formatDuration(new Date().getTime() - data.started) + "</td></tr>");
});
Global.bimServerApi.call("MetaInterface", "getServiceInterfaces", {}, function(data){
$(".webservices table").append("<tr><th class=\"header\">Namespace</th><th>Name</th><th>Files</th></tr>");
data.forEach(function(service){
var tr = $("<tr>");
tr.append("<td>" + service.nameSpace + "</td>");
tr.append("<td>" + service.simpleName + "</td>");
var td = $("<td>");
tr.append(td);
td.append("<a href=\"" + Global.bimServerApi.baseUrl + "/soap11/" + service.simpleName + "?wsdl\">WSDL (1.1)</a> / ");
td.append("<a href=\"" + Global.bimServerApi.baseUrl + "/soap12/" + service.simpleName + "?wsdl\">WSDL (1.2)</a> / ");
td.append("<a href=\"" + Global.bimServerApi.baseUrl + "/download?token=" + Global.bimServerApi.token + "&action=getfile&type=proto&name=" + service.simpleName + "\">Proto</a>");
$(".webservices table tbody").append(tr);
});
});
Global.bimServerApi.call("AdminInterface", "getMetrics", {}, function(metrics){
$(".metrics table").append("<tr><th class=\"header\">Name</th><th># Calls</th><th>Average (ms)</th></tr>");
metrics.interfaces.forEach(function(service){
$(".metrics table").append("<tr><th class=\"header\" colspan=\"3\">" + service.name + "</th></tr>");
service.methods.forEach(function(method){
var tr = $("<tr>");
tr.append("<td>" + method.name + "</td>");
tr.append("<td>" + method.nrCalls + "</td>");
tr.append("<td>" + method.averageMs + "</td>");
$(".metrics table tbody").append(tr);
});
});
});
}
$(".serverinfo .link").click(function(){
pushHistory({page: "ServerInfo", subpage: $(this).attr("href").substring(1)}, "Server Info");
});
this.progressHandler = function(topicId, state){
var tr = containerDiv.find("table tr[tid=\"" + topicId + "\"]");
if (tr.length == 0) {
tr = $("<tr>");
tr.attr("tid", topicId);
tr.append("<td class=\"topicid\"></td>");
tr.append("<td class=\"title\"></td>");
tr.append("<td class=\"state\"></td>");
tr.append("<td class=\"progresstd\" width=\"200px\"><div class=\"progress\"><div class=\"bar\"></div></div></td>");
containerDiv.find("table tbody tbody").append(tr);
}
tr.find(".topicid").html(topicId);
tr.find(".title").html(state.title);
tr.find(".state").html(state.state);
if (state.progress == -1) {
tr.find(".progress").addClass("progress-striped").addClass("active");
tr.find(".progress .bar").css("width", "100%");
} else if (state.progress == 100){
tr.find(".progress").removeClass("progress-striped").removeClass("active");
tr.find(".progress .bar").css("width", "100%");
} else {
tr.find(".progress .bar").css("width", state.progress + "%");
}
};
this.newChangeProgressHandler = function(topicId){
Global.bimServerApi.call("RegistryInterface", "getProgress", {topicId: topicId}, function(state){
othis.progressHandler(topicId, state);
Global.bimServerApi.registerProgressHandler(topicId, othis.progressHandler);
});
};
this.closedChangeProgressHandler = function(topicId){
Global.bimServerApi.unregisterProgressHandler(topicId, othis.progressHandler);
};
this.loadLog = function(){
$("#log").load(Global.baseDir + "log.html", function(){
var settings = {
getTopicsMethod: "getProgressTopicsOnServer",
getTopicsArguments: {},
registerFunction: function(newChangeProgressHandler, closedChangeProgressHandler){
Global.bimServerApi.registerChangeProgressServerHandler(newChangeProgressHandler, closedChangeProgressHandler);
},
unregisterFunction: function(newChangeProgressHandler, closedChangeProgressHandler){
Global.bimServerApi.unregisterChangeProgressServerHandler(newChangeProgressHandler, closedChangeProgressHandler)
}
};
new Log($(this), settings, main);
});
};
this.showSystem = function(){
$(".systemLink").tab("show");
};
this.showJava = function(){
$(".javaLink").tab("show");
};
this.showBimServer = function(){
$(".bimserverLink").tab("show");
};
this.showDatabase = function(){
$(".databaseLink").tab("show");
};
this.showWebServices = function(){
$(".webservicesLink").tab("show");
};
this.showMetrics = function(){
$(".metricsLink").tab("show");
};
this.showLog = function(){
$(".logLink").tab("show");
};
containerDiv.find(".logLink").click(othis.loadLog);
containerDiv.find(".transactionsLink, .longrunningactionsLink").hide();
}
</script>