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
end
def browse
path = params[:path].to_s
@paths = artifacts_metadata.map do |_artifact_file|
Gitlab::StringPath.new(path, artifacts_metadata)
end
current_path = params[:path] ? "./#{params[:path]}/" : './'
@path = Gitlab::StringPath.new(current_path, artifacts_metadata)
end
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'
- 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