Ejemplo n.º 1
0
        public IActionResult StreamProxy()
        {
            StreamProxyDataSourceDto dataSourceDto = new StreamProxyDataSourceDto();

            dataSourceDto.Power = new PowerDto();
            var menus = userService.FindUserMenus(GetUserDto(), false);

            if (menus.Where(p => !string.IsNullOrWhiteSpace(p.Url) && p.Url.Contains("ZLServer") && p.Url.Contains("AddStreamProxy")).Any())
            {
                dataSourceDto.Power.Add = true;
            }
            if (menus.Where(p => !string.IsNullOrWhiteSpace(p.Url) && p.Url.Contains("ZLServer") && p.Url.Contains("EditStreamProxy")).Any())
            {
                dataSourceDto.Power.Edit = true;
            }
            if (menus.Where(p => !string.IsNullOrWhiteSpace(p.Url) && p.Url.Contains("ZLServer") && p.Url.Contains("DeleteStreamProxy")).Any())
            {
                dataSourceDto.Power.Delete = true;
            }

            //判断添加条件,必须存在域名和应用才允许添加
            if (DataBaseCache.Applications.Where(p => p.State != (int)BaseStatus.Deleted && DataBaseCache.Domains.Where(q => q.Id == p.DomainId).First().State != (int)BaseStatus.Deleted).Any())
            {
                dataSourceDto.Power.Audit = true;
            }


            dataSourceDto.Domains      = DataBaseCache.Domains.Where(p => p.State != (int)BaseStatus.Deleted).Select(p => mapper.Map <DomainDto>(p)).ToList();
            dataSourceDto.Applications = DataBaseCache.Applications.Where(p => p.State != (int)BaseStatus.Deleted).Select(p => mapper.Map <ApplicationDto>(p)).ToList();
            return(View(dataSourceDto));
        }
Ejemplo n.º 2
0
        public IActionResult EditStreamProxy(long streamProxyId)
        {
            var dataSource = new StreamProxyDataSourceDto()
            {
                StreamProxy = zLServerService.FindStreamProxy(streamProxyId)
            };

            return(View(dataSource));
        }