Skip to content

Commit

Permalink
Extracts novnc connection compression & quality into Configuration va…
Browse files Browse the repository at this point in the history
…riables (#3380)

* Extracts novnc connection compression & quality into Configuration variables

* Fixes class name

* Casts .to_i on novnc connection option variables

* Updates variable names
  • Loading branch information
HazelGrant authored Feb 27, 2024
1 parent 50c3514 commit eb966a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

<div class="row">
<div class="col-sm-6">
<%= f.number_field(:compression, class: 'custom-range', type: 'range', min: 0, max: 9, value: 6, label: "Compression", help: "0 (low) to 9 (high)") %>
<%= f.number_field(:compression, class: 'custom-range', type: 'range', min: 0, max: 9, value: Configuration.novnc_default_compression.to_i, label: "Compression", help: "0 (low) to 9 (high)") %>
</div>
<div class="col-sm-6">
<%= f.number_field(:quality, class: 'custom-range', type: 'range', min: 0, max: 9, value: 2, label: "Image Quality", help: "0 (low) to 9 (high)") %>
<%= f.number_field(:quality, class: 'custom-range', type: 'range', min: 0, max: 9, value: Configuration.novnc_default_quality.to_i, label: "Image Quality", help: "0 (low) to 9 (high)") %>
</div>
</div>

Expand Down
22 changes: 12 additions & 10 deletions apps/dashboard/config/configuration_singleton.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,18 @@ def boolean_configs
# @return [Hash] key/value pairs of defaults
def string_configs
{
:module_file_dir => nil,
:user_settings_file => Pathname.new("~/.config/ondemand/settings.yml").expand_path.to_s,
:facl_domain => nil,
:auto_groups_filter => nil,
:bc_clean_old_dirs_days => '30',
:google_analytics_tag_id => nil,
:project_template_dir => "#{config_root}/projects",
:rclone_extra_config => nil,
:default_profile => nil,
:project_size_timeout => '15'
:module_file_dir => nil,
:user_settings_file => Pathname.new("~/.config/ondemand/settings.yml").expand_path.to_s,
:facl_domain => nil,
:auto_groups_filter => nil,
:bc_clean_old_dirs_days => '30',
:google_analytics_tag_id => nil,
:project_template_dir => "#{config_root}/projects",
:rclone_extra_config => nil,
:default_profile => nil,
:project_size_timeout => '15',
:novnc_default_compression => '6',
:novnc_default_quality => '2'
}.freeze
end

Expand Down

0 comments on commit eb966a2

Please sign in to comment.