Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/projects/ml/experiments_helper.rb')
-rw-r--r--app/helpers/projects/ml/experiments_helper.rb23
1 files changed, 19 insertions, 4 deletions
diff --git a/app/helpers/projects/ml/experiments_helper.rb b/app/helpers/projects/ml/experiments_helper.rb
index a67484e3d2f..b9a219b3021 100644
--- a/app/helpers/projects/ml/experiments_helper.rb
+++ b/app/helpers/projects/ml/experiments_helper.rb
@@ -11,7 +11,10 @@ module Projects
**candidate.params.to_h { |p| [p.name, p.value] },
**candidate.latest_metrics.to_h { |m| [m.name, number_with_precision(m.value, precision: 4)] },
artifact: link_to_artifact(candidate),
- details: link_to_details(candidate)
+ details: link_to_details(candidate),
+ name: candidate.name,
+ created_at: candidate.created_at,
+ user: user_info(candidate)
}
end
@@ -32,7 +35,8 @@ module Projects
experiment_name: candidate.experiment.name,
path_to_experiment: link_to_experiment(candidate),
status: candidate.status
- }
+ },
+ metadata: candidate.metadata
}
Gitlab::Json.generate(data)
@@ -45,11 +49,11 @@ module Projects
return unless artifact.present?
- project_package_path(candidate.experiment.project, artifact)
+ project_package_path(candidate.project, artifact)
end
def link_to_details(candidate)
- project_ml_candidate_path(candidate.experiment.project, candidate.iid)
+ project_ml_candidate_path(candidate.project, candidate.iid)
end
def link_to_experiment(candidate)
@@ -57,6 +61,17 @@ module Projects
project_ml_experiment_path(experiment.project, experiment.iid)
end
+
+ def user_info(candidate)
+ user = candidate.user
+
+ return unless user.present?
+
+ {
+ username: user.username,
+ path: user_path(user)
+ }
+ end
end
end
end