Add active single market settings to SMS tool tip
This commit is contained in:
parent
f07e52b831
commit
88c8f39480
|
@ -3,13 +3,17 @@
|
||||||
@{
|
@{
|
||||||
Layout = null;
|
Layout = null;
|
||||||
|
|
||||||
|
// Single market settings tool tip
|
||||||
int activeSingleSettings = Model.MarketsWithSingleSettings.Count;
|
int activeSingleSettings = Model.MarketsWithSingleSettings.Count;
|
||||||
string singleSettingInfoIcon = "";
|
string singleSettingInfoIcon = "";
|
||||||
if (activeSingleSettings > 0) {
|
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>";
|
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;
|
DateTime lastRuntime = Model.Summary.LastRuntime;
|
||||||
double elapsedSecondsSinceRuntime = DateTime.UtcNow.Subtract(lastRuntime).TotalSeconds;
|
double elapsedSecondsSinceRuntime = DateTime.UtcNow.Subtract(lastRuntime).TotalSeconds;
|
||||||
double intervalSeconds = Model.PTMagicConfiguration.AnalyzerSettings.MarketAnalyzer.IntervalMinutes * 60.0;
|
double intervalSeconds = Model.PTMagicConfiguration.AnalyzerSettings.MarketAnalyzer.IntervalMinutes * 60.0;
|
||||||
|
|
|
@ -21,14 +21,23 @@ namespace Monitor.Pages {
|
||||||
|
|
||||||
private void BindData() {
|
private void BindData() {
|
||||||
// Get markets with active single settings
|
// Get markets with active single settings
|
||||||
foreach (string key in Summary.MarketSummary.Keys) {
|
var MarketsWithSingleSettingsData = from x in Summary.MarketSummary
|
||||||
if (Summary.MarketSummary[key].ActiveSingleSettings != null) {
|
where x.Value.ActiveSingleSettings != null
|
||||||
if (Summary.MarketSummary[key].ActiveSingleSettings.Count > 0) {
|
&& x.Value.ActiveSingleSettings.Count > 0
|
||||||
MarketsWithSingleSettings.Add(key);
|
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue