some minor changes
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>services</title>
|
||||
<link rel="stylesheet" type="text/css" href="../style.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../style.css">
|
||||
<script src="./script.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
let services = [];
|
||||
getServices();
|
||||
|
||||
async function getServices()
|
||||
{
|
||||
await fetch('https://localhost:5001/api/Service')
|
||||
.then(x => x.json())
|
||||
.then(y => {
|
||||
services = y;
|
||||
console.log(services);
|
||||
display();
|
||||
});
|
||||
}
|
||||
|
||||
function display()
|
||||
{
|
||||
document.getElementById('resultarea').innerHTML = '';
|
||||
|
||||
services.forEach(t => {
|
||||
document.getElementById('resultarea').innerHTML +=
|
||||
'<tr><td>'
|
||||
+ t.id +
|
||||
'</td><td>'
|
||||
+ t.name +
|
||||
'</td><td>'
|
||||
+ '<button colspan="2" type="button" onclick="runQuery(' + t.id + ')">Run</button>'
|
||||
+ '</td></tr>';
|
||||
});
|
||||
}
|
||||
|
||||
async function runQuery(id)
|
||||
{
|
||||
let results = []
|
||||
|
||||
await fetch('https://localhost:5001/api/WhoUsesService?id=' + id)
|
||||
.then(x => x.json())
|
||||
.then(y => {
|
||||
results = y;
|
||||
console.log(results);
|
||||
});
|
||||
|
||||
document.getElementById('resultarea').innerHTML = '';
|
||||
|
||||
results.forEach(t => {
|
||||
document.getElementById('resultarea').innerHTML +=
|
||||
'<h2>Query results</h2>' +
|
||||
'<table>' +
|
||||
'<tr>' +
|
||||
'<td>ID</td>' +
|
||||
'<td>Client</td>' +
|
||||
'</tr>';
|
||||
});
|
||||
|
||||
}
|
||||
@@ -7,14 +7,14 @@
|
||||
</head>
|
||||
<body>
|
||||
<h1>Tables</h1>
|
||||
<a href="./WhoUsesService.html" class="button">Get clients using a service</a>
|
||||
<a href="./WhoUsesService/WhoUsesService.html" class="button">Get clients using a service</a>
|
||||
<br>
|
||||
<a href="./GetSubordinates.html" class="button">Get subordinates of employee</a>
|
||||
<a href="./GetSubordinates/GetSubordinates.html" class="button">Get subordinates of employee</a>
|
||||
<br>
|
||||
<a href="./WhoIsResponsibleForService.html" class="button">Get responsible leader for service</a>
|
||||
<a href="./WhoIsResponsibleForService/WhoIsResponsibleForService.html" class="button">Get responsible leader for service</a>
|
||||
<br>
|
||||
<a href="./WhoMaintainsService.html" class="button">Get employees working on a service</a>
|
||||
<a href="./WhoMaintainsService/WhoMaintainsService.html" class="button">Get employees working on a service</a>
|
||||
<br>
|
||||
<a href="./WhoWorksInMaintainerTeam.html" class="button">Get members of a team</a>
|
||||
<a href="./WhoWorksInMaintainerTeam/WhoWorksInMaintainerTeam.html" class="button">Get members of a team</a>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -62,8 +62,10 @@
|
||||
<td>Port</td>
|
||||
<td class="inputcell"><input type="text" id="in_port"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><button onclick="addemployee()">Save</button></td>
|
||||
</tr>
|
||||
</table>
|
||||
<button class="save" onclick="addService()">Save</button>
|
||||
<div id="addresult"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user