forked from opensourceBIM/bimvie.ws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebmodules.html
63 lines (55 loc) · 1.71 KB
/
webmodules.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
<div class="webmodules">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Enabled</th>
<th class="defaultHeader">Default</th>
<th>Default Path</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<script>
function WebModules(main, serversettings) {
var othis = this;
this.show = function(){};
this.setDefaultClick = function(){
var oid = $(this).parents("tr").data("plugin").oid;
Global.bimServerApi.callWithFullIndication("PluginInterface", "setDefaultWebModule", {
oid: oid
}, function(){});
};
this.addPlugin = function(plugin){
var tr = $("<tr>");
tr.data("plugin", plugin);
tr.append("<td>" + plugin.name + "</td>");
tr.append("<td>" + plugin.description + "</td>");
tr.append("<td>" + plugin.enabled + "</td>");
tr.append("<td><input name=\"default\" type=\"radio\"></td>");
tr.find("input").change(othis.setDefaultClick);
Global.bimServerApi.call("PluginInterface", "getPluginSettings", {poid: plugin.oid}, function(settings){
tr.append("<td>" + settings.parameters[0].value.value + "</td>");
});
if (othis.defaultModule != null && plugin.oid == othis.defaultModule.oid) {
tr.find("input").attr("checked", "checked");
}
$(".webmodules table tbody").append(tr);
};
this.loadWebModules = function(){
Global.bimServerApi.call("PluginInterface", "getDefaultWebModule", {}, function(defaultModule){
othis.defaultModule = defaultModule;
Global.bimServerApi.call("PluginInterface", "getAllWebModules", {onlyEnabled: false}, function(plugins){
plugins.forEach(function(plugin){
othis.addPlugin(plugin);
});
});
});
};
this.close = function(){
};
othis.loadWebModules();
}
</script>