_UpdateNotesPartial.cshtml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. @using GreenTree.Nachtragsmanagement.Web.Models.Global;
  2. @model GreenTree.Nachtragsmanagement.Web.Models.Admin.AppInfo.AppUpdateDataModel
  3. <div class="updateContainer">
  4. <script>
  5. function update() {
  6. devPopupControlDoUpdate.Hide();
  7. devLoadingPanelUpdate.SetText("Update wird durchgeführt und die Anwendung anschließend neu gestartet... bitte warten!");
  8. devLoadingPanelUpdate.Show();
  9. $.ajax({
  10. method: "POST",
  11. url: '@Url.Action("Update", "Admin")',
  12. success: function (response) {
  13. window.location = '@Url.Action("ViewUpdateSuccess", "Admin")'
  14. },
  15. error: function () {
  16. devLoadingPanelUpdate.Hide();
  17. alert("error occured");
  18. }
  19. });
  20. }
  21. </script>
  22. @Html.DevExpress().PopupControl(s =>
  23. {
  24. s.Name = "devPopupControlDoUpdate";
  25. s.HeaderText = "Update durchführen";
  26. s.Modal = true;
  27. s.Width = new Unit(450, UnitType.Pixel);
  28. s.CloseAction = CloseAction.CloseButton;
  29. s.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
  30. s.PopupVerticalAlign = PopupVerticalAlign.TopSides;
  31. s.PopupVerticalOffset = 50;
  32. s.AllowDragging = false;
  33. s.AllowResize = false;
  34. s.ShowFooter = false;
  35. s.ShowOnPageLoad = true;
  36. s.SetContent(() =>
  37. {
  38. ViewContext.Writer.Write(
  39. "<div class='dialogText' style='padding: 12px'>" +
  40. "<h2>Es ist ein Update verfügbar (v" + Model.UpdateVersion + ")</h2>" +
  41. "Beschreibung:<br />" +
  42. "<div style='margin: 6px 0 12px; padding: 6px 4px; border-top: 1px solid #009688; border-bottom: 1px solid #009688;" +
  43. "min-height: 80px; max-height: 150px; overflow: auto'>" +
  44. Model.UpdateDescription + "</div>" +
  45. "<p><b>Sind Sie sicher, dass Sie das Update durchführen möchten? " +
  46. "Der Vorgang kann einige Zeit in Anspruch nehmen.<br /><br />" +
  47. "Die Anwendung wird anschließend neu gestartet!</b></p>" +
  48. "</div>");
  49. Html.RenderPartial(
  50. "~/Views/Shared/_PopupButtonPanel.cshtml",
  51. new GreenTree.Nachtragsmanagement.Web.Models.Global.PopupModel
  52. {
  53. PopupName = "devPopupControlDoUpdate",
  54. AcceptFunction = "function (s, e) { update(); }"
  55. }
  56. );
  57. });
  58. s.Styles.Content.Paddings.Padding = new Unit(0);
  59. s.Styles.ModalBackground.Opacity = 0;
  60. }).GetHtml()
  61. </div>