Display a glyph for official plugins.
This commit is contained in:
parent
8f08c864d2
commit
1f686200bb
|
@ -51,7 +51,13 @@ module DockerManager
|
|||
repos << DockerManager::GitRepo.new(File.dirname(p.path), p.name)
|
||||
end
|
||||
repos.map! do |r|
|
||||
result = {name: r.name, path: r.path, branch: r.branch }
|
||||
result = {
|
||||
name: r.name,
|
||||
path: r.path,
|
||||
branch: r.branch,
|
||||
official: Plugin::Metadata::OFFICIAL_PLUGINS.include?(r.name)
|
||||
}
|
||||
|
||||
if r.valid?
|
||||
result[:id] = r.name.downcase.gsub(/[^a-z]/, '_').gsub(/_+/, '_').sub(/_$/, '')
|
||||
result[:version] = r.latest_local_commit
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -44,6 +44,15 @@ div.logs {
|
|||
|
||||
table#repos {
|
||||
margin-top: 10px;
|
||||
|
||||
td:first-child {
|
||||
width: 3%;
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 8px 8px 8px 0px;
|
||||
}
|
||||
}
|
||||
|
||||
h3.loading {
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<td>
|
||||
{{#if repo.official}}
|
||||
<span class="glyphicon glyphicon-check" title="Official Plugin"></span>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td>
|
||||
{{repo.name}}
|
||||
{{fmt-commit repo.version repo.url repo.branch}}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<table class='table' id='repos'>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style='width: 50%'>Repository Name</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
|
|
|
@ -30,4 +30,18 @@ RSpec.describe DockerManager::AdminController do
|
|||
expect(response.status).to eq(200)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#repos' do
|
||||
it 'should return the right response' do
|
||||
sign_in(Fabricate(:admin))
|
||||
|
||||
get '/admin/docker/repos'
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
|
||||
body = JSON.parse(response.body)
|
||||
|
||||
expect(body["repos"].first["official"]).to eq(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue