コード例 #1
0
 public override void PopulateWebModel(TileWebModel tileWebModel, dynamic options)
 {
     try
     {
         tileWebModel.title = "Зоны";
         tileWebModel.url = "webapp/zones/dashboard";
         tileWebModel.className = "btn-info th-tile-icon th-tile-icon-fa fa-th";
     }
     catch (Exception ex)
     {
         tileWebModel.content = ex.Message;
     }
 }
コード例 #2
0
 public override void PopulateWebModel(TileWebModel tileWebModel, dynamic options)
 {
     try
     {
         tileWebModel.title = "Голосовые команды";
         tileWebModel.url = "webapp/speech/settings";
         tileWebModel.className = "btn-info th-tile-icon th-tile-icon-fa fa-gear";
     }
     catch (Exception ex)
     {
         tileWebModel.content = ex.Message;
     }
 }
コード例 #3
0
 public override void PopulateWebModel(TileWebModel tileWebModel, dynamic options)
 {
     try
     {
         tileWebModel.title = "Мониторы";
         tileWebModel.url = "webapp/monitors/settings";
         tileWebModel.className = "btn-info th-tile-icon th-tile-icon-fa fa-gear";
     }
     catch (Exception ex)
     {
         tileWebModel.content = ex.Message;
     }
 }
コード例 #4
0
 public override void PopulateWebModel(TileWebModel tileWebModel, dynamic parameters)
 {
     try
     {
         tileWebModel.title = "Сеть MySensors";
         tileWebModel.url = "webapp/mysensors/settings";
         tileWebModel.className = "btn-info th-tile-icon th-tile-icon-fa fa-sitemap";
         tileWebModel.content = Context.GetPlugin<MySensorsPlugin>().BuildTileContent();
         tileWebModel.SignalRReceiveHandler = Context.GetPlugin<MySensorsPlugin>().BuildSignalRReceiveHandler();
     }
     catch (Exception ex)
     {
         tileWebModel.content = ex.Message;
     }
 }
コード例 #5
0
        public override void PopulateWebModel(TileWebModel tileWebModel, dynamic parameters)
        {
            try
            {
                UserScript script = GetScript(parameters);

                tileWebModel.title = script.Name;
                tileWebModel.content = "Выполнить скрипт\r\n" + script.Name;
                tileWebModel.className = "btn-primary th-tile-icon th-tile-icon-fa fa-file-code-o";
            }
            catch (Exception ex)
            {
                tileWebModel.content = ex.Message;
            }
        }
コード例 #6
0
 public override void PopulateWebModel(TileWebModel tileWebModel, dynamic options)
 {
     try
     {
         tileWebModel.title = "Метеостанция";
         tileWebModel.url = "webapp/meteostation/dashboard";
         tileWebModel.className = "btn-info th-tile-icon th-tile-icon-fa fa-umbrella";
         //tileWebModel.wide = true;
         tileWebModel.content = Context.GetPlugin<MeteoStationPlugin>().BuildTileContent();
         tileWebModel.SignalRReceiveHandler = Context.GetPlugin<MeteoStationPlugin>().BuildSignalRReceiveHandler();
     }
     catch (Exception ex)
     {
         tileWebModel.content = ex.Message;
     }
 }
コード例 #7
0
 public override void PopulateWebModel(TileWebModel tileWebModel, dynamic parameters)
 {
     try
     {
         tileWebModel.title = "Периодические задачи";
         tileWebModel.url = "webapp/alarm-clock/list";
         tileWebModel.className = "btn-warning th-tile-icon th-tile-icon-fa fa-bell";
         tileWebModel.wide = true;
         tileWebModel.content = Context.GetPlugin<AlarmClockPlugin>().BuildTileContent();
         tileWebModel.SignalRReceiveHandler = Context.GetPlugin<AlarmClockPlugin>().BuildSignalRReceiveHandler();
     }
     catch (Exception ex)
     {
         tileWebModel.content = ex.Message;
     }
 }
コード例 #8
0
        public override void PopulateWebModel(TileWebModel tileWebModel, dynamic parameters)
        {
            tileWebModel.title = "Интернет-погода";
            tileWebModel.url = "webapp/weather/forecast";

            string strCityId = parameters.cityId;
            if (string.IsNullOrWhiteSpace(strCityId))
            {
                tileWebModel.content = "Отсутствует cityId параметр";
                return;
            }
            Guid cityId;
            if (!Guid.TryParse(strCityId, out cityId))
            {
                tileWebModel.content = "Параметр cityId должен содержать GUID";
                return;
            }

            WeatherLocatioinModel location = Context.GetPlugin<WeatherPlugin>().GetWeatherData(DateTime.Now).FirstOrDefault(l => l.LocationId == cityId);
            if (location == null)
            {
                tileWebModel.content = string.Format("Локация с id = {0} не найдена", cityId);
                return;
            }

            tileWebModel.title = location.LocationName;

            // текущая погода
            if (location.Now == null)
                tileWebModel.content = "&lt;нет данных&gt";
            else
            {
                tileWebModel.className = "btn-info th-tile-icon th-tile-icon-wa " + WeatherUtils.GetIconClass(location.Now.Code);
                tileWebModel.content = string.Format("сейчас: {0}°C", WeatherUtils.FormatTemperature(location.Now.Temperature));

                // погода на завтра
                var tomorrow = location.Forecast.FirstOrDefault();
                if (tomorrow != null)
                    tileWebModel.content += string.Format("\nзавтра: {0}°C", WeatherUtils.FormatTemperatureRange(tomorrow.MinTemperature, tomorrow.MaxTemperature));
            }
        }
コード例 #9
0
 public abstract void PopulateWebModel(TileWebModel tileWebModel, dynamic parameters);
コード例 #10
0
 public override void PopulateWebModel(TileWebModel webTile, dynamic options)
 {
     webTile.title = options.title;
     webTile.url = options.url;
     webTile.className = "btn-primary th-tile-icon th-tile-icon-fa fa-arrow-circle-right";
 }