Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
metagrid-go
metagrid-vue
Commits
3e187405
Commit
3e187405
authored
Apr 29, 2022
by
Tobinsk
Browse files
Check ml state for all proposals
parent
5690c1fc
Pipeline
#9228
failed with stage
in 3 minutes and 16 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/PersonInfoRow.vue
View file @
3e187405
...
...
@@ -8,7 +8,6 @@
<a
:href=
"person.url"
><b-icon-box-arrow-up-right
scale=
"1.5"
></b-icon-box-arrow-up-right></a>
</div>
<div
class=
"provider"
>
{{
person
.
provider
}}
</div>
<div
class=
"ml"
:class=
"
{'match': person.ml_match}">
</div>
</div>
</
template
>
...
...
@@ -38,15 +37,5 @@ export default {
.provider
{
width
:
15%
;
}
.ml
{
&
.match
{
background
:
green
;
}
background
:
orange
;
width
:
2rem
;
margin-right
:
2rem
;
}
}
</
style
>
src/components/ProposalList.vue
View file @
3e187405
...
...
@@ -25,6 +25,7 @@
<
template
v-slot:header
>
<div
class=
"action-header"
>
<h6
class=
"mb-0"
>
Concordance #
{{
proposal
.
id
}}
</h6>
<div
class=
"ml"
:class=
"
{'match': proposal.ml_match}">
</div>
<b-form-checkbox
switch
v-model=
"proposal.match"
@
change=
"changeProposal(proposal, $event)"
></b-form-checkbox>
</div>
</
template
>
...
...
@@ -41,7 +42,6 @@
<div
class=
"d-flex justify-content-end list-group-item action-footer"
>
<b-btn-group>
<b-button
@
click=
"preSave(ml)"
>
Save
</b-button>
<b-button
@
click=
"train(ml)"
>
Train
</b-button>
<b-button
@
click=
"predict(ml)"
>
Predict
</b-button>
</b-btn-group>
</div>
...
...
@@ -59,10 +59,14 @@
computed
:
{
...
mapGetters
(
'
proposal
'
,
[
'
list
'
]),
proposals
()
{
return
this
.
list
.
map
((
p
)
=>
{
const
r
=
this
.
list
.
map
((
p
)
=>
{
p
.
base
.
match
=
true
;
p
.
base
.
persons
.
forEach
((
person
)
=>
person
.
match
=
true
);
})
});
r
.
forEach
((
p
)
=>
{
this
.
machineLearningPredict
(
p
)
});
return
r
;
}
},
methods
:
{
...
...
@@ -143,4 +147,13 @@
border-bottom
:
1px
solid
var
(
--
primary
);
}
}
.ml
{
&
.match
{
background
:
green
;
}
background
:
orange
;
width
:
2rem
;
margin-right
:
2rem
;
}
</
style
>
src/store/proposal/index.ts
View file @
3e187405
...
...
@@ -2,6 +2,7 @@ import {api, MatchProposal, Match, MetagridError, Concordance, MatchPrediction}
import
{
Module
}
from
"
vuex
"
import
{
Actions
,
Getters
,
Mutations
}
from
'
@/store/proposal/type
'
;
import
{
ErrorType
}
from
'
@/store/error
'
;
import
Proposal
from
"
@/views/Proposal.vue
"
;
export
interface
TmpPagination
{
from
:
number
;
...
...
@@ -112,7 +113,7 @@ const proposal: Module<ProposalState, any> = {
* @param query
* @return number
*/
async
[
Actions
.
LIST
]({
commit
,
state
},
pagination
:
TmpPagination
)
{
async
[
Actions
.
LIST
]({
commit
,
state
,
dispatch
},
pagination
:
TmpPagination
)
{
commit
(
Mutations
.
START_LOAD
);
if
(
typeof
pagination
===
"
undefined
"
)
{
pagination
=
{
...
...
@@ -140,6 +141,9 @@ const proposal: Module<ProposalState, any> = {
commit
(
'
error/add
'
,
metagridError
,
{
root
:
true
});
throw
err
;
});
proposals
.
proposals
.
forEach
((
p
:
MatchProposal
)
=>
{
dispatch
(
Actions
.
MACHINE_LEARNING_PREDICT
,
p
)
})
commit
(
Mutations
.
FINISH_LOAD
);
commit
(
Mutations
.
LIST
,
proposals
.
proposals
);
// todo: return intTotal
...
...
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