Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
8c600acb
Commit
8c600acb
authored
3 years ago
by
Jai Bhagat
Browse files
Options
Download
Email Patches
Plain Diff
ui: prettify js files
parent
635e9370
Changes
291
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
ui/.storybook/babel.config.js
+9
-2
ui/.storybook/babel.config.js
ui/app/abilities/abstract.js
+34
-16
ui/app/abilities/abstract.js
ui/app/abilities/agent.js
+5
-1
ui/app/abilities/agent.js
ui/app/abilities/client.js
+12
-3
ui/app/abilities/client.js
ui/app/abilities/job.js
+5
-1
ui/app/abilities/job.js
ui/app/abilities/recommendation.js
+5
-1
ui/app/abilities/recommendation.js
ui/app/adapters/allocation.js
+10
-3
ui/app/adapters/allocation.js
ui/app/adapters/application.js
+3
-1
ui/app/adapters/application.js
ui/app/adapters/deployment.js
+4
-1
ui/app/adapters/deployment.js
ui/app/adapters/job-version.js
+4
-1
ui/app/adapters/job-version.js
ui/app/adapters/job.js
+12
-3
ui/app/adapters/job.js
ui/app/adapters/node.js
+4
-1
ui/app/adapters/node.js
ui/app/adapters/recommendation-summary.js
+12
-5
ui/app/adapters/recommendation-summary.js
ui/app/adapters/token.js
+4
-1
ui/app/adapters/token.js
ui/app/adapters/watchable-namespace-ids.js
+2
-1
ui/app/adapters/watchable-namespace-ids.js
ui/app/adapters/watchable.js
+45
-9
ui/app/adapters/watchable.js
ui/app/components/allocation-row.js
+3
-1
ui/app/components/allocation-row.js
ui/app/components/allocation-stat.js
+4
-2
ui/app/components/allocation-stat.js
ui/app/components/chart-primitives/area.js
+3
-1
ui/app/components/chart-primitives/area.js
ui/app/components/children-status-bar.js
+15
-3
ui/app/components/children-status-bar.js
with
195 additions
and
57 deletions
+195
-57
ui/.storybook/babel.config.js
+
9
-
2
View file @
8c600acb
...
...
@@ -14,7 +14,11 @@ module.exports = {
shippedProposals
:
true
,
useBuiltIns
:
'
usage
'
,
corejs
:
'
3
'
,
targets
:
[
'
last 1 Chrome versions
'
,
'
last 1 Firefox versions
'
,
'
last 1 Safari versions
'
],
targets
:
[
'
last 1 Chrome versions
'
,
'
last 1 Firefox versions
'
,
'
last 1 Safari versions
'
,
],
},
],
],
...
...
@@ -27,7 +31,10 @@ module.exports = {
],
[
'
@babel/plugin-proposal-class-properties
'
,
{
loose
:
true
}],
'
@babel/plugin-syntax-dynamic-import
'
,
[
'
@babel/plugin-proposal-object-rest-spread
'
,
{
loose
:
true
,
useBuiltIns
:
true
}],
[
'
@babel/plugin-proposal-object-rest-spread
'
,
{
loose
:
true
,
useBuiltIns
:
true
},
],
'
babel-plugin-macros
'
,
[
'
emotion
'
,
{
sourceMap
:
true
,
autoLabel
:
true
}],
[
...
...
This diff is collapsed.
Click to expand it.
ui/app/abilities/abstract.js
+
34
-
16
View file @
8c600acb
...
...
@@ -26,17 +26,26 @@ export default class Abstract extends Ability {
get
rulesForNamespace
()
{
let
namespace
=
this
.
_namespace
;
return
(
this
.
get
(
'
token.selfTokenPolicies
'
)
||
[]).
toArray
().
reduce
((
rules
,
policy
)
=>
{
let
policyNamespaces
=
get
(
policy
,
'
rulesJSON.Namespaces
'
)
||
[];
let
matchingNamespace
=
this
.
_findMatchingNamespace
(
policyNamespaces
,
namespace
);
if
(
matchingNamespace
)
{
rules
.
push
(
policyNamespaces
.
find
((
namespace
)
=>
namespace
.
Name
===
matchingNamespace
));
}
return
(
this
.
get
(
'
token.selfTokenPolicies
'
)
||
[])
.
toArray
()
.
reduce
((
rules
,
policy
)
=>
{
let
policyNamespaces
=
get
(
policy
,
'
rulesJSON.Namespaces
'
)
||
[];
let
matchingNamespace
=
this
.
_findMatchingNamespace
(
policyNamespaces
,
namespace
);
if
(
matchingNamespace
)
{
rules
.
push
(
policyNamespaces
.
find
(
(
namespace
)
=>
namespace
.
Name
===
matchingNamespace
)
);
}
return
rules
;
},
[]);
return
rules
;
},
[]);
}
@
computed
(
'
token.selfTokenPolicies.[]
'
)
...
...
@@ -44,9 +53,11 @@ export default class Abstract extends Ability {
return
(
this
.
get
(
'
token.selfTokenPolicies
'
)
||
[])
.
toArray
()
.
reduce
((
allCapabilities
,
policy
)
=>
{
(
get
(
policy
,
'
rulesJSON.Namespaces
'
)
||
[]).
forEach
(({
Capabilities
})
=>
{
allCapabilities
=
allCapabilities
.
concat
(
Capabilities
);
});
(
get
(
policy
,
'
rulesJSON.Namespaces
'
)
||
[]).
forEach
(
({
Capabilities
})
=>
{
allCapabilities
=
allCapabilities
.
concat
(
Capabilities
);
}
);
return
allCapabilities
;
},
[]);
}
...
...
@@ -76,12 +87,16 @@ export default class Abstract extends Ability {
return
namespace
;
}
let
globNamespaceNames
=
namespaceNames
.
filter
((
namespaceName
)
=>
namespaceName
.
includes
(
'
*
'
));
let
globNamespaceNames
=
namespaceNames
.
filter
((
namespaceName
)
=>
namespaceName
.
includes
(
'
*
'
)
);
let
matchingNamespaceName
=
globNamespaceNames
.
reduce
(
(
mostMatching
,
namespaceName
)
=>
{
// Convert * wildcards to .* for regex matching
let
namespaceNameRegExp
=
new
RegExp
(
namespaceName
.
replace
(
/
\*
/g
,
'
.*
'
));
let
namespaceNameRegExp
=
new
RegExp
(
namespaceName
.
replace
(
/
\*
/g
,
'
.*
'
)
);
let
characterDifference
=
namespace
.
length
-
namespaceName
.
length
;
if
(
...
...
@@ -96,7 +111,10 @@ export default class Abstract extends Ability {
return
mostMatching
;
}
},
{
mostMatchingNamespaceName
:
null
,
mostMatchingCharacterDifference
:
Number
.
MAX_SAFE_INTEGER
}
{
mostMatchingNamespaceName
:
null
,
mostMatchingCharacterDifference
:
Number
.
MAX_SAFE_INTEGER
,
}
).
mostMatchingNamespaceName
;
if
(
matchingNamespaceName
)
{
...
...
This diff is collapsed.
Click to expand it.
ui/app/abilities/agent.js
+
5
-
1
View file @
8c600acb
...
...
@@ -3,7 +3,11 @@ import { computed, get } from '@ember/object';
import
{
or
}
from
'
@ember/object/computed
'
;
export
default
class
Client
extends
AbstractAbility
{
@
or
(
'
bypassAuthorization
'
,
'
selfTokenIsManagement
'
,
'
policiesIncludeAgentReadOrWrite
'
)
@
or
(
'
bypassAuthorization
'
,
'
selfTokenIsManagement
'
,
'
policiesIncludeAgentReadOrWrite
'
)
canRead
;
@
computed
(
'
token.selfTokenPolicies.[]
'
)
...
...
This diff is collapsed.
Click to expand it.
ui/app/abilities/client.js
+
12
-
3
View file @
8c600acb
...
...
@@ -10,17 +10,26 @@ export default class Client extends AbstractAbility {
@
or
(
'
bypassAuthorization
'
,
'
selfTokenIsManagement
'
,
'
policiesIncludeNodeRead
'
)
canRead
;
@
or
(
'
bypassAuthorization
'
,
'
selfTokenIsManagement
'
,
'
policiesIncludeNodeWrite
'
)
@
or
(
'
bypassAuthorization
'
,
'
selfTokenIsManagement
'
,
'
policiesIncludeNodeWrite
'
)
canWrite
;
@
computed
(
'
token.selfTokenPolicies.[]
'
)
get
policiesIncludeNodeRead
()
{
return
policiesIncludePermissions
(
this
.
get
(
'
token.selfTokenPolicies
'
),
[
'
read
'
,
'
write
'
]);
return
policiesIncludePermissions
(
this
.
get
(
'
token.selfTokenPolicies
'
),
[
'
read
'
,
'
write
'
]);
}
@
computed
(
'
token.selfTokenPolicies.[]
'
)
get
policiesIncludeNodeWrite
()
{
return
policiesIncludePermissions
(
this
.
get
(
'
token.selfTokenPolicies
'
),
[
'
write
'
]);
return
policiesIncludePermissions
(
this
.
get
(
'
token.selfTokenPolicies
'
),
[
'
write
'
]);
}
}
...
...
This diff is collapsed.
Click to expand it.
ui/app/abilities/job.js
+
5
-
1
View file @
8c600acb
...
...
@@ -20,7 +20,11 @@ export default class Job extends AbstractAbility {
@
or
(
'
bypassAuthorization
'
,
'
selfTokenIsManagement
'
)
canListAll
;
@
or
(
'
bypassAuthorization
'
,
'
selfTokenIsManagement
'
,
'
policiesSupportDispatching
'
)
@
or
(
'
bypassAuthorization
'
,
'
selfTokenIsManagement
'
,
'
policiesSupportDispatching
'
)
canDispatch
;
@
computed
(
'
rulesForNamespace.@each.capabilities
'
)
...
...
This diff is collapsed.
Click to expand it.
ui/app/abilities/recommendation.js
+
5
-
1
View file @
8c600acb
...
...
@@ -6,7 +6,11 @@ export default class Recommendation extends AbstractAbility {
@
and
(
'
dynamicApplicationSizingIsPresent
'
,
'
hasPermissions
'
)
canAccept
;
@
or
(
'
bypassAuthorization
'
,
'
selfTokenIsManagement
'
,
'
policiesSupportAcceptingOnAnyNamespace
'
)
@
or
(
'
bypassAuthorization
'
,
'
selfTokenIsManagement
'
,
'
policiesSupportAcceptingOnAnyNamespace
'
)
hasPermissions
;
@
computed
(
'
capabilitiesForAllNamespaces.[]
'
)
...
...
This diff is collapsed.
Click to expand it.
ui/app/adapters/allocation.js
+
10
-
3
View file @
8c600acb
...
...
@@ -14,13 +14,17 @@ export default class AllocationAdapter extends Watchable {
ls
(
model
,
path
)
{
return
this
.
token
.
authorizedRequest
(
`/v1/client/fs/ls/
${
model
.
id
}
?path=
${
encodeURIComponent
(
path
)}
`
)
.
authorizedRequest
(
`/v1/client/fs/ls/
${
model
.
id
}
?path=
${
encodeURIComponent
(
path
)}
`
)
.
then
(
handleFSResponse
);
}
stat
(
model
,
path
)
{
return
this
.
token
.
authorizedRequest
(
`/v1/client/fs/stat/
${
model
.
id
}
?path=
${
encodeURIComponent
(
path
)}
`
)
.
authorizedRequest
(
`/v1/client/fs/stat/
${
model
.
id
}
?path=
${
encodeURIComponent
(
path
)}
`
)
.
then
(
handleFSResponse
);
}
}
...
...
@@ -40,7 +44,10 @@ async function handleFSResponse(response) {
function
adapterAction
(
path
,
verb
=
'
POST
'
)
{
return
function
(
allocation
)
{
const
url
=
addToPath
(
this
.
urlForFindRecord
(
allocation
.
id
,
'
allocation
'
),
path
);
const
url
=
addToPath
(
this
.
urlForFindRecord
(
allocation
.
id
,
'
allocation
'
),
path
);
return
this
.
ajax
(
url
,
verb
);
};
}
This diff is collapsed.
Click to expand it.
ui/app/adapters/application.js
+
3
-
1
View file @
8c600acb
...
...
@@ -125,5 +125,7 @@ export default class ApplicationAdapter extends RESTAdapter {
}
function
associateRegion
(
url
,
region
)
{
return
url
.
indexOf
(
'
?
'
)
!==
-
1
?
`
${
url
}
®ion=
${
region
}
`
:
`
${
url
}
?region=
${
region
}
`
;
return
url
.
indexOf
(
'
?
'
)
!==
-
1
?
`
${
url
}
®ion=
${
region
}
`
:
`
${
url
}
?region=
${
region
}
`
;
}
This diff is collapsed.
Click to expand it.
ui/app/adapters/deployment.js
+
4
-
1
View file @
8c600acb
...
...
@@ -13,7 +13,10 @@ export default class DeploymentAdapter extends Watchable {
promote
(
deployment
)
{
const
id
=
deployment
.
get
(
'
id
'
);
const
url
=
urlForAction
(
this
.
urlForFindRecord
(
id
,
'
deployment
'
),
'
/promote
'
);
const
url
=
urlForAction
(
this
.
urlForFindRecord
(
id
,
'
deployment
'
),
'
/promote
'
);
return
this
.
ajax
(
url
,
'
POST
'
,
{
data
:
{
DeploymentId
:
id
,
...
...
This diff is collapsed.
Click to expand it.
ui/app/adapters/job-version.js
+
4
-
1
View file @
8c600acb
...
...
@@ -5,7 +5,10 @@ export default class JobVersionAdapter extends ApplicationAdapter {
revertTo
(
jobVersion
)
{
const
jobAdapter
=
this
.
store
.
adapterFor
(
'
job
'
);
const
url
=
addToPath
(
jobAdapter
.
urlForFindRecord
(
jobVersion
.
get
(
'
job.id
'
),
'
job
'
),
'
/revert
'
);
const
url
=
addToPath
(
jobAdapter
.
urlForFindRecord
(
jobVersion
.
get
(
'
job.id
'
),
'
job
'
),
'
/revert
'
);
const
[
jobName
]
=
JSON
.
parse
(
jobVersion
.
get
(
'
job.id
'
));
return
this
.
ajax
(
url
,
'
POST
'
,
{
...
...
This diff is collapsed.
Click to expand it.
ui/app/adapters/job.js
+
12
-
3
View file @
8c600acb
...
...
@@ -14,7 +14,10 @@ export default class JobAdapter extends WatchableNamespaceIDs {
forcePeriodic
(
job
)
{
if
(
job
.
get
(
'
periodic
'
))
{
const
url
=
addToPath
(
this
.
urlForFindRecord
(
job
.
get
(
'
id
'
),
'
job
'
),
'
/periodic/force
'
);
const
url
=
addToPath
(
this
.
urlForFindRecord
(
job
.
get
(
'
id
'
),
'
job
'
),
'
/periodic/force
'
);
return
this
.
ajax
(
url
,
'
POST
'
);
}
}
...
...
@@ -71,7 +74,10 @@ export default class JobAdapter extends WatchableNamespaceIDs {
}
scale
(
job
,
group
,
count
,
message
)
{
const
url
=
addToPath
(
this
.
urlForFindRecord
(
job
.
get
(
'
id
'
),
'
job
'
),
'
/scale
'
);
const
url
=
addToPath
(
this
.
urlForFindRecord
(
job
.
get
(
'
id
'
),
'
job
'
),
'
/scale
'
);
return
this
.
ajax
(
url
,
'
POST
'
,
{
data
:
{
Count
:
count
,
...
...
@@ -87,7 +93,10 @@ export default class JobAdapter extends WatchableNamespaceIDs {
}
dispatch
(
job
,
meta
,
payload
)
{
const
url
=
addToPath
(
this
.
urlForFindRecord
(
job
.
get
(
'
id
'
),
'
job
'
),
'
/dispatch
'
);
const
url
=
addToPath
(
this
.
urlForFindRecord
(
job
.
get
(
'
id
'
),
'
job
'
),
'
/dispatch
'
);
return
this
.
ajax
(
url
,
'
POST
'
,
{
data
:
{
Payload
:
base64EncodeString
(
payload
),
...
...
This diff is collapsed.
Click to expand it.
ui/app/adapters/node.js
+
4
-
1
View file @
8c600acb
...
...
@@ -11,7 +11,10 @@ export default class NodeAdapter extends Watchable {
}
setEligibility
(
node
,
isEligible
)
{
const
url
=
addToPath
(
this
.
urlForFindRecord
(
node
.
id
,
'
node
'
),
'
/eligibility
'
);
const
url
=
addToPath
(
this
.
urlForFindRecord
(
node
.
id
,
'
node
'
),
'
/eligibility
'
);
return
this
.
ajax
(
url
,
'
POST
'
,
{
data
:
{
NodeID
:
node
.
id
,
...
...
This diff is collapsed.
Click to expand it.
ui/app/adapters/recommendation-summary.js
+
12
-
5
View file @
8c600acb
...
...
@@ -9,13 +9,20 @@ export default class RecommendationSummaryAdapter extends ApplicationAdapter {
}
updateRecord
(
store
,
type
,
snapshot
)
{
const
url
=
`
${
super
.
urlForCreateRecord
(
'
recommendations
'
,
snapshot
)}
/apply`
;
const
url
=
`
${
super
.
urlForCreateRecord
(
'
recommendations
'
,
snapshot
)}
/apply`
;
const
allRecommendationIds
=
snapshot
.
hasMany
(
'
recommendations
'
).
mapBy
(
'
id
'
);
const
excludedRecommendationIds
=
(
snapshot
.
hasMany
(
'
excludedRecommendations
'
)
||
[]).
mapBy
(
'
id
'
const
allRecommendationIds
=
snapshot
.
hasMany
(
'
recommendations
'
)
.
mapBy
(
'
id
'
);
const
excludedRecommendationIds
=
(
snapshot
.
hasMany
(
'
excludedRecommendations
'
)
||
[]
).
mapBy
(
'
id
'
);
const
includedRecommendationIds
=
allRecommendationIds
.
removeObjects
(
excludedRecommendationIds
);
const
includedRecommendationIds
=
allRecommendationIds
.
removeObjects
(
excludedRecommendationIds
);
const
data
=
{
Apply
:
includedRecommendationIds
,
...
...
This diff is collapsed.
Click to expand it.
ui/app/adapters/token.js
+
4
-
1
View file @
8c600acb
...
...
@@ -30,7 +30,10 @@ export default class TokenAdapter extends ApplicationAdapter {
tokens
:
[
token
],
});
return
store
.
peekRecord
(
'
token
'
,
store
.
normalize
(
'
token
'
,
token
).
data
.
id
);
return
store
.
peekRecord
(
'
token
'
,
store
.
normalize
(
'
token
'
,
token
).
data
.
id
);
})
.
catch
(()
=>
{
throw
new
OTTExchangeError
();
...
...
This diff is collapsed.
Click to expand it.
ui/app/adapters/watchable-namespace-ids.js
+
2
-
1
View file @
8c600acb
...
...
@@ -26,7 +26,8 @@ export default class WatchableNamespaceIDs extends Watchable {
findRecord
(
store
,
type
,
id
,
snapshot
)
{
const
[,
namespace
]
=
JSON
.
parse
(
id
);
const
namespaceQuery
=
namespace
&&
namespace
!==
'
default
'
?
{
namespace
}
:
{};
const
namespaceQuery
=
namespace
&&
namespace
!==
'
default
'
?
{
namespace
}
:
{};
return
super
.
findRecord
(
store
,
type
,
id
,
snapshot
,
namespaceQuery
);
}
...
...
This diff is collapsed.
Click to expand it.
ui/app/adapters/watchable.js
+
45
-
9
View file @
8c600acb
...
...
@@ -40,7 +40,10 @@ export default class Watchable extends ApplicationAdapter {
params
.
index
=
this
.
watchList
.
getIndexFor
(
url
);
}
const
signal
=
get
(
snapshotRecordArray
||
{},
'
adapterOptions.abortController.signal
'
);
const
signal
=
get
(
snapshotRecordArray
||
{},
'
adapterOptions.abortController.signal
'
);
return
this
.
ajax
(
url
,
'
GET
'
,
{
signal
,
data
:
params
,
...
...
@@ -48,9 +51,18 @@ export default class Watchable extends ApplicationAdapter {
}
findRecord
(
store
,
type
,
id
,
snapshot
,
additionalParams
=
{})
{
const
originalUrl
=
this
.
buildURL
(
type
.
modelName
,
id
,
snapshot
,
'
findRecord
'
);
const
originalUrl
=
this
.
buildURL
(
type
.
modelName
,
id
,
snapshot
,
'
findRecord
'
);
let
[
url
,
params
]
=
originalUrl
.
split
(
'
?
'
);
params
=
assign
(
queryString
.
parse
(
params
)
||
{},
this
.
buildQuery
(),
additionalParams
);
params
=
assign
(
queryString
.
parse
(
params
)
||
{},
this
.
buildQuery
(),
additionalParams
);
if
(
get
(
snapshot
||
{},
'
adapterOptions.watch
'
))
{
params
.
index
=
this
.
watchList
.
getIndexFor
(
originalUrl
);
...
...
@@ -68,15 +80,29 @@ export default class Watchable extends ApplicationAdapter {
});
}
query
(
store
,
type
,
query
,
snapshotRecordArray
,
options
,
additionalParams
=
{})
{
query
(
store
,
type
,
query
,
snapshotRecordArray
,
options
,
additionalParams
=
{}
)
{
const
url
=
this
.
buildURL
(
type
.
modelName
,
null
,
null
,
'
query
'
,
query
);
let
[
urlPath
,
params
]
=
url
.
split
(
'
?
'
);
params
=
assign
(
queryString
.
parse
(
params
)
||
{},
this
.
buildQuery
(),
additionalParams
,
query
);
params
=
assign
(
queryString
.
parse
(
params
)
||
{},
this
.
buildQuery
(),
additionalParams
,
query
);
if
(
get
(
options
,
'
adapterOptions.watch
'
))
{
// The intended query without additional blocking query params is used
// to track the appropriate query index.
params
.
index
=
this
.
watchList
.
getIndexFor
(
`
${
urlPath
}
?
${
queryString
.
stringify
(
query
)}
`
);
params
.
index
=
this
.
watchList
.
getIndexFor
(
`
${
urlPath
}
?
${
queryString
.
stringify
(
query
)}
`
);
}
const
signal
=
get
(
options
,
'
adapterOptions.abortController.signal
'
);
...
...
@@ -88,7 +114,9 @@ export default class Watchable extends ApplicationAdapter {
// Query params may not necessarily map one-to-one to attribute names.
// Adapters are responsible for declaring param mappings.
const
queryParamsToAttrs
=
Object
.
keys
(
adapter
.
queryParamsToAttrs
||
{}).
map
((
key
)
=>
({
const
queryParamsToAttrs
=
Object
.
keys
(
adapter
.
queryParamsToAttrs
||
{}
).
map
((
key
)
=>
({
queryParam
:
key
,
attr
:
adapter
.
queryParamsToAttrs
[
key
],
}));
...
...
@@ -110,7 +138,11 @@ export default class Watchable extends ApplicationAdapter {
});
}
reloadRelationship
(
model
,
relationshipName
,
options
=
{
watch
:
false
,
abortController
:
null
})
{
reloadRelationship
(
model
,
relationshipName
,
options
=
{
watch
:
false
,
abortController
:
null
}
)
{
const
{
watch
,
abortController
}
=
options
;
const
relationship
=
model
.
relationshipFor
(
relationshipName
);
if
(
relationship
.
kind
!==
'
belongsTo
'
&&
relationship
.
kind
!==
'
hasMany
'
)
{
...
...
@@ -146,7 +178,11 @@ export default class Watchable extends ApplicationAdapter {
:
'
normalizeFindHasManyResponse
'
;
const
serializer
=
store
.
serializerFor
(
relationship
.
type
);
const
modelClass
=
store
.
modelFor
(
relationship
.
type
);
const
normalizedData
=
serializer
[
normalizeMethod
](
store
,
modelClass
,
json
);
const
normalizedData
=
serializer
[
normalizeMethod
](
store
,
modelClass
,
json
);
store
.
push
(
normalizedData
);
},
(
error
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
ui/app/components/allocation-row.js
+
3
-
1
View file @
8c600acb
...
...
@@ -85,7 +85,9 @@ async function qualifyAllocation() {
// Make sure the allocation is a complete record and not a partial so we
// can show information such as preemptions and rescheduled allocation.
if
(
allocation
.
isPartial
)
{
await
this
.
store
.
findRecord
(
'
allocation
'
,
allocation
.
id
,
{
backgroundReload
:
false
});
await
this
.
store
.
findRecord
(
'
allocation
'
,
allocation
.
id
,
{
backgroundReload
:
false
,
});
}
if
(
allocation
.
get
(
'
job.isPending
'
))
{
...
...
This diff is collapsed.
Click to expand it.
ui/app/components/allocation-stat.js
+
4
-
2
View file @
8c600acb
...
...
@@ -42,8 +42,10 @@ export default class AllocationStat extends Component {
@
computed
(
'
metric
'
,
'
statsTracker.{reservedMemory,reservedCPU}
'
)
get
formattedReserved
()
{
if
(
this
.
metric
===
'
memory
'
)
return
formatBytes
(
this
.
statsTracker
.
reservedMemory
,
'
MiB
'
);
if
(
this
.
metric
===
'
cpu
'
)
return
formatHertz
(
this
.
statsTracker
.
reservedCPU
,
'
MHz
'
);
if
(
this
.
metric
===
'
memory
'
)
return
formatBytes
(
this
.
statsTracker
.
reservedMemory
,
'
MiB
'
);
if
(
this
.
metric
===
'
cpu
'
)
return
formatHertz
(
this
.
statsTracker
.
reservedCPU
,
'
MHz
'
);
return
undefined
;
}
}
This diff is collapsed.
Click to expand it.
ui/app/components/chart-primitives/area.js
+
3
-
1
View file @
8c600acb
...
...
@@ -7,7 +7,9 @@ export default class ChartPrimitiveArea extends Component {
get
colorClass
()
{
if
(
this
.
args
.
colorClass
)
return
this
.
args
.
colorClass
;
if
(
this
.
args
.
colorScale
&&
this
.
args
.
index
!=
null
)
return
`
${
this
.
args
.
colorScale
}
${
this
.
args
.
colorScale
}
-
${
this
.
args
.
index
+
1
}
`
;
return
`
${
this
.
args
.
colorScale
}
${
this
.
args
.
colorScale
}
-
${
this
.
args
.
index
+
1
}
`
;
return
'
is-primary
'
;
}
...
...
This diff is collapsed.
Click to expand it.
ui/app/components/children-status-bar.js
+
15
-
3
View file @
8c600acb
...
...
@@ -16,10 +16,22 @@ export default class ChildrenStatusBar extends DistributionBar {
return
[];
}
const
children
=
this
.
job
.
getProperties
(
'
pendingChildren
'
,
'
runningChildren
'
,
'
deadChildren
'
);
const
children
=
this
.
job
.
getProperties
(
'
pendingChildren
'
,
'
runningChildren
'
,
'
deadChildren
'
);
return
[
{
label
:
'
Pending
'
,
value
:
children
.
pendingChildren
,
className
:
'
queued
'
},
{
label
:
'
Running
'
,
value
:
children
.
runningChildren
,
className
:
'
running
'
},
{
label
:
'
Pending
'
,
value
:
children
.
pendingChildren
,
className
:
'
queued
'
,
},
{
label
:
'
Running
'
,
value
:
children
.
runningChildren
,
className
:
'
running
'
,
},
{
label
:
'
Dead
'
,
value
:
children
.
deadChildren
,
className
:
'
complete
'
},
];
}
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
…
15
Next
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