Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
08cc3c2d
Commit
08cc3c2d
authored
Jun 26, 2014
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qemu GUI: add support to edit SMBIOS settings
parent
8816f15a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
146 additions
and
1 deletion
+146
-1
Makefile
www/manager/Makefile
+1
-0
Parser.js
www/manager/Parser.js
+25
-1
Options.js
www/manager/qemu/Options.js
+5
-0
Smbios1Edit.js
www/manager/qemu/Smbios1Edit.js
+115
-0
No files found.
www/manager/Makefile
View file @
08cc3c2d
...
@@ -115,6 +115,7 @@ JSSRC= \
...
@@ -115,6 +115,7 @@ JSSRC= \
qemu/BootOrderEdit.js
\
qemu/BootOrderEdit.js
\
qemu/MemoryEdit.js
\
qemu/MemoryEdit.js
\
qemu/NetworkEdit.js
\
qemu/NetworkEdit.js
\
qemu/Smbios1Edit.js
\
qemu/CDEdit.js
\
qemu/CDEdit.js
\
qemu/HDEdit.js
\
qemu/HDEdit.js
\
qemu/HDResize.js
\
qemu/HDResize.js
\
...
...
www/manager/Parser.js
View file @
08cc3c2d
...
@@ -260,6 +260,30 @@ Ext.define('PVE.Parser', { statics: {
...
@@ -260,6 +260,30 @@ Ext.define('PVE.Parser', { statics: {
}
}
return
arr
.
join
(
'
,
'
);
return
arr
.
join
(
'
,
'
);
}
},
parseQemuSmbios1
:
function
(
value
)
{
var
res
=
{};
Ext
.
Array
.
each
(
value
.
split
(
'
,
'
),
function
(
p
)
{
var
kva
=
p
.
split
(
/=/
,
2
);
res
[
kva
[
0
]]
=
kva
[
1
];
});
return
res
;
},
printQemuSmbios1
:
function
(
data
)
{
var
datastr
=
''
;
Ext
.
Object
.
each
(
data
,
function
(
key
,
value
)
{
if
(
value
===
''
)
return
;
datastr
+=
(
datastr
!==
''
?
'
,
'
:
''
)
+
key
+
'
=
'
+
value
;
});
return
datastr
;
},
}});
}});
www/manager/qemu/Options.js
View file @
08cc3c2d
...
@@ -232,6 +232,11 @@ Ext.define('PVE.qemu.Options', {
...
@@ -232,6 +232,11 @@ Ext.define('PVE.qemu.Options', {
allowBlank
:
true
allowBlank
:
true
}
}
}
:
undefined
}
:
undefined
},
smbios1
:
{
header
:
gettext
(
'
SMBIOS settings (type1)
'
),
defaultValue
:
''
,
editor
:
caps
.
vms
[
'
VM.Config.HWType
'
]
?
'
PVE.qemu.Smbios1Edit
'
:
undefined
}
}
};
};
...
...
www/manager/qemu/Smbios1Edit.js
0 → 100644
View file @
08cc3c2d
Ext
.
define
(
'
PVE.qemu.Smbios1InputPanel
'
,
{
extend
:
'
PVE.panel.InputPanel
'
,
alias
:
'
widget.PVE.qemu.Smbios1InputPanel
'
,
insideWizard
:
false
,
smbios1
:
{},
onGetValues
:
function
(
values
)
{
var
me
=
this
;
var
params
=
{
smbios1
:
PVE
.
Parser
.
printQemuSmbios1
(
values
)
};
return
params
;
},
setSmbios1
:
function
(
data
)
{
var
me
=
this
;
me
.
smbios1
=
data
;
me
.
setValues
(
me
.
smbios1
);
},
initComponent
:
function
()
{
var
me
=
this
;
me
.
items
=
[
{
xtype
:
'
textfield
'
,
fieldLabel
:
'
UUID
'
,
regex
:
/^
[
a-fA-F0-9
]{8}(?:
-
[
a-fA-F0-9
]{4}){3}
-
[
a-fA-F0-9
]{12}
$/
,
name
:
'
uuid
'
,
},
{
xtype
:
'
textfield
'
,
fieldLabel
:
gettext
(
'
Manufacturer
'
),
regex
:
/^
\S
+$/
,
name
:
'
manufacturer
'
,
},
{
xtype
:
'
textfield
'
,
fieldLabel
:
gettext
(
'
Product
'
),
regex
:
/^
\S
+$/
,
name
:
'
product
'
,
},
{
xtype
:
'
textfield
'
,
fieldLabel
:
gettext
(
'
version
'
),
regex
:
/^
\S
+$/
,
name
:
'
version
'
,
},
{
xtype
:
'
textfield
'
,
fieldLabel
:
gettext
(
'
serial
'
),
regex
:
/^
\S
+$/
,
name
:
'
serial
'
,
},
{
xtype
:
'
textfield
'
,
fieldLabel
:
gettext
(
'
SKU
'
),
regex
:
/^
\S
+$/
,
name
:
'
sku
'
,
},
{
xtype
:
'
textfield
'
,
fieldLabel
:
gettext
(
'
Family
'
),
regex
:
/^
\S
+$/
,
name
:
'
family
'
,
}
];
me
.
callParent
();
}
});
Ext
.
define
(
'
PVE.qemu.Smbios1Edit
'
,
{
extend
:
'
PVE.window.Edit
'
,
initComponent
:
function
()
{
/*jslint confusion: true */
var
me
=
this
;
var
ipanel
=
Ext
.
create
(
'
PVE.qemu.Smbios1InputPanel
'
,
{});
Ext
.
applyIf
(
me
,
{
subject
:
gettext
(
'
SMBIOS settings (type1)
'
),
width
:
450
,
items
:
ipanel
});
me
.
callParent
();
me
.
load
({
success
:
function
(
response
,
options
)
{
var
i
,
confid
;
me
.
vmconfig
=
response
.
result
.
data
;
var
value
=
me
.
vmconfig
.
smbios1
;
if
(
value
)
{
var
data
=
PVE
.
Parser
.
parseQemuSmbios1
(
value
);
if
(
!
data
)
{
Ext
.
Msg
.
alert
(
gettext
(
'
Error
'
),
gettext
(
'
Unable to parse smbios options
'
));
me
.
close
();
return
;
}
ipanel
.
setSmbios1
(
data
);
}
}
});
}
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment