-
Notifications
You must be signed in to change notification settings - Fork 87
/
modelcheckers.html
60 lines (53 loc) · 1.77 KB
/
modelcheckers.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
<div class="modelcheckers">
<div class="well well-sm buttonBar">
<button class="btn btn-default addNewModelCheckerButton">Add new</button>
<button class="btn btn-default addRepoModelCheckerButton">Add from repository</button>
</div>
<div class="well well-sm nomodelcheckers">
No model checkers
</div>
<table class="table initialhide table-striped table-hover">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Plugin</th>
<th>Status</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<script>
function ModelCheckers(main, serversettings) {
var othis = this;
this.show = function(){};
this.close = function(){
};
this.addModelChecker = function(modelChecker) {
$(".modelcheckers .nomodelcheckers").hide();
$(".modelcheckers table").show();
var tr = $("<tr>");
tr.data("modelchecker", modelChecker);
tr.click(function(){
main.showModelChecker($(this).data("modelchecker").oid);
});
tr.append("<td>" + modelChecker.name + "</td>");
tr.append("<td>" + modelChecker.description + "</td>");
tr.append("<td>" + modelChecker.modelCheckerPluginClassName + "</td>");
tr.append("<td>" + (modelChecker.valid ? "<span class=\"label label-success\">Valid</span>" : "<span class=\"label label-danger\">Not Valid</span>") + "</td>");
$(".modelcheckers table tbody").append(tr);
};
this.loadModelCheckers = function() {
Global.bimServerApi.call("ServiceInterface", "getAllModelCheckers", {}, function(data){
data.forEach(function(modelChecker){
othis.addModelChecker(modelChecker);
});
});
};
othis.loadModelCheckers();
$(".modelcheckers .addNewModelCheckerButton").click(serversettings.showAddNewModelChecker);
$(".modelcheckers .addRepoModelCheckerButton").click(serversettings.showAddRepoModelChecker);
}
</script>