PageRenderTime 49ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/admin/Settings/Advanced.aspx

#
ASP.NET | 192 lines | 181 code | 11 blank | 0 comment | 5 complexity | 13d8e5c99545201ddf60f5a940898ba4 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. <%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="Advanced.aspx.cs" Inherits="admin.Settings.Advanced" %>
  2. <%@ Register src="Menu.ascx" tagname="TabMenu" tagprefix="menu" %>
  3. <asp:Content ID="Content1" ContentPlaceHolderID="cphAdmin" Runat="Server">
  4. <script type="text/javascript">
  5. $(document).ready(function () {
  6. var frm = document.forms.aspnetForm;
  7. $(frm).validate({
  8. onsubmit: false
  9. });
  10. $("#btnSave").click(function (evt) {
  11. if ($(frm).valid())
  12. SaveSettings();
  13. evt.preventDefault();
  14. });
  15. });
  16. function SaveSettings() {
  17. $('.loader').show();
  18. var dto = {
  19. "enableCompression": $("[id$='_cbEnableCompression']").attr('checked'),
  20. "removeWhitespaceInStyleSheets": $("[id$='_cbRemoveWhitespaceInStyleSheets']").attr('checked'),
  21. "compressWebResource": $("[id$='_cbCompressWebResource']").attr('checked'),
  22. "enableOpenSearch": $("[id$='_cbEnableOpenSearch']").attr('checked'),
  23. "requireSslForMetaWeblogApi": $("[id$='_cbRequireSslForMetaWeblogApi']").attr('checked'),
  24. "wwwSubdomain": $('.rblSubdomain input:radio:checked').val(),
  25. "enableTrackBackSend": $("[id$='_cbEnableTrackBackSend']").attr('checked'),
  26. "enableTrackBackReceive": $("[id$='_cbEnableTrackBackReceive']").attr('checked'),
  27. "enablePingBackSend": $("[id$='_cbEnablePingBackSend']").attr('checked'),
  28. "enablePingBackReceive": $("[id$='_cbEnablePingBackReceive']").attr('checked'),
  29. "enableErrorLogging": $("[id$='_cbEnableErrorLogging']").attr('checked'),
  30. "allowRemoteFileDownloads": $("[id$='_cbAllowRemoteFileDownloads']").attr('checked'),
  31. "remoteTimeout": $("[id$='_txtRemoteTimeout']").attr('value'),
  32. "remoteMaxFileSize": $("[id$='_txtRemoteMaxFileSize']").attr('value'),
  33. "galleryFeedUrl": $("[id$='_txtGalleryFeed']").attr('value')
  34. };
  35. $.ajax({
  36. url: SiteVars.ApplicationRelativeWebRoot + "admin/Settings/Advanced.aspx/Save",
  37. type: "POST",
  38. dataType: "json",
  39. contentType: "application/json; charset=utf-8",
  40. data: JSON.stringify(dto),
  41. beforeSend: onAjaxBeforeSend,
  42. success: function (result) {
  43. var rt = result.d;
  44. if (rt.Success)
  45. ShowStatus("success", rt.Message);
  46. else
  47. ShowStatus("warning", rt.Message);
  48. }
  49. });
  50. $('.loader').hide();
  51. return false;
  52. }
  53. function warnProviderChange() {
  54. if ($('#ddlProvider').val() == $('#hdnProvider').val()) {
  55. ShowStatus("warning", "No provider change detected, operation cancelled.");
  56. return false;
  57. }
  58. return confirm('***CRITIAL WARNING***\r\n\r\nAre you sure you wish to modify your Storage Provider?\r\n\r\nWhen you modify your' +
  59. ' storage provider all your uploaded files will be archived, and then moved into your selected provider. Once the move has been completed old File Storage will be deleted.' +
  60. '\r\n\r\nThis operation could take 2-3 minutes where your application may seem unresponsive.\r\n\r\nIt is advised to backup ' +
  61. 'your File Storage locally before completing this request.\r\n\r\nDo NOT refresh the page while your provider is being modified. ' +
  62. '\r\n\r\nAre you sure you wish to continue?');
  63. }
  64. function warnBackupTime() {
  65. return confirm('***CRITICAL WARNING***\r\n\r\nYou have selected to backup your file system.' +
  66. ' This operation will archive all your current files and allow you to download the archive to your local machine.\r\n\r\n' +
  67. 'This operation (depending on the file storage size) could take 2-3 minutes.' +
  68. ' During this time you MUST NOT refresh or reload your browser.\r\n\r\nAre you sure you wish to continue?');
  69. }
  70. </script>
  71. <div class="content-box-outer">
  72. <div class="content-box-right">
  73. <menu:TabMenu ID="TabMenu" runat="server" />
  74. </div>
  75. <div class="content-box-left">
  76. <h1><%=Resources.labels.advancedSettings %></h1>
  77. <ul class="fl leftaligned">
  78. <li>
  79. <label class="lbl" for=""><%=Resources.labels.enableTrackbacks %></label>
  80. <asp:CheckBox runat="server" ID="cbEnableTrackBackSend" /><label><%=Resources.labels.send %></label>
  81. &nbsp;&nbsp;
  82. <asp:CheckBox runat="server" ID="cbEnableTrackBackReceive" /><label><%=Resources.labels.receive %></label>
  83. </li>
  84. <li>
  85. <label for="" class="lbl"><%=Resources.labels.enablePingbacks %></label>
  86. <asp:CheckBox runat="server" ID="cbEnablePingBackSend" /><label><%=Resources.labels.send %></label>
  87. &nbsp;&nbsp;
  88. <asp:CheckBox runat="server" ID="cbEnablePingBackReceive" /><label><%=Resources.labels.receive %></label>
  89. </li>
  90. <li>
  91. <label class="lbl" for="<%=rblWwwSubdomain.ClientID %>"><%=Resources.labels.handleWwwSubdomain %></label>
  92. <asp:RadioButtonList runat="server" CssClass="rblSubdomain" ID="rblWwwSubdomain" RepeatLayout="flow" RepeatDirection="horizontal">
  93. <asp:ListItem Text="<%$ Resources:labels, remove %>" Value="remove" />
  94. <asp:ListItem Text="<%$ Resources:labels, enforce %>" Value="add" />
  95. <asp:ListItem Text="<%$ Resources:labels, ignore %>" Value="" Selected="true" />
  96. </asp:RadioButtonList>
  97. </li>
  98. <li>
  99. <label class="lbl"><%=Resources.labels.otherSettings %></label>
  100. <asp:CheckBox runat="server" ID="cbEnableCompression" />
  101. <label for="<%=cbEnableCompression.ClientID %>"><%=Resources.labels.enableHttpCompression %></label>
  102. <span class="insetHelp">(<%=Resources.labels.enableHttpCompressionDescription %>)</span>
  103. </li>
  104. <li>
  105. <span class="filler"></span>
  106. <asp:CheckBox runat="server" ID="cbRemoveWhitespaceInStyleSheets" />
  107. <label for="<%=cbRemoveWhitespaceInStyleSheets.ClientID %>"><%=Resources.labels.trimStylesheet %></label>
  108. <span class="insetHelp">(<%=Resources.labels.trimStylesheetDescription %>)</span>
  109. </li>
  110. <li>
  111. <span class="filler"></span>
  112. <asp:CheckBox runat="server" ID="cbCompressWebResource" />
  113. <label for="<%=cbCompressWebResource.ClientID %>"><%=Resources.labels.compressWebResource %></label>
  114. <span class="insetHelp">(<%=Resources.labels.compressWebResourceDescription%>)</span>
  115. </li>
  116. <li>
  117. <span class="filler"></span>
  118. <asp:CheckBox runat="server" ID="cbEnableOpenSearch" />
  119. <label for="<%=cbEnableOpenSearch.ClientID %>"><%=Resources.labels.enableOpenSearch %></label>
  120. <span class="insetHelp">(<%=Resources.labels.enableOpenSearchDescription %>)</span>
  121. </li>
  122. <li>
  123. <span class="filler"></span>
  124. <asp:CheckBox runat="server" ID="cbRequireSslForMetaWeblogApi" />
  125. <label for="<%=cbRequireSslForMetaWeblogApi.ClientID %>"><%=Resources.labels.requireSslForMetaWeblogApi %></label>
  126. <span class="insetHelp">(<%=Resources.labels.requireSslForMetaWeblogApiDescription%>)</span>
  127. </li>
  128. <li>
  129. <span class="filler"></span>
  130. <asp:CheckBox runat="server" ID="cbEnableErrorLogging" />
  131. <label for="<%=cbEnableErrorLogging.ClientID %>"><%=Resources.labels.enableErrorLogging %></label>
  132. <span class="insetHelp">(<%=Resources.labels.enableErrorLoggingDescription%>)</span>
  133. </li>
  134. <li>
  135. <label class="lbl" for="<%=txtGalleryFeed.ClientID %>"><%=Resources.labels.galleryFeedUrl%></label>
  136. <asp:TextBox Width="300" runat="server" ID="txtGalleryFeed" />
  137. <span class="belowHelp"><label><%=Resources.labels.galleryFeedUrlDescription%></label></span>
  138. </li>
  139. </ul>
  140. <h2><%=Resources.labels.securitySettings %></h2>
  141. <ul class="fl leftaligned">
  142. <li>
  143. <label class="lbl" for="<%=txtRemoteTimeout.ClientID %>"><%=Resources.labels.remoteTimeout %></label>
  144. <asp:TextBox runat="server" Width="80" ID="txtRemoteTimeout" />
  145. <span class="belowHelp"><label for="<%=txtRemoteTimeout.ClientID %>"><%=Resources.labels.remoteTimeoutDescription %></label></span>
  146. </li>
  147. <li>
  148. <label class="lbl" for="<%=txtRemoteMaxFileSize.ClientID %>"><%=Resources.labels.maximumRemoteFileSize%></label>
  149. <asp:TextBox runat="server" ID="txtRemoteMaxFileSize" />
  150. <span class="belowHelp"><label><%=Resources.labels.maximumRemoteFileSizeDescription%></label></span>
  151. </li>
  152. <li>
  153. <span class="filler"></span>
  154. <asp:CheckBox runat="server" ID="cbAllowRemoteFileDownloads" /><label for="<%=cbAllowRemoteFileDownloads.ClientID %>"><%=Resources.labels.allowRemoteFileDownloads %></label>
  155. <span class="insetHelp"><%=Resources.labels.allowRemoteFileDownloadsDescription%></span>
  156. </li>
  157. </ul>
  158. <h2><%=Resources.labels.filestorage %></h2>
  159. <p>
  160. Modifying your File Storage settings may cause data loss. This operation will move all your files from one storage provider to another storage provider. It is recommended to backup your File storage into a recoverable archive.
  161. </p>
  162. <ul class="fl leftaligned">
  163. <li>
  164. <label class="lbl">Backup File Storage</label>
  165. <asp:Button runat="server" ID="btnDownloadArchive" OnClick="btnDownloadArchive_Click" Text="Start Backup" CssClass="btn rounded" OnClientClick="return warnBackupTime();" />
  166. </li>
  167. <li>
  168. <label class="lbl">Change File Storage Provider</label>
  169. <asp:DropDownList runat="server" ID="ddlProvider" ClientIDMode="Static" /><br />
  170. <asp:HiddenField runat="server" ID="hdnProvider" ClientIDMode="Static" />
  171. <label class="lbl"></label>
  172. <asp:Label runat="server" ID="providerError" ForeColor="Red" Visible="false" />
  173. <asp:Button runat="server" ID="btnChangeProvider" OnClick="btnChangeProvider_Click" Text="Change Provider" CssClass="btn rounded" OnClientClick="return warnProviderChange();" />
  174. </li>
  175. </ul>
  176. <div class="action_buttons">
  177. <input type="submit" id="btnSave" class="btn primary rounded" value="<%=Resources.labels.saveSettings %>" />
  178. </div>
  179. </div>
  180. </div>
  181. </asp:Content>