monitor desc improvements

This commit is contained in:
vaxerski 2022-10-05 17:38:36 +01:00
parent 0e4a894edb
commit 9c5023ab1a

View file

@ -1300,7 +1300,7 @@ SMonitorRule CConfigManager::getMonitorRuleFor(std::string name, std::string dis
SMonitorRule* found = nullptr; SMonitorRule* found = nullptr;
for (auto& r : m_dMonitorRules) { for (auto& r : m_dMonitorRules) {
if (r.name == name) { if (r.name == name || (r.name.find("desc:") == 0 && (r.name.substr(5) == displayName || r.name.substr(5) == removeBeginEndSpacesTabs(displayName.substr(0, displayName.find_first_of('(')))))) {
found = &r; found = &r;
break; break;
} }
@ -1312,7 +1312,7 @@ SMonitorRule CConfigManager::getMonitorRuleFor(std::string name, std::string dis
Debug::log(WARN, "No rule found for %s, trying to use the first.", name.c_str()); Debug::log(WARN, "No rule found for %s, trying to use the first.", name.c_str());
for (auto& r : m_dMonitorRules) { for (auto& r : m_dMonitorRules) {
if (r.name == "" || (r.name.find("desc:") == 0 && r.name.substr(5) == displayName)) { if (r.name == "") {
found = &r; found = &r;
break; break;
} }