123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using Edge.Core.Processor;
- using Edge.Core.Processor.Dispatcher.Attributes;
- using Edge.Core.UniversalApi;
- using System;
- using System.Collections.Generic;
- using System.Threading.Tasks;
- namespace WebConsoleConfigApp
- {
- [MetaPartsDescriptor(
- "lang-zh-cn:控制台应用配置lang-zh-tw:控製臺應用配置lang-en-us:WebConsole Config",
- "lang-zh-cn:控制台应用配置, 用于支持此应用的配置,配置将被获取用于定制化的界面和功能" +
- "lang-zh-tw:控製臺應用配置, 用於支持此應用的配置,配置將被獲取用於定製化的界面和功能" +
- "lang-en-us:控制台应用配置, 用于支持此应用的配置,配置将被获取用于定制化的界面和功能",
- new[] { "lang-zh-cn:控制台lang-zh-tw:控製臺lang-en-us:WebConsole" })]
- public class App : IAppProcessor
- {
- private AppConfigV1 appConfig;
- public string MetaConfigName { get; set; }
- #region AppConfig
- public class NaviMenuItemConfigV1
- {
- public string IconUrl { get; set; }
- public string LinkUrl { get; set; }
- public string Action { get; set; }
- }
- public enum NaviMenuSizeEnum
- {
- Medium,
- Small,
- Large,
- }
- public enum NaviMenuPositionEnum
- {
- Bottom,
- Top,
- Left,
- Right,
- }
- public class NaviMenuConfigV1
- {
- public NaviMenuSizeEnum MenuSize { get; set; }
- public NaviMenuPositionEnum MenuPosition { get; set; }
- public string LogoUrl { get; set; }
- public NaviMenuItemConfigV1[] MenuItemConfigs { get; set; }
- }
- public class LayoutConfigV1
- {
- public string Theme { get; set; }
- public string IndexPageUrl { get; set; }
- public NaviMenuConfigV1 NaviMenuConfig { get; set; }
- }
- public class AppConfigV1
- {
- public LayoutConfigV1 LayoutConfig { get; set; }
- }
- #endregion
- public App(AppConfigV1 appConfig, IServiceProvider services)
- {
- this.appConfig = appConfig;
- }
- public void Init(IEnumerable<IProcessor> processors)
- {
- }
- [UniversalApi(Description = "Get the App Config")]
- public Task<AppConfigV1> GetAppConfigAsync()
- {
- return Task.FromResult(this.appConfig);
- }
- }
- }
|