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/components/projects/ml/show_ml_model_component.rb')
-rw-r--r--app/components/projects/ml/show_ml_model_component.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/app/components/projects/ml/show_ml_model_component.rb b/app/components/projects/ml/show_ml_model_component.rb
new file mode 100644
index 00000000000..2fe2c7e7e9d
--- /dev/null
+++ b/app/components/projects/ml/show_ml_model_component.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+module Projects
+ module Ml
+ class ShowMlModelComponent < ViewComponent::Base
+ attr_reader :model
+
+ def initialize(model:)
+ @model = model.present
+ end
+
+ private
+
+ def view_model
+ vm = {
+ model: {
+ id: model.id,
+ name: model.name,
+ path: model.path
+ }
+ }
+
+ Gitlab::Json.generate(vm)
+ end
+ end
+ end
+end