some minor changes
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>services</title>
|
<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>
|
<script src="./script.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Tables</h1>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -62,8 +62,10 @@
|
|||||||
<td>Port</td>
|
<td>Port</td>
|
||||||
<td class="inputcell"><input type="text" id="in_port"></td>
|
<td class="inputcell"><input type="text" id="in_port"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><button onclick="addemployee()">Save</button></td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<button class="save" onclick="addService()">Save</button>
|
|
||||||
<div id="addresult"></div>
|
<div id="addresult"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user