Add privilegedExecution flag to database and Poseidon Strategy

This commit is contained in:
Sebastian Serth
2022-09-24 00:05:03 +02:00
committed by Sebastian Serth
parent dffeca27de
commit eb188dcd71
13 changed files with 51 additions and 10 deletions

View File

@ -28,6 +28,10 @@
label.form-check-label
= f.check_box(:network_enabled, class: 'form-check-input')
= t('activerecord.attributes.execution_environment.network_enabled')
.form-check.mb-3
label.form-check-label
= f.check_box(:privileged_execution, class: 'form-check-input')
= t('activerecord.attributes.execution_environment.privileged_execution')
.mb-3
= f.label(:permitted_execution_time, class: 'form-label')
= f.number_field(:permitted_execution_time, class: 'form-control', min: 1)

View File

@ -15,6 +15,7 @@ h1.d-inline-block = ExecutionEnvironment.model_name.human(count: 2)
th = t('activerecord.attributes.execution_environment.memory_limit')
th = t('activerecord.attributes.execution_environment.cpu_limit')
th = t('activerecord.attributes.execution_environment.network_enabled')
th = t('activerecord.attributes.execution_environment.privileged_execution')
th = t('activerecord.attributes.execution_environment.permitted_execution_time')
th colspan=5 = t('shared.actions')
tbody
@ -26,6 +27,7 @@ h1.d-inline-block = ExecutionEnvironment.model_name.human(count: 2)
td = execution_environment.memory_limit
td = execution_environment.cpu_limit
td = symbol_for(execution_environment.network_enabled)
td = symbol_for(execution_environment.privileged_execution)
td = execution_environment.permitted_execution_time
td = link_to(t('shared.show'), execution_environment) if policy(execution_environment).show?
td = link_to(t('shared.edit'), edit_execution_environment_path(execution_environment)) if policy(execution_environment).edit?

View File

@ -11,7 +11,7 @@ h1.d-inline-block = @execution_environment
= row(label: 'execution_environment.name', value: @execution_environment.name)
= row(label: 'execution_environment.user', value: link_to_if(policy(@execution_environment.author).show?, @execution_environment.author, @execution_environment.author))
= row(label: 'execution_environment.file_type', value: @execution_environment.file_type.present? ? link_to(@execution_environment.file_type, @execution_environment.file_type) : nil)
- [:docker_image, :exposed_ports_list, :memory_limit, :cpu_limit, :network_enabled, :permitted_execution_time, :pool_size].each do |attribute|
- [:docker_image, :exposed_ports_list, :memory_limit, :cpu_limit, :network_enabled, :privileged_execution, :permitted_execution_time, :pool_size].each do |attribute|
= row(label: "execution_environment.#{attribute}", value: @execution_environment.send(attribute))
- [:run_command, :test_command].each do |attribute|
= row(label: "execution_environment.#{attribute}") do