-
Notifications
You must be signed in to change notification settings - Fork 87
/
basicserversettings.html
499 lines (486 loc) · 23.3 KB
/
basicserversettings.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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
<div class="basicserversettings">
<form class="form-horizontal" role="form">
<div class="panel panel-default">
<div class="panel-heading">Main server settings</div>
<div class="panel-body">
<div class="form-group">
<label class="col-sm-2 control-label" for="siteAddress"><a rel="tooltip" data-original-title="Address where this BIMserver can primarily be found. Make sure you add a port number if the server is not running on port 80. Also include http:// or https://" data-placement="right">Site address</a></label>
<div class="col-sm-8">
<input type="text" class="form-control siteAddress" id="siteAddress" placeholder="Name">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="serverName"><a rel="tooltip" data-original-title="" data-placement="right">Server name</a></label>
<div class="col-sm-8">
<input type="text" class="form-control serverName" id="serverName" placeholder="Server Name">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="serverDescription"><a rel="tooltip" data-original-title="" data-placement="right">Site description</a></label>
<div class="col-sm-8">
<input type="text" class="form-control serverDescription" id="serverDescription" placeholder="Server Description">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="serverIcon"><a rel="tooltip" data-original-title="" data-placement="right">Server icon</a></label>
<div class="col-sm-8">
<input type="text" class="form-control serverIcon" id="serverIcon" placeholder="Server Icon">
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Other settings</div>
<div class="panel-body">
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label for="hideUserList">
<input type="checkbox" class="hideUserList" id="hideUserList">
<a rel="tooltip" data-original-title="Whether to hide the list of users for non-admin users" data-placement="right">Hide userlist for non-admin users</a>
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" class="checkinMergingEnabled">
<a rel="tooltip" data-original-title="Whether checkin-merging is enabled" data-placement="right">Checkin merging enabled</a>
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" class="storeLastLogin">
<a rel="tooltip" data-original-title="Whether to update last-login for User on login" data-placement="right">Update last-login on login</a>
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" class="storeServiceRuns">
<a rel="tooltip" data-original-title="Whether to store the models sent for running a service" data-placement="right">Store service runs</a>
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" class="createTopLevelProjects">
<a rel="tooltip" data-original-title="Allow user to create top level projects" data-placement="right">Allow user to create top level projects</a>
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" class="allowSelfRegistration"/>
<a rel="tooltip" data-original-title="Whether to allow users to register themselves" data-placement="right">Allow self registration</a>
</label>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Geometry generation</div>
<div class="panel-body">
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" class="generateGeometryCheckin">
<a rel="tooltip" data-original-title="Whether to generate geometry on checkin" data-placement="right">Generate geometry on checkin</a>
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" class="geometryReuseEnabled">
<a rel="tooltip" data-original-title="Whether geometry reuse is enabled" data-placement="right">Geometry reuse</a>
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" class="geometryOptimizeMappedItems">
<a rel="tooltip" data-original-title="Optimize mapped item geometry" data-placement="right">Optimize mapped items (more reuse)</a>
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2"><a rel="tooltip" data-original-title="Maximum amount of processes to use concurrently when generating geometry for 1 revision" data-placement="right">Max Render Engine Processes</a>
</label>
<div class="col-sm-8">
<input type="text" class="form-control renderEngineProcesses">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="defaultRenderEnginePlugin"><a rel="tooltip" data-original-title="Default render engine plugin" data-placement="right">Default render engine plugin</a></label>
<div class="col-sm-8">
<select class="form-control defaultRenderEnginePlugin" id="defaultRenderEnginePlugin">
</select>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Email</div>
<div class="panel-body">
<div class="form-group">
<label class="col-sm-2 control-label" for="smtpServer"><a rel="tooltip" data-original-title="SMTP server to use for sending emails" data-placement="right">SMTP server</a></label>
<div class="col-sm-8">
<input type="text" class="form-control smtpServer" id="smtpServer" placeholder="Name">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="smtpUsername"><a rel="tooltip" data-original-title="SMTP username" data-placement="right">SMTP username</a></label>
<div class="col-sm-8">
<input type="text" class="form-control smtpUsername" id="smtpUsername" placeholder="SMTP username">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="smtpPassword"><a rel="tooltip" data-original-title="SMTP password" data-placement="right">SMTP password</a></label>
<div class="col-sm-8">
<input type="password" class="form-control smtpPassword" id="smtpPassword" placeholder="SMTP password">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="smtpPort"><a rel="tooltip" data-original-title="SMTP port" data-placement="right">SMTP port</a></label>
<div class="col-sm-8">
<input type="text" class="form-control smtpPort" id="smtpPort" placeholder="SMTP port">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="smtpProtocol"><a rel="tooltip" data-original-title="SMTP protocol" data-placement="right">SMTP protocol</a></label>
<div class="col-sm-8">
<select class="form-control smtpProtocol" id="smtpProtocol">
<option value="SMTP">SMTP</option>
<option value="SMTPS">SMTPS</option>
<option value="STARTTLS">STARTTLS</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="emailSenderAddress"><a rel="tooltip" data-original-title="Email address to send emails from" data-placement="right">Email sender address</a></label>
<div class="col-sm-8">
<input type="text" class="form-control emailSenderAddress" id="emailSenderAddress" placeholder="Name">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="emailSenderName"><a rel="tooltip" data-original-title="Name to use for sending emails" data-placement="right">Email sender name</a></label>
<div class="col-sm-8">
<input type="text" class="form-control emailSenderName" id="emailSenderName" placeholder="Name">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" class="sendConfirmationEmailAfterRegistration"/>
<a rel="tooltip" data-original-title="Whether a confirmation e-mail should be send after a new user has been registered" data-placement="right">Send confirmation email after registration</a>
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" class="sendEmailOnNewRevision"/>
<a rel="tooltip" data-original-title="Whether an email should be send to all authorized users of a project when there is new revision" data-placement="right">Send email on new revision</a>
</label>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Technical</div>
<div class="panel-body">
<div class="form-group">
<label class="col-sm-2 control-label" for="inputRepositoryServer"><a rel="tooltip" data-original-title="Central repository server from which services, plugins and extended data schemas can be loaded" data-placement="right">Repository Server</a></label>
<div class="col-sm-8">
<input type="text" class="form-control inputRepositoryServer" id="inputRepositoryServer" placeholder="Name">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" class="strictPluginChecking">
<a rel="tooltip" data-original-title="Only allow to install plugins that indicate to work with this version of BIMserver" data-placement="right">Strict plugin checking</a>
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button class="btn btn-default clearMavenCacheButton">Clear maven cache</button>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" class="input-xxlarge cacheOutputFiles">
<a rel="tooltip" data-original-title="Whether serialized versions of models should be cached on disk. The first time a model is downloaded a cache file will be created. The server administrator is responsible for cleaning up cached files" data-placement="right">Cache output files</a>
</label>
</div>
<button class="btn btn-default clearCacheButton">Clear cache</button>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="protocolBuffersPort"><a rel="tooltip" data-original-title="Port to run the protocol buffers server on" data-placement="right">Protocol buffers port</a></label>
<div class="col-sm-8">
<input type="text" class="form-control protocolBuffersPort" id="protocolBuffersPort">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="sessionTimeOutSeconds"><a rel="tooltip" data-original-title="Session timeout in seconds" data-placement="right">Session timeout (s)</a></label>
<div class="col-sm-8">
<input type="text" class="form-control sessionTimeOutSeconds" id="sessionTimeOutSeconds">
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Security</div>
<div class="panel-body">
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" class="allowOnlyWhitelisted"/>
<a rel="tooltip" data-original-title="Whether only whitelisted (below) domains should be authorized to connect" data-placement="right">Only white listed domains</a>
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><a rel="tooltip" data-original-title="Select from which referred domains web browsers can connect to this BIMserver. More information about this can be found by searching for 'CORS'" data-placement="right">Whitelisted domains</a></label>
<div class="col-sm-8 whiteListedDomains">
</div>
</div>
</div>
</div>
</form>
</div>
<script>
function BasicServerSettings(main, serversettings) {
var othis = this;
othis.change = false;
this.show = function(){};
this.removeDomainButton = function(){
$(this).parent().remove();
othis.change = true;
othis.save();
};
this.checkWhiteListedDomains = function() {
othis.change = true;
var empty = 0;
$(".basicserversettings .whiteListedDomainDiv").each(function(){
if ($(this).find(".whiteListedDomain").val() == "") {
empty++;
$(this).find("button").hide();
} else {
$(this).find("button").show();
}
});
if (empty == 0) {
othis.addWhiteListedDomain("");
} else if (empty > 1) {
var found = 0;
$(".basicserversettings .whiteListedDomainDiv").each(function(){
if ($(this).find(".whiteListedDomain").val() == "") {
found++;
if (found > 1) {
$(this).remove();
}
}
});
}
};
this.save = function(force) {
if (othis.change) {
var serverSettings = {
__type: "SServerSettings"
};
serverSettings.whitelistedDomains = [];
$(".basicserversettings .whiteListedDomainDiv").each(function(){
var val = $(this).find("input").val();
if (val != "") {
serverSettings.whitelistedDomains.push(val);
}
});
serverSettings.serviceRepositoryUrl = $(".basicserversettings .inputRepositoryServer").val();
serverSettings.siteAddress = $(".basicserversettings .siteAddress").val();
serverSettings.name = $(".basicserversettings .serverName").val();
serverSettings.description = $(".basicserversettings .serverDescription").val();
serverSettings.icon = $(".basicserversettings .serverIcon").val();
serverSettings.smtpServer = $(".basicserversettings .smtpServer").val();
serverSettings.smtpProtocol = $(".basicserversettings .smtpProtocol").val();
serverSettings.smtpPort = $(".basicserversettings .smtpPort").val();
serverSettings.smtpUsername = $(".basicserversettings .smtpUsername").val();
serverSettings.smtpPassword = $(".basicserversettings .smtpPassword").val();
serverSettings.emailSenderAddress = $(".basicserversettings .emailSenderAddress").val();
serverSettings.emailSenderName = $(".basicserversettings .emailSenderName").val();
serverSettings.hideUserListForNonAdmin = $(".basicserversettings .hideUserList").prop("checked");
serverSettings.protocolBuffersPort = $(".basicserversettings .protocolBuffersPort").val();
serverSettings.sessionTimeOutSeconds = $(".basicserversettings .sessionTimeOutSeconds").val();
serverSettings.cacheOutputFiles = $(".basicserversettings .cacheOutputFiles").prop("checked");
serverSettings.defaultRenderEnginePluginId = $(".basicserversettings .defaultRenderEnginePlugin").val();
serverSettings.renderEngineProcesses = $(".basicserversettings .renderEngineProcesses").val();
serverSettings.reuseGeometry = $(".basicserversettings .geometryReuseEnabled").prop("checked");
serverSettings.optimizeMappedItems = $(".basicserversettings .geometryOptimizeMappedItems").prop("checked");
serverSettings.checkinMergingEnabled = $(".basicserversettings .checkinMergingEnabled").prop("checked");
serverSettings.storeLastLogin = $(".basicserversettings .storeLastLogin").prop("checked");
serverSettings.storeServiceRuns = $(".basicserversettings .storeServiceRuns").prop("checked");
serverSettings.allowUsersToCreateTopLevelProjects = $(".basicserversettings .createTopLevelProjects").prop("checked");
serverSettings.allowSelfRegistration = $(".basicserversettings .allowSelfRegistration").prop("checked");
serverSettings.sendConfirmationEmailAfterRegistration = $(".basicserversettings .sendConfirmationEmailAfterRegistration").prop("checked");
serverSettings.sendEmailOnNewRevision = $(".basicserversettings .sendEmailOnNewRevision").prop("checked");
serverSettings.allowOnlyWhitelisted = $(".basicserversettings .allowOnlyWhitelisted").prop("checked");
serverSettings.pluginStrictVersionChecking = $(".basicserversettings .strictPluginChecking").prop("checked");
serverSettings.generateGeometryOnCheckin = $(".basicserversettings .generateGeometryCheckin").prop("checked");
Global.bimServerApi.callWithFullIndication("SettingsInterface", "setServerSettings", {serverSettings: serverSettings}, function(data){
othis.change = false;
});
}
};
this.addWhiteListedDomain = function(domain) {
var div = $("<div class=\"whiteListedDomainDiv\">");
var input = $("<input type=\"text\" class=\"form-control whiteListedDomain input-xlarge\">");
input.val(domain);
if (domain == "") {
input.attr("placeHolder", "Add a new domain");
}
var button = $("<button class=\"btn btn-small removeDomainButton\"><i class=\"icon-minus\"/></button>");
button.attr("title", "Remove domain");
button.click(othis.removeDomainButton);
div.append(input);
input.blur(othis.save);
input.keyup(othis.checkWhiteListedDomains);
div.append(button);
if (domain == "") {
button.hide();
}
$(".basicserversettings .whiteListedDomains").append(div);
};
this.loadSettings = function() {
Global.bimServerApi.call("SettingsInterface", "getServerSettings", {}, function(data){
$(".basicserversettings .inputRepositoryServer").val(data.serviceRepositoryUrl);
$(".basicserversettings .siteAddress").val(data.siteAddress);
$(".basicserversettings .serverName").val(data.name);
$(".basicserversettings .serverDescription").val(data.description);
$(".basicserversettings .serverIcon").val(data.icon);
$(".basicserversettings .smtpServer").val(data.smtpServer);
$(".basicserversettings .smtpUsername").val(data.smtpUsername);
$(".basicserversettings .smtpPassword").val(data.smtpPassword);
$(".basicserversettings .smtpPort").val(data.smtpPort);
$(".basicserversettings .smtpProtocol").val(data.smtpProtocol);
$(".basicserversettings .emailSenderAddress").val(data.emailSenderAddress);
$(".basicserversettings .emailSenderName").val(data.emailSenderName);
$(".basicserversettings .hideUserList").prop("checked", data.hideUserListForNonAdmin);
$(".basicserversettings .protocolBuffersPort").val(data.protocolBuffersPort);
$(".basicserversettings .renderEngineProcesses").val(data.renderEngineProcesses);
$(".basicserversettings .sessionTimeOutSeconds").val(data.sessionTimeOutSeconds);
$(".basicserversettings .cacheOutputFiles").prop("checked", data.cacheOutputFiles);
$(".basicserversettings .geometryReuseEnabled").prop("checked", data.reuseGeometry);
$(".basicserversettings .geometryOptimizeMappedItems").prop("checked", data.optimizeMappedItems);
$(".basicserversettings .checkinMergingEnabled").prop("checked", data.checkinMergingEnabled);
$(".basicserversettings .createTopLevelProjects").prop("checked", data.allowUsersToCreateTopLevelProjects);
$(".basicserversettings .storeLastLogin").prop("checked", data.storeLastLogin);
$(".basicserversettings .storeServiceRuns").prop("checked", data.storeServiceRuns);
$(".basicserversettings .allowSelfRegistration").prop("checked", data.allowSelfRegistration);
$(".basicserversettings .sendConfirmationEmailAfterRegistration").prop("checked", data.sendConfirmationEmailAfterRegistration);
$(".basicserversettings .sendEmailOnNewRevision").prop("checked", data.sendEmailOnNewRevision);
$(".basicserversettings .allowOnlyWhitelisted").prop("checked", data.allowOnlyWhitelisted);
$(".basicserversettings .generateGeometryCheckin").prop("checked", data.generateGeometryOnCheckin);
$(".basicserversettings .strictPluginChecking").prop("checked", data.pluginStrictVersionChecking);
$(".basicserversettings .whiteListedDomains .whiteListedDomainDiv").remove();
data.whitelistedDomains.forEach(function(domain){
othis.addWhiteListedDomain(domain);
});
othis.addWhiteListedDomain("");
othis.updateWhiteListedVisible(data.allowOnlyWhitelisted);
});
};
this.updateWhiteListedVisible = function(allowOnlyWhitelisted){
if (allowOnlyWhitelisted) {
$(".basicserversettings .whiteListedDomains input").removeAttr("disabled");
$(".basicserversettings .whiteListedDomains button").show();
$(".basicserversettings .whiteListedDomains input").each(function(){
if ($(this).val() == "") {
$(this).show();
}
});
} else {
$(".basicserversettings .whiteListedDomains input").attr("disabled", "disabled");
$(".basicserversettings .whiteListedDomains button").hide();
$(".basicserversettings .whiteListedDomains input").each(function(){
if ($(this).val() == "") {
$(this).hide();
}
});
}
};
this.clearCacheClick = function(event){
event.preventDefault();
Global.bimServerApi.call("AdminInterface", "clearOutputFileCache", {}, function(data){
alert(data + " cache files removed");
});
};
this.clearMavenCacheClick = function(event){
event.preventDefault();
Global.bimServerApi.call("PluginInterface", "clearMavenCache", {}, function(data){
});
};
this.close = function(){
};
$(".basicserversettings select").change(function(){othis.change = true; othis.save()});
$(".basicserversettings input[type='checkbox']").change(function(){othis.change = true; othis.save()});
$(".basicserversettings input[type='text'], .basicserversettings input[type='password']").blur(othis.save);
$(".basicserversettings input[type='text'], .basicserversettings input[type='password']").enterpress(othis.save);
$(".basicserversettings input[type='text'], .basicserversettings input[type='password']").keyup(function(event){
if (event.which != 13 && event.which != 9) {
othis.change = true;
}
});
$(".basicserversettings .allowOnlyWhitelisted").change(function(event){othis.updateWhiteListedVisible($(this).is(":checked"))});
$(".basicserversettings .clearCacheButton").click(othis.clearCacheClick);
$(".basicserversettings .clearMavenCacheButton").click(othis.clearMavenCacheClick);
Global.bimServerApi.call("PluginInterface", "getDefaultRenderEnginePluginDescriptor", {}, function(defaultPluginDescriptor){
Global.bimServerApi.call("PluginInterface", "getAllRenderEnginePluginDescriptors", {}, function(pluginDescriptors){
pluginDescriptors.forEach(function(pluginDescriptor){
var option = $("<option value=\"" + pluginDescriptor.oid + "\">" + pluginDescriptor.name + "</option>");
$(".defaultRenderEnginePlugin").append(option);
if (defaultPluginDescriptor.oid == pluginDescriptor.oid) {
option.attr("selected", "selected");
}
});
});
});
$("[rel=tooltip]").tooltip();
othis.loadSettings();
}
</script>