diff options
author | chotaire <chotaire@chotaire.net> | 2019-09-07 14:15:21 +0200 |
---|---|---|
committer | chotaire <chotaire@chotaire.net> | 2019-09-07 14:15:21 +0200 |
commit | 9787fa9b89e33932250fc9359700e4cd15992da9 (patch) | |
tree | f501f330605c242487d9a958fe0fe6e1d983aa51 /js | |
parent | 3b60ef056d6544361f91c90c05d18125118debc2 (diff) | |
download | phpvirtualbox-9787fa9b89e33932250fc9359700e4cd15992da9.zip phpvirtualbox-9787fa9b89e33932250fc9359700e4cd15992da9.tar.gz phpvirtualbox-9787fa9b89e33932250fc9359700e4cd15992da9.tar.bz2 |
Added Discard (TRIM) option and NVME harddisk controller (by pasha1st)
Diffstat (limited to 'js')
-rw-r--r-- | js/phpvirtualbox.js | 67 |
1 files changed, 53 insertions, 14 deletions
diff --git a/js/phpvirtualbox.js b/js/phpvirtualbox.js index 19fd02e..57c56eb 100644 --- a/js/phpvirtualbox.js +++ b/js/phpvirtualbox.js @@ -2430,7 +2430,7 @@ var vboxMedia = { }, /** - * Return true if a medium format supports + * Return true if a medium format supports Split2G */ formatSupportsSplit: function(format) { @@ -2445,6 +2445,23 @@ var vboxMedia = { } return false; }, + + /** + * Return true if a medium format supports Discard + */ + formatSupportsDiscard: function(format) { + + var format = format.toLowerCase(); + + var mfs = $('#vboxPane').data('vboxSystemProperties').mediumFormats; + + for(var i = 0; i < mfs.length; i++) { + if(mfs[i].id.toLowerCase() == format) { + return (jQuery.inArray('Discard',mfs[i].capabilities) > -1); + } + } + return false; + }, /** * Return printable virtual hard disk variant @@ -4747,7 +4764,13 @@ var vboxStorage = { attrib: 'ignoreFlush', runningEnabled: true, }); - } + }; + if($('#vboxPane').data('vboxConfig').enableAdvancedConfig&&vboxMedia.formatSupportsDiscard(ma.medium.format)) { + opts[opts.length]={ + label: 'Support Discard(TRIM)', + attrib: 'discard', + }; + }; return opts; case 'DVD': // Host drive @@ -4881,18 +4904,34 @@ var vboxStorage = { }, USB: { - maxPortCount: 8, - maxDevicesPerPortCount: 1, - types: ['USB'], - driveTypes: ['dvd','disk'], - slotName: function(p,d) { return trans('USB Port %1','VBoxGlobal', null, 'StorageSlot').replace('%1',p); }, - slots: function() { - var s = {}; - for(var i = 0; i < 8; i++) { - s[i+'-0'] = trans('USB Port %1','VBoxGlobal', null, 'StorageSlot').replace('%1',i); - } - return s; - } + maxPortCount: 8, + maxDevicesPerPortCount: 1, + types: ['USB'], + driveTypes: ['dvd','disk'], + slotName: function(p,d) { return trans('USB Port %1','VBoxGlobal', null, 'StorageSlot').replace('%1',p); }, + slots: function() { + var s = {}; + for(var i = 0; i < 8; i++) { + s[i+'-0'] = trans('USB Port %1','VBoxGlobal', null, 'StorageSlot').replace('%1',i); + } + return s; + } + }, + +PCIe: { + maxPortCount: 255, + maxDevicesPerPortCount: 1, + types: ['NVMe'], + driveTypes: ['disk'], + slotName: function(p,d) { return trans('NVMe Port %1','VBoxGlobal', null, 'StorageSlot').replace('%1',p); }, + slots: function() { + var s = {}; + for(var i = 0; i < 8; i++) { + s[i+'-0'] = trans('NVMe Port %1','VBoxGlobal', null, 'StorageSlot').replace('%1',i); + } + return s; + }, + displayInherit: 'IDE' } }; |