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
63faac94
Commit
63faac94
authored
1 year ago
by
Erwan Rouchet
Committed by
Bastien Abadie
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix Show all models toggle
parent
385ac409
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1551
Fix Show all models toggle
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/Model/List.vue
+19
-14
19 additions, 14 deletions
src/views/Model/List.vue
with
19 additions
and
14 deletions
src/views/Model/List.vue
+
19
−
14
View file @
63faac94
<
template
>
<main
class=
"container is-fluid"
>
<div
class=
"columns"
>
<div
class=
"
field
column is-one-third"
>
<div
class=
"column is-one-third"
>
<router-link
class=
"button is-primary is-pulled-right"
class=
"button is-primary is-pulled-right
mb-2
"
:to=
"
{ name: 'model-create' }"
v-if="trainingMode"
>
Create a model
</router-link>
<div
v-if=
"compatibleWorkerId"
>
<!-- All bulma-switch does is build a visually dynamic toggle and hide the actual checkbox away; sometimes it doesn't
work, like here, perhaps because of is-pulled-right. So the entire toggle + label block is clickable and changes the
value of allModels -->
<div
class=
"is-pulled-right"
v-on:click=
"allModels = !allModels"
>
<div
v-if=
"compatibleWorkerId"
class=
"field has-text-right"
>
<div
class=
"control"
>
<!--
bulma-switch hides the checkbox entirely because it can't be easily styled in CSS,
and instead uses :before and :after on the label to show a switch.
The ID on the checkbox and the `for` attribute on the label allows the label to trigger
the checkbox and properly switch the switch.
This component is used in multiple places, including in WorkerRun selection, so the modal
can be present multiple times on the page, so we have to make sure the IDs are unique to
avoid triggering only the switch of the first modal ever opened on the page.
-->
<input
id=
"allModelsToggle"
:
id=
"
`
allModelsToggle
$
{uid}`
"
type="checkbox"
class="switch is-rounded is-info"
:checked
=
"allModels"
v-model
="allModels"
/>
<label
for=
"allModelsToggle"
>
Show all models
</label>
<label
:
for=
"
`
allModelsToggle
$
{uid}`
">Show all models
</label>
</div>
<p
class=
"help all-models-help is-pulled-right mb-2"
>
By default, only models compatible with the selected worker are shown.
</p>
</div>
...
...
@@ -101,6 +104,7 @@
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'
vue
'
import
{
mapActions
}
from
'
pinia
'
import
{
uniqueId
}
from
'
lodash
'
import
{
ModelListParameters
}
from
'
@/api
'
import
{
errorParser
}
from
'
@/helpers
'
...
...
@@ -160,7 +164,8 @@ export default defineComponent({
selectedModel
:
null
,
page
:
1
,
nameFilter
:
''
,
allModels
:
false
allModels
:
false
,
uid
:
uniqueId
()
}),
methods
:
{
...
mapActions
(
useNotificationStore
,
[
'
notify
'
]),
...
...
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