[manager,webapp]bugfix#5 website monitor path Illegal character in path
[manager,webapp]bugfix website monitor path Illegal character in path
This commit is contained in:
@@ -55,6 +55,8 @@ public class WheelTimerTask implements TimerTask {
|
|||||||
log.error("Aes Decode value {} error.", item.getValue());
|
log.error("Aes Decode value {} error.", item.getValue());
|
||||||
}
|
}
|
||||||
item.setValue(decodeValue);
|
item.setValue(decodeValue);
|
||||||
|
} else if (item.getValue() != null && item.getValue() instanceof String) {
|
||||||
|
item.setValue(((String) item.getValue()).trim());
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect(Collectors.toMap(Configmap::getKey, item -> item));
|
.collect(Collectors.toMap(Configmap::getKey, item -> item));
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ public class IpDomainUtil {
|
|||||||
if (ipDomain == null || "".equals(ipDomain)) {
|
if (ipDomain == null || "".equals(ipDomain)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
ipDomain = ipDomain.trim();
|
||||||
if (LOCALHOST.equalsIgnoreCase(ipDomain)) {
|
if (LOCALHOST.equalsIgnoreCase(ipDomain)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,9 +126,15 @@ public class MonitorServiceImpl implements MonitorService {
|
|||||||
public void validate(MonitorDto monitorDto, Boolean isModify) throws IllegalArgumentException {
|
public void validate(MonitorDto monitorDto, Boolean isModify) throws IllegalArgumentException {
|
||||||
// 请求监控参数与监控参数定义映射校验匹配
|
// 请求监控参数与监控参数定义映射校验匹配
|
||||||
Monitor monitor = monitorDto.getMonitor();
|
Monitor monitor = monitorDto.getMonitor();
|
||||||
|
monitor.setHost(monitor.getHost().trim());
|
||||||
|
monitor.setName(monitor.getName().trim());
|
||||||
Map<String, Param> paramMap = monitorDto.getParams()
|
Map<String, Param> paramMap = monitorDto.getParams()
|
||||||
.stream()
|
.stream()
|
||||||
.peek(param -> param.setMonitorId(monitor.getId()))
|
.peek(param -> {
|
||||||
|
param.setMonitorId(monitor.getId());
|
||||||
|
String value = param.getValue() == null ? null : param.getValue().trim();
|
||||||
|
param.setValue(value);
|
||||||
|
})
|
||||||
.collect(Collectors.toMap(Param::getField, param -> param));
|
.collect(Collectors.toMap(Param::getField, param -> param));
|
||||||
// 校验名称唯一性
|
// 校验名称唯一性
|
||||||
if (isModify != null) {
|
if (isModify != null) {
|
||||||
|
|||||||
@@ -112,11 +112,16 @@ export class MonitorEditComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.monitor.host = this.monitor.host.trim();
|
||||||
|
this.monitor.name = this.monitor.name.trim();
|
||||||
// todo 暂时单独设置host属性值
|
// todo 暂时单独设置host属性值
|
||||||
this.params.forEach(param => {
|
this.params.forEach(param => {
|
||||||
if (param.field === 'host') {
|
if (param.field === 'host') {
|
||||||
param.value = this.monitor.host;
|
param.value = this.monitor.host;
|
||||||
}
|
}
|
||||||
|
if (param.value != null && typeof param.value == 'string') {
|
||||||
|
param.value = (param.value as string).trim();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let addMonitor = {
|
let addMonitor = {
|
||||||
detected: this.detected,
|
detected: this.detected,
|
||||||
@@ -151,11 +156,16 @@ export class MonitorEditComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.monitor.host = this.monitor.host.trim();
|
||||||
|
this.monitor.name = this.monitor.name.trim();
|
||||||
// todo 暂时单独设置host属性值
|
// todo 暂时单独设置host属性值
|
||||||
this.params.forEach(param => {
|
this.params.forEach(param => {
|
||||||
if (param.field === 'host') {
|
if (param.field === 'host') {
|
||||||
param.value = this.monitor.host;
|
param.value = this.monitor.host;
|
||||||
}
|
}
|
||||||
|
if (param.value != null && typeof param.value == 'string') {
|
||||||
|
param.value = (param.value as string).trim();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let detectMonitor = {
|
let detectMonitor = {
|
||||||
detected: this.detected,
|
detected: this.detected,
|
||||||
|
|||||||
@@ -93,11 +93,16 @@ export class MonitorNewComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.monitor.host = this.monitor.host.trim();
|
||||||
|
this.monitor.name = this.monitor.name.trim();
|
||||||
// todo 暂时单独设置host属性值
|
// todo 暂时单独设置host属性值
|
||||||
this.params.forEach(param => {
|
this.params.forEach(param => {
|
||||||
if (param.field === 'host') {
|
if (param.field === 'host') {
|
||||||
param.value = this.monitor.host;
|
param.value = this.monitor.host;
|
||||||
}
|
}
|
||||||
|
if (param.value != null && typeof param.value == 'string') {
|
||||||
|
param.value = (param.value as string).trim();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let addMonitor = {
|
let addMonitor = {
|
||||||
detected: this.detected,
|
detected: this.detected,
|
||||||
@@ -132,11 +137,16 @@ export class MonitorNewComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.monitor.host = this.monitor.host.trim();
|
||||||
|
this.monitor.name = this.monitor.name.trim();
|
||||||
// todo 暂时单独设置host属性值
|
// todo 暂时单独设置host属性值
|
||||||
this.params.forEach(param => {
|
this.params.forEach(param => {
|
||||||
if (param.field === 'host') {
|
if (param.field === 'host') {
|
||||||
param.value = this.monitor.host;
|
param.value = this.monitor.host;
|
||||||
}
|
}
|
||||||
|
if (param.value != null && typeof param.value == 'string') {
|
||||||
|
param.value = (param.value as string).trim();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let detectMonitor = {
|
let detectMonitor = {
|
||||||
detected: true,
|
detected: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user