Created
January 8, 2012 13:28
-
-
Save PaulStovell/1578363 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class EnvironmentsController : OctopusController | |
| { | |
| readonly IDataContext dataContext; | |
| public EnvironmentsController(IDataContext dataContext) | |
| { | |
| this.dataContext = dataContext; | |
| } | |
| public ActionResult Index() | |
| { | |
| var environments = dataContext.Set<DeploymentEnvironment>() | |
| .Include(m => m.Machines) | |
| .Include(m => m.Variables) | |
| .OrderBy(m => m.SortOrder) | |
| .ToList(); | |
| var upgradeNeeded = environments.SelectMany(m => m.Machines).Any(x => x.NeedsUpgrading ?? false); | |
| if (upgradeNeeded) | |
| { | |
| ViewData.FlashWarning("One or more of your machines below appear to be running old versions of Octopus Tentacle. Please use the \"Upgrade All\" button above to upgrade them. Or, use the \"Check Health\" button to refresh the version numbers."); | |
| } | |
| return View(new EnvironmentListModel(environments)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment