Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Frontend
Commits
68520c30
Commit
68520c30
authored
1 year ago
by
Theo Lesage
Committed by
Erwan Rouchet
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Add a field for deleting worker results by filtering worker runs
parent
39e28851
No related branches found
No related tags found
1 merge request
!1654
Add a field for deleting worker results by filtering worker runs
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/api/mlresults.ts
+5
-0
5 additions, 0 deletions
src/api/mlresults.ts
src/components/Process/Workers/DeleteResultsModal.vue
+136
-47
136 additions, 47 deletions
src/components/Process/Workers/DeleteResultsModal.vue
with
141 additions
and
47 deletions
src/api/mlresults.ts
+
5
−
0
View file @
68520c30
...
@@ -8,6 +8,11 @@ export type DeleteWorkerResultsParameters = {
...
@@ -8,6 +8,11 @@ export type DeleteWorkerResultsParameters = {
*/
*/
element_id
?:
UUID
element_id
?:
UUID
/**
* Delete results produced by a specific worker run
*/
worker_run_id
?:
UUID
/**
/**
* Delete results produced with a specific worker version.
* Delete results produced with a specific worker version.
*/
*/
...
...
This diff is collapsed.
Click to expand it.
src/components/Process/Workers/DeleteResultsModal.vue
+
136
−
47
View file @
68520c30
...
@@ -5,7 +5,9 @@
...
@@ -5,7 +5,9 @@
:is-large=
"!advancedMode"
:is-large=
"!advancedMode"
>
>
<template
v-slot:header
>
<template
v-slot:header
>
<p
class=
"modal-card-title mr-5"
>
{{
truncateLong
(
'
Delete results
'
+
originDescription
)
}}
</p>
<p
class=
"modal-card-title mr-5"
>
{{
truncateLong
(
'
Delete results
'
+
originDescription
)
}}
</p>
<span
class=
"ml-auto"
>
<span
class=
"ml-auto"
>
<input
<input
id=
"advancedModeSwitch"
id=
"advancedModeSwitch"
...
@@ -13,11 +15,36 @@
...
@@ -13,11 +15,36 @@
class=
"switch is-rtl is-rounded is-info"
class=
"switch is-rtl is-rounded is-info"
v-model=
"advancedMode"
v-model=
"advancedMode"
/>
/>
<label
class=
"is-pulled-right mr-4"
for=
"advancedModeSwitch"
>
Advanced mode
</label>
<label
class=
"is-pulled-right mr-4"
for=
"advancedModeSwitch"
>
Advanced mode
</label>
</span>
</span>
</
template
>
</
template
>
<div
v-if=
"advancedMode"
class=
"content"
>
<div
v-if=
"advancedMode"
class=
"content"
>
<div
class=
"field"
>
<label
class=
"label"
>
Worker run UUID
</label>
<div
class=
"control"
>
<input
type=
"text"
placeholder=
"00000000-0000-0000-0000-000000000000"
maxlength=
"36"
class=
"input uuid-input"
v-model=
"workerRunId"
:disabled=
"loading || undefined"
/>
<
template
v-if=
"errors.worker_run_id"
>
<p
class=
"help is-danger"
v-for=
"err in errors.worker_run_id"
:key=
"err"
>
{{
err
}}
</p>
</
template
>
</div>
</div>
<div
class=
"field"
>
<div
class=
"field"
>
<label
class=
"label"
>
Worker version UUID
</label>
<label
class=
"label"
>
Worker version UUID
</label>
<div
class=
"control"
>
<div
class=
"control"
>
...
@@ -27,7 +54,7 @@
...
@@ -27,7 +54,7 @@
maxlength=
"36"
maxlength=
"36"
class=
"input uuid-input"
class=
"input uuid-input"
v-model=
"workerVersionId"
v-model=
"workerVersionId"
:disabled=
"loading ||
null
"
:disabled=
"
inWorkerRunMode ||
loading ||
undefined
"
/>
/>
<
template
v-if=
"errors.worker_version_id"
>
<
template
v-if=
"errors.worker_version_id"
>
<p
<p
...
@@ -49,7 +76,7 @@
...
@@ -49,7 +76,7 @@
maxlength=
"36"
maxlength=
"36"
class=
"input uuid-input"
class=
"input uuid-input"
v-model=
"modelVersionId"
v-model=
"modelVersionId"
:disabled=
"loading ||
null
"
:disabled=
"
inWorkerRunMode ||
loading ||
undefined
"
/>
/>
<
template
v-if=
"errors.model_version_id"
>
<
template
v-if=
"errors.model_version_id"
>
<p
<p
...
@@ -68,16 +95,19 @@
...
@@ -68,16 +95,19 @@
<span
class=
"control"
>
<span
class=
"control"
>
<label
<label
v-for=
"(value, label) in configurationRadio"
v-for=
"(value, label) in configurationRadio"
:key=
"
value
"
:key=
"
label
"
class=
"radio ml-4"
class=
"radio ml-4"
:class=
"{
'
active
'
: configurationField === value }"
:class=
"{ active: configurationField === value }"
v-on:click.capture=
"setConfigurationField(value)"
v-on:click.capture=
"setConfigurationField(value)"
>
>
<input
<input
class=
"is-checkradio"
class=
"is-checkradio"
type=
"radio"
type=
"radio"
:checked=
"configurationField === value || null"
:checked=
"
:disabled=
"loading || null"
(configurationField === value && !inWorkerRunMode) ||
undefined
"
:disabled=
"inWorkerRunMode || loading || undefined"
/>
/>
{{ label }}
{{ label }}
</label>
</label>
...
@@ -91,7 +121,12 @@
...
@@ -91,7 +121,12 @@
maxlength=
"36"
maxlength=
"36"
class=
"input uuid-input"
class=
"input uuid-input"
v-model=
"configurationId"
v-model=
"configurationId"
:disabled=
"configurationField !== true || loading || null"
:disabled=
"
inWorkerRunMode ||
configurationField !== true ||
loading ||
undefined
"
/>
/>
<
template
v-if=
"errors.configuration_id"
>
<
template
v-if=
"errors.configuration_id"
>
<p
<p
...
@@ -104,11 +139,7 @@
...
@@ -104,11 +139,7 @@
</
template
>
</
template
>
</div>
</div>
</div>
</div>
<button
<button
class=
"button is-danger"
type=
"button"
v-on:click=
"checkManual"
>
class=
"button is-danger is-light"
type=
"button"
v-on:click=
"checkManual"
>
Delete
Delete
</button>
</button>
</div>
</div>
...
@@ -124,16 +155,28 @@
...
@@ -124,16 +155,28 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
v-for=
"({ worker_version, worker_configuration, model_version }, cacheId) in workerVersionsCache"
:key=
"cacheId"
>
<tr
v-for=
"(
{ worker_version, worker_configuration, model_version }, cacheId
) in workerVersionsCache"
:key=
"cacheId"
>
<td>
<td>
<WorkerVersionSummary
:worker-version=
"worker_version"
/>
<WorkerVersionSummary
:worker-version=
"worker_version"
/>
</td>
</td>
<td>
<td>
<ModelVersionSummary
v-if=
"model_version"
:model-version=
"model_version"
/>
<ModelVersionSummary
v-if=
"model_version"
:model-version=
"model_version"
/>
<
template
v-else
>
—
</
template
>
<
template
v-else
>
—
</
template
>
</td>
</td>
<td>
<td>
<ConfigurationSummary
v-if=
"worker_configuration"
:configuration=
"worker_configuration"
:worker-version=
"worker_version"
/>
<ConfigurationSummary
v-if=
"worker_configuration"
:configuration=
"worker_configuration"
:worker-version=
"worker_version"
/>
<
template
v-else
>
—
</
template
>
<
template
v-else
>
—
</
template
>
</td>
</td>
<td>
<td>
...
@@ -154,13 +197,16 @@
...
@@ -154,13 +197,16 @@
</
template
>
</
template
>
</Modal>
</Modal>
<Modal
<Modal
v-model=
"confirmationModal"
title=
"Confirm deletion"
>
v-model=
"confirmationModal"
title=
"Confirm deletion"
>
<div
class=
"content"
>
<div
class=
"content"
>
<
template
v-if=
"deletesAll"
>
<
template
v-if=
"inWorkerRunMode"
>
You are about to delete
<strong>
all worker results
</strong>
{{
originDescription
}}
.
You are about to delete all results from worker run
<strong>
{{
workerRunId
}}
</strong>
{{
originDescription
}}
.
</
template
>
<
template
v-else-if=
"deletesAll"
>
You are about to delete
<strong>
all worker results
</strong>
{{
originDescription
}}
.
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
...
@@ -169,13 +215,21 @@
...
@@ -169,13 +215,21 @@
</p>
</p>
</
template
>
</
template
>
<hr
class=
"my-3"
/>
<hr
class=
"my-3"
/>
<p
class=
"mb-0"
>
Child elements of these results will also be deleted recursively.
</p>
<p
class=
"mb-0"
>
Child elements of these results will also be deleted recursively.
</p>
<p>
This action is irreversible.
</p>
<p>
This action is irreversible.
</p>
</div>
</div>
<
template
v-slot:footer=
"{ close }"
>
<
template
v-slot:footer=
"{ close }"
>
<button
class=
"button"
v-on:click=
"close"
>
Cancel
</button>
<button
class=
"button"
v-on:click=
"close"
>
Cancel
</button>
<button
class=
"button is-danger ml-auto"
v-on:click=
"performDelete"
:title=
"originDescription"
>
{{
truncateLong
(
'
Delete results
'
+
originDescription
)
}}
</button>
<button
class=
"button is-danger ml-auto"
v-on:click=
"performDelete"
:title=
"originDescription"
>
{{
truncateLong
(
'
Delete results
'
+
originDescription
)
}}
</button>
</
template
>
</
template
>
</Modal>
</Modal>
</template>
</template>
...
@@ -196,10 +250,7 @@ import ModelVersionSummary from '@/components/Model/Versions/Summary.vue'
...
@@ -196,10 +250,7 @@ import ModelVersionSummary from '@/components/Model/Versions/Summary.vue'
import
ConfigurationSummary
from
'
@/components/Process/Workers/Configurations/Summary.vue
'
import
ConfigurationSummary
from
'
@/components/Process/Workers/Configurations/Summary.vue
'
export
default
defineComponent
({
export
default
defineComponent
({
mixins
:
[
mixins
:
[
corporaMixin
,
truncateMixin
],
corporaMixin
,
truncateMixin
],
components
:
{
components
:
{
Modal
,
Modal
,
WorkerVersionSummary
,
WorkerVersionSummary
,
...
@@ -219,7 +270,7 @@ export default defineComponent({
...
@@ -219,7 +270,7 @@ export default defineComponent({
*/
*/
corpusId
:
{
corpusId
:
{
type
:
String
as
PropType
<
UUID
>
,
type
:
String
as
PropType
<
UUID
>
,
validator
:
value
=>
typeof
value
===
'
string
'
&&
UUID_REGEX
.
test
(
value
),
validator
:
(
value
)
=>
typeof
value
===
'
string
'
&&
UUID_REGEX
.
test
(
value
),
required
:
true
required
:
true
},
},
/**
/**
...
@@ -228,7 +279,7 @@ export default defineComponent({
...
@@ -228,7 +279,7 @@ export default defineComponent({
*/
*/
elementId
:
{
elementId
:
{
type
:
String
as
PropType
<
UUID
>
,
type
:
String
as
PropType
<
UUID
>
,
validator
:
value
=>
typeof
value
===
'
string
'
&&
UUID_REGEX
.
test
(
value
),
validator
:
(
value
)
=>
typeof
value
===
'
string
'
&&
UUID_REGEX
.
test
(
value
),
default
:
null
default
:
null
},
},
/**
/**
...
@@ -250,6 +301,7 @@ export default defineComponent({
...
@@ -250,6 +301,7 @@ export default defineComponent({
/**
/**
* Custom fields for manual deletion
* Custom fields for manual deletion
*/
*/
workerRunId
:
''
,
workerVersionId
:
''
,
workerVersionId
:
''
,
modelVersionId
:
''
,
modelVersionId
:
''
,
configurationId
:
''
,
configurationId
:
''
,
...
@@ -302,40 +354,64 @@ export default defineComponent({
...
@@ -302,40 +354,64 @@ export default defineComponent({
messages
.
push
(
`You are about to delete results
${
this
.
originDescription
}
`
)
messages
.
push
(
`You are about to delete results
${
this
.
originDescription
}
`
)
// Worker version
// Worker version
const
versionName
=
this
.
truncateLong
(
const
versionName
=
this
.
truncateLong
(
this
.
versionCacheToDelete
?.
worker_version
?.
worker
?.
name
||
this
.
workerVersionId
||
'
Any
'
this
.
versionCacheToDelete
?.
worker_version
?.
worker
?.
name
||
this
.
workerVersionId
||
'
Any
'
)
)
messages
.
push
(
`• Worker version:
${
versionName
}
`
)
messages
.
push
(
`• Worker version:
${
versionName
}
`
)
// Model version
// Model version
if
(
this
.
advancedMode
)
{
if
(
this
.
advancedMode
)
{
messages
.
push
(
`• Model version:
${
this
.
modelVersionId
||
'
Any
'
}
`
)
messages
.
push
(
`• Model version:
${
this
.
modelVersionId
||
'
Any
'
}
`
)
}
else
if
(
this
.
versionCacheToDelete
?.
model_version
)
{
}
else
if
(
this
.
versionCacheToDelete
?.
model_version
)
{
messages
.
push
(
`• Model version:
${
this
.
versionCacheToDelete
.
model_version
.
model
.
name
}
`
)
messages
.
push
(
`• Model version:
${
this
.
versionCacheToDelete
.
model_version
.
model
.
name
}
`
)
}
}
// Worker configuration
// Worker configuration
const
confName
=
this
.
advancedMode
const
confName
=
this
.
advancedMode
?
this
.
configurationId
||
(
this
.
configurationField
===
null
&&
'
Any
'
)
||
'
None
'
?
this
.
configurationId
||
:
this
.
truncateLong
(
this
.
versionCacheToDelete
?.
worker_configuration
?.
name
||
'
None
'
)
(
this
.
configurationField
===
null
&&
'
Any
'
)
||
'
None
'
:
this
.
truncateLong
(
this
.
versionCacheToDelete
?.
worker_configuration
?.
name
||
'
None
'
)
messages
.
push
(
`• Configuration:
${
confName
}
`
)
messages
.
push
(
`• Configuration:
${
confName
}
`
)
return
messages
return
messages
},
},
payload
()
{
payload
()
{
const
payload
:
DeleteWorkerResultsParameters
=
{
use_selection
:
this
.
selection
}
const
payload
:
DeleteWorkerResultsParameters
=
{
use_selection
:
this
.
selection
}
if
(
this
.
elementId
)
payload
.
element_id
=
this
.
elementId
if
(
this
.
elementId
)
payload
.
element_id
=
this
.
elementId
if
(
this
.
advancedMode
)
{
if
(
this
.
advancedMode
)
{
if
(
this
.
workerVersionId
)
payload
.
worker_version_id
=
this
.
workerVersionId
if
(
this
.
workerRunId
)
payload
.
worker_run_id
=
this
.
workerRunId
if
(
this
.
workerVersionId
)
{
payload
.
worker_version_id
=
this
.
workerVersionId
}
if
(
this
.
modelVersionId
)
payload
.
model_version_id
=
this
.
modelVersionId
if
(
this
.
modelVersionId
)
payload
.
model_version_id
=
this
.
modelVersionId
if
(
this
.
configurationField
!==
null
)
{
payload
.
configuration_id
=
this
.
configurationField
?
this
.
configurationId
:
false
}
if
(
this
.
configurationField
!==
null
)
{
payload
.
configuration_id
=
this
.
configurationField
?
this
.
configurationId
:
false
}
}
else
if
(
this
.
versionCacheToDelete
!==
null
)
{
}
else
if
(
this
.
versionCacheToDelete
!==
null
)
{
payload
.
worker_version_id
=
this
.
versionCacheToDelete
.
worker_version
.
id
payload
.
worker_version_id
=
this
.
versionCacheToDelete
.
worker_version
.
id
payload
.
configuration_id
=
this
.
versionCacheToDelete
?.
worker_configuration
?.
id
??
false
payload
.
configuration_id
=
if
(
this
.
versionCacheToDelete
?.
model_version
?.
id
)
payload
.
model_version_id
=
this
.
versionCacheToDelete
.
model_version
.
id
this
.
versionCacheToDelete
?.
worker_configuration
?.
id
??
false
if
(
this
.
versionCacheToDelete
?.
model_version
?.
id
)
{
payload
.
model_version_id
=
this
.
versionCacheToDelete
.
model_version
.
id
}
}
}
return
payload
return
payload
},
inWorkerRunMode
():
boolean
{
return
this
.
workerRunId
!==
''
}
}
},
},
methods
:
{
methods
:
{
...
mapActions
(
useMLResultsStore
,
[
'
listWorkerVersionsCache
'
,
'
deleteWorkerResults
'
]),
...
mapActions
(
useMLResultsStore
,
[
updateModelValue
(
value
:
boolean
)
{
this
.
$emit
(
'
update:modelValue
'
,
value
)
},
'
listWorkerVersionsCache
'
,
'
deleteWorkerResults
'
]),
updateModelValue
(
value
:
boolean
)
{
this
.
$emit
(
'
update:modelValue
'
,
value
)
},
select
(
cacheId
:
UUID
)
{
select
(
cacheId
:
UUID
)
{
this
.
cacheUUIDToDelete
=
cacheId
this
.
cacheUUIDToDelete
=
cacheId
this
.
confirmationModal
=
true
this
.
confirmationModal
=
true
...
@@ -345,11 +421,24 @@ export default defineComponent({
...
@@ -345,11 +421,24 @@ export default defineComponent({
},
},
checkManual
()
{
checkManual
()
{
this
.
errors
=
{}
this
.
errors
=
{}
if
(
this
.
workerVersionId
&&
!
UUID_REGEX
.
test
(
this
.
workerVersionId
))
{
this
.
errors
.
worker_version_id
=
[
'
This value must be a valid UUID.
'
]
}
if
(
this
.
workerRunId
&&
!
UUID_REGEX
.
test
(
this
.
workerRunId
))
{
if
(
this
.
modelVersionId
&&
!
UUID_REGEX
.
test
(
this
.
modelVersionId
))
{
this
.
errors
.
model_version_id
=
[
'
This value must be a valid UUID.
'
]
}
this
.
errors
.
worker_run_id
=
[
'
This value must be a valid UUID.
'
]
if
(
this
.
configurationId
&&
!
UUID_REGEX
.
test
(
this
.
configurationId
))
{
this
.
errors
.
configuration_id
=
[
'
This value must be a valid UUID.
'
]
}
}
if
(
this
.
configurationField
===
true
&&
this
.
configurationId
===
''
)
{
this
.
errors
.
configuration_id
=
[
'
This value must be set.
'
]
}
if
(
this
.
workerVersionId
&&
!
UUID_REGEX
.
test
(
this
.
workerVersionId
))
{
if
(
Object
.
keys
(
this
.
errors
).
length
===
0
)
{
this
.
confirmationModal
=
true
}
this
.
errors
.
worker_version_id
=
[
'
This value must be a valid UUID.
'
]
}
if
(
this
.
modelVersionId
&&
!
UUID_REGEX
.
test
(
this
.
modelVersionId
))
{
this
.
errors
.
model_version_id
=
[
'
This value must be a valid UUID.
'
]
}
if
(
this
.
configurationId
&&
!
UUID_REGEX
.
test
(
this
.
configurationId
))
{
this
.
errors
.
configuration_id
=
[
'
This value must be a valid UUID.
'
]
}
if
(
this
.
configurationField
===
true
&&
this
.
configurationId
===
''
)
{
this
.
errors
.
configuration_id
=
[
'
This value must be set.
'
]
}
if
(
Object
.
keys
(
this
.
errors
).
length
===
0
)
{
this
.
confirmationModal
=
true
}
},
},
async
performDelete
()
{
async
performDelete
()
{
this
.
errors
=
{}
this
.
errors
=
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment