Add getConfigPage to Descriptor
I added this for enabling config view like in the playground.
This commit is contained in:
parent
aa0cae317b
commit
737e4c04db
|
@ -18,6 +18,22 @@ module Jenkins
|
|||
@java_type
|
||||
end
|
||||
|
||||
# TODO: We removed @name from Descriptor (see playground) so we need to use another name.
|
||||
# Just use class name which is in CamelCase.
|
||||
def getConfigPage
|
||||
"/#{name_to_path}/config".tap { |path|
|
||||
puts "getConfigPage -> #{path}"
|
||||
}
|
||||
end
|
||||
|
||||
# TODO: We removed @name from Descriptor (see playground) so we need to use another name.
|
||||
# Just use class name which is in CamelCase.
|
||||
def getGlobalConfigPage
|
||||
"/#{name_to_path}/global".tap { |path|
|
||||
puts "getGlobalConfigPage -> #{path}"
|
||||
}
|
||||
end
|
||||
|
||||
def newInstance(request, form)
|
||||
properties = JSON.parse(form.toString(2))
|
||||
properties.delete("kind")
|
||||
|
@ -34,6 +50,10 @@ module Jenkins
|
|||
rescue ArgumentError
|
||||
@impl.new
|
||||
end
|
||||
|
||||
def name_to_path
|
||||
@impl.name.split('::').join('/')
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue