View.cshtml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. @using GreenTree.Nachtragsmanagement.Web.Models.Global;
  2. @{
  3. Layout = "~/Views/Shared/_FunctionLayout.cshtml";
  4. }
  5. @{
  6. var userContext = GreenTree.Nachtragsmanagement.Core.CommonHelper.UserContext();
  7. }
  8. @model GreenTree.Nachtragsmanagement.Web.Models.Admin.AppInfo.AppInfoDataModel
  9. <script>
  10. function checkUpdate() {
  11. devLoadingPanelUpdate.Show();
  12. $.ajax({
  13. method: "POST",
  14. url: '@Url.Action("CheckUpdate", "Admin")',
  15. success: function (response) {
  16. if (!response) return;
  17. devLoadingPanelUpdate.Hide();
  18. if (response.IsUpdateAvailable == true) {
  19. devPopupControlDoUpdate.Show();
  20. }
  21. },
  22. error: function () {
  23. devLoadingPanelUpdate.Hide();
  24. alert("error occured");
  25. }
  26. });
  27. }
  28. function update() {
  29. devPopupControlDoUpdate.Hide();
  30. devLoadingPanelUpdate.SetText("Update wird durchgeführt und die Anwendung anschließend neu gestartet... bitte warten!");
  31. devLoadingPanelUpdate.Show();
  32. $.ajax({
  33. method: "POST",
  34. url: '@Url.Action("Update", "Admin")',
  35. success: function (response) {
  36. window.location = '@Url.Action("ViewUpdateSuccess", "Admin")'
  37. },
  38. error: function () {
  39. devLoadingPanelUpdate.Hide();
  40. alert("error occured");
  41. }
  42. });
  43. }
  44. </script>
  45. <img src="@Url.Content("~/Content/Images/appInfo.png")" style="width: 90%; margin: 38px 5%" />
  46. <table style="margin: 0 5%; width: 90%">
  47. <tbody>
  48. <tr>
  49. <td style="width: 49%">
  50. <div style="margin-bottom: 6px; vertical-align: top">
  51. <b>Verwendete Bibliotheken</b>
  52. </div>
  53. @Html.DevExpress().ListBox(t =>
  54. {
  55. t.Name = "devListBoxAssemblies";
  56. t.Width = new Unit(100, UnitType.Percentage);
  57. t.Height = new Unit(260, UnitType.Pixel);
  58. t.Properties.Columns.Add("Manufacturer", "Hersteller", new Unit(75, UnitType.Percentage));
  59. t.Properties.Columns.Add("Name", "Bibliothek", new Unit(75, UnitType.Percentage));
  60. t.Properties.Columns.Add("Version", "Version", new Unit(25, UnitType.Percentage));
  61. }).BindList(Model.Assemblies).GetHtml()
  62. </td>
  63. <td style="width: 51%; padding-left: 18px; vertical-align: top">
  64. <div style="padding-bottom: 3px; margin-bottom: 3px; vertical-align: top; border-bottom: 1px solid #009688">
  65. <b>Sonstige Informationen</b>
  66. </div>
  67. Basisverzeichnis:<br/>
  68. <i>@Model.BaseDirectory</i>
  69. <div style="width: 90%; margin: 0 5%; text-align: center">
  70. <h3 style="color: #009688">
  71. Aktuelle Programmpaketversion
  72. </h3>
  73. <div style="font-size: 40px; margin: 12px 0">
  74. @GreenTree.Nachtragsmanagement.Core.AppendixVersion.CurrentVersion
  75. </div>
  76. @if (userContext.CurrentUser.HasFunction("Administration-AppInfo-Update"))
  77. {
  78. Html.DevExpress().Button(t =>
  79. {
  80. t.Name = "devButtonUpdate";
  81. t.Text = "Auf Update prüfen";
  82. t.ClientSideEvents.Click = "function (s, e) { checkUpdate(); }";
  83. }).GetHtml();
  84. }
  85. @if (Model.IsUpdate)
  86. {
  87. <div style="margin-top: 12px; color: green; font-size: 28px">
  88. Update erfolgreich!
  89. </div>
  90. }
  91. </div>
  92. </td>
  93. </tr>
  94. </tbody>
  95. </table>
  96. @Html.DevExpress().LoadingPanel(t =>
  97. {
  98. t.Name = "devLoadingPanelUpdate";
  99. t.Text = "Es wird nach Updates geprüft... bitte warten!";
  100. t.Modal = true;
  101. t.Styles.LoadingDiv.Opacity = 0;
  102. }).GetHtml()
  103. @Html.Partial("~/Views/Shared/_PopupDialogYesNo.cshtml", new GreenTree.Nachtragsmanagement.Web.Models.Global.YesNoDialogModel
  104. {
  105. PopupName = "devPopupControlDoUpdate",
  106. Content = "<div class='dialogText' style='padding: 12px'>" +
  107. "Es ist ein Update verfügbar. Sind Sie sicher, dass Sie das Update durchführen möchten? " +
  108. "Der Vorgang kann einige Zeit in Anspruch nehmen.</div>",
  109. HeaderText = "Update durchführen",
  110. YesFunction = "function (s, e) { update(); }"
  111. })