status.ejs ajax : suseendhiran

This commit is contained in:
suseendhiran17 2022-09-21 10:09:10 +05:30
parent 7573347b6c
commit b4b6c8b5c3
3 changed files with 21 additions and 34 deletions

View File

@ -87,7 +87,7 @@ exports.APIstatus = async (req, res) =>
exports.SingleApiStatus = async (req, res) =>
{
try
{
{
ApiName = req.body.api;
ApiData = JSON.parse(process.env.STATUSARRAY);
// call token api
@ -107,7 +107,17 @@ exports.SingleApiStatus = async (req, res) =>
URL = object.url;
request_object = object.requestObject;
if (object.header == 1 && token_data.status == 200) { request_header = "Bearer"+" "+token_data.data.token; reqObj = {url: URL, method: object.method,json: true,body: request_object,headers : { 'Content-Type' : 'application/json' , 'Authorization' : request_header }} }
else { reqObj = {url: URL,method: object.method,body: request_object} }
else
{
if (object.name == "SMC Front End")
{
reqObj = {url: URL,method: object.method}
}
else
{
reqObj = {url: URL,method: object.method,body: request_object,json: true}
}
}
request(reqObj, function (error, response, body) {
if (response == undefined)
{
@ -133,23 +143,3 @@ exports.SingleApiStatus = async (req, res) =>
};
exports.test = async (req, res) =>
{
try
{
reqObj = {url: "https://demo.devopsmcfinance.com/mw/cet/main" ,method: "GET",json: true,body: "request_object"}
request(reqObj, function (error, response, body) {
console.log(response.statusCode);
})
}
catch(err)
{
res.send({'status':404,
message: err.message || "Some error occurred while inserting statements." ,'data': "No data"
});
} //end of try catch
};

View File

@ -13,7 +13,6 @@ module.exports = app => {
// Single Api status check Api
router.post("/SingleApiStatus", Mycontroller.SingleApiStatus);
router.get("/test", Mycontroller.test);

View File

@ -1,5 +1,7 @@
<html>
<head>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js"></script>
<!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
@ -15,9 +17,7 @@
}, 300000);
</script>
<style>
/* Desktops and laptops ----------- */
/* Desktops and laptops ----------- */
@media only screen and (min-width : 1224px) {
b {
font-family: Arial, Helvetica, sans-serif;
@ -243,7 +243,7 @@
/* Smartphones (portrait and landscape) ----------- */
/* Smartphones (portrait and landscape) ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
b {
font-family: Arial, Helvetica, sans-serif;
@ -412,7 +412,7 @@
width: 0em;
padding: 8px;
text-align: center;
font-size: larger;
}
#tab-des tr:nth-child(even){background-color: #f2f2f2;}
@ -429,7 +429,7 @@
color: white;
}
#tab-des-2 {
/* #tab-des-2 {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 87%;
@ -453,7 +453,7 @@
text-align: center;
background-color: #04AA6D;
color: white;
}
} */
.xd-content .xd-body .xd-body-inner {
max-height: unset;
@ -526,7 +526,7 @@
</div>
<div class = "header4"><h1><i style="font-size:18px;color:black"></i> <strong>Server Services</strong></h1></div>
<div class = "header5">
<table id="tab-des-2">
<table id="tab-des">
<thead>
<tr>
<th>Server</th>
@ -556,7 +556,7 @@
</div>
<div class = "header6"><h1><i style="font-size:18px;color:black"></i> <strong>Database Services</strong></h1></div>
<div class = "header7">
<table id="tab-des-2">
<table id="tab-des">
<thead>
<tr>
<th>Database</th>
@ -585,8 +585,6 @@
</table>
</div>
</body>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.4.1.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
<script>
$(".index").click(function (evt) {
var api = $(evt.target).parent().parent("tr").find("td:nth-child(1)").text();