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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
c4ccb91b
Commit
c4ccb91b
authored
Sep 14, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve remaining conflicts in new runners view feature
parent
636382fb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
38 deletions
+0
-38
app/controllers/admin/runners_controller.rb
app/controllers/admin/runners_controller.rb
+0
-4
app/models/ci/runner.rb
app/models/ci/runner.rb
+0
-3
app/views/admin/runners/index.html.haml
app/views/admin/runners/index.html.haml
+0
-18
lib/api/runners.rb
lib/api/runners.rb
+0
-13
No files found.
app/controllers/admin/runners_controller.rb
View file @
c4ccb91b
...
...
@@ -5,11 +5,7 @@ class Admin::RunnersController < Admin::ApplicationController
def
index
finder
=
Admin
::
RunnersFinder
.
new
(
params:
params
)
@runners
=
finder
.
execute
<<<<<<<
HEAD
@active_runners_cnt
=
Ci
::
Runner
.
online
.
count
=======
@active_runners_count
=
Ci
::
Runner
.
online
.
count
>>>>>>>
upstream
/
master
@sort
=
finder
.
sort_key
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
app/models/ci/runner.rb
View file @
c4ccb91b
...
...
@@ -32,15 +32,12 @@ module Ci
scope
:active
,
->
{
where
(
active:
true
)
}
scope
:paused
,
->
{
where
(
active:
false
)
}
scope
:online
,
->
{
where
(
'contacted_at > ?'
,
contact_time_deadline
)
}
<<<<<<<
HEAD
=======
# The following query using negation is cheaper than using `contacted_at <= ?`
# because there are less runners online than have been created. The
# resulting query is quickly finding online ones and then uses the regular
# indexed search and rejects the ones that are in the previous set. If we
# did `contacted_at <= ?` the query would effectively have to do a seq
# scan.
>>>>>>>
upstream
/
master
scope
:offline
,
->
{
where
.
not
(
id:
online
)
}
scope
:ordered
,
->
{
order
(
id: :desc
)
}
...
...
app/views/admin/runners/index.html.haml
View file @
c4ccb91b
...
...
@@ -47,11 +47,7 @@
.bs-callout
%p
<
<<<<<<
HEAD
=
_
(
'Runners currently online: %{active_runners_cnt}'
)
%
{
active_runners_cnt:
@active_runners_cnt
}
==
=====
=
_
(
'Runners currently online: %{active_runners_count}'
)
%
{
active_runners_count:
@active_runners_count
}
>
>>>>>> upstream/master
.row-content-block.second-block
=
form_tag
admin_runners_path
,
id:
'runners-search'
,
method: :get
,
class:
'filter-form js-filter-form'
do
...
...
@@ -72,21 +68,13 @@
#js-dropdown-hint
.filtered-search-input-dropdown-menu.dropdown-menu.hint-dropdown
%ul
{
data:
{
dropdown:
true
}
}
%li
.filter-dropdown-item
{
data:
{
action:
'submit'
}
}
<
<<<<<<
HEAD
%button
.btn.btn-link
==
=====
=
button_tag
class:
%w[btn btn-link]
do
>
>>>>>> upstream/master
=
icon
(
'search'
)
%span
=
_
(
'Press Enter or click to search'
)
%ul
.filter-dropdown
{
data:
{
dynamic:
true
,
dropdown:
true
}
}
%li
.filter-dropdown-item
<
<<<<<<
HEAD
%button
.btn.btn-link
==
=====
=
button_tag
class:
%w[btn btn-link]
do
>
>>>>>> upstream/master
-# Encapsulate static class name `{{icon}}` inside #{} to bypass
-# haml lint's ClassAttributeWithStaticValue
%i
.fa
{
class:
"#{'{{icon}}'}"
}
...
...
@@ -98,15 +86,9 @@
%ul
{
data:
{
dropdown:
true
}
}
-
Ci
::
Runner
::
AVAILABLE_STATUSES
.
each
do
|
status
|
%li
.filter-dropdown-item
{
data:
{
value:
status
}
}
<
<<<<<<
HEAD
%button
.btn.btn-link
=
status
.
titleize
%button
.clear-search.hidden
{
type:
'button'
}
==
=====
=
button_tag
class:
%w[btn btn-link]
do
=
status
.
titleize
=
button_tag
class:
%w[clear-search hidden]
do
>
>>>>>> upstream/master
=
icon
(
'times'
)
.filter-dropdown-container
=
render
'sort_dropdown'
...
...
lib/api/runners.rb
View file @
c4ccb91b
...
...
@@ -14,11 +14,7 @@ module API
use
:pagination
end
get
do
<<<<<<<
HEAD
runners
=
filter_runners
(
current_user
.
ci_owned_runners
,
params
[
:scope
],
only:
Ci
::
Runner
::
AVAILABLE_STATUSES
)
=======
runners
=
filter_runners
(
current_user
.
ci_owned_runners
,
params
[
:scope
],
allowed_scopes:
Ci
::
Runner
::
AVAILABLE_STATUSES
)
>>>>>>>
upstream
/
master
present
paginate
(
runners
),
with:
Entities
::
Runner
end
...
...
@@ -164,19 +160,10 @@ module API
end
helpers
do
<<<<<<<
HEAD
def
filter_runners
(
runners
,
scope
,
only:
nil
)
return
runners
unless
scope
.
present?
available_scopes
=
only
||
::
Ci
::
Runner
::
AVAILABLE_SCOPES
unless
available_scopes
.
include?
(
scope
)
=======
def
filter_runners
(
runners
,
scope
,
allowed_scopes:
::
Ci
::
Runner
::
AVAILABLE_SCOPES
)
return
runners
unless
scope
.
present?
unless
allowed_scopes
.
include?
(
scope
)
>>>>>>>
upstream
/
master
render_api_error!
(
'Scope contains invalid value'
,
400
)
end
...
...
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