예제 #1
0
        public IActionResult GetRoute(string url)
        {
            //Stopwatch sw = new Stopwatch(); // Creación del Stopwatch.
            //sw.Start(); // Iniciar la medición.
            var page = _documentationApi.GetPage($"/{url}");

            if (page == null)
            {
                return(NotFound());
            }
            //sw.Stop();
            //Log.Information($"Tiempo pasado al hacer GetPage de {url} : {sw.Elapsed.ToString("hh\\:mm\\:ss\\.fff")}\n");
            //Cambiar el contendio de los uses
            CmsDataViewModel dataModel = new CmsDataViewModel();

            //sw = new Stopwatch(); // Creación del Stopwatch.
            //sw.Start(); // Iniciar la medición.
            if (page.Content.Contains("@*<%"))
            {
                dataModel = _replaceUsesService.PageWithDirectives(page.Content, dataModel);
            }
            //sw.Stop();
            //Log.Information($"cargar las directivas de la página : {sw.Elapsed.ToString("hh\\:mm\\:ss\\.fff")}\n");
            return(View($"/{url}", dataModel));
        }
예제 #2
0
        public IActionResult GetRoute(string url)
        {
            var page = _documentationApi.GetPage($"/{url}");

            if (page == null)
            {
                return(NotFound());
            }
            //Cambiar el contendio de los uses
            CmsDataViewModel dataModel = new CmsDataViewModel();

            if (page.Content.Contains("@*<%"))
            {
                dataModel = _replaceUsesService.PageWithDirectives(page.Content, dataModel);
            }
            return(View($"/{url}", dataModel));
        }
예제 #3
0
        public IActionResult Index()
        {
            var page = _documentationApi.GetPage(RUTA_MENU);

            if (page != null)
            {
                ConfigUrlService configUrlService = new ConfigUrlService();
                string           routeProxy       = $"{configUrlService.GetProxy()}{page.Route}";
                PageViewModel    pageViewModel    = new PageViewModel()
                {
                    RouteProxyLess = page.Route,
                    Route          = routeProxy,
                    LastModified   = page.LastModified,
                    PageId         = page.PageId
                };
                return(View(pageViewModel));
            }
            else
            {
                return(View(null));
            }
        }