zhaolei
7 days ago 921de2254ff5712a44ed8575ee8efe34252f6603
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
@inherits SettingsBase
 
<ConditionComponent AuthKey="saveTitle">
    <div class="card">
        <div class="card-header">系统名称设置</div>
        <div class="card-body">
            <ConditionComponent>
                <div class="alert alert-danger" role="alert">
                    <span>演示系统禁止更改系统名称</span>
                </div>
            </ConditionComponent>
            <div class="form-group">
                <div class="input-group">
                    <input type="text" class="form-control" placeholder="请输入网站标题,50字以内" @bind-value="@Model.Title" />
                    <ConditionComponent Inverse="true">
                        <div class="input-group-append">
                            <button class="btn btn-secondary" type="button" @onclick="SaveWebTitle">保存</button>
                        </div>
                    </ConditionComponent>
                </div>
            </div>
        </div>
    </div>
</ConditionComponent>
<ConditionComponent AuthKey="saveFooter">
    <div class="card">
        <div class="card-header">网站页脚设置</div>
        <div class="card-body">
            <ConditionComponent>
                <div class="alert alert-danger" role="alert">
                    <span>演示系统禁止更改网站页脚</span>
                </div>
            </ConditionComponent>
            <div class="form-group">
                <div class="input-group">
                    <input type="text" class="form-control" id="sysFoot" placeholder="请输入网站页脚,50字以内" @bind-value="@Model.Footer" />
                    <ConditionComponent Inverse="true">
                        <div class="input-group-append">
                            <button class="btn btn-secondary" type="button" @onclick="SaveWebFooter">保存</button>
                        </div>
                    </ConditionComponent>
                </div>
            </div>
        </div>
    </div>
</ConditionComponent>
<div class="card">
    <div class="card-header"><label class="control-label" data-toggle="lgbinfo" data-content="通过此功能进行整个网站的登录界面设置">后台管理登录地址设置</label></div>
    <div class="card-body">
        <div class="form-group">
            <div class="form-group text-right">
                <div class="btn-group" role="group">
                    <Dropdown @bind-Value="@Model.SelectedLogin" Items="@Model.Logins"></Dropdown>
                    <button class="btn btn-secondary" type="button">保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="card">
    <div class="card-header"><label class="control-label" data-toggle="lgbinfo" data-content="此功能给前台网站拼接后台功能菜单时使用">后台管理地址设置</label></div>
    <div class="card-body" data-toggle="LgbValidate" data-valid-button="[data-method='appPath']">
        <ConditionComponent>
            <div class="alert alert-danger" role="alert">
                <span>演示系统禁止更改后台管理地址</span>
            </div>
        </ConditionComponent>
        <div class="form-group">
            <div class="input-group">
                <input type="text" class="form-control flex-fill" placeholder="请输入后台管理地址,2000字以内" value="@Model.AdminPathBase" maxlength="2000" data-valid="true" />
                <ConditionComponent Inverse="true">
                    <div class="input-group-append">
                        <button class="btn btn-secondary" type="button" data-method="appPath">保存</button>
                    </div>
                </ConditionComponent>
            </div>
        </div>
    </div>
</div>
<div class="card" asp-auth="app">
    <div class="card-header">前台应用设置</div>
    <div class="card-body">
        <ConditionComponent>
            <div class="alert alert-danger" role="alert">
                <span>演示系统禁止更改前台应用设置</span>
            </div>
        </ConditionComponent>
        <div class="form-inline">
            <div class="row" id="appList">
                @foreach (var app in Model.Apps)
                {
                    <div class="form-group col-12 app" data-key="@app.Key">
                        <label class="control-label" for="@app.Key">@app.Name</label>
                        <div class="input-group flex-fill">
                            <input id="@app.Key" class="form-control" value="@app.Url" readonly />
                            <ConditionComponent Inverse="true">
                                <div class="input-group-append">
                                    <button class="btn btn-danger" type="button" data-key="@app.Key" data-method="delApp"><i class="fa fa-trash-o"></i><span>删除</span></button>
                                    <button class="btn btn-primary" type="button" data-key="@app.Key" data-method="editApp"><i class="fa fa fa-pencil"></i><span>编辑</span></button>
                                </div>
                            </ConditionComponent> 
                        </div>
                    </div>
                }
            </div>
        </div>
    </div>
    <ConditionComponent Inverse="true">
        <div class="card-footer text-right">
            <button class="btn btn-secondary" type="button" data-method="addApp"><i class="fa fa-plus"></i><span>新增</span></button>
        </div>
    </ConditionComponent>
</div>
<ConditionComponent AuthKey="saveTheme">
    <div class="card">
        <div class="card-header">网站样式设置</div>
        <div class="card-body">
            <div class="alert alert-info" role="alert">
                <span>注意:<b><a class="badge-pill" href="@("~/Admin/Profiles".ToBlazorMenuUrl())">个人中心</a></b>中设置的网站样式覆盖本设置</span>
            </div>
            <div class="form-group text-right">
                <div class="btn-group" role="group">
                    <div class="btn-group" role="group">
                        <button id="dictCssDefine" class="btn btn-success dropdown-select dropdown-toggle" data-toggle="dropdown" data-default-val="" value="@Model.Theme">默认样式</button>
                        <div class="dropdown-menu">
                            <a href="#" data-val="">默认样式</a>
                            @foreach (var css in Model.Themes)
                            {
                                <a href="#" data-val="@css.Code">@css.Name</a>
                            }
                        </div>
                    </div>
                    <button class="btn btn-secondary" type="button" data-method="css">保存</button>
                </div>
            </div>
        </div>
    </div>
</ConditionComponent>
<ConditionComponent AuthKey="saveUISettings">
    <div class="card">
        <div class="card-header">网站功能设置</div>
        <div class="card-body">
            <div class="form-inline">
                <div class="row">
                    <div class="form-group col-6">
                        <label class="control-label" for="sider">侧边栏设置</label>
                        <Toggle @bind-Value="@Model.ShowSideBar"></Toggle>
                    </div>
                    <div class="form-group col-6">
                        <label class="control-label" for="cardTitle">标题设置</label>
                        <Toggle @bind-Value="@Model.ShowCardTitle" OnText="显示" OffText="关闭"></Toggle>
                    </div>
                    <div class="form-group col-6">
                        <label class="control-label" for="cardTitle">固定表头</label>
                        <Toggle @bind-Value="@Model.FixedTableHeader" OnText="固定" OffText="跟随"></Toggle>
                    </div>
                    <div class="form-group col-6">
                        <label class="control-label" for="cardTitle">健康检查</label>
                        <Toggle @bind-Value="@Model.EnableHealth" OnText="开启" OffText="关闭"></Toggle>
                    </div>
                </div>
            </div>
        </div>
        <div class="card-footer text-right">
            <button class="btn btn-secondary" type="button" @onclick="SaveWebSettings"><i class="fa fa-save"></i><span>保存</span></button>
        </div>
    </div>
</ConditionComponent>
<ConditionComponent AuthKey="loginSettings">
    <div class="card" asp-auth="loginSettings">
        <div class="card-header">网站登录设置</div>
        <div class="card-body">
            <ConditionComponent>
                <div class="alert alert-danger" role="alert">
                    <span>演示系统禁止更改网站登录设置</span>
                </div>
            </ConditionComponent>
            <div class="form-inline">
                <div class="row">
                    <div class="form-group col-6">
                        <label class="control-label" for="mobile">手机登录</label>
                        <Toggle @bind-Value="@Model.ShowMobile" OnText="允许" OffText="关闭"></Toggle>
                    </div>
                    <div class="form-group col-6">
                        <label class="control-label" for="cardTitle">OAuth 认证</label>
                        <Toggle @bind-Value="@Model.ShowOAuth" OnText="允许" OffText="关闭"></Toggle>
                    </div>
                </div>
            </div>
        </div>
        <ConditionComponent Inverse="true">
            <div class="card-footer text-right">
                <button class="btn btn-secondary" type="button" @onclick="SaveLogin"><i class="fa fa-save"></i><span>保存</span></button>
            </div>
        </ConditionComponent>
    </div>
</ConditionComponent>
<ConditionComponent AuthKey="lockScreen">
    <div class="card">
        <div class="card-header">自动锁屏设置</div>
        <div class="card-body">
            <div class="form-inline">
                <div class="row">
                    <div class="form-group col-6">
                        <label class="control-label" for="lockScreen">自动锁屏</label>
                        <Toggle @bind-Value="@Model.AutoLockScreen" OnText="开启" OffText="关闭"></Toggle>
                    </div>
                    <div class="form-group col-6">
                        <label class="control-label" for="lockPeriod">时长间隔(秒)</label>
                        <input id="lockPeriod" type="number" class="form-control" @bind-value="@Model.LockScreenPeriod" />
                    </div>
                </div>
            </div>
        </div>
        <div class="card-footer text-right">
            <button class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
        </div>
    </div>
</ConditionComponent>
<ConditionComponent AuthKey="lockScreen">
    <div class="card" asp-auth="defaultApp">
        <div class="card-header">默认应用设置</div>
        <div class="card-body">
            <div class="alert alert-info" role="alert">
                <span>开启此功能后用户登录时默认导航到第一个已授权的前台应用</span>
            </div>
            <div class="form-inline">
                <div class="row">
                    <div class="form-group col-6">
                        <label class="control-label" for="defaultApp">默认应用</label>
                        <Toggle @bind-Value="@Model.DefaultApp" OnText="开启" OffText="关闭"></Toggle>
                    </div>
                </div>
            </div>
        </div>
        <div class="card-footer text-right">
            <button class="btn btn-secondary" type="button" @onclick="SaveDefaultApp"><i class="fa fa-save"></i><span>保存</span></button>
        </div>
    </div>
</ConditionComponent>
<ConditionComponent AuthKey="blazor">
    <div class="card">
        <div class="card-header">网站设置</div>
        <div class="card-body">
            <div class="alert alert-info" role="alert">
                <span>开启此功能网站增加 Blazor 与 MVC 切换挂件</span>
            </div>
            <div class="form-inline">
                <div class="row">
                    <div class="form-group col-6">
                        <label class="control-label" for="blazor">MVC 切换</label>
                        <Toggle @bind-Value="@Model.EnableBlazor" OnText="开启" OffText="关闭"></Toggle>
                    </div>
                </div>
            </div>
        </div>
        <div class="card-footer text-right">
            <button class="btn btn-secondary" type="button" @onclick="SaveBlazor"><i class="fa fa-save"></i><span>保存</span></button>
        </div>
    </div>
</ConditionComponent>
<ConditionComponent AuthKey="iplocate">
    <div class="card">
        <div class="card-header">地址位置信息</div>
        <div class="card-body">
            <ConditionComponent>
                <div class="alert alert-danger" role="alert">
                    <span>演示系统禁止更改地理信息配置</span>
                </div>
            </ConditionComponent>
            <div class="form-group">
                <Dropdown @bind-Value="@Model.SelectedIPLocator" Items="@Model.IPLocators"></Dropdown>
            </div>
        </div>
        <ConditionComponent Inverse="true">
            <div class="card-footer text-right">
                <button class="btn btn-secondary" type="button" @onclick="SaveIPLocator"><i class="fa fa-save"></i><span>保存</span></button>
            </div>
        </ConditionComponent>
    </div>
</ConditionComponent>
<ConditionComponent AuthKey="logSettings">
    <div class="card">
        <div class="card-header">地址位置信息</div>
        <div class="card-body">
            <ConditionComponent>
                <div class="alert alert-danger" role="alert">
                    <span>演示系统禁止更改日志缓存设置</span>
                </div>
            </ConditionComponent>
            <div class="form-inline">
                <div class="row">
                    <div class="form-group col-6">
                        <label class="control-label" for="appErrorLog">异常日志(月)</label>
                        <input id="appErrorLog" type="number" class="form-control" min="1" @bind-value="@Model.ErrorLogPeriod" />
                    </div>
                    <div class="form-group col-6">
                        <label class="control-label" for="opLog">操作日志(月)</label>
                        <input id="opLog" type="number" class="form-control" min="1" @bind-value="@Model.OpLog" />
                    </div>
                    <div class="form-group col-6">
                        <label class="control-label" for="logLog">登录日志(月)</label>
                        <input id="logLog" type="number" class="form-control" min="1" @bind-value="@Model.LogLog" />
                    </div>
                    <div class="form-group col-6">
                        <label class="control-label" for="traceLog">访问日志(月)</label>
                        <input id="traceLog" type="number" class="form-control" min="1" @bind-value="@Model.TraceLog" />
                    </div>
                    <div class="form-group col-6">
                        <label class="control-label" for="cookiePeriod">Cookie(天)</label>
                        <input id="cookiePeriod" type="number" class="form-control" min="1" @bind-value="@Model.CookiePeriod" />
                    </div>
                    <div class="form-group col-6">
                        <label class="control-label" for="ipCachePeriod">IP 缓存(分)</label>
                        <input id="ipCachePeriod" type="number" class="form-control" min="1" @bind-value="@Model.IPCachePeriod" />
                    </div>
                </div>
            </div>
        </div>
        <ConditionComponent Inverse="true">
            <div class="card-footer text-right">
                <button class="btn btn-secondary" type="button" @onclick="SaveLogSettings"><i class="fa fa-save"></i><span>保存</span></button>
            </div>
        </ConditionComponent>
    </div>
</ConditionComponent>
<div class="card" asp-auth="demo">
    <div class="card-header">演示系统设置</div>
    <div class="card-body">
        <div class="form-inline">
            <div class="row">
                <div class="form-group col-6">
                    <label class="control-label" data-toggle="lgbinfo" data-content="开启此功能网站切换至演示系统">演示系统</label>
                    <Toggle @bind-Value="@Model.EnableDemo" OnText="开启" OffText="关闭"></Toggle>
                </div>
                <div class="form-group col-6">
                    <label class="control-label" for="authKey">授权码</label>
                    <input type="password" autocomplete="off" class="form-control" @bind-value="@Model.AuthKey" />
                </div>
            </div>
        </div>
    </div>
    <div class="card-footer text-right">
        <button class="btn btn-secondary" type="button" @onclick="SaveSystemModel"><i class="fa fa-save"></i><span>保存</span></button>
    </div>
</div>
<div class="card">
    <div class="card-header">
        <span>网站缓存设置</span>
    </div>
    <div class="card-body">
        <Table Id="settings-cache" TItem="Prow.Cache.ICacheItem" ShowToolBar="true" ShowRefresh="true" ShowExtendButtons="true" EditModel="ConsoleCaCheModel" OnQuery="QueryData">
            <TableHeader>
                <LgbTableHeader TItem="string" @bind-Value="@context.Desc"></LgbTableHeader>
                <LgbTableHeader TItem="int" @bind-Value="@context.Interval"></LgbTableHeader>
                <LgbTableHeader TItem="string" @bind-Value="@context.Key"></LgbTableHeader>
                <LgbTableHeader TItem="string" @bind-Value="@context.Value"></LgbTableHeader>
                <LgbTableHeader TItem="int" @bind-Value="@context.ElapsedSeconds"></LgbTableHeader>
            </TableHeader>
            <RowTemplate>
                <td>@context.Desc</td>
                <td>@(context.Interval / 1000)</td>
                <td>@context.Key</td>
                <td>@context.Value</td>
                <td>@context.ElapsedSeconds</td>
            </RowTemplate>
            <TableToolbarTemplate>
                <TableToolbarButton class="btn btn-danger" Icon="fa fa-trash-o" Title="一键清除" OnClick="ClearCache" />
            </TableToolbarTemplate>
            <ButtonTemplate>
                <button class='btn btn-sm btn-danger' asp-auth="del" @onclick="e => DeleteCache(context.Key)"><i class='fa fa-remove'></i><span>删除</span></button>
            </ButtonTemplate>
        </Table>
    </div>
</div>