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
404ff2c3
Commit
404ff2c3
authored
Oct 20, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add backup panel for openvz containers
parent
6ec52543
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
126 additions
and
117 deletions
+126
-117
Makefile
www/manager/Makefile
+2
-1
BackupView.js
www/manager/grid/BackupView.js
+9
-105
Config.js
www/manager/openvz/Config.js
+2
-2
Config.js
www/manager/qemu/Config.js
+1
-1
DirEdit.js
www/manager/storage/DirEdit.js
+3
-4
NFSEdit.js
www/manager/storage/NFSEdit.js
+3
-4
Backup.js
www/manager/window/Backup.js
+106
-0
No files found.
www/manager/Makefile
View file @
404ff2c3
...
@@ -47,12 +47,14 @@ JSSRC= \
...
@@ -47,12 +47,14 @@ JSSRC= \
window/TaskViewer.js
\
window/TaskViewer.js
\
window/Wizard.js
\
window/Wizard.js
\
window/NotesEdit.js
\
window/NotesEdit.js
\
window/Backup.js
\
panel/NotesView.js
\
panel/NotesView.js
\
grid/SelectFeature.js
\
grid/SelectFeature.js
\
grid/ObjectGrid.js
\
grid/ObjectGrid.js
\
grid/ResourceGrid.js
\
grid/ResourceGrid.js
\
tree/ResourceTree.js
\
tree/ResourceTree.js
\
panel/ConfigPanel.js
\
panel/ConfigPanel.js
\
grid/BackupView.js
\
node/DNSEdit.js
\
node/DNSEdit.js
\
node/DNSView.js
\
node/DNSView.js
\
node/TimeView.js
\
node/TimeView.js
\
...
@@ -80,7 +82,6 @@ JSSRC= \
...
@@ -80,7 +82,6 @@ JSSRC= \
qemu/KeyboardEdit.js
\
qemu/KeyboardEdit.js
\
qemu/HardwareView.js
\
qemu/HardwareView.js
\
qemu/Options.js
\
qemu/Options.js
\
qemu/Backup.js
\
qemu/Config.js
\
qemu/Config.js
\
qemu/CreateWizard.js
\
qemu/CreateWizard.js
\
openvz/StatusView.js
\
openvz/StatusView.js
\
...
...
www/manager/
qemu/Backup
.js
→
www/manager/
grid/BackupView
.js
View file @
404ff2c3
Ext
.
define
(
'
PVE.qemu.Backup
'
,
{
Ext
.
define
(
'
PVE.grid.BackupView
'
,
{
extend
:
'
Ext.window.Window
'
,
resizable
:
false
,
initComponent
:
function
()
{
var
me
=
this
;
if
(
!
me
.
nodename
)
{
throw
"
no node name specified
"
;
}
if
(
!
me
.
vmid
)
{
throw
"
no VM ID specified
"
;
}
var
storagesel
=
Ext
.
create
(
'
PVE.form.StorageSelector
'
,
{
nodename
:
me
.
nodename
,
name
:
'
storage
'
,
value
:
me
.
storage
,
fieldLabel
:
'
Storage
'
,
storageContent
:
'
backup
'
,
allowBlank
:
false
});
me
.
formPanel
=
Ext
.
create
(
'
Ext.form.Panel
'
,
{
bodyPadding
:
10
,
border
:
false
,
fieldDefaults
:
{
labelWidth
:
100
,
anchor
:
'
100%
'
},
items
:
[
storagesel
,
{
xtype
:
'
pvecheckbox
'
,
name
:
'
compress
'
,
uncheckedValue
:
0
,
checked
:
true
,
fieldLabel
:
'
Compress
'
},
{
xtype
:
'
pvecheckbox
'
,
name
:
'
snapshot
'
,
uncheckedValue
:
0
,
checked
:
true
,
fieldLabel
:
'
Snapshot mode
'
}
]
});
var
form
=
me
.
formPanel
.
getForm
();
var
submitBtn
=
Ext
.
create
(
'
Ext.Button
'
,
{
text
:
'
Backup
'
,
handler
:
function
(){
var
storage
=
storagesel
.
getValue
();
var
msg
=
'
Start backup to storage "
'
+
storage
+
'
"
'
;
var
values
=
form
.
getValues
();
console
.
dir
(
me
.
vmid
,
me
.
nodename
,
values
.
online
);
PVE
.
Utils
.
API2Request
({
url
:
'
/nodes/
'
+
me
.
nodename
+
'
/vzdump
'
,
params
:
{
storage
:
storage
,
vmid
:
me
.
vmid
,
compress
:
values
.
compress
,
snapshot
:
values
.
snapshot
},
method
:
'
POST
'
,
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
'
Error
'
,
response
.
htmlStatus
);
},
success
:
function
(
response
,
options
)
{
var
upid
=
response
.
result
.
data
;
var
win
=
Ext
.
create
(
'
PVE.window.TaskViewer
'
,
{
upid
:
upid
});
win
.
show
();
me
.
close
();
}
});
}
});
Ext
.
apply
(
me
,
{
title
:
"
Backup VM
"
+
me
.
vmid
,
width
:
350
,
modal
:
true
,
layout
:
'
auto
'
,
border
:
false
,
items
:
[
me
.
formPanel
],
buttons
:
[
submitBtn
],
});
me
.
callParent
();
}
});
Ext
.
define
(
'
PVE.qemu.BackupView
'
,
{
extend
:
'
Ext.grid.GridPanel
'
,
extend
:
'
Ext.grid.GridPanel
'
,
alias
:
[
'
widget.pve
Qemu
BackupView
'
],
alias
:
[
'
widget.pveBackupView
'
],
initComponent
:
function
()
{
initComponent
:
function
()
{
...
@@ -117,6 +17,11 @@ Ext.define('PVE.qemu.BackupView', {
...
@@ -117,6 +17,11 @@ Ext.define('PVE.qemu.BackupView', {
throw
"
no VM ID specified
"
;
throw
"
no VM ID specified
"
;
}
}
var
vmtype
=
me
.
pveSelNode
.
data
.
type
;
if
(
!
vmtype
)
{
throw
"
no VM type specified
"
;
}
me
.
store
=
Ext
.
create
(
'
Ext.data.Store
'
,
{
me
.
store
=
Ext
.
create
(
'
Ext.data.Store
'
,
{
model
:
'
pve-storage-content
'
,
model
:
'
pve-storage-content
'
,
sorters
:
{
sorters
:
{
...
@@ -159,9 +64,10 @@ Ext.define('PVE.qemu.BackupView', {
...
@@ -159,9 +64,10 @@ Ext.define('PVE.qemu.BackupView', {
var
backup_btn
=
new
Ext
.
Button
({
var
backup_btn
=
new
Ext
.
Button
({
text
:
'
Backup now
'
,
text
:
'
Backup now
'
,
handler
:
function
()
{
handler
:
function
()
{
var
win
=
Ext
.
create
(
'
PVE.
qemu
.Backup
'
,
{
var
win
=
Ext
.
create
(
'
PVE.
window
.Backup
'
,
{
nodename
:
nodename
,
nodename
:
nodename
,
vmid
:
vmid
,
vmid
:
vmid
,
vmtype
:
vmtype
,
storage
:
storagesel
.
getValue
()
storage
:
storagesel
.
getValue
()
});
});
win
.
show
();
win
.
show
();
...
@@ -221,7 +127,5 @@ Ext.define('PVE.qemu.BackupView', {
...
@@ -221,7 +127,5 @@ Ext.define('PVE.qemu.BackupView', {
});
});
me
.
callParent
();
me
.
callParent
();
//setStorage('local');
}
}
});
});
www/manager/openvz/Config.js
View file @
404ff2c3
...
@@ -61,9 +61,9 @@ Ext.define('PVE.openvz.Config', {
...
@@ -61,9 +61,9 @@ Ext.define('PVE.openvz.Config', {
vmid
:
vmid
vmid
:
vmid
},
},
{
{
xtype
:
'
pveBackupView
'
,
title
:
'
Backup
'
,
title
:
'
Backup
'
,
itemId
:
'
backup
'
,
itemId
:
'
backup
'
html
:
'
Backup and restore - not implemented!
'
},
},
{
{
title
:
'
Permissions
'
,
title
:
'
Permissions
'
,
...
...
www/manager/qemu/Config.js
View file @
404ff2c3
...
@@ -46,7 +46,7 @@ Ext.define('PVE.qemu.Config', {
...
@@ -46,7 +46,7 @@ Ext.define('PVE.qemu.Config', {
vmid
:
vmid
vmid
:
vmid
},
},
{
{
xtype
:
'
pve
Qemu
BackupView
'
,
xtype
:
'
pveBackupView
'
,
title
:
'
Backup
'
,
title
:
'
Backup
'
,
itemId
:
'
backup
'
itemId
:
'
backup
'
},
},
...
...
www/manager/storage/DirEdit.js
View file @
404ff2c3
...
@@ -42,7 +42,7 @@ Ext.define('PVE.storage.DirInputPanel', {
...
@@ -42,7 +42,7 @@ Ext.define('PVE.storage.DirInputPanel', {
xtype
:
'
pveContentTypeSelector
'
,
xtype
:
'
pveContentTypeSelector
'
,
name
:
'
content
'
,
name
:
'
content
'
,
value
:
'
images
'
,
value
:
'
images
'
,
multiSelect
:
me
.
storageId
===
'
local
'
,
multiSelect
:
true
,
fieldLabel
:
'
Content
'
,
fieldLabel
:
'
Content
'
,
allowBlank
:
false
allowBlank
:
false
}
}
...
@@ -114,9 +114,8 @@ Ext.define('PVE.storage.DirEdit', {
...
@@ -114,9 +114,8 @@ Ext.define('PVE.storage.DirEdit', {
var
values
=
response
.
result
.
data
;
var
values
=
response
.
result
.
data
;
var
ctypes
=
values
.
content
||
''
;
var
ctypes
=
values
.
content
||
''
;
if
(
values
.
storage
===
'
local
'
)
{
values
.
content
=
ctypes
.
split
(
'
,
'
);
values
.
content
=
ctypes
.
split
(
'
,
'
);
}
if
(
values
.
nodes
)
{
if
(
values
.
nodes
)
{
values
.
nodes
=
values
.
nodes
.
split
(
'
,
'
);
values
.
nodes
=
values
.
nodes
.
split
(
'
,
'
);
}
}
...
...
www/manager/storage/NFSEdit.js
View file @
404ff2c3
...
@@ -116,7 +116,7 @@ Ext.define('PVE.storage.NFSInputPanel', {
...
@@ -116,7 +116,7 @@ Ext.define('PVE.storage.NFSInputPanel', {
xtype
:
'
pveContentTypeSelector
'
,
xtype
:
'
pveContentTypeSelector
'
,
name
:
'
content
'
,
name
:
'
content
'
,
value
:
'
images
'
,
value
:
'
images
'
,
multiSelect
:
me
.
storageId
===
'
local
'
,
multiSelect
:
true
,
fieldLabel
:
'
Content
'
,
fieldLabel
:
'
Content
'
,
allowBlank
:
false
allowBlank
:
false
}
}
...
@@ -179,9 +179,8 @@ Ext.define('PVE.storage.NFSEdit', {
...
@@ -179,9 +179,8 @@ Ext.define('PVE.storage.NFSEdit', {
var
values
=
response
.
result
.
data
;
var
values
=
response
.
result
.
data
;
var
ctypes
=
values
.
content
||
''
;
var
ctypes
=
values
.
content
||
''
;
if
(
values
.
storage
===
'
local
'
)
{
values
.
content
=
ctypes
.
split
(
'
,
'
);
values
.
content
=
ctypes
.
split
(
'
,
'
);
}
if
(
values
.
nodes
)
{
if
(
values
.
nodes
)
{
values
.
nodes
=
values
.
nodes
.
split
(
'
,
'
);
values
.
nodes
=
values
.
nodes
.
split
(
'
,
'
);
}
}
...
...
www/manager/window/Backup.js
0 → 100644
View file @
404ff2c3
Ext
.
define
(
'
PVE.window.Backup
'
,
{
extend
:
'
Ext.window.Window
'
,
resizable
:
false
,
initComponent
:
function
()
{
var
me
=
this
;
if
(
!
me
.
nodename
)
{
throw
"
no node name specified
"
;
}
if
(
!
me
.
vmid
)
{
throw
"
no VM ID specified
"
;
}
if
(
!
me
.
vmtype
)
{
throw
"
no VM type specified
"
;
}
var
storagesel
=
Ext
.
create
(
'
PVE.form.StorageSelector
'
,
{
nodename
:
me
.
nodename
,
name
:
'
storage
'
,
value
:
me
.
storage
,
fieldLabel
:
'
Storage
'
,
storageContent
:
'
backup
'
,
allowBlank
:
false
});
me
.
formPanel
=
Ext
.
create
(
'
Ext.form.Panel
'
,
{
bodyPadding
:
10
,
border
:
false
,
fieldDefaults
:
{
labelWidth
:
100
,
anchor
:
'
100%
'
},
items
:
[
storagesel
,
{
xtype
:
'
pvecheckbox
'
,
name
:
'
compress
'
,
uncheckedValue
:
0
,
checked
:
true
,
fieldLabel
:
'
Compress
'
},
{
xtype
:
'
pvecheckbox
'
,
name
:
'
snapshot
'
,
uncheckedValue
:
0
,
checked
:
true
,
fieldLabel
:
'
Snapshot mode
'
}
]
});
var
form
=
me
.
formPanel
.
getForm
();
var
submitBtn
=
Ext
.
create
(
'
Ext.Button
'
,
{
text
:
'
Backup
'
,
handler
:
function
(){
var
storage
=
storagesel
.
getValue
();
var
values
=
form
.
getValues
();
console
.
dir
(
me
.
vmid
,
me
.
nodename
,
values
.
online
);
PVE
.
Utils
.
API2Request
({
url
:
'
/nodes/
'
+
me
.
nodename
+
'
/vzdump
'
,
params
:
{
storage
:
storage
,
vmid
:
me
.
vmid
,
compress
:
values
.
compress
,
snapshot
:
values
.
snapshot
},
method
:
'
POST
'
,
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
'
Error
'
,
response
.
htmlStatus
);
},
success
:
function
(
response
,
options
)
{
var
upid
=
response
.
result
.
data
;
var
win
=
Ext
.
create
(
'
PVE.window.TaskViewer
'
,
{
upid
:
upid
});
win
.
show
();
me
.
close
();
}
});
}
});
var
title
=
(
me
.
vmtype
===
'
openvz
'
)
?
"
Backup CT
"
+
me
.
vmid
:
"
Backup VM
"
+
me
.
vmid
;
Ext
.
apply
(
me
,
{
title
:
title
,
width
:
350
,
modal
:
true
,
layout
:
'
auto
'
,
border
:
false
,
items
:
[
me
.
formPanel
],
buttons
:
[
submitBtn
],
});
me
.
callParent
();
}
});
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