dnet-applications/apps/dnet-is-application/src/main/resources/templates/info.html

81 lines
2.1 KiB
HTML

<!DOCTYPE html>
<html>
<head th:replace="fragments/mainParts.html :: htmlHeader('Info')"></head>
<body ng-app="infoApp" ng-controller="infoController">
<nav th:replace="fragments/mainParts.html :: mainMenu('Info')"></nav>
<div class="container-fluid">
<div class="row">
<div class="col">
<p>
<input type="text" class="form-control form-control-sm" ng-model="infoFilter" placeholder="Filter..."/>
</p>
<div class="card mb-3" ng-repeat="section in info">
<div class="card-header">{{section.name}}</div>
<table class="table table-striped table-sm small">
<thead ng-if="section.name == 'Modules'">
<tr>
<th>Group ID</th>
<th>Artifact ID</th>
<th>Version</th>
<th>POM</th>
</tr>
</thead>
<tbody>
<tr ng-show="(section.data|filter:infoFilter).length == 0">
<td colspan="4">No match</td>
</tr>
<tr ng-repeat="r in section.data|filter:infoFilter" ng-if="section.name != 'Modules'">
<th style="width:30%">{{r.k}}</th>
<td>{{r.v}}</td>
</tr>
<tr ng-repeat="r in section.data|filter:infoFilter" ng-if="section.name == 'Modules'" ng-class="{'table-warning' : r.files.length > 1}">
<td>{{r.group}}</td>
<td>{{r.name}}</td>
<td><span ng-repeat="v in r.versions">{{v}}<br /></span></td>
<td><span ng-repeat="f in r.files">{{f}}<br /></span></td>
</tr>
</tbody>
</table>
<table class="table table-striped table-sm small" >
</tbody>
</table>
</div>
</div>
</div>
</div>
</body>
<th:block th:replace="fragments/mainParts.html :: scripts"></th:block>
<script>
var app = angular.module('infoApp', []);
app.controller('infoController', function($scope, $http) {
$scope.info = [];
$scope.modules = {};
$http.get('./api/info/?' + $.now()).then(function successCallback(res) {
$scope.info = res.data;
}, function errorCallback(res) {
alert('ERROR: ' + res.data.message);
});
});
</script>
</html>