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
c9de56fa
Commit
c9de56fa
authored
Nov 09, 2017
by
Filipa Lacerda
Committed by
Kamil Trzcinski
Dec 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add existing cluster form - FE and CSS
Add GKE, Login - HTML & CSS Cluster details - HTML & CSS
parent
26a585c9
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
75 additions
and
36 deletions
+75
-36
app/assets/javascripts/clusters/clusters_bundle.js
app/assets/javascripts/clusters/clusters_bundle.js
+15
-0
app/assets/stylesheets/pages/clusters.scss
app/assets/stylesheets/pages/clusters.scss
+4
-0
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+7
-7
app/views/projects/clusters/_dropdown.html.haml
app/views/projects/clusters/_dropdown.html.haml
+6
-5
app/views/projects/clusters/_form.html.haml
app/views/projects/clusters/_form.html.haml
+16
-4
app/views/projects/clusters/gcp/_form.html.haml
app/views/projects/clusters/gcp/_form.html.haml
+7
-3
app/views/projects/clusters/gcp/_header.html.haml
app/views/projects/clusters/gcp/_header.html.haml
+1
-1
app/views/projects/clusters/gcp/login.html.haml
app/views/projects/clusters/gcp/login.html.haml
+2
-1
app/views/projects/clusters/gcp/new.html.haml
app/views/projects/clusters/gcp/new.html.haml
+1
-1
app/views/projects/clusters/kubernetes/_form.html.haml
app/views/projects/clusters/kubernetes/_form.html.haml
+8
-12
app/views/projects/clusters/kubernetes/_header.html.haml
app/views/projects/clusters/kubernetes/_header.html.haml
+5
-0
app/views/projects/clusters/kubernetes/new.html.haml
app/views/projects/clusters/kubernetes/new.html.haml
+3
-2
No files found.
app/assets/javascripts/clusters/clusters_bundle.js
View file @
c9de56fa
...
...
@@ -48,6 +48,7 @@ export default class Clusters {
this
.
toggle
=
this
.
toggle
.
bind
(
this
);
this
.
installApplication
=
this
.
installApplication
.
bind
(
this
);
this
.
showToken
=
this
.
showToken
.
bind
(
this
);
this
.
toggleButton
=
document
.
querySelector
(
'
.js-toggle-cluster
'
);
this
.
toggleInput
=
document
.
querySelector
(
'
.js-toggle-input
'
);
...
...
@@ -56,6 +57,8 @@ export default class Clusters {
this
.
creatingContainer
=
document
.
querySelector
(
'
.js-cluster-creating
'
);
this
.
errorReasonContainer
=
this
.
errorContainer
.
querySelector
(
'
.js-error-reason
'
);
this
.
successApplicationContainer
=
document
.
querySelector
(
'
.js-cluster-application-notice
'
);
this
.
showTokenButton
=
document
.
querySelector
(
'
.js-show-cluster-token
'
);
this
.
tokenField
=
document
.
querySelector
(
'
.js-cluster-token
'
);
initSettingsPanels
();
this
.
initApplications
();
...
...
@@ -97,11 +100,13 @@ export default class Clusters {
addListeners
()
{
this
.
toggleButton
.
addEventListener
(
'
click
'
,
this
.
toggle
);
this
.
showTokenButton
.
addEventListener
(
'
click
'
,
this
.
showToken
);
eventHub
.
$on
(
'
installApplication
'
,
this
.
installApplication
);
}
removeListeners
()
{
this
.
toggleButton
.
removeEventListener
(
'
click
'
,
this
.
toggle
);
this
.
showTokenButton
.
removeEventListener
(
'
click
'
,
this
.
showToken
);
eventHub
.
$off
(
'
installApplication
'
,
this
.
installApplication
);
}
...
...
@@ -149,6 +154,16 @@ export default class Clusters {
this
.
toggleInput
.
setAttribute
(
'
value
'
,
this
.
toggleButton
.
classList
.
contains
(
'
checked
'
).
toString
());
}
showToken
()
{
const
type
=
this
.
tokenField
.
getAttribute
(
'
type
'
);
if
(
type
===
'
password
'
)
{
this
.
tokenField
.
setAttribute
(
'
type
'
,
'
text
'
);
}
else
{
this
.
tokenField
.
setAttribute
(
'
type
'
,
'
password
'
);
}
}
hideAll
()
{
this
.
errorContainer
.
classList
.
add
(
'
hidden
'
);
this
.
successContainer
.
classList
.
add
(
'
hidden
'
);
...
...
app/assets/stylesheets/pages/clusters.scss
View file @
c9de56fa
...
...
@@ -8,3 +8,7 @@
// Wait for the Vue to kick-in and render the applications block
min-height
:
302px
;
}
.clusters-dropdown-menu
{
max-width
:
100%
;
}
\ No newline at end of file
app/views/layouts/nav/sidebar/_project.html.haml
View file @
c9de56fa
...
...
@@ -154,7 +154,7 @@
CI / CD
%ul
.sidebar-sub-level-items
=
nav_link
(
controller:
[
:pipelines
,
:builds
,
:jobs
,
:pipeline_schedules
,
:environments
,
:artifacts
],
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
nav_link
(
controller:
[
:pipelines
,
:builds
,
:jobs
,
:pipeline_schedules
,
:environments
,
:artifacts
,
:clusters
,
:kubernetes
,
:gcp
],
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
link_to
project_pipelines_path
(
@project
)
do
%strong
.fly-out-top-item-name
#{
_
(
'CI / CD'
)
}
...
...
@@ -183,18 +183,18 @@
%span
Environments
-
if
project_nav_tab?
:clusters
=
nav_link
(
controller:
[
:clusters
,
:kubernetes
,
:gcp
])
do
=
link_to
project_clusters_path
(
@project
),
title:
'Cluster'
,
class:
'shortcuts-cluster'
do
%span
Cluster
-
if
@project
.
feature_available?
(
:builds
,
current_user
)
&&
!
@project
.
empty_repo?
=
nav_link
(
path:
'pipelines#charts'
)
do
=
link_to
charts_project_pipelines_path
(
@project
),
title:
'Charts'
,
class:
'shortcuts-pipelines-charts'
do
%span
Charts
-
if
project_nav_tab?
:clusters
=
nav_link
(
controller: :clusters
)
do
=
link_to
project_clusters_path
(
@project
),
title:
'Cluster'
,
class:
'shortcuts-cluster'
do
%span
Cluster
-
if
project_nav_tab?
:wiki
=
nav_link
(
controller: :wikis
)
do
=
link_to
get_project_wiki_path
(
@project
),
class:
'shortcuts-wiki'
do
...
...
app/views/projects/clusters/_dropdown.html.haml
View file @
c9de56fa
%h4
.prepend-top-0
=
s_
(
'ClusterIntegration|Choose how to set up cluster integration'
)
.dropdown
%button
.dropdown-toggle.form-control
{
type:
'button'
,
data:
{
toggle:
'dropdown'
},
"aria-haspopup"
:
true
,
"aria-expanded"
:
false
}
=
dropdown_text
%span
.caret
%ul
.dropdown-menu
%button
.dropdown-menu-toggle.dropdown-menu-full-width
{
type:
'button'
,
data:
{
toggle:
'dropdown'
},
"aria-haspopup"
:
true
,
"aria-expanded"
:
false
}
%span
.dropdown-toggle-text
=
dropdown_text
=
icon
(
'chevron-down'
)
%ul
.dropdown-menu.clusters-dropdown-menu.dropdown-menu-full-width
%li
%a
{
href:
providers_gcp_new_namespace_project_clusters_path
(
@project
.
namespace
,
@project
)
}
=
s_
(
'ClusterIntegration| Create cluster on Google Engine'
)
%li
%a
{
href:
platforms_kubernetes_new_namespace_project_clusters_path
(
@project
.
namespace
,
@project
)}
%a
{
href:
platforms_kubernetes_new_namespace_project_clusters_path
(
@project
.
namespace
,
@project
)
}
=
s_
(
'ClusterIntegration| Add existing cluster'
)
app/views/projects/clusters/_form.html.haml
View file @
c9de56fa
.form
_group.append-bottom-20
.form
-group
%label
.append-bottom-10
{
for:
'cluster-name'
}
=
s_
(
'ClusterIntegration|Cluster name'
)
.input-group
...
...
@@ -11,11 +11,23 @@
=
field
.
fields_for
:platform_kubernetes
,
@cluster
.
platform_kubernetes
do
|
platform_kubernetes_field
|
.form-group
=
platform_kubernetes_field
.
label
:api_url
,
s_
(
'ClusterIntegration|API URL'
)
=
platform_kubernetes_field
.
text_field
:api_url
,
class:
'form-control'
,
disabled:
@cluster
.
managed?
=
platform_kubernetes_field
.
text_field
:api_url
,
class:
'form-control'
,
placeholder:
s_
(
'ClusterIntegration|API URL'
),
disabled:
@cluster
.
managed?
.form-group
=
platform_kubernetes_field
.
label
:ca_cert
,
s_
(
'ClusterIntegration|CA Certificate'
)
=
platform_kubernetes_field
.
text_area
:ca_cert
,
class:
'form-control'
,
placeholder:
s_
(
'ClusterIntegration|Certificate Authority bundle (PEM format)'
),
disabled:
@cluster
.
managed?
.form-group
=
platform_kubernetes_field
.
label
:namespace
,
s_
(
'ClusterIntegration|Project namespace (optional, unique)'
)
=
platform_kubernetes_field
.
text_field
:namespace
,
class:
'form-control'
,
placeholder:
Clusters
::
Platforms
::
Kubernetes
.
namespace_for_project
(
@project
),
disabled:
@cluster
.
managed?
=
platform_kubernetes_field
.
text_field
:namespace
,
class:
'form-control'
,
placeholder:
s_
(
'ClusterIntegration|Project namespace'
),
disabled:
@cluster
.
managed?
.form-group
=
platform_kubernetes_field
.
label
:token
,
s_
(
'ClusterIntegration|Token'
)
.input-group
=
platform_kubernetes_field
.
text_field
:token
,
class:
'form-control js-cluster-token'
,
type:
'password'
,
placeholder:
s_
(
'ClusterIntegration|Token'
),
disabled:
@cluster
.
managed?
%span
.input-group-addon.clipboard-addon
%button
.js-show-cluster-token.btn-blank
{
type:
'button'
}
=
s_
(
'ClusterIntegration|Show'
)
.form-group
=
field
.
submit
s_
(
'ClusterIntegration|Save c
luster
'
),
class:
'btn btn-save'
=
field
.
submit
s_
(
'ClusterIntegration|Save c
hanges
'
),
class:
'btn btn-save'
app/views/projects/clusters/gcp/_form.html.haml
View file @
c9de56fa
=
form_for
@cluster
,
url:
providers_gcp_namespace_project_clusters_path
(
@project
.
namespace
,
@project
),
as: :cluster
do
|
field
|
%p
-
link_to_help_page
=
link_to
(
s_
(
'ClusterIntegration|help page'
),
help_page_path
(
'user/project/clusters/index'
),
target:
'_blank'
,
rel:
'noopener noreferrer'
)
=
s_
(
'ClusterIntegration|Read our %{link_to_help_page} on cluster integration.'
).
html_safe
%
{
link_to_help_page:
link_to_help_page
}
=
form_for
@cluster
,
html:
{
class:
'prepend-top-20'
},
url:
providers_gcp_namespace_project_clusters_path
(
@project
.
namespace
,
@project
),
as: :cluster
do
|
field
|
=
form_errors
(
@cluster
)
.form-group
=
field
.
label
:name
,
s_
(
'ClusterIntegration|Cluster name'
)
=
field
.
text_field
:name
,
class:
'form-control'
=
field
.
text_field
:name
,
class:
'form-control'
,
placeholder:
s_
(
'ClusterIntegration|Cluster name'
)
=
field
.
fields_for
:provider_gcp
,
@cluster
.
provider_gcp
do
|
provider_gcp_field
|
.form-group
=
provider_gcp_field
.
label
:gcp_project_id
,
s_
(
'ClusterIntegration|Google Cloud Platform project ID'
)
=
link_to
(
s_
(
'ClusterIntegration|See your projects'
),
'https://console.cloud.google.com/home/dashboard'
,
target:
'_blank'
,
rel:
'noopener noreferrer'
)
=
provider_gcp_field
.
text_field
:gcp_project_id
,
class:
'form-control'
=
provider_gcp_field
.
text_field
:gcp_project_id
,
class:
'form-control'
,
placeholder:
s_
(
'ClusterIntegration|Project ID'
)
.form-group
=
provider_gcp_field
.
label
:zone
,
s_
(
'ClusterIntegration|Zone'
)
...
...
app/views/projects/clusters/_header.html.haml
→
app/views/projects/clusters/
gcp/
_header.html.haml
View file @
c9de56fa
%h4
%h4
.prepend-top-20
=
s_
(
'ClusterIntegration|Enter the details for your cluster'
)
%p
=
s_
(
'ClusterIntegration|Please make sure that your Google account meets the following requirements:'
)
...
...
app/views/projects/clusters/gcp/login.html.haml
View file @
c9de56fa
...
...
@@ -5,7 +5,8 @@
.col-sm-4
=
render
'projects/clusters/sidebar'
.col-sm-8
=
render
'projects/clusters/header'
=
render
'projects/clusters/dropdown'
,
dropdown_text:
s_
(
'ClusterIntegration|Create cluster on Google Container Engine'
)
=
render
'header'
.row
.col-sm-8.col-sm-offset-4.signin-with-google
-
if
@authorize_url
...
...
app/views/projects/clusters/gcp/new.html.haml
View file @
c9de56fa
...
...
@@ -6,5 +6,5 @@
=
render
'projects/clusters/sidebar'
.col-sm-8
=
render
'projects/clusters/dropdown'
,
dropdown_text:
s_
(
'ClusterIntegration|Create cluster on Google Container Engine'
)
=
render
'
projects/clusters/
header'
=
render
'header'
=
render
'form'
app/views/projects/clusters/kubernetes/_form.html.haml
View file @
c9de56fa
=
form_for
@cluster
,
url:
platforms_kubernetes_namespace_project_clusters_path
(
@project
.
namespace
,
@project
),
as: :cluster
do
|
field
|
=
form_errors
(
@cluster
)
.form-group
=
field
.
label
:name
,
s_
(
'ClusterIntegration|Cluster name'
)
=
field
.
text_field
:name
,
class:
'form-control'
=
field
.
fields_for
:platform_kubernetes
,
@cluster
.
platform_kubernetes
do
|
platform_kubernetes_field
|
.form-group
=
platform_kubernetes_field
.
label
:api_url
,
s_
(
'ClusterIntegration|API URL'
)
=
platform_kubernetes_field
.
text_field
:api_url
,
class:
'form-control'
=
platform_kubernetes_field
.
text_field
:api_url
,
class:
'form-control'
,
placeholder:
s_
(
'ClusterIntegration|API URL'
)
.form-group
=
platform_kubernetes_field
.
label
:
token
,
s_
(
'ClusterIntegration|Token
'
)
=
platform_kubernetes_field
.
text_
field
:token
,
class:
'form-control'
=
platform_kubernetes_field
.
label
:
ca_cert
,
s_
(
'ClusterIntegration|CA Certificate
'
)
=
platform_kubernetes_field
.
text_
area
:ca_cert
,
class:
'form-control'
,
placeholder:
s_
(
'ClusterIntegration|Certificate Authority bundle (PEM format)'
)
.form-group
=
platform_kubernetes_field
.
label
:
ca_cert
,
s_
(
'ClusterIntegration|Token
'
)
=
platform_kubernetes_field
.
text_field
:
ca_cert
,
class:
'form-control'
=
platform_kubernetes_field
.
label
:
namespace
,
s_
(
'ClusterIntegration|Project namespace (optional, unique)
'
)
=
platform_kubernetes_field
.
text_field
:
namespace
,
class:
'form-control'
,
placeholder:
s_
(
'ClusterIntegration|Project namespace'
)
.form-group
=
platform_kubernetes_field
.
label
:
namespace
,
s_
(
'ClusterIntegration|Project namespace (optional, unique)
'
)
=
platform_kubernetes_field
.
text_field
:
namespace
,
class:
'form-control'
,
placeholder:
Clusters
::
Platforms
::
Kubernetes
.
namespace_for_project
(
@project
)
=
platform_kubernetes_field
.
label
:
token
,
s_
(
'ClusterIntegration|Token
'
)
=
platform_kubernetes_field
.
text_field
:
token
,
class:
'form-control'
,
placeholder:
s_
(
'ClusterIntegration|Service token'
)
.form-group
=
field
.
submit
s_
(
'ClusterIntegration|
Create
cluster'
),
class:
'btn btn-save'
=
field
.
submit
s_
(
'ClusterIntegration|
Add
cluster'
),
class:
'btn btn-save'
app/views/projects/clusters/kubernetes/_header.html.haml
0 → 100644
View file @
c9de56fa
%h4
.prepend-top-20
=
s_
(
'ClusterIntegration|Enter the details for your cluster'
)
%p
-
link_to_help_page
=
link_to
(
s_
(
'ClusterIntegration|documentation'
),
help_page_path
(
'user/project/clusters/index'
),
target:
'_blank'
,
rel:
'noopener noreferrer'
)
=
s_
(
'ClusterIntegration|Please enter access information for your cluster. If you need help, you can read our %{link_to_help_page} on clusters'
).
html_safe
%
{
link_to_help_page:
link_to_help_page
}
app/views/projects/clusters/kubernetes/new.html.haml
View file @
c9de56fa
...
...
@@ -6,5 +6,6 @@
=
render
'projects/clusters/sidebar'
.col-sm-8
=
render
'projects/clusters/dropdown'
,
dropdown_text:
s_
(
'ClusterIntegration|Add existing cluster'
)
=
render
'projects/clusters/header'
=
render
'form'
=
render
'header'
.prepend-top-20
=
render
'form'
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