kongdeqiang
2022-12-16 daf6a95086087ec99232eea8b4648b7541881f7c
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
376
377
378
379
380
381
382
383
384
385
package com.wgcloud.config;
 
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
 
 
@Data
@Configuration
@ConfigurationProperties(prefix = "base")
public class CommonConfig {
 
 
    //admin管理员密码
    private String account = "admin";
    private String accountPwd = "111111";
    private String guestAccount = "guest";
    private String guestAccountPwd = "111111";
    private String wgToken = "";
    private String dashView;
    private String dashViewIpHide;
    private String dapingView;
    private Integer dbTableTimes = 3600;
    private Integer heathTimes = 600;
    private Integer dceTimes = 900;
    private Integer snmpTimes = 900;
    private Integer warnCacheTimes = 7200;
    private String nodeType = "master";
    private Integer historyDataOut = 10;
    private Integer pageSize = 20;
    private String copyRight;
    private String icoUrl = "";
    private String logoUrl = "";
    private String wgName = "";
    private String wgShortName = "";
    private String webSsh;
    private Integer webSshPort = 9998;
    private String sidebarCollapse;
    private String showWarnCount;
    private String shellToRun;
    private String shellToRunLinuxBlock;
    private String shellToRunWinBlock;
    private String sqlInKeys;
    private String daemonUrl;
    private String mailTitlePrefix;
    private String mailContentSuffix;
    private String hostGroup;
    private String userInfoManage;
 
    public String getAccount() {
        return account;
    }
 
    public void setAccount(String account) {
        this.account = account;
    }
 
    public String getAccountPwd() {
        return accountPwd;
    }
 
    public void setAccountPwd(String accountPwd) {
        this.accountPwd = accountPwd;
    }
 
    public String getWgToken() {
        return wgToken;
    }
 
    public void setWgToken(String wgToken) {
        this.wgToken = wgToken;
    }
 
 
    public String getDashView() {
        if (StringUtils.isEmpty(dashView)) {
            return "true";
        }
        return dashView;
    }
 
    public void setDashView(String dashView) {
        this.dashView = dashView;
    }
 
    public Integer getDbTableTimes() {
        if (dbTableTimes == null) {
            return 3600;
        }
        return dbTableTimes;
    }
 
    public void setDbTableTimes(Integer dbTableTimes) {
        this.dbTableTimes = dbTableTimes;
    }
 
    public Integer getHeathTimes() {
        if (heathTimes == null) {
            return 600;
        }
        return heathTimes;
    }
 
    public void setHeathTimes(Integer heathTimes) {
        this.heathTimes = heathTimes;
    }
 
    public String getNodeType() {
        return nodeType;
    }
 
    public void setNodeType(String nodeType) {
        this.nodeType = nodeType;
    }
 
    public Integer getHistoryDataOut() {
        if (historyDataOut == null) {
            return 10;
        }
        return historyDataOut;
    }
 
    public void setHistoryDataOut(Integer historyDataOut) {
        this.historyDataOut = historyDataOut;
    }
 
    public Integer getWarnCacheTimes() {
        if (warnCacheTimes == null) {
            return 3600;
        }
        return warnCacheTimes;
    }
 
    public void setWarnCacheTimes(Integer warnCacheTimes) {
        this.warnCacheTimes = warnCacheTimes;
    }
 
    public String getIcoUrl() {
        return icoUrl;
    }
 
    public void setIcoUrl(String icoUrl) {
        this.icoUrl = icoUrl;
    }
 
    public String getLogoUrl() {
        return logoUrl;
    }
 
    public void setLogoUrl(String logoUrl) {
        this.logoUrl = logoUrl;
    }
 
    public String getWgName() {
        return wgName;
    }
 
    public void setWgName(String wgName) {
        this.wgName = wgName;
    }
 
    public String getWgShortName() {
        return wgShortName;
    }
 
    public void setWgShortName(String wgShortName) {
        this.wgShortName = wgShortName;
    }
 
    public String getDapingView() {
        if (StringUtils.isEmpty(dapingView)) {
            return "true";
        }
        return dapingView;
    }
 
    public void setDapingView(String dapingView) {
        this.dapingView = dapingView;
    }
 
    public String getWebSsh() {
        if (StringUtils.isEmpty(webSsh)) {
            return "true";
        }
        return webSsh;
    }
 
    public void setWebSsh(String webSsh) {
        this.webSsh = webSsh;
    }
 
    public Integer getWebSshPort() {
        if (warnCacheTimes == null) {
            return 9998;
        }
        return webSshPort;
    }
 
    public void setWebSshPort(Integer webSshPort) {
        this.webSshPort = webSshPort;
    }
 
    public Integer getDceTimes() {
        if (dceTimes == null) {
            return 900;
        }
        return dceTimes;
    }
 
    public void setDceTimes(Integer dceTimes) {
        this.dceTimes = dceTimes;
    }
 
    public String getSidebarCollapse() {
        if (StringUtils.isEmpty(sidebarCollapse) || "true".equals(sidebarCollapse)) {
            //自动闭合左侧菜单class
            return "sidebar-mini sidebar-collapse";
        }
        //自动展开左侧菜单class
        return "hold-transition sidebar-mini layout-fixed";
    }
 
    public void setSidebarCollapse(String sidebarCollapse) {
        this.sidebarCollapse = sidebarCollapse;
    }
 
    public String getShellToRun() {
        if (StringUtils.isEmpty(shellToRun)) {
            return "false";
        }
        return shellToRun;
    }
 
    public void setShellToRun(String shellToRun) {
        this.shellToRun = shellToRun;
    }
 
    public String getShellToRunLinuxBlock() {
        return shellToRunLinuxBlock;
    }
 
    public void setShellToRunLinuxBlock(String shellToRunLinuxBlock) {
        this.shellToRunLinuxBlock = shellToRunLinuxBlock;
    }
 
    public String getShellToRunWinBlock() {
        return shellToRunWinBlock;
    }
 
    public void setShellToRunWinBlock(String shellToRunWinBlock) {
        this.shellToRunWinBlock = shellToRunWinBlock;
    }
 
    public String getDaemonUrl() {
        if (StringUtils.isEmpty(daemonUrl)) {
            return "http://localhost:9997";
        }
        return daemonUrl;
    }
 
    public void setDaemonUrl(String daemonUrl) {
        this.daemonUrl = daemonUrl;
    }
 
    public String getGuestAccount() {
        return guestAccount;
    }
 
    public void setGuestAccount(String guestAccount) {
        this.guestAccount = guestAccount;
    }
 
    public String getGuestAccountPwd() {
        return guestAccountPwd;
    }
 
    public void setGuestAccountPwd(String guestAccountPwd) {
        this.guestAccountPwd = guestAccountPwd;
    }
 
    public String getMailTitlePrefix() {
        return mailTitlePrefix;
    }
 
    public void setMailTitlePrefix(String mailTitlePrefix) {
        this.mailTitlePrefix = mailTitlePrefix;
    }
 
    public String getMailContentSuffix() {
        return mailContentSuffix;
    }
 
    public void setMailContentSuffix(String mailContentSuffix) {
        this.mailContentSuffix = mailContentSuffix;
    }
 
    public String getHostGroup() {
        if (StringUtils.isEmpty(hostGroup)) {
            return "false";
        }
        return hostGroup;
    }
 
    public void setHostGroup(String hostGroup) {
        this.hostGroup = hostGroup;
    }
 
    public String getUserInfoManage() {
        if (StringUtils.isEmpty(userInfoManage)) {
            return "false";
        }
        return userInfoManage;
    }
 
    public void setUserInfoManage(String userInfoManage) {
        this.userInfoManage = userInfoManage;
    }
 
    public String getCopyRight() {
        if (StringUtils.isEmpty(copyRight)) {
            return "true";
        }
        return copyRight;
    }
 
    public void setCopyRight(String copyRight) {
        this.copyRight = copyRight;
    }
 
    public Integer getPageSize() {
        if (pageSize < 10) {
            pageSize = 10;
        }
        return pageSize;
    }
 
    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
 
    public Integer getSnmpTimes() {
        if (snmpTimes == null) {
            return 1200;
        }
        return snmpTimes;
    }
 
    public void setSnmpTimes(Integer snmpTimes) {
        this.snmpTimes = snmpTimes;
    }
 
    public String getSqlInKeys() {
        if (StringUtils.isEmpty(sqlInKeys)) {
            return "execute ,delete ,drop ,alter ,rename ,modify ";
        }
        return sqlInKeys;
    }
 
    public void setSqlInKeys(String sqlInKeys) {
        this.sqlInKeys = sqlInKeys;
    }
 
    public String getShowWarnCount() {
        if (StringUtils.isEmpty(showWarnCount)) {
            return "false";
        }
        return showWarnCount;
    }
 
    public void setShowWarnCount(String showWarnCount) {
        this.showWarnCount = showWarnCount;
    }
 
    public String getDashViewIpHide() {
        if (StringUtils.isEmpty(dashViewIpHide)) {
            return "true";
        }
        return dashViewIpHide;
    }
 
    public void setDashViewIpHide(String dashViewIpHide) {
        this.dashViewIpHide = dashViewIpHide;
    }
}