From c631ada380928169e439bbaaf8d669b446868bfd Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 27 Jul 2018 19:13:42 +0000 Subject: [PATCH] --- Controllers/OpsController.cs | 168 +++++++++++++++++------------------ wwwroot/js/app.ops.js | 28 +++--- 2 files changed, 101 insertions(+), 95 deletions(-) diff --git a/Controllers/OpsController.cs b/Controllers/OpsController.cs index 97ea908..eff36a4 100644 --- a/Controllers/OpsController.cs +++ b/Controllers/OpsController.cs @@ -31,101 +31,101 @@ namespace rockfishCore.Controllers { dtoOpsStatus Ret = new dtoOpsStatus(); - //TESTING - Ret.OpsCheckError="Fake error message\r\nwith more fake text\r\neot"; - Ret.MailMirrorOK=true; - Ret.ContactFormOK=true; + // //TESTING + // Ret.OpsCheckError="Fake error message\r\nwith more fake text\r\neot"; + // Ret.MailMirrorOK=true; + // Ret.ContactFormOK=true; - // try - // { - // Ret.MailMirrorOK = RfMail.MailIsMirroringProperly(); - // } - // catch (Exception ex) - // { - // Ret.OpsCheckError += $"Mail mirror: {ex.Message}\r\n"; - // } + try + { + Ret.MailMirrorOK = RfMail.MailIsMirroringProperly(); + } + catch (Exception ex) + { + Ret.OpsCheckError += $"Mail mirror: {ex.Message}\r\n"; + } - // try - // { - // Ret.AyaNovaSiteOK = OpsDiagnostics.CheckWebsite("https://www.ayanova.com/", "Ground Zero Tech-Works Inc."); - // } - // catch (Exception ex) - // { - // Ret.OpsCheckError += $"AyaNova site: {ex.Message}\r\n"; - // } + try + { + Ret.AyaNovaSiteOK = OpsDiagnostics.CheckWebsite("https://www.ayanova.com/", "Ground Zero Tech-Works Inc."); + } + catch (Exception ex) + { + Ret.OpsCheckError += $"AyaNova site: {ex.Message}\r\n"; + } - // try - // { - // Ret.APISiteOK = OpsDiagnostics.CheckWebsite("https://api.ayanova.com/", "WorkorderTypes Enumeration"); - // } - // catch (Exception ex) - // { - // Ret.OpsCheckError += $"API site: {ex.Message}\r\n"; - // } + try + { + Ret.APISiteOK = OpsDiagnostics.CheckWebsite("https://api.ayanova.com/", "WorkorderTypes Enumeration"); + } + catch (Exception ex) + { + Ret.OpsCheckError += $"API site: {ex.Message}\r\n"; + } - // try - // { - // Ret.ContactFormOK = OpsDiagnostics.CheckWebsite("https://contact.ayanova.com/contact", "Contact.Email"); - // } - // catch (Exception ex) - // { - // Ret.OpsCheckError += $"Contact form: {ex.Message}\r\n"; - // } + try + { + Ret.ContactFormOK = OpsDiagnostics.CheckWebsite("https://contact.ayanova.com/contact", "Contact.Email"); + } + catch (Exception ex) + { + Ret.OpsCheckError += $"Contact form: {ex.Message}\r\n"; + } - // try - // { - // Ret.RequestFormOK = OpsDiagnostics.CheckWebsite("https://contact.ayanova.com/request", "Contact.Email"); - // } - // catch (Exception ex) - // { - // Ret.OpsCheckError += $"Request form: {ex.Message}\r\n"; - // } + try + { + Ret.RequestFormOK = OpsDiagnostics.CheckWebsite("https://contact.ayanova.com/request", "Contact.Email"); + } + catch (Exception ex) + { + Ret.OpsCheckError += $"Request form: {ex.Message}\r\n"; + } - // try - // { - // Ret.RequestLiteFormOK = OpsDiagnostics.CheckWebsite("https://contact.ayanova.com/requestlite", "Contact.Email"); - // } - // catch (Exception ex) - // { - // Ret.OpsCheckError += $"RequestLite form: {ex.Message}\r\n"; - // } + try + { + Ret.RequestLiteFormOK = OpsDiagnostics.CheckWebsite("https://contact.ayanova.com/requestlite", "Contact.Email"); + } + catch (Exception ex) + { + Ret.OpsCheckError += $"RequestLite form: {ex.Message}\r\n"; + } - // try - // { - // Ret.SubversionOK = OpsDiagnostics.CheckWebsite("http://svn.helloayanova.com:3343/csvn/login/auth", "Subversion Edge"); - // } - // catch (Exception ex) - // { - // Ret.OpsCheckError += $"Subversion: {ex.Message}\r\n"; - // } + try + { + Ret.SubversionOK = OpsDiagnostics.CheckWebsite("http://svn.helloayanova.com:3343/csvn/login/auth", "Subversion Edge"); + } + catch (Exception ex) + { + Ret.OpsCheckError += $"Subversion: {ex.Message}\r\n"; + } - // try - // { - // Ret.ForumOK = OpsDiagnostics.CheckWebsite("http://forum.ayanova.com/", "AyaNova support resources"); - // } - // catch (Exception ex) - // { - // Ret.OpsCheckError += $"Forum: {ex.Message}\r\n"; - // } + try + { + Ret.ForumOK = OpsDiagnostics.CheckWebsite("http://forum.ayanova.com/", "AyaNova support resources"); + } + catch (Exception ex) + { + Ret.OpsCheckError += $"Forum: {ex.Message}\r\n"; + } - // try - // { - // Ret.DevOpsOK = OpsDiagnostics.CheckWebsite("https://test.helloayanova.com/api/v8/", "AyaNova server"); - // } - // catch (Exception ex) - // { - // Ret.OpsCheckError += $"DevOps: {ex.Message}\r\n"; - // } + try + { + Ret.DevOpsOK = OpsDiagnostics.CheckWebsite("https://test.helloayanova.com/api/v8/", "AyaNova server"); + } + catch (Exception ex) + { + Ret.OpsCheckError += $"DevOps: {ex.Message}\r\n"; + } - // try - // { - // Ret.BackupOK = OpsDiagnostics.VerifyBackups(); - // } - // catch (Exception ex) - // { - // Ret.OpsCheckError += $"Backup: {ex.Message}\r\n"; - // } + try + { + Ret.BackupOK = OpsDiagnostics.VerifyBackups(); + } + catch (Exception ex) + { + Ret.OpsCheckError += $"Backup: {ex.Message}\r\n"; + } return Ret; } diff --git a/wwwroot/js/app.ops.js b/wwwroot/js/app.ops.js index 35d834b..787e4bb 100644 --- a/wwwroot/js/app.ops.js +++ b/wwwroot/js/app.ops.js @@ -21,11 +21,15 @@ app.ops = (function() { //Generate list item // generateItem = function(okStatus, label) { + + var okClassFragment = okStatus + ? "mdi-check-circle text-success" + : "mdi-alert text-danger"; + return ( - '

') + + '

' + label + "

" ); @@ -67,23 +71,25 @@ app.ops = (function() { if (res.opsCheckError) { $("#rf-ops-error").text(res.opsCheckError); } - + var generatedHtml = ""; generatedHtml += generateItem(res.mailMirrorOK, "Mail & mirror"); generatedHtml += generateItem(res.ayaNovaSiteOK, "AyaNova site"); generatedHtml += generateItem(res.backupOK, "Backup"); generatedHtml += generateItem(res.contactFormOK, "Contact form"); generatedHtml += generateItem(res.requestFormOK, "Request form"); - generatedHtml += generateItem(res.requestLiteFormOK, "Request lite form"); - generatedHtml += generateItem(res.forumOK, "Forum"); - generatedHtml += generateItem(res.subversionOK, "Subversion"); - generatedHtml += generateItem(res.devOpsOK, "Devops site"); - generatedHtml += generateItem(res.apiSiteOK, "API site"); + generatedHtml += generateItem( + res.requestLiteFormOK, + "Request lite form" + ); + generatedHtml += generateItem(res.forumOK, "Forum"); + generatedHtml += generateItem(res.subversionOK, "Subversion"); + generatedHtml += generateItem(res.devOpsOK, "Devops site"); + generatedHtml += generateItem(res.apiSiteOK, "API site"); $("#rf-ops-status").html(generatedHtml); } }); - }; //PUBLIC METHODS