Beispiel #1
0
        void PerformLoadTestLog()
        {
            var log = new LoadLogViewModel();

            if (LoadLogService.ShowDialog(MessageButton.OKCancel, "Load log", log) == MessageResult.OK)
            {
                string url = log.Url;
                if (string.IsNullOrEmpty(url))
                {
                    MessageBoxService.Show("Build url is not specified.", "Build log error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
                var match = parseBuildRegex.Match(url);
                if (!match.Success)
                {
                    MessageBoxService.Show("Specified url doesn`t match the pattern:\r\nhttp://{server}/{namespace}/{name}/builds/{buildId}", "Build log error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
                var repo      = $@"http://{match.Groups["server"]}/{match.Groups["nspace"]}/{match.Groups["name"]}.git";
                var artifacts = Repositories.SelectedBranch.DownloadArtifacts(repo, new Build()
                {
                    Id = Convert.ToInt32(match.Groups["build"].Value)
                });
                if (artifacts == null)
                {
                    MessageBoxService.Show("Build artifacts not found", "Build log error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
                ArtifactsViewModel model = new ArtifactsViewModel(new ArtifactsFile()
                {
                    FileName = "test.zip"
                }, artifacts);
                ShowLogsService.Show(model);
            }
        }
 public ShowLogController(ILogger <ShowLogController> logger, ShowLogsService showLogsService,
                          QueryBuildingService queryBuildingService)
 {
     _logger               = logger;
     _showLogService       = showLogsService;
     _queryBuildingService = queryBuildingService;
 }
 void PerformShowLogs(CommitViewModel model)
 {
     if (model.Build == null)
     {
         model.UpdateBuilds();
     }
     ShowLogsService.Show(model);
 }
 void PerformShowLogs(CommitViewModel model)
 {
     ShowLogsService.Show(model);
 }
Beispiel #5
0
 public AnalysisLogController(ILogger <AnalysisLogController> logger, ShowLogsService showLogsService)
 {
     _logger         = logger;
     _showLogService = showLogsService;
 }
 public void Setup()
 {
     dbContextService = new DbContextService(connectionString);
     showLogsService  = new ShowLogsService(dbContextService);
     filterParameters = CreateFilterParameters();
 }