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
Jérome Perrin
gitlab-ce
Commits
19bac884
Commit
19bac884
authored
Feb 07, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add route for environment folder and expose an API
parent
d6ae01da
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
app/controllers/projects/environments_controller.rb
app/controllers/projects/environments_controller.rb
+18
-0
config/routes/project.rb
config/routes/project.rb
+4
-0
No files found.
app/controllers/projects/environments_controller.rb
View file @
19bac884
...
...
@@ -28,6 +28,24 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
end
def
folder
@environments
=
project
.
environments
.
where
(
environment_type:
params
[
:id
])
.
with_state
(
params
[
:scope
]
||
:available
)
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
{
environments:
EnvironmentSerializer
.
new
(
project:
@project
,
user:
@current_user
)
.
with_pagination
(
request
,
response
)
.
represent
(
@environments
),
}
end
end
end
def
show
@deployments
=
environment
.
deployments
.
order
(
id: :desc
).
page
(
params
[
:page
])
end
...
...
config/routes/project.rb
View file @
19bac884
...
...
@@ -156,6 +156,10 @@ constraints(ProjectUrlConstrainer.new) do
get
:terminal
get
'/terminal.ws/authorize'
,
to:
'environments#terminal_websocket_authorize'
,
constraints:
{
format:
nil
}
end
collection
do
get
:folder
,
path:
'folders/:id'
end
end
resource
:cycle_analytics
,
only:
[
:show
]
...
...
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