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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
1c302d56
Commit
1c302d56
authored
Jun 02, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP, try to add views for locked runners
parent
0eeb4bed
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
3 deletions
+14
-3
app/models/ci/runner.rb
app/models/ci/runner.rb
+1
-1
app/views/projects/runners/_form.html.haml
app/views/projects/runners/_form.html.haml
+6
-0
app/views/projects/runners/show.html.haml
app/views/projects/runners/show.html.haml
+3
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-0
lib/api/runners.rb
lib/api/runners.rb
+1
-1
lib/ci/api/runners.rb
lib/ci/api/runners.rb
+2
-1
No files found.
app/models/ci/runner.rb
View file @
1c302d56
...
@@ -4,7 +4,7 @@ module Ci
...
@@ -4,7 +4,7 @@ module Ci
LAST_CONTACT_TIME
=
5
.
minutes
.
ago
LAST_CONTACT_TIME
=
5
.
minutes
.
ago
AVAILABLE_SCOPES
=
%w[specific shared active paused online]
AVAILABLE_SCOPES
=
%w[specific shared active paused online]
FORM_EDITABLE
=
%i[description tag_list active run_untagged]
FORM_EDITABLE
=
%i[description tag_list active run_untagged
locked
]
has_many
:builds
,
class_name:
'Ci::Build'
has_many
:builds
,
class_name:
'Ci::Build'
has_many
:runner_projects
,
dependent: :destroy
,
class_name:
'Ci::RunnerProject'
has_many
:runner_projects
,
dependent: :destroy
,
class_name:
'Ci::RunnerProject'
...
...
app/views/projects/runners/_form.html.haml
View file @
1c302d56
...
@@ -12,6 +12,12 @@
...
@@ -12,6 +12,12 @@
.checkbox
.checkbox
=
f
.
check_box
:run_untagged
=
f
.
check_box
:run_untagged
%span
.light
Indicates whether this runner can pick jobs without tags
%span
.light
Indicates whether this runner can pick jobs without tags
.form-group
=
label
:locked
,
'Exclusive to this project'
,
class:
'control-label'
.col-sm-10
.checkbox
=
f
.
check_box
:locked
%span
.light
Indicates whether this runner can be enabled for other projects
.form-group
.form-group
=
label_tag
:token
,
class:
'control-label'
do
=
label_tag
:token
,
class:
'control-label'
do
Token
Token
...
...
app/views/projects/runners/show.html.haml
View file @
1c302d56
...
@@ -22,6 +22,9 @@
...
@@ -22,6 +22,9 @@
%tr
%tr
%td
Can run untagged jobs
%td
Can run untagged jobs
%td
=
@runner
.
run_untagged?
?
'Yes'
:
'No'
%td
=
@runner
.
run_untagged?
?
'Yes'
:
'No'
%tr
%td
Exclusive to this project
%td
=
@runner
.
locked?
?
'Yes'
:
'No'
%tr
%tr
%td
Tags
%td
Tags
%td
%td
...
...
lib/api/entities.rb
View file @
1c302d56
...
@@ -413,6 +413,7 @@ module API
...
@@ -413,6 +413,7 @@ module API
class
RunnerDetails
<
Runner
class
RunnerDetails
<
Runner
expose
:tag_list
expose
:tag_list
expose
:run_untagged
expose
:run_untagged
expose
:locked
expose
:version
,
:revision
,
:platform
,
:architecture
expose
:version
,
:revision
,
:platform
,
:architecture
expose
:contacted_at
expose
:contacted_at
expose
:token
,
if:
lambda
{
|
runner
,
options
|
options
[
:current_user
].
is_admin?
||
!
runner
.
is_shared?
}
expose
:token
,
if:
lambda
{
|
runner
,
options
|
options
[
:current_user
].
is_admin?
||
!
runner
.
is_shared?
}
...
...
lib/api/runners.rb
View file @
1c302d56
...
@@ -49,7 +49,7 @@ module API
...
@@ -49,7 +49,7 @@ module API
runner
=
get_runner
(
params
[
:id
])
runner
=
get_runner
(
params
[
:id
])
authenticate_update_runner!
(
runner
)
authenticate_update_runner!
(
runner
)
attrs
=
attributes_for_keys
[
:description
,
:active
,
:tag_list
,
:run_untagged
]
attrs
=
attributes_for_keys
[
:description
,
:active
,
:tag_list
,
:run_untagged
,
:locked
]
if
runner
.
update
(
attrs
)
if
runner
.
update
(
attrs
)
present
runner
,
with:
Entities
::
RunnerDetails
,
current_user:
current_user
present
runner
,
with:
Entities
::
RunnerDetails
,
current_user:
current_user
else
else
...
...
lib/ci/api/runners.rb
View file @
1c302d56
...
@@ -29,7 +29,8 @@ module Ci
...
@@ -29,7 +29,8 @@ module Ci
required_attributes!
[
:token
]
required_attributes!
[
:token
]
attributes
=
{
description:
params
[
:description
],
attributes
=
{
description:
params
[
:description
],
tag_list:
params
[
:tag_list
]
}
tag_list:
params
[
:tag_list
],
locked:
!!
params
[
:locked
]
}
unless
params
[
:run_untagged
].
nil?
unless
params
[
:run_untagged
].
nil?
attributes
[
:run_untagged
]
=
params
[
:run_untagged
]
attributes
[
:run_untagged
]
=
params
[
:run_untagged
]
...
...
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