174 lines
		
	
	
		
			6.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			174 lines
		
	
	
		
			6.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| <%@ Page Title="" Language="C#" MasterPageFile="~/SystemSettings/SysSettingMasterPage.master" AutoEventWireup="true" CodeFile="SystemParams.aspx.cs" Inherits="SystemParams" %>
 | |
| 
 | |
| <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
 | |
|     <style type="text/css">
 | |
|         .label {
 | |
|             min-width: 100px;
 | |
|             font-weight: bold;
 | |
|             padding-right: 10px;
 | |
|             text-align: right;
 | |
|         }
 | |
| 
 | |
|         .table_params {
 | |
|             width: 100%;
 | |
|             color: #666;
 | |
|             border-collapse: collapse;
 | |
|             table-layout: fixed;
 | |
|         }
 | |
| 
 | |
|             .table_params thead tr {
 | |
|                 background: #f9f9f9;
 | |
|                 /*font-weight: bold;*/
 | |
|             }
 | |
| 
 | |
|             .table_params tbody tr {
 | |
|                 border-bottom: 1px solid #e6e6e6;
 | |
|             }
 | |
| 
 | |
|                 .table_params tbody tr:hover {
 | |
|                     background: #f9f9f9;
 | |
|                 }
 | |
|     </style>
 | |
|     <script type="text/javascript">
 | |
| 
 | |
|         function systemparamsrequest(method, param, callback, error) {
 | |
|             _network.request("SystemSettings/SystemParams.aspx", -1, method, param, callback, error || function (e) {
 | |
|                 console.log(e);
 | |
|                 showmaskbg(false, true);
 | |
|                 showAlert(GetTextByKey('P_SET_QUERY', 'An unknown error occurred.  Please refresh page.'), GetTextByKey('P_SET_QUERY', 'Query'));
 | |
|             });
 | |
|         }
 | |
| 
 | |
|         function OnRefresh() {
 | |
|             showloading(true);
 | |
|             systemparamsrequest("GetSystemParams", "", function (data) {
 | |
|                 showloading(false);
 | |
|                 if (typeof (data) === "string") {
 | |
|                     showAlert(data, GetTextByKey("P_SET_ERROR", 'Error'));
 | |
|                     return;
 | |
|                 }
 | |
|                 showSystemParams(data);
 | |
|             }, function (err) {
 | |
|                 showloading(false);
 | |
|             });
 | |
|         }
 | |
| 
 | |
| 
 | |
|         function showSystemParams(data) {
 | |
|             var tb = $("#tbody_systemparams");
 | |
|             tb.empty();
 | |
|             if (data && data.length > 0) {
 | |
|                 for (var i = 0; i < data.length; i++) {
 | |
|                     var param = data[i];
 | |
|                     var tr = $('<tr></tr>').data('param', param).dblclick(function () {
 | |
|                         openSystemParam(this);
 | |
|                     });
 | |
|                     tb.append(tr);
 | |
|                     var td = $('<td style="padding-left:10px;"></td>').text(param.Key);
 | |
|                     tr.append(td);
 | |
|                     td = $('<td></td>').text(param.Value);
 | |
|                     tr.append(td);
 | |
|                     td = $('<td></td>');
 | |
|                     tr.append(td);
 | |
|                     var span = $('<span class="sbutton iconedit" title="' + GetTextByKey('P_SET_XXX', 'Edit') + '"></span>').data('param', param).click(function () {
 | |
|                         openSystemParam(this);
 | |
|                     });
 | |
|                     td.append(span);
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         var paramname;
 | |
|         function openSystemParam(e) {
 | |
|             var param = $(e).data('param')
 | |
|             if (!param) {
 | |
|                 return;
 | |
|             }
 | |
|             paramname = param.Key;
 | |
|             $('#dialog_paramvalue').val(param.Value);
 | |
|             $('#dialog_systemparam .dialog-title span.title').text(paramname);
 | |
|             showmaskbg(true);
 | |
|             $('#dialog_systemparam')
 | |
|                 .css({
 | |
|                     'top': (document.documentElement.clientHeight - $('#dialog_systemparam').height()) / 3,
 | |
|                     'left': (document.documentElement.clientWidth - $('#dialog_systemparam').width()) / 2
 | |
|                 }).showDialogfixed();
 | |
|             $('#dialog_paramvalue').focus();
 | |
|         }
 | |
| 
 | |
| 
 | |
|         function onSetSystemParams() {
 | |
|             var value = $('#dialog_paramvalue').val();
 | |
|             var item = [paramname, value];
 | |
|             var param = JSON.stringify(item);
 | |
|             param = htmlencode(param);
 | |
|             var alerttitle = GetTextByKey('P_SET_XXX', 'System Param')
 | |
|             systemparamsrequest("SetSystemParams", param, function (data) {
 | |
|                 if (data !== 'OK') {
 | |
|                     showAlert(data, alerttitle);
 | |
|                     return;
 | |
|                 }
 | |
|                 showmaskbg(false);
 | |
|                 $('#dialog_systemparam').hideDialog();
 | |
|                 OnRefresh();
 | |
|             }, function (err) {
 | |
|                 showmaskbg(false);
 | |
|             });
 | |
| 
 | |
|         }
 | |
| 
 | |
|         $(function () {
 | |
|             setPageTitle(GetTextByKey("P_SET_XXX", 'System Params'), true);
 | |
|             $('#dialog_systemparam').dialog(function () {
 | |
|                 showmaskbg(false);
 | |
|             });
 | |
|             OnRefresh();
 | |
| 
 | |
|             $(window).resize(function () {
 | |
|                 $("#paramslist").css("height", $(window).height() - $("#paramslist").offset().top - 4);
 | |
|             }).resize();
 | |
|         });
 | |
| 
 | |
|     </script>
 | |
| </asp:Content>
 | |
| <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
 | |
|     <div style="padding: 0px; margin: 0px;">
 | |
|         <div class="page_title" data-lgid="P_SET_XXX">System Params</div>
 | |
|         <div class="function_title">
 | |
|             <span class="sbutton iconrefresh" onclick="OnRefresh();" data-lgid="P_SET_REFRESH">Refresh</span>
 | |
|         </div>
 | |
|         <div class="clear"></div>
 | |
|         <div id="paramslist" class="content_main content_div">
 | |
|             <table class="table_params" style="line-height: 30px; width: 100%;">
 | |
|                 <thead>
 | |
|                     <tr style="text-align: left;">
 | |
|                         <th style="width: 200px; padding-left: 10px;">Name</th>
 | |
|                         <th style="width: 600px;">Value</th>
 | |
|                         <th style="width: 50px;"></th>
 | |
|                     </tr>
 | |
|                 </thead>
 | |
|                 <tbody id="tbody_systemparams"></tbody>
 | |
|             </table>
 | |
|         </div>
 | |
|     </div>
 | |
| 
 | |
|     <div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
 | |
|     <div class="dialog" id="dialog_systemparam" style="display: none; width: 500px;">
 | |
|         <div class="dialog-title"><span class="title"></span><em class="dialog-close"></em></div>
 | |
|         <div class="dialog-content">
 | |
|             <table>
 | |
|                 <tr>
 | |
|                     <td>
 | |
|                         <textarea id="dialog_paramvalue" tabindex="1" style="width: 475px; height: 200px;"></textarea></td>
 | |
|                 </tr>
 | |
|             </table>
 | |
|         </div>
 | |
|         <div class="dialog-func">
 | |
|             <input type="button" value="Cancel" data-lgid="P_SET_CANCEL" class="dialog-close" tabindex="8" />
 | |
|             <input type="button" onclick="onSetSystemParams();" value="OK" data-lgid="P_SET_OK" tabindex="7" />
 | |
|             <div class="clear"></div>
 | |
|         </div>
 | |
|     </div>
 | |
| </asp:Content>
 | |
| 
 |