Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
7eee6cd2
Commit
7eee6cd2
authored
Jul 17, 2018
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert admin runners table to responsive table
parent
34bdb747
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
100 additions
and
80 deletions
+100
-80
app/views/admin/runners/_runner.html.haml
app/views/admin/runners/_runner.html.haml
+77
-50
app/views/admin/runners/index.html.haml
app/views/admin/runners/index.html.haml
+13
-16
spec/features/admin/admin_runners_spec.rb
spec/features/admin/admin_runners_spec.rb
+10
-14
No files found.
app/views/admin/runners/_runner.html.haml
View file @
7eee6cd2
%tr
{
id:
dom_id
(
runner
)
}
.gl-responsive-table-row
{
id:
dom_id
(
runner
)
}
%td
.table-section.section-10
.table-mobile-header
{
role:
"rowheader"
}
Type
.table-mobile-content
-
if
runner
.
instance_type?
-
if
runner
.
instance_type?
%span
.badge.badge-success
shared
%span
.badge.badge-success
shared
-
elsif
runner
.
group_type?
-
elsif
runner
.
group_type?
...
@@ -11,41 +13,66 @@
...
@@ -11,41 +13,66 @@
-
unless
runner
.
active?
-
unless
runner
.
active?
%span
.badge.badge-danger
paused
%span
.badge.badge-danger
paused
%td
.table-section.section-10
=
link_to
admin_runner_path
(
runner
)
do
.table-mobile-header
{
role:
'rowheader'
}
Runner token
=
runner
.
short_sha
.table-mobile-content
%td
=
link_to
runner
.
short_sha
,
admin_runner_path
(
runner
)
.table-section.section-10
.table-mobile-header
{
role:
'rowheader'
}
Description
.table-mobile-content
=
runner
.
description
=
runner
.
description
%td
.table-section.section-10
.table-mobile-header
{
role:
'rowheader'
}
Version
.table-mobile-content
=
runner
.
version
=
runner
.
version
%td
.table-section.section-10
.table-mobile-header
{
role:
'rowheader'
}
IP Address
.table-mobile-content
=
runner
.
ip_address
=
runner
.
ip_address
%td
.table-section.section-10
.table-mobile-header
{
role:
'rowheader'
}
Projects
.table-mobile-content
-
if
runner
.
instance_type?
||
runner
.
group_type?
-
if
runner
.
instance_type?
||
runner
.
group_type?
n/a
n/a
-
else
-
else
=
runner
.
projects
.
count
(
:all
)
=
runner
.
projects
.
count
(
:all
)
%td
#{
runner
.
builds
.
count
(
:all
)
}
.table-section.section-10
%td
.table-mobile-header
{
role:
'rowheader'
}
Jobs
.table-mobile-content
=
runner
.
builds
.
count
(
:all
)
.table-section.section-10
.table-mobile-header
{
role:
'rowheader'
}
Tags
.table-mobile-content
-
runner
.
tag_list
.
sort
.
each
do
|
tag
|
-
runner
.
tag_list
.
sort
.
each
do
|
tag
|
%span
.badge.badge-primary
%span
.badge.badge-primary
=
tag
=
tag
%td
.table-section.section-10
.table-mobile-header
{
role:
'rowheader'
}
Last contact
.table-mobile-content
-
if
runner
.
contacted_at
-
if
runner
.
contacted_at
=
time_ago_with_tooltip
runner
.
contacted_at
=
time_ago_with_tooltip
runner
.
contacted_at
-
else
-
else
Never
Never
%td
.admin-runner-btn-group-cell
.float-right.btn-group
.table-section.table-button-footer.section-10
=
link_to
admin_runner_path
(
runner
),
class:
'btn btn-sm btn-default has-tooltip'
,
title:
'Edit'
,
ref:
'tooltip'
,
aria:
{
label:
'Edit'
},
data:
{
placement:
'top'
,
container:
'body'
}
do
.btn-group.table-action-buttons
.btn-group
=
link_to
admin_runner_path
(
runner
),
class:
'btn btn-default has-tooltip'
,
title:
'Edit'
,
ref:
'tooltip'
,
aria:
{
label:
'Edit'
},
data:
{
placement:
'top'
,
container:
'body'
}
do
=
icon
(
'pencil'
)
=
icon
(
'pencil'
)
.btn-group
-
if
runner
.
active?
-
if
runner
.
active?
=
link_to
[
:pause
,
:admin
,
runner
],
method: :get
,
class:
'btn btn-sm
btn-default has-tooltip'
,
title:
'Pause'
,
ref:
'tooltip'
,
aria:
{
label:
'Pause'
},
data:
{
placement:
'top'
,
container:
'body'
,
confirm:
"Are you sure?"
}
do
=
link_to
[
:pause
,
:admin
,
runner
],
method: :get
,
class:
'btn
btn-default has-tooltip'
,
title:
'Pause'
,
ref:
'tooltip'
,
aria:
{
label:
'Pause'
},
data:
{
placement:
'top'
,
container:
'body'
,
confirm:
"Are you sure?"
}
do
=
icon
(
'pause'
)
=
icon
(
'pause'
)
-
else
-
else
=
link_to
[
:resume
,
:admin
,
runner
],
method: :get
,
class:
'btn btn-default btn-sm
has-tooltip'
,
title:
'Resume'
,
ref:
'tooltip'
,
aria:
{
label:
'Resume'
},
data:
{
placement:
'top'
,
container:
'body'
}
do
=
link_to
[
:resume
,
:admin
,
runner
],
method: :get
,
class:
'btn btn-default
has-tooltip'
,
title:
'Resume'
,
ref:
'tooltip'
,
aria:
{
label:
'Resume'
},
data:
{
placement:
'top'
,
container:
'body'
}
do
=
icon
(
'play'
)
=
icon
(
'play'
)
=
link_to
[
:admin
,
runner
],
method: :delete
,
class:
'btn btn-danger btn-sm has-tooltip'
,
title:
'Remove'
,
ref:
'tooltip'
,
aria:
{
label:
'Remove'
},
data:
{
placement:
'top'
,
container:
'body'
,
confirm:
"Are you sure?"
}
do
.btn-group
=
link_to
[
:admin
,
runner
],
method: :delete
,
class:
'btn btn-danger has-tooltip'
,
title:
'Remove'
,
ref:
'tooltip'
,
aria:
{
label:
'Remove'
},
data:
{
placement:
'top'
,
container:
'body'
,
confirm:
"Are you sure?"
}
do
=
icon
(
'remove'
)
=
icon
(
'remove'
)
app/views/admin/runners/index.html.haml
View file @
7eee6cd2
...
@@ -92,21 +92,18 @@
...
@@ -92,21 +92,18 @@
%br
%br
-
if
@runners
.
any?
-
if
@runners
.
any?
.runners-content
.runners-content
.content-list
.table-holder
.table-holder
%table
.table
.gl-responsive-table-row.table-row-header
{
role:
'row'
}
%thead
.table-section.section-10
{
role:
'rowheader'
}
Type
%tr
.table-section.section-10
{
role:
'rowheader'
}
Runner token
%th
Type
.table-section.section-10
{
role:
'rowheader'
}
Description
%th
Runner token
.table-section.section-10
{
role:
'rowheader'
}
Version
%th
Description
.table-section.section-10
{
role:
'rowheader'
}
IP Address
%th
Version
.table-section.section-10
{
role:
'rowheader'
}
Projects
%th
IP Address
.table-section.section-10
{
role:
'rowheader'
}
Jobs
%th
Projects
.table-section.section-10
{
role:
'rowheader'
}
Tags
%th
Jobs
.table-section.section-10
{
role:
'rowheader'
}
Last contact
%th
Tags
%th
Last contact
%th
-
@runners
.
each
do
|
runner
|
-
@runners
.
each
do
|
runner
|
=
render
"admin/runners/runner"
,
runner:
runner
=
render
"admin/runners/runner"
,
runner:
runner
...
...
spec/features/admin/admin_runners_spec.rb
View file @
7eee6cd2
...
@@ -99,29 +99,25 @@ describe "Admin Runners", :js do
...
@@ -99,29 +99,25 @@ describe "Admin Runners", :js do
visit
admin_runners_path
visit
admin_runners_path
within
'.runners-content tbody'
do
within
'.runners-content .gl-responsive-table-row:nth-child(2)'
do
within
(
'tr:nth-child(1)'
)
do
expect
(
page
).
to
have_content
'runner-2'
expect
(
page
).
to
have_content
'runner-2'
end
end
within
(
'tr:nth-child(2)'
)
do
within
'.runners-content .gl-responsive-table-row:nth-child(3)'
do
expect
(
page
).
to
have_content
'runner-1'
expect
(
page
).
to
have_content
'runner-1'
end
end
end
sorting_by
'Last Contact'
sorting_by
'Last Contact'
within
'.runners-content tbody'
do
within
'.runners-content .gl-responsive-table-row:nth-child(2)'
do
within
(
'tr:nth-child(1)'
)
do
expect
(
page
).
to
have_content
'runner-1'
expect
(
page
).
to
have_content
'runner-1'
end
end
within
(
'tr:nth-child(2)'
)
do
within
'.runners-content .gl-responsive-table-row:nth-child(3)'
do
expect
(
page
).
to
have_content
'runner-2'
expect
(
page
).
to
have_content
'runner-2'
end
end
end
end
end
end
end
context
"when there are no runners"
do
context
"when there are no runners"
do
before
do
before
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment