yzh
2022-05-26 3b18a48485f7207438d9d0eb3038d979e069431d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<%@ Page Language="C#" masterpagefile="~/Main.master" AutoEventWireup="true" CodeFile="Setting.aspx.cs" Inherits="SettingPage" %>
<asp:Content ID="Content3" ContentPlaceHolderID="title" runat="Server">
    告警参数设置
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script>
        $(function () {
            var setting = <%=Newtonsoft.Json.JsonConvert.SerializeObject(this.Setting) %>
 
            var smtpProfile = $.evalJSON(setting.SmtpProfile);
            var wxProfile =  $.evalJSON(setting.WxProfile);
            var sms57Profile =  $.evalJSON(setting.SmsProfile);
 
            $("#SmtpServer").val(smtpProfile.SmtpServer);
            $("#SmtpPort").val(smtpProfile.SmtpPort);
            $("#SmtpUsername").val(smtpProfile.Username);
            $("#SmtpPassword").val(smtpProfile.Password);
            $("#SmtpSenderAddress").val(smtpProfile.SenderAddress);
            $("#SmtpSSL").iCheck(smtpProfile.SSL ? "check": "uncheck");
 
            $("#WxAppID").val(wxProfile.AppID);
            $("#WxAppSecret").val(wxProfile.AppSecret);
            $("#WxMsgTemplateID").val(wxProfile.MsgTemplateID);
 
            $("#SmsUserID").val( sms57Profile.UserID);
            $("#SmsAccount").val(sms57Profile.Account );
            $("#SmsPassword").val(sms57Profile.Password );
            $("#SmsMTURL").val(sms57Profile.MTURL);
            $("#SmsExtNo").val(sms57Profile.ExtNo);
            $("#CmSegments").val(setting.CmSegments);
            $("#CuSegments").val(setting.CuSegments);
            $("#CtSegments").val(setting.CtSegments);
            $("#GwName").val(setting.GwName);
            $("#BlackMoContent").val(setting.BlackMoContent);
 
 
 
            $(".action-save").on("click", function () {
                smtpProfile.SmtpServer = $("#SmtpServer").val();
                smtpProfile.SmtpPort = $("#SmtpPort").val();
                smtpProfile.Username = $("#SmtpUsername").val();
                smtpProfile.Password = $("#SmtpPassword").val();
                smtpProfile.SenderAddress = $("#SmtpSenderAddress").val();
                smtpProfile.SSL = $("#SmtpSSL").is(":checked") ? 1 : 0;
 
                wxProfile.AppID = $("#WxAppID").val();
                wxProfile.AppSecret = $("#WxAppSecret").val();
                wxProfile.MsgTemplateID = $("#WxMsgTemplateID").val();
                sms57Profile.UserID = $("#SmsUserID").val();
                sms57Profile.Account = $("#SmsAccount").val();
                sms57Profile.Password = $("#SmsPassword").val();
                sms57Profile.MTURL = $("#SmsMTURL").val();
                sms57Profile.ExtNo = $("#SmsExtNo").val();
 
                $.ajax({
                    url: "setting.ashx",
                    method: "POST",
                    data: { action: "save",
                        "smsProfile": $.toJSON(sms57Profile),
                        "smtpProfile": $.toJSON(smtpProfile),
                        "wxProfile": $.toJSON(wxProfile),
                        "cmSegments":$("#CmSegments").val(),
                        "cuSegments":$("#CuSegments").val(),
                        "ctSegments":$("#CtSegments").val(),
                        "gwName":$("#GwName").val(),
                        "blackMoContent":$("#BlackMoContent").val()
 
                    },
                    success: function (result) {
                        if (result.OK) {
                            mytek.alert(result.Message,"success");
                        } else {
                            mytek.alert(result.Message,"warning");
                        }
                    }
                });
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server">
    <form name="DefaultForm" method="post" action="GwSpUpdate.aspx" id="DefaultForm"
    class="form-horizontal">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                基础设置
            </div>
            
            
 
 
            <div class="ibox-content">
                <div class="form-group">
                    <label class="control-label">
                        网关显示名称
                    </label>
                    <div>
                        <input type="text" name="GwName" id="GwName" value="" class="form-control" />
                    </div>
                </div>
                <div class="form-group hide">
                    <label class="control-label">
                        版权信息
                    </label>
                    <div>
                        <input type="text" name="CopyRights" id="CopyRights" value="" class="form-control" />
                    </div>
                </div>
                <div class="form-group hide">
                    <label class="control-label">
                        欢迎信息
                    </label>
                    <div>
                        <input type="text" name="WelcomeMessage" id="WelcomeMessage" value="" class="form-control" />
                    </div>
                </div>
                
                 <div class="form-group">
                    <label class="control-label">
                        手机上行自动加黑(多个上行内容之间用英文分号" ; "分割,内容中可以使用通配符" * ",每个 * 号代表0-10个字符)
                    </label>
                    <div>
                        <input type="text" value="" maxlength="1000" name="BlackMoContent" id="BlackMoContent" class="form-control" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')" 
                            onpaste="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')" oncontextmenu = "value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')" />
                    </div>
                </div>
                
            </div>
        </div>
    </div>
    <div class="col-sm-6 ">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                短信告警设置
            </div>
            <div class="ibox-content">
                <div class="form-group">
                    <label class="control-label">
                        USERID(接本SMGW网关平台,该值为0)</label>
                    <input type="text" value="" name="SmsUserID" id="SmsUserID" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        账号</label>
                    <input type="text" value="" name="SmsAccount" id="SmsAccount" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        密码</label>
                    <input type="password" value="" name="SmsPassword" id="SmsPassword" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        下发号码(或扩展码)</label>
                    <input type="text" value="" name="SmsExtNo" id="SmsExtNo" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        短信提交地址</label>
                    <input type="text" value="" name="SmsMTURL" id="SmsMTURL" class="form-control" />
                </div>
            </div>
        </div>
    </div>
    <div class="col-sm-6 ">
        <div class="ibox  float-e-margins">
            <div class="ibox-title">
                邮件告警设置
            </div>
            <div class="ibox-content">
                <div class="form-group ">
                    <label class="control-label">
                        SMTP服务器</label>
                    <input type="text" value="" name="SmtpServer" id="SmtpServer" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        SMTP端口</label>
                    <input type="text" value="" name="SmtpPort" id="SmtpPort" class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        发送方邮件地址</label><input type="text" value="" name="SmtpSenderAddress" id="SmtpSenderAddress"
                            class="form-control" />
                </div>
                <div class="form-group">
                    <label class="control-label">
                        登录账号</label><input type="text" value="" name="SmtpUsername" id="SmtpUsername" class="form-control" />
                </div>
                <div class="form-group ">
                    <label class="control-label">
                        登录密码</label>
                    <input type="password" value="" name="SmtpPassword" id="SmtpPassword" class="form-control" />
                </div>
                <div class="form-group ">
                    <label class="control-label">
                        是否支持SSL</label>
                    <input type="checkbox" value="" name="SmtpSSL" id="SmtpSSL" class="form-control icheck-me" />
                </div>
            </div>
        </div>
    </div>
    <div class="ibox">
        <div class="ibox-content">
            <input class="action-save btn btn-primary pull-right" value="保存" type="button" />
        </div>
    </div>
    </form>
</asp:Content>