using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using MQTTnet; using MQTTnet.Client; using MQTTnet.Server; using MyCore.Models; using MyCore.Models.Layout; using MyCore.Services; using static MyCore.Services.OddService; namespace MyCore.Controllers { [Authorize(Roles = "User")] [Route("api/layout")] [ApiController] public class LayoutController : ControllerBase { // GET api/values /// /// It's a test ! :) /// [AllowAnonymous] [HttpGet("panelSection")] public ActionResult> Get() { List panelSectionToSend = new List(); PanelSection panelSection = new PanelSection(); panelSection.Label = "System"; panelSection.Icon = "System"; panelSection.Color = "System"; panelSection.DefaultRoute = "System"; List panelMenuItemList = new List(); PanelMenuItem panelMenuItem1 = new PanelMenuItem(); panelMenuItem1.Label = "About"; panelMenuItem1.Route = "/system/summary"; panelMenuItem1.Icon = "fa-question-circle"; panelMenuItem1.BadgeValue = 0; panelMenuItem1.BadgeType = null; panelMenuItem1.Children = null; PanelMenuItem panelMenuItem2 = new PanelMenuItem(); panelMenuItem2.Label = "Events"; panelMenuItem2.Route = "/system/events"; panelMenuItem2.Icon = "fa-file-text"; panelMenuItem2.BadgeValue = 0; panelMenuItem2.BadgeType = null; panelMenuItem2.Children = null; panelMenuItemList.Add(panelMenuItem1); panelMenuItemList.Add(panelMenuItem2); panelSection.Children = panelMenuItemList; panelSectionToSend.Add(panelSection); return panelSectionToSend; } } }