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
06fb70fc
Commit
06fb70fc
authored
May 11, 2020
by
Emily Ring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added default cluster status
Added default cluster status to /clusters_list/constants.js
parent
1282559c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
4 deletions
+15
-4
app/assets/javascripts/clusters_list/components/clusters.vue
app/assets/javascripts/clusters_list/components/clusters.vue
+4
-4
app/assets/javascripts/clusters_list/constants.js
app/assets/javascripts/clusters_list/constants.js
+1
-0
spec/frontend/clusters_list/components/clusters_spec.js
spec/frontend/clusters_list/components/clusters_spec.js
+1
-0
spec/frontend/clusters_list/mock_data.js
spec/frontend/clusters_list/mock_data.js
+9
-0
No files found.
app/assets/javascripts/clusters_list/components/clusters.vue
View file @
06fb70fc
...
@@ -54,12 +54,12 @@ export default {
...
@@ -54,12 +54,12 @@ export default {
methods
:
{
methods
:
{
...
mapActions
([
'
fetchClusters
'
]),
...
mapActions
([
'
fetchClusters
'
]),
statusClass
(
status
)
{
statusClass
(
status
)
{
const
{
className
}
=
STATUSES
[
status
]
;
const
iconClass
=
STATUSES
[
status
]
||
STATUSES
.
default
;
return
className
||
'
disabled
'
;
return
iconClass
.
className
;
},
},
statusTitle
(
status
)
{
statusTitle
(
status
)
{
const
{
title
}
=
STATUSES
[
status
]
;
const
iconTitle
=
STATUSES
[
status
]
||
STATUSES
.
default
;
return
sprintf
(
__
(
'
Status: %{title}
'
),
{
title
},
false
);
return
sprintf
(
__
(
'
Status: %{title}
'
),
{
title
:
iconTitle
.
title
},
false
);
},
},
},
},
};
};
...
...
app/assets/javascripts/clusters_list/constants.js
View file @
06fb70fc
...
@@ -7,6 +7,7 @@ export const CLUSTER_TYPES = {
...
@@ -7,6 +7,7 @@ export const CLUSTER_TYPES = {
};
};
export
const
STATUSES
=
{
export
const
STATUSES
=
{
default
:
{
className
:
'
bg-white
'
,
title
:
__
(
'
Unknown
'
)
},
disabled
:
{
className
:
'
disabled
'
,
title
:
__
(
'
Disabled
'
)
},
disabled
:
{
className
:
'
disabled
'
,
title
:
__
(
'
Disabled
'
)
},
created
:
{
className
:
'
bg-success
'
,
title
:
__
(
'
Connected
'
)
},
created
:
{
className
:
'
bg-success
'
,
title
:
__
(
'
Connected
'
)
},
unreachable
:
{
className
:
'
bg-danger
'
,
title
:
__
(
'
Unreachable
'
)
},
unreachable
:
{
className
:
'
bg-danger
'
,
title
:
__
(
'
Unreachable
'
)
},
...
...
spec/frontend/clusters_list/components/clusters_spec.js
View file @
06fb70fc
...
@@ -80,6 +80,7 @@ describe('Clusters', () => {
...
@@ -80,6 +80,7 @@ describe('Clusters', () => {
${
'
authentication_failure
'
}
|
${
'
bg-warning
'
}
|
${
2
}
${
'
authentication_failure
'
}
|
${
'
bg-warning
'
}
|
${
2
}
${
'
deleting
'
}
|
${
null
}
|
${
3
}
${
'
deleting
'
}
|
${
null
}
|
${
3
}
${
'
created
'
}
|
${
'
bg-success
'
}
|
${
4
}
${
'
created
'
}
|
${
'
bg-success
'
}
|
${
4
}
${
'
default
'
}
|
${
'
bg-white
'
}
|
${
5
}
`
(
'
renders a status for each cluster
'
,
({
statusName
,
className
,
lineNumber
})
=>
{
`
(
'
renders a status for each cluster
'
,
({
statusName
,
className
,
lineNumber
})
=>
{
const
statuses
=
findStatuses
();
const
statuses
=
findStatuses
();
const
status
=
statuses
.
at
(
lineNumber
);
const
status
=
statuses
.
at
(
lineNumber
);
...
...
spec/frontend/clusters_list/mock_data.js
View file @
06fb70fc
...
@@ -44,6 +44,15 @@ export const clusterList = [
...
@@ -44,6 +44,15 @@ export const clusterList = [
cpu
:
'
6 (100% free)
'
,
cpu
:
'
6 (100% free)
'
,
memory
:
'
20.12 (35% free)
'
,
memory
:
'
20.12 (35% free)
'
,
},
},
{
name
:
'
My Cluster 6
'
,
environmentScope
:
'
*
'
,
size
:
'
1
'
,
clusterType
:
'
project_type
'
,
status
:
'
cleanup_ongoing
'
,
cpu
:
'
6 (100% free)
'
,
memory
:
'
20.12 (35% free)
'
,
},
];
];
export
const
apiData
=
{
export
const
apiData
=
{
...
...
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