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
f3a3566e
Commit
f3a3566e
authored
Nov 06, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for not_installable/scheduled and to not show created banner
parent
001de85e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
5 deletions
+21
-5
app/assets/javascripts/clusters/clusters_bundle.js
app/assets/javascripts/clusters/clusters_bundle.js
+4
-1
app/assets/javascripts/clusters/components/application_row.vue
...ssets/javascripts/clusters/components/application_row.vue
+5
-2
app/assets/javascripts/clusters/constants.js
app/assets/javascripts/clusters/constants.js
+2
-0
app/models/clusters/applications/helm.rb
app/models/clusters/applications/helm.rb
+6
-0
app/models/clusters/cluster.rb
app/models/clusters/cluster.rb
+3
-2
app/models/clusters/concerns/application_status.rb
app/models/clusters/concerns/application_status.rb
+1
-0
No files found.
app/assets/javascripts/clusters/clusters_bundle.js
View file @
f3a3566e
...
@@ -132,9 +132,12 @@ export default class Clusters {
...
@@ -132,9 +132,12 @@ export default class Clusters {
handleSuccess
(
data
)
{
handleSuccess
(
data
)
{
const
prevApplicationMap
=
Object
.
assign
({},
this
.
store
.
state
.
applications
);
const
prevApplicationMap
=
Object
.
assign
({},
this
.
store
.
state
.
applications
);
const
prevStatus
=
this
.
store
.
state
.
status
;
this
.
store
.
updateStateFromServer
(
data
.
data
);
this
.
store
.
updateStateFromServer
(
data
.
data
);
this
.
checkForNewInstalls
(
prevApplicationMap
,
this
.
store
.
state
.
applications
);
this
.
checkForNewInstalls
(
prevApplicationMap
,
this
.
store
.
state
.
applications
);
this
.
updateContainer
(
this
.
store
.
state
.
status
,
this
.
store
.
state
.
statusReason
);
if
(
prevStatus
.
length
==
0
||
prevStatus
!==
this
.
store
.
state
.
status
)
{
this
.
updateContainer
(
this
.
store
.
state
.
status
,
this
.
store
.
state
.
statusReason
);
}
}
}
toggle
()
{
toggle
()
{
...
...
app/assets/javascripts/clusters/components/application_row.vue
View file @
f3a3566e
...
@@ -3,6 +3,8 @@ import { s__ } from '../../locale';
...
@@ -3,6 +3,8 @@ import { s__ } from '../../locale';
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
import
loadingButton
from
'
../../vue_shared/components/loading_button.vue
'
;
import
loadingButton
from
'
../../vue_shared/components/loading_button.vue
'
;
import
{
import
{
APPLICATION_NOT_INSTALLABLE
,
APPLICATION_SCHEDULED
,
APPLICATION_INSTALLABLE
,
APPLICATION_INSTALLABLE
,
APPLICATION_INSTALLING
,
APPLICATION_INSTALLING
,
APPLICATION_INSTALLED
,
APPLICATION_INSTALLED
,
...
@@ -59,6 +61,7 @@ export default {
...
@@ -59,6 +61,7 @@ export default {
},
},
installButtonLoading
()
{
installButtonLoading
()
{
return
!
this
.
status
||
return
!
this
.
status
||
this
.
status
===
APPLICATION_SCHEDULED
||
this
.
status
===
APPLICATION_INSTALLING
||
this
.
status
===
APPLICATION_INSTALLING
||
this
.
requestStatus
===
REQUEST_LOADING
;
this
.
requestStatus
===
REQUEST_LOADING
;
},
},
...
@@ -72,9 +75,9 @@ export default {
...
@@ -72,9 +75,9 @@ export default {
},
},
installButtonLabel
()
{
installButtonLabel
()
{
let
label
;
let
label
;
if
(
this
.
status
===
APPLICATION_INSTALLABLE
||
this
.
status
===
APPLICATION_ERROR
)
{
if
(
this
.
status
===
APPLICATION_INSTALLABLE
||
this
.
status
===
APPLICATION_ERROR
||
this
.
status
===
APPLICATION_NOT_INSTALLABLE
)
{
label
=
s__
(
'
ClusterIntegration|Install
'
);
label
=
s__
(
'
ClusterIntegration|Install
'
);
}
else
if
(
this
.
status
===
APPLICATION_INSTALLING
)
{
}
else
if
(
this
.
status
===
APPLICATION_
SCHEDULED
||
this
.
status
===
APPLICATION_
INSTALLING
)
{
label
=
s__
(
'
ClusterIntegration|Installing
'
);
label
=
s__
(
'
ClusterIntegration|Installing
'
);
}
else
if
(
this
.
status
===
APPLICATION_INSTALLED
)
{
}
else
if
(
this
.
status
===
APPLICATION_INSTALLED
)
{
label
=
s__
(
'
ClusterIntegration|Installed
'
);
label
=
s__
(
'
ClusterIntegration|Installed
'
);
...
...
app/assets/javascripts/clusters/constants.js
View file @
f3a3566e
// These need to match what is returned from the server
// These need to match what is returned from the server
export
const
APPLICATION_NOT_INSTALLABLE
=
'
not_installable
'
;
export
const
APPLICATION_INSTALLABLE
=
'
installable
'
;
export
const
APPLICATION_INSTALLABLE
=
'
installable
'
;
export
const
APPLICATION_SCHEDULED
=
'
scheduled
'
;
export
const
APPLICATION_INSTALLING
=
'
installing
'
;
export
const
APPLICATION_INSTALLING
=
'
installing
'
;
export
const
APPLICATION_INSTALLED
=
'
installed
'
;
export
const
APPLICATION_INSTALLED
=
'
installed
'
;
export
const
APPLICATION_ERROR
=
'
error
'
;
export
const
APPLICATION_ERROR
=
'
error
'
;
...
...
app/models/clusters/applications/helm.rb
View file @
f3a3566e
...
@@ -11,10 +11,16 @@ module Clusters
...
@@ -11,10 +11,16 @@ module Clusters
validates
:cluster
,
presence:
true
validates
:cluster
,
presence:
true
after_initialize
:set_initial_status
def
self
.
application_name
def
self
.
application_name
self
.
to_s
.
demodulize
.
underscore
self
.
to_s
.
demodulize
.
underscore
end
end
def
set_initial_status
self
.
status
=
0
unless
cluster
.
platform_kubernetes_active?
end
def
name
def
name
self
.
class
.
application_name
self
.
class
.
application_name
end
end
...
...
app/models/clusters/cluster.rb
View file @
f3a3566e
...
@@ -37,6 +37,9 @@ module Clusters
...
@@ -37,6 +37,9 @@ module Clusters
delegate
:on_creation?
,
to: :provider
,
allow_nil:
true
delegate
:on_creation?
,
to: :provider
,
allow_nil:
true
delegate
:update_kubernetes_integration!
,
to: :platform
,
allow_nil:
true
delegate
:update_kubernetes_integration!
,
to: :platform
,
allow_nil:
true
delegate
:active?
,
to: :platform_kubernetes
,
prefix:
true
,
allow_nil:
true
delegate
:installed?
,
to: :application_helm
,
prefix:
true
,
allow_nil:
true
enum
platform_type:
{
enum
platform_type:
{
kubernetes:
1
kubernetes:
1
}
}
...
@@ -58,8 +61,6 @@ module Clusters
...
@@ -58,8 +61,6 @@ module Clusters
end
end
def
applications
def
applications
return
[]
unless
kubernetes?
[
[
application_helm
||
build_application_helm
application_helm
||
build_application_helm
]
]
...
...
app/models/clusters/concerns/application_status.rb
View file @
f3a3566e
...
@@ -5,6 +5,7 @@ module Clusters
...
@@ -5,6 +5,7 @@ module Clusters
included
do
included
do
state_machine
:status
,
initial: :installable
do
state_machine
:status
,
initial: :installable
do
state
:not_installable
,
value:
-
2
state
:errored
,
value:
-
1
state
:errored
,
value:
-
1
state
:installable
,
value:
0
state
:installable
,
value:
0
state
:scheduled
,
value:
1
state
:scheduled
,
value:
1
...
...
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