# Conflicts:
#	MyCore/Controllers/LayoutController.cs
#	MyCore/Models/Layout/PanelSection.cs
This commit is contained in:
Thomas Fransolet 2020-03-09 09:32:24 +01:00
commit 15a758fccf
2 changed files with 128 additions and 27 deletions

View File

@ -28,37 +28,138 @@ namespace MyCore.Controllers
[HttpGet("panelSection")] [HttpGet("panelSection")]
public ActionResult<IEnumerable<PanelSection>> Get() public ActionResult<IEnumerable<PanelSection>> Get()
{ {
List<PanelSection> panelSectionToSend = new List<PanelSection>(); List<PanelSection> panelSectionList = new List<PanelSection>();
PanelSection panelSection = new PanelSection();
panelSection.Label = "System";
panelSection.Icon = "System";
panelSection.Color = "System";
panelSection.DefaultRoute = "System";
List<PanelMenuItem> panelMenuItemList = new List<PanelMenuItem>(); // Energy
PanelMenuItem panelMenuItem1 = new PanelMenuItem(); PanelSection panelSectionEnergy = new PanelSection();
panelMenuItem1.Label = "About"; panelSectionEnergy.Label = "Energy";
panelMenuItem1.Route = "/system/summary"; panelSectionEnergy.Icon = "fas fa-seedling";
panelMenuItem1.Icon = "fa-question-circle"; panelSectionEnergy.DefaultRoute = "energy";
panelMenuItem1.BadgeValue = 0; panelSectionEnergy.Color = "green";
panelMenuItem1.BadgeType = null;
panelMenuItem1.Children = null;
PanelMenuItem panelMenuItem2 = new PanelMenuItem(); List<PanelMenuItem> panelSectionEnergyList = new List<PanelMenuItem>();
panelMenuItem2.Label = "Events"; PanelMenuItem panelMenuItemElectricity = new PanelMenuItem();
panelMenuItem2.Route = "/system/events"; panelMenuItemElectricity.Label = "Electricity";
panelMenuItem2.Icon = "fa-file-text"; panelMenuItemElectricity.Icon = "fas fa-bolt";
panelMenuItem2.BadgeValue = 0; panelMenuItemElectricity.Route = "electricity";
panelMenuItem2.BadgeType = null; panelMenuItemElectricity.Color = "yellow";
panelMenuItem2.Children = null; panelMenuItemElectricity.BadgeType = null;
panelMenuItemElectricity.BadgeValue = 0;
panelMenuItemList.Add(panelMenuItem1); PanelMenuItem panelMenuItemGas = new PanelMenuItem();
panelMenuItemList.Add(panelMenuItem2); panelMenuItemGas.Label = "Gas";
panelMenuItemGas.Icon = "fas fa-burn";
panelMenuItemGas.Route = "gas";
panelMenuItemGas.Color = "orange";
panelMenuItemGas.BadgeType = null;
panelMenuItemGas.BadgeValue = 0;
panelSection.Children = panelMenuItemList; PanelMenuItem panelMenuItemWater = new PanelMenuItem();
panelMenuItemWater.Label = "Water";
panelMenuItemWater.Icon = "fas fa-tint";
panelMenuItemWater.Route = "water";
panelMenuItemWater.Color = "blue";
panelMenuItemWater.BadgeType = null;
panelMenuItemWater.BadgeValue = 0;
panelSectionToSend.Add(panelSection); panelSectionEnergyList.Add(panelMenuItemElectricity);
return panelSectionToSend; panelSectionEnergyList.Add(panelMenuItemGas);
panelSectionEnergyList.Add(panelMenuItemWater);
panelSectionEnergy.Children = panelSectionEnergyList;
// Security
PanelSection panelSectionSecurity = new PanelSection();
panelSectionSecurity.Label = "Security";
panelSectionSecurity.Icon = "fas fa-lock";
panelSectionSecurity.Color = "yellow";
panelSectionSecurity.DefaultRoute = "security";
List<PanelMenuItem> panelMenuItemSecurityList = new List<PanelMenuItem>();
PanelMenuItem panelMenuItemAlarm = new PanelMenuItem();
panelMenuItemAlarm.Label = "Alarm";
panelMenuItemAlarm.Icon = "fas fa-bell";
panelMenuItemAlarm.Color = "yellow";
panelMenuItemAlarm.Route = "alarm";
panelMenuItemAlarm.BadgeType = null;
panelMenuItemAlarm.BadgeValue = 0;
PanelMenuItem panelMenuItemCamera = new PanelMenuItem();
panelMenuItemCamera.Label = "Camera";
panelMenuItemCamera.Icon = "fas fa-video";
panelMenuItemCamera.Route = "camera";
panelMenuItemCamera.Color = "black";
panelMenuItemCamera.BadgeType = null;
panelMenuItemCamera.BadgeValue = 0;
panelMenuItemSecurityList.Add(panelMenuItemAlarm);
panelMenuItemSecurityList.Add(panelMenuItemCamera);
panelSectionSecurity.Children = panelMenuItemSecurityList;
// Entertainment
PanelSection panelSectionEntertainment = new PanelSection();
panelSectionEntertainment.Label = "Entertainment";
panelSectionEntertainment.Icon = "fas fa-music";
panelSectionEntertainment.Color = "blue";
panelSectionEntertainment.DefaultRoute = "entertainment";
List<PanelMenuItem> panelMenuItemEntertainmentList = new List<PanelMenuItem>();
PanelMenuItem panelMenuItemMusic = new PanelMenuItem();
panelMenuItemMusic.Label = "Music";
panelMenuItemMusic.Icon = "fas fa-music";
panelMenuItemMusic.Route = "music";
panelMenuItemMusic.Color = "black";
panelMenuItemMusic.BadgeType = null;
panelMenuItemMusic.BadgeValue = 0;
PanelMenuItem panelMenuItemTv = new PanelMenuItem();
panelMenuItemTv.Label = "Tv";
panelMenuItemTv.Icon = "fas fa-tv";
panelMenuItemTv.Route = "tv";
panelMenuItemTv.BadgeType = null;
panelMenuItemTv.BadgeValue = 0;
panelMenuItemEntertainmentList.Add(panelMenuItemMusic);
panelMenuItemEntertainmentList.Add(panelMenuItemTv);
panelSectionEntertainment.Children = panelMenuItemEntertainmentList;
// Health
PanelSection panelSectionHealth = new PanelSection();
panelSectionHealth.Label = "Health";
panelSectionHealth.Icon = "fas fa-heartbeat";
panelSectionHealth.DefaultRoute = "health";
panelSectionHealth.Color = "#ff4c4c";
List<PanelMenuItem> panelSectionHealthList = new List<PanelMenuItem>();
PanelMenuItem panelMenuItemMyBody = new PanelMenuItem();
panelMenuItemMyBody.Label = "My body";
panelMenuItemMyBody.Icon = "fas fa-user-alt";
panelMenuItemMyBody.Route = "body";
panelMenuItemMyBody.BadgeType = null;
panelMenuItemMyBody.BadgeValue = 0;
PanelMenuItem panelMenuItemFitness = new PanelMenuItem();
panelMenuItemFitness.Label = "Fitness";
panelMenuItemFitness.Icon = "fas fa-running";
panelMenuItemFitness.Route = "fitness";
panelMenuItemFitness.BadgeType = null;
panelMenuItemFitness.BadgeValue = 0;
panelSectionHealthList.Add(panelMenuItemMyBody);
panelSectionHealthList.Add(panelMenuItemFitness);
panelSectionHealth.Children = panelSectionHealthList;
// panelSectionList
panelSectionList.Add(panelSectionEnergy);
panelSectionList.Add(panelSectionSecurity);
panelSectionList.Add(panelSectionEntertainment);
panelSectionList.Add(panelSectionHealth);
return panelSectionList;
} }
} }
} }

View File

@ -19,9 +19,9 @@ namespace MyCore.Models.Layout
public string Label { get; set; } public string Label { get; set; }
public string Route { get; set; } public string Route { get; set; }
public string Icon { get; set; } public string Icon { get; set; }
public string Color { get; set; }
public int BadgeValue { get; set; } public int BadgeValue { get; set; }
public string BadgeType { get; set; } public string BadgeType { get; set; }
public List<PanelMenuItem> Children { get; set; } public List<PanelMenuItem> Children { get; set; }
} }
} }