Add active single market settings to SMS tool tip

This commit is contained in:
djbadders 2021-02-04 22:57:54 +00:00
parent f07e52b831
commit 88c8f39480
2 changed files with 20 additions and 7 deletions

View File

@ -3,13 +3,17 @@
@{
Layout = null;
// Single market settings tool tip
int activeSingleSettings = Model.MarketsWithSingleSettings.Count;
string singleSettingInfoIcon = "";
if (activeSingleSettings > 0) {
singleSettingInfoIcon = "<i class=\"fa fa-info-circle text-muted\" data-toggle=\"tooltip\" data-placement=\"top\" data-html=\"true\" title=\"<b>Single Market Settings active for:</b><br />-" + Core.Helper.SystemHelper.ConvertListToTokenString(Model.MarketsWithSingleSettings, "<br />-", true) + "\" data-template=\"<div class='tooltip' role='tooltip'><div class='tooltip-arrow'></div><div class='tooltip-inner tooltip-200 text-left'></div></div>\"></i>";
singleSettingInfoIcon = "<i class=\"fa fa-info-circle text-muted\" data-toggle=\"tooltip\" data-placement=\"top\" data-html=\"true\" title=\"<b>Single Market Settings active for:</b><br />" + Core.Helper.SystemHelper.ConvertListToTokenString(Model.MarketsWithSingleSettings, "<br />", true) + "\" data-template=\"<div class='tooltip' role='tooltip'><div class='tooltip-arrow'></div><div class='tooltip-inner tooltip-200 text-left'></div></div>\"></i>";
}
// Global setting tool tip
string globalSettingInfoIcon = "<i class=\"fa fa-info-circle text-muted\" data-toggle=\"tooltip\" data-placement=\"top\" data-html=\"true\" title=\"<b>Instance: </b>" + Model.PTMagicConfiguration.GeneralSettings.Application.InstanceName + "\" data-template=\"<div class='tooltip' role='tooltip'><div class='tooltip-arrow'></div><div class='tooltip-inner tooltip-100 text-left'></div></div>\"></i>";
// Health indicator
DateTime lastRuntime = Model.Summary.LastRuntime;
double elapsedSecondsSinceRuntime = DateTime.UtcNow.Subtract(lastRuntime).TotalSeconds;
double intervalSeconds = Model.PTMagicConfiguration.AnalyzerSettings.MarketAnalyzer.IntervalMinutes * 60.0;

View File

@ -21,14 +21,23 @@ namespace Monitor.Pages {
private void BindData() {
// Get markets with active single settings
foreach (string key in Summary.MarketSummary.Keys) {
if (Summary.MarketSummary[key].ActiveSingleSettings != null) {
if (Summary.MarketSummary[key].ActiveSingleSettings.Count > 0) {
MarketsWithSingleSettings.Add(key);
}
var MarketsWithSingleSettingsData = from x in Summary.MarketSummary
where x.Value.ActiveSingleSettings != null
&& x.Value.ActiveSingleSettings.Count > 0
orderby x.Key ascending
select x;
foreach (var market in MarketsWithSingleSettingsData) {
// Get the name of all active single market settings
string activeSettings = string.Empty;
foreach (var singleSetting in market.Value.ActiveSingleSettings)
{
activeSettings += (", " + singleSetting.SettingName);
}
activeSettings = activeSettings.Substring(2); // Chop the unrequired comma
MarketsWithSingleSettings.Add(String.Format("{0} : {1}", market.Key, activeSettings));
}
MarketsWithSingleSettings.Sort();
}
}
}