Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
6b77d1f3
Commit
6b77d1f3
authored
2 years ago
by
Phil Renaud
Browse files
Options
Download
Email Patches
Plain Diff
Working through timing issues w breadcrumbs
parent
3f08b2fd
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
ui/app/components/breadcrumbs/default.hbs
+1
-1
ui/app/components/breadcrumbs/default.hbs
ui/app/components/breadcrumbs/peers.js
+1
-0
ui/app/components/breadcrumbs/peers.js
ui/app/components/lifecycle-chart.js
+7
-1
ui/app/components/lifecycle-chart.js
ui/app/controllers/allocations/allocation.js
+38
-0
ui/app/controllers/allocations/allocation.js
ui/app/styles/core/breadcrumb.scss
+3
-0
ui/app/styles/core/breadcrumb.scss
with
50 additions
and
2 deletions
+50
-2
ui/app/components/breadcrumbs/default.hbs
+
1
-
1
View file @
6b77d1f3
...
...
@@ -10,7 +10,7 @@
exclusive
=
true
)
}}
>
{{
log
"CRUMB"
@crumb
@crumb
.
peers
}}
{{#if
@crumb
.
peers
}}
<span
class=
"peer-dropdown-container"
>
{{#if
@crumb
.
title
}}
...
...
This diff is collapsed.
Click to expand it.
ui/app/components/breadcrumbs/peers.js
+
1
-
0
View file @
6b77d1f3
...
...
@@ -8,6 +8,7 @@ export default class BreadcrumbsPeersComponent extends Component {
selectedPeer
=
{};
selectPeer
(
peer
)
{
const
[
routeName
,
...
models
]
=
peer
.
args
;
console
.
log
(
'
about to transition to
'
,
routeName
,
models
);
this
.
router
.
transitionTo
(
routeName
,
...
models
);
}
}
This diff is collapsed.
Click to expand it.
ui/app/components/lifecycle-chart.js
+
7
-
1
View file @
6b77d1f3
...
...
@@ -13,6 +13,10 @@ export default class LifecycleChart extends Component {
@
computed
(
'
tasks.@each.lifecycle
'
,
'
taskStates.@each.state
'
)
get
lifecyclePhases
()
{
const
tasksOrStates
=
this
.
taskStates
||
this
.
tasks
;
console
.
log
(
'
phases for 1
'
,
tasksOrStates
.
map
((
x
)
=>
x
.
get
(
'
allocation
'
).
get
(
'
shortId
'
))
);
const
lifecycles
=
{
'
prestart-ephemerals
'
:
[],
'
prestart-sidecars
'
:
[],
...
...
@@ -61,11 +65,13 @@ export default class LifecycleChart extends Component {
}
@
sort
(
'
taskStates
'
,
function
(
a
,
b
)
{
console
.
log
(
'
+++TS
'
,
a
);
return
getTaskSortPrefix
(
a
.
task
).
localeCompare
(
getTaskSortPrefix
(
b
.
task
));
})
sortedLifecycleTaskStates
;
@
sort
(
'
tasks
'
,
function
(
a
,
b
)
{
console
.
log
(
'
!!!SLT
'
,
a
);
return
getTaskSortPrefix
(
a
).
localeCompare
(
getTaskSortPrefix
(
b
));
})
sortedLifecycleTasks
;
...
...
@@ -81,5 +87,5 @@ const lifecycleNameSortPrefix = {
};
function
getTaskSortPrefix
(
task
)
{
return
`
${
lifecycleNameSortPrefix
[
task
.
lifecycleName
]}
-
${
task
.
name
}
`
;
return
`
${
lifecycleNameSortPrefix
[
task
?
.
lifecycleName
]}
-
${
task
?
.
name
}
`
;
}
This diff is collapsed.
Click to expand it.
ui/app/controllers/allocations/allocation.js
+
38
-
0
View file @
6b77d1f3
...
...
@@ -16,6 +16,42 @@ export default class AllocationsAllocationController extends Controller {
return
job
;
}
get
allocationPeers
()
{
return
this
.
job
.
taskGroups
.
filterBy
(
'
name
'
,
this
.
allocation
.
taskGroup
.
name
)
.
reduce
((
allocs
,
group
)
=>
{
return
allocs
.
concat
(
group
.
allocations
.
rejectBy
(
'
id
'
,
this
.
allocation
.
id
).
map
((
alloc
)
=>
{
return
{
label
:
alloc
.
shortId
,
args
:
[
'
allocations.allocation
'
,
alloc
.
id
],
};
})
);
},
[]);
// console.log('getting allocpeers', this.allocation, this.store.peekAll('allocation'));
// return this.store
// .peekAll('allocation')
// .rejectBy('id', this.allocation?.id)
// .map((alloc) => {
// return {
// label: alloc.shortId,
// args: ['allocations.allocation', alloc.id],
// };
// });
}
get
taskGroupPeers
()
{
const
groupsWithinJob
=
this
.
job
.
taskGroups
.
map
((
group
)
=>
{
return
{
label
:
group
.
name
,
args
:
[
'
jobs.job.task-group
'
,
this
.
job
.
idWithNamespace
,
group
.
name
],
};
});
return
groupsWithinJob
.
length
>
1
?
groupsWithinJob
:
null
;
}
get
jobNamespace
()
{
const
jobNamespaceId
=
this
.
job
.
belongsTo
(
'
namespace
'
).
id
();
...
...
@@ -40,11 +76,13 @@ export default class AllocationsAllocationController extends Controller {
job
.
idWithNamespace
,
allocation
.
taskGroupName
,
],
peers
:
this
.
taskGroupPeers
,
},
{
title
:
'
Allocation
'
,
label
:
allocation
.
shortId
,
args
:
[
'
allocations.allocation
'
,
allocation
],
peers
:
this
.
allocationPeers
,
},
];
}
...
...
This diff is collapsed.
Click to expand it.
ui/app/styles/core/breadcrumb.scss
+
3
-
0
View file @
6b77d1f3
...
...
@@ -36,6 +36,7 @@
position
:
relative
;
&
>
.peer-dropdown-container
{
padding-left
:
0
.75em
;
padding-right
:
0
.75em
;
}
.ember-power-select-trigger
{
background-color
:
transparent
;
...
...
@@ -46,6 +47,7 @@
padding-bottom
:
0
;
// outline: none;
box-shadow
:
none
;
padding-right
:
24px
;
&
:focus
{
border-bottom
:
1px
solid
white
;
...
...
@@ -58,6 +60,7 @@
.ember-power-select-prefix
{
color
:
unset
;
font-size
:
16px
;
}
.ember-power-select-selected-item
{
margin-left
:
0
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help