The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HelpController.cs 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. using Microsoft.AspNetCore.Authorization;
  2. using Microsoft.AspNetCore.Http;
  3. using Microsoft.AspNetCore.Mvc;
  4. using Microsoft.Extensions.Logging;
  5. using Teknik.Areas.Help.ViewModels;
  6. using Teknik.Attributes;
  7. using Teknik.Configuration;
  8. using Teknik.Controllers;
  9. using Teknik.Data;
  10. using Teknik.Filters;
  11. using Teknik.Logging;
  12. namespace Teknik.Areas.Help.Controllers
  13. {
  14. [Authorize]
  15. [Area("Help")]
  16. public class HelpController : DefaultController
  17. {
  18. public HelpController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
  19. [AllowAnonymous]
  20. public IActionResult Index()
  21. {
  22. ViewBag.Title = "Help";
  23. HelpViewModel model = new HelpViewModel();
  24. return View(model);
  25. }
  26. [AllowAnonymous]
  27. public IActionResult API(string version, string service)
  28. {
  29. HelpViewModel model = new HelpViewModel();
  30. if (string.IsNullOrEmpty(version) && string.IsNullOrEmpty(service))
  31. {
  32. ViewBag.Title = "API Help";
  33. return View("~/Areas/Help/Views/Help/API/API.cshtml", model);
  34. }
  35. else if(!string.IsNullOrEmpty(version) && !string.IsNullOrEmpty(service))
  36. {
  37. ViewBag.Title = service + " API " + version + " Help";
  38. return View("~/Areas/Help/Views/Help/API/" + version + "/" + service + ".cshtml", model);
  39. }
  40. return new StatusCodeResult(StatusCodes.Status404NotFound);
  41. }
  42. [AllowAnonymous]
  43. public IActionResult Blog()
  44. {
  45. ViewBag.Title = "Blogging Help";
  46. HelpViewModel model = new HelpViewModel();
  47. return View("~/Areas/Help/Views/Help/Blog.cshtml", model);
  48. }
  49. [AllowAnonymous]
  50. public IActionResult Git()
  51. {
  52. ViewBag.Title = "Git Service Help";
  53. HelpViewModel model = new HelpViewModel();
  54. return View("~/Areas/Help/Views/Help/Git.cshtml", model);
  55. }
  56. [AllowAnonymous]
  57. public IActionResult IRC()
  58. {
  59. ViewBag.Title = "IRC Server Help ";
  60. HelpViewModel model = new HelpViewModel();
  61. return View("~/Areas/Help/Views/Help/IRC.cshtml", model);
  62. }
  63. [AllowAnonymous]
  64. public IActionResult Mail()
  65. {
  66. ViewBag.Title = "Mail Server Help";
  67. HelpViewModel model = new HelpViewModel();
  68. return View("~/Areas/Help/Views/Help/Mail.cshtml", model);
  69. }
  70. [AllowAnonymous]
  71. public IActionResult Markdown()
  72. {
  73. ViewBag.Title = "Markdown Help";
  74. HelpViewModel model = new HelpViewModel();
  75. return View("~/Areas/Help/Views/Help/Markdown.cshtml", model);
  76. }
  77. [AllowAnonymous]
  78. public IActionResult Mumble()
  79. {
  80. ViewBag.Title = "Mumble Server Help";
  81. HelpViewModel model = new HelpViewModel();
  82. return View("~/Areas/Help/Views/Help/Mumble.cshtml", model);
  83. }
  84. [AllowAnonymous]
  85. public IActionResult RSS()
  86. {
  87. ViewBag.Title = "RSS Help";
  88. HelpViewModel model = new HelpViewModel();
  89. return View("~/Areas/Help/Views/Help/RSS.cshtml", model);
  90. }
  91. [AllowAnonymous]
  92. public IActionResult Tools()
  93. {
  94. ViewBag.Title = "Tool Help";
  95. HelpViewModel model = new HelpViewModel();
  96. return View("~/Areas/Help/Views/Help/Tools.cshtml", model);
  97. }
  98. [AllowAnonymous]
  99. public IActionResult Upload()
  100. {
  101. ViewBag.Title = "Upload Service Help";
  102. HelpViewModel model = new HelpViewModel();
  103. return View("~/Areas/Help/Views/Help/Upload.cshtml", model);
  104. }
  105. }
  106. }