Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bc_uab_igv
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rc
bc_uab_igv
Merge requests
!11
Feat form js
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Feat form js
feat-form-js
into
master
Overview
0
Commits
2
Pipelines
0
Changes
2
Merged
Bo-Chun Chen
requested to merge
feat-form-js
into
master
1 year ago
Overview
0
Commits
2
Pipelines
0
Changes
2
Expand
Enable GPU selection if choose GPU partition
Set max GPU base on partition
Set max CPU base on partition
Set max hour base on partition
👍
0
👎
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
12fb264a
2 commits,
1 year ago
2 files
+
70
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
form.js
0 → 100644
+
68
−
0
Options
const
table
=
{
"
interactive
"
:
{
"
max_cpu
"
:
48
,
"
max_hour
"
:
2
,
"
max_gpu
"
:
-
1
},
"
express
"
:
{
"
max_cpu
"
:
48
,
"
max_hour
"
:
2
,
"
max_gpu
"
:
-
1
},
"
short
"
:
{
"
max_cpu
"
:
48
,
"
max_hour
"
:
12
,
"
max_gpu
"
:
-
1
},
"
pascalnodes
"
:
{
"
max_cpu
"
:
28
,
"
max_hour
"
:
12
,
"
max_gpu
"
:
4
},
"
pascalnodes-medium
"
:
{
"
max_cpu
"
:
28
,
"
max_hour
"
:
48
,
"
max_gpu
"
:
4
},
"
medium
"
:
{
"
max_cpu
"
:
48
,
"
max_hour
"
:
50
,
"
max_gpu
"
:
-
1
},
"
long
"
:
{
"
max_cpu
"
:
48
,
"
max_hour
"
:
150
,
"
max_gpu
"
:
-
1
},
"
intel-dcb
"
:
{
"
max_cpu
"
:
24
,
"
max_hour
"
:
150
,
"
max_gpu
"
:
-
1
},
"
amd-hdr100
"
:
{
"
max_cpu
"
:
128
,
"
max_hour
"
:
150
,
"
max_gpu
"
:
-
1
},
"
largemem
"
:
{
"
max_cpu
"
:
24
,
"
max_hour
"
:
50
,
"
max_gpu
"
:
-
1
},
"
largemem-long
"
:
{
"
max_cpu
"
:
24
,
"
max_hour
"
:
150
,
"
max_gpu
"
:
-
1
},
"
amperenodes
"
:
{
"
max_cpu
"
:
128
,
"
max_hour
"
:
12
,
"
max_gpu
"
:
2
},
"
amperenodes-medium
"
:
{
"
max_cpu
"
:
128
,
"
max_hour
"
:
48
,
"
max_gpu
"
:
2
},
}
function
set_max_value
(
form_id
,
value
)
{
const
form_element
=
$
(
form_id
);
form_element
.
attr
({
'
max
'
:
value
});
}
function
set_partition_change_handler
()
{
let
partition_select
=
$
(
"
#batch_connect_session_context_bc_partition
"
);
partition_select
.
change
(
function
(
e
)
{
toggle_gpu_visibility
(
e
);
});
}
function
toggle_gpu_visibility
(
event
)
{
const
partition
=
event
.
target
.
value
;
const
cpu_selector
=
'
#batch_connect_session_context_bc_num_slots
'
;
const
gpu_selector
=
'
#batch_connect_session_context_bc_num_gpus
'
;
const
hour_selector
=
'
#batch_connect_session_context_bc_num_hours
'
;
toggle_visibilty_of_form_group
(
gpu_selector
,
table
[
partition
][
"
max_gpu
"
]
!=
-
1
);
set_max_value
(
cpu_selector
,
table
[
partition
][
"
max_cpu
"
]);
set_max_value
(
gpu_selector
,
table
[
partition
][
"
max_gpu
"
]);
set_max_value
(
hour_selector
,
table
[
partition
][
"
max_hour
"
]);
}
function
toggle_visibilty_of_form_group
(
form_id
,
show
)
{
let
form_element
=
$
(
form_id
);
let
parent
=
form_element
;
while
(
(
!
parent
[
0
].
classList
.
contains
(
'
form-group
'
))
&&
(
!
parent
.
is
(
'
html
'
))
// ensure that we don't loop infinitely
)
{
parent
=
parent
.
parent
();
}
// If parent is HTML then something has gone wrong and visibility should not be changed
if
(
parent
.
is
(
'
html
'
)
)
{
return
;
}
if
(
show
)
{
parent
.
show
();
}
else
{
parent
.
hide
();
}
}
toggle_gpu_visibility
(
// Fake the event
{
target
:
document
.
querySelector
(
'
#batch_connect_session_context_bc_partition
'
)
}
);
set_partition_change_handler
();
Loading