2021-08-10 11:10:03 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
class RunnerPresenter < Gitlab::View::Presenter::Delegated
|
2021-09-21 05:12:21 -04:00
|
|
|
presents ::Ci::Runner, as: :runner
|
2021-08-10 11:10:03 -04:00
|
|
|
|
2021-09-21 05:12:21 -04:00
|
|
|
delegator_override :locked?
|
2021-08-10 11:10:03 -04:00
|
|
|
def locked?
|
|
|
|
read_attribute(:locked) && project_type?
|
|
|
|
end
|
2021-09-21 05:12:21 -04:00
|
|
|
|
|
|
|
delegator_override :locked
|
2021-08-10 11:10:03 -04:00
|
|
|
alias_method :locked, :locked?
|
2021-12-22 19:11:02 -05:00
|
|
|
|
|
|
|
def executor_name
|
|
|
|
Ci::Runner::EXECUTOR_TYPE_TO_NAMES[executor_type&.to_sym]
|
|
|
|
end
|
2022-01-25 10:12:32 -05:00
|
|
|
|
|
|
|
def paused
|
|
|
|
!active
|
|
|
|
end
|
2021-08-10 11:10:03 -04:00
|
|
|
end
|
|
|
|
end
|