Esempio n. 1
0
        public virtual async Task <ActionResult> ServiceAlert()
        {
            string alertString = null;
            var    alert       = await ContentService.GetContentItemAsync(Constants.ContentNames.Alert, TimeSpan.Zero);

            if (alert != null)
            {
                alertString = alert.ToString();
            }

            if (String.IsNullOrEmpty(alertString) && _config.ReadOnlyMode)
            {
                var readOnly = await ContentService.GetContentItemAsync(Constants.ContentNames.ReadOnly, TimeSpan.Zero);

                alertString = (readOnly == null) ? (string)null : readOnly.ToString();
            }
            return(Content(alertString, "text/html"));
        }
Esempio n. 2
0
        public virtual async Task <ActionResult> ServiceAlert()
        {
            var    markdownContentFileExtension = NuGetGallery.ContentService.MarkdownContentFileExtension;
            string alertString = null;
            var    alert       = await ContentService.GetContentItemAsync(Constants.ContentNames.Alert, markdownContentFileExtension, TimeSpan.Zero);

            if (alert != null)
            {
                alertString = alert.ToString().Replace("</div>", " - Check our <a href=\"http://status.nuget.org\">status page</a> for updates.</div>");
            }

            if (String.IsNullOrEmpty(alertString) && _config.ReadOnlyMode)
            {
                var readOnly = await ContentService.GetContentItemAsync(Constants.ContentNames.ReadOnly, markdownContentFileExtension, TimeSpan.Zero);

                alertString = readOnly?.ToString();
            }
            return(Content(alertString, "text/html"));
        }
Esempio n. 3
0
        public virtual async Task <ActionResult> Team()
        {
            var team = await ContentService.GetContentItemAsync(Constants.ContentNames.Team, TimeSpan.FromHours(1));

            return(Content(team.ToString(), "application/json"));
        }
Esempio n. 4
0
        public virtual async Task <ActionResult> ServiceAlert()
        {
            var alert = await ContentService.GetContentItemAsync(Constants.ContentNames.Alert, TimeSpan.Zero);

            return(Content(alert == null ? (string)null : alert.ToString(), "text/html"));
        }