oVirt / ovirt-web-ui

Modern lightweight UI for standard (non-admin) oVirt users
https://www.ovirt.org
Apache License 2.0
116 stars 72 forks source link

Default value in console.vv file #1257

Closed gruz123 closed 4 years ago

gruz123 commented 4 years ago

VM Portal version number: 1.6.3/1.6.4

oVirt version number:4.4

Browser and version:nwm

Steps to Reproduce:

  1. Download spice console.vv file

Actual results: not full screen when open

Expected results: full screen when open

Additional info:

It's not a bug or something like that but it's very annoying, searching for a few days and can find anything, plz help, and sorry for this request

How can i change default values in console.vv file? , can you help me change it? When I download this file, inside I see fullscreen=0 but I need fullscreen=1. It's in db or js? Or?? Help please. I need to change this value global for all vm and users in portal vm. Thanks and sorry for my English

gruz123 commented 4 years ago

cat src/sagas/console/vvFileUtils.js

export function adjustVVFile ({ data, options, usbFilter, isSpice }) { // options can either be a plain JS object or ImmutableJS Map console.log('adjustVVFile options:', options)

if (options && ((options.get && options.get('fullscreen')) || options.fullscreen)) { data = data.replace(/^fullscreen=0/mg, 'fullscreen=1') } else { data = data.replace(/^fullscreen=0/mg, 'fullscreen=1') }

const pattern = /^secure-attention=.*$/mg let text = 'secure-attention=ctrl+alt+del' if (options && ((options.get && options.get('ctrlAltDelToEnd')) || options.ctrlAltDelToEnd)) { text = 'secure-attention=ctrl+alt+end' } if (data.match(pattern)) { console.log('secure-attention found, replacing by ', text) data = data.replace(pattern, text) } else { console.log('secure-attention was not found, inserting ', text) data = data.replace(/^[virt-viewer]$/mg, [virt-viewer]\n${text}) // ending \n is already there }

if (usbFilter) { data = data.replace(/^[virt-viewer]$/mg, [virt-viewer]\nusb-filter=${usbFilter}) }

if (options && isSpice) { const smartcardEnabled = options.get ? options.get('smartcardEnabled') : options.smartcardEnabled data = data.replace(/^enable-smartcard=[01]$/mg, enable-smartcard=${smartcardEnabled ? 1 : 0}) }

console.log('adjustVVFile data after adjustment:', data) return data }