diff --git a/main/webserver_newsettings.cpp b/main/webserver_newsettings.cpp index 45d91e8..0d38182 100644 --- a/main/webserver_newsettings.cpp +++ b/main/webserver_newsettings.cpp @@ -53,7 +53,7 @@ typename std::enable_if< !std::is_same_v && !std::is_same_v && !std::is_same_v && - !std::is_same_v + !std::is_same_v , void>::type showInputForSetting(std::string_view key, T value, std::string &body) { @@ -203,69 +203,17 @@ showInputForSetting(std::string_view key, T value, std::string &body) template typename std::enable_if< - std::is_same_v -, void>::type -showInputForSetting(std::string_view key, T value, std::string &body) -{ - HtmlTag select{"select", fmt::format("name=\"{}\"", esphttpdutils::htmlentities(key)), body}; - - iterateOtaAnimationModes([&](T enumVal, std::string_view enumKey){ - HtmlTag option{"option", fmt::format("value=\"{}\"{}", std::to_underlying(enumVal), value == enumVal ? " selected" : ""), body}; - body += esphttpdutils::htmlentities(enumKey); - }); -} - -template -typename std::enable_if< - std::is_same_v -, void>::type -showInputForSetting(std::string_view key, T value, std::string &body) -{ - HtmlTag select{"select", fmt::format("name=\"{}\"", esphttpdutils::htmlentities(key)), body}; - - iterateLedstripAnimation([&](T enumVal, std::string_view enumKey){ - HtmlTag option{"option", fmt::format("value=\"{}\"{}", std::to_underlying(enumVal), value == enumVal ? " selected" : ""), body}; - body += esphttpdutils::htmlentities(enumKey); - }); -} - -template -typename std::enable_if< + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || std::is_same_v , void>::type showInputForSetting(std::string_view key, T value, std::string &body) { HtmlTag select{"select", fmt::format("name=\"{}\"", esphttpdutils::htmlentities(key)), body}; - iterateHandbremseMode([&](T enumVal, std::string_view enumKey){ - HtmlTag option{"option", fmt::format("value=\"{}\"{}", std::to_underlying(enumVal), value == enumVal ? " selected" : ""), body}; - body += esphttpdutils::htmlentities(enumKey); - }); -} - -template -typename std::enable_if< - std::is_same_v -, void>::type -showInputForSetting(std::string_view key, T value, std::string &body) -{ - HtmlTag select{"select", fmt::format("name=\"{}\"", esphttpdutils::htmlentities(key)), body}; - - iterateBobbyQuickActions([&](T enumVal, std::string_view enumKey){ - HtmlTag option{"option", fmt::format("value=\"{}\"{}", std::to_underlying(enumVal), value == enumVal ? " selected" : ""), body}; - body += esphttpdutils::htmlentities(enumKey); - }); -} - -template -typename std::enable_if< - std::is_same_v -, void>::type -showInputForSetting(std::string_view key, T value, std::string &body) -{ - HtmlTag select{"select", fmt::format("name=\"{}\"", esphttpdutils::htmlentities(key)), body}; - - iterateCloudMode([&](T enumVal, std::string_view enumKey){ + iterateEnum::iterate([&](T enumVal, std::string_view enumKey){ HtmlTag option{"option", fmt::format("value=\"{}\"{}", std::to_underlying(enumVal), value == enumVal ? " selected" : ""), body}; body += esphttpdutils::htmlentities(enumKey); });