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

88 lines
2.4 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" ng-show="(section.data|filter:infoFilter).length > 0">
<div class="card-body">
<h5 class="card-title">{{section.name}}</h5>
<table class="table table-striped table-sm small" style="table-layout: fixed;">
<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-repeat="r in section.data|filter:infoFilter" ng-if="section.name != 'Modules'">
<th style="width: 25%;">{{r.k}}</th>
<td style="overflow-x:auto;"><pre style="margin: 0;">{{r.v}}</pre></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 class="text-monospace"><span ng-repeat="v in r.versions">{{v}}<br /></span></td>
<td class="text-monospace"><span ng-repeat="f in r.files">{{f}}<br /></span></td>
</tr>
</tbody>
</table>
</div>
</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) {
angular.forEach(res.data, function(section) {
if (section.name != 'Modules') {
angular.forEach(section.data, function(r) {
if (r.k.toLowerCase().endsWith('path') || r.k.toLowerCase().endsWith('.dirs')) {
r.v = r.v.replaceAll(':', ':\n');
}
});
}
});
$scope.info = res.data;
}, function errorCallback(res) {
alert('ERROR: ' + res.data.message);
});
});
</script>
</html>