Commit 5a1faf61 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add artifacts browser

This implementation makes it possible to browse artifacts, it
depends on artifacts metadata.
parent 37b2c5dd
...@@ -15,10 +15,8 @@ class Projects::ArtifactsController < Projects::ApplicationController ...@@ -15,10 +15,8 @@ class Projects::ArtifactsController < Projects::ApplicationController
end end
def browse def browse
path = params[:path].to_s current_path = params[:path] ? "./#{params[:path]}/" : './'
@paths = artifacts_metadata.map do |_artifact_file| @path = Gitlab::StringPath.new(current_path, artifacts_metadata)
Gitlab::StringPath.new(path, artifacts_metadata)
end
end end
private private
......
%tr{ class: 'tree-item' }
%td.tree-item-file-name
= tree_icon('folder', '755', directory.basename)
%span.str-truncated
= link_to directory.basename, browse_namespace_project_build_artifacts_path(@project.namespace, @project, @build, path: directory.path)
%tr{ class: 'tree-item' }
%td.tree-item-file-name
= tree_icon('file', '664', file.basename)
%span.str-truncated
= file.basename
- page_title "#{@build.name} (##{@build.id})", 'Build artifacts' - page_title "#{@build.name} (##{@build.id})", 'Build artifacts'
- header_title project_title(@project, "Build artifacts", namespace_project_build_path(@project.namespace, @project, @build)) - header_title project_title(@project, "Build artifacts", namespace_project_build_path(@project.namespace, @project, @build))
= @metadata.inspect %table.table.table-hover
= render partial: 'tree_directory', collection: @path.directories, as: :directory
= render partial: 'tree_file', collection: @path.files, as: :file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment