diff --git a/Controllers/OpsController.cs b/Controllers/OpsController.cs index eff36a4..860d29b 100644 --- a/Controllers/OpsController.cs +++ b/Controllers/OpsController.cs @@ -26,137 +26,163 @@ namespace rockfishCore.Controllers //status of ops - [HttpGet("status")] - public dtoOpsStatus GetOpsStatus() + [HttpGet("status/{service}")] + public dtoOpsStatus GetOpsStatus([FromRoute] string service) { dtoOpsStatus Ret = new dtoOpsStatus(); - // //TESTING - // Ret.OpsCheckError="Fake error message\r\nwith more fake text\r\neot"; - // Ret.MailMirrorOK=true; - // Ret.ContactFormOK=true; - try { - Ret.MailMirrorOK = RfMail.MailIsMirroringProperly(); + switch (service) + { + case "MailMirror": + Ret.Status = true;//RfMail.MailIsMirroringProperly(); + break; + case "AyaNovaSite": + Ret.Status = false;//OpsDiagnostics.CheckWebsite("https://www.ayanova.com/", "Ground Zero Tech-Works Inc."); + break; + case "APISite": + Ret.Status = true;// OpsDiagnostics.CheckWebsite("https://api.ayanova.com/", "WorkorderTypes Enumeration"); + break; + case "ContactForm": + Ret.Status = false; //OpsDiagnostics.CheckWebsite("https://contact.ayanova.com/contact", "Contact.Email"); + break; + case "RequestForm": + Ret.Status = true;// OpsDiagnostics.CheckWebsite("https://contact.ayanova.com/request", "Contact.Email"); + break; + case "RequestLiteForm": + Ret.Status = false; //OpsDiagnostics.CheckWebsite("https://contact.ayanova.com/requestlite", "Contact.Email"); + break; + case "Subversion": + Ret.Status = true; //OpsDiagnostics.CheckWebsite("http://svn.helloayanova.com:3343/csvn/login/auth", "Subversion Edge"); + break; + case "Forum": + Ret.Status = false; //OpsDiagnostics.CheckWebsite("http://forum.ayanova.com/", "AyaNova support resources"); + break; + case "DevOps": + Ret.Status = true; //OpsDiagnostics.CheckWebsite("https://test.helloayanova.com/api/v8/", "AyaNova server"); + break; + case "Backup": + Ret.Status = false;//OpsDiagnostics.VerifyBackups(); + break; + default: + Ret.Status = false; + Ret.ServiceCheckError=$"Unknown service: \"{service}\""; + break; + + } + } catch (Exception ex) { - Ret.OpsCheckError += $"Mail mirror: {ex.Message}\r\n"; + Ret.ServiceCheckError += $"{service}: {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"; - } +Ret.ServiceCheckError=$"test {service} error"; - try - { - Ret.APISiteOK = OpsDiagnostics.CheckWebsite("https://api.ayanova.com/", "WorkorderTypes Enumeration"); - } - catch (Exception ex) - { - Ret.OpsCheckError += $"API site: {ex.Message}\r\n"; - } + // try + // { + // Ret.MailMirrorOK = RfMail.MailIsMirroringProperly(); + // } + // catch (Exception ex) + // { + // Ret.OpsCheckError += $"Mail mirror: {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.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.RequestFormOK = OpsDiagnostics.CheckWebsite("https://contact.ayanova.com/request", "Contact.Email"); - } - catch (Exception ex) - { - Ret.OpsCheckError += $"Request form: {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.RequestLiteFormOK = OpsDiagnostics.CheckWebsite("https://contact.ayanova.com/requestlite", "Contact.Email"); - } - catch (Exception ex) - { - Ret.OpsCheckError += $"RequestLite 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.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.RequestFormOK = OpsDiagnostics.CheckWebsite("https://contact.ayanova.com/request", "Contact.Email"); + // } + // catch (Exception ex) + // { + // Ret.OpsCheckError += $"Request form: {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.RequestLiteFormOK = OpsDiagnostics.CheckWebsite("https://contact.ayanova.com/requestlite", "Contact.Email"); + // } + // catch (Exception ex) + // { + // Ret.OpsCheckError += $"RequestLite form: {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.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.BackupOK = OpsDiagnostics.VerifyBackups(); - } - catch (Exception ex) - { - Ret.OpsCheckError += $"Backup: {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.BackupOK = OpsDiagnostics.VerifyBackups(); + // } + // catch (Exception ex) + // { + // Ret.OpsCheckError += $"Backup: {ex.Message}\r\n"; + // } return Ret; } public class dtoOpsStatus { - public bool MailMirrorOK; - public bool ForumOK; - public bool AyaNovaSiteOK; - public bool APISiteOK; - public bool ContactFormOK; - public bool RequestFormOK; - public bool RequestLiteFormOK; - public bool SubversionOK; - public bool DevOpsOK; - public bool BackupOK; - public string OpsCheckError; + public bool Status; + public string ServiceCheckError; public dtoOpsStatus() { - MailMirrorOK = false; - ForumOK = false; - AyaNovaSiteOK = false; - APISiteOK = false; - ContactFormOK = false; - RequestFormOK = false; - RequestLiteFormOK = false; - SubversionOK = false; - DevOpsOK = false; - BackupOK = false; - OpsCheckError = string.Empty; + Status = false; + ServiceCheckError = string.Empty; } } diff --git a/util/RfVersion.cs b/util/RfVersion.cs index 2f65c6e..ae26216 100644 --- a/util/RfVersion.cs +++ b/util/RfVersion.cs @@ -2,7 +2,7 @@ namespace rockfishCore.Util { public static class RfVersion { - public const string NumberOnly="6.5"; + public const string NumberOnly="6.6"; public const string Full = "Rockfish server " + NumberOnly; } } \ No newline at end of file diff --git a/wwwroot/default.htm b/wwwroot/default.htm index 48db6dd..6a87516 100644 --- a/wwwroot/default.htm +++ b/wwwroot/default.htm @@ -11,69 +11,69 @@