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
8747655a
Commit
8747655a
authored
Nov 04, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement restore GUI
parent
161b8020
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
141 additions
and
1 deletion
+141
-1
Makefile
www/manager/Makefile
+1
-0
ContentView.js
www/manager/storage/ContentView.js
+26
-1
Restore.js
www/manager/window/Restore.js
+114
-0
No files found.
www/manager/Makefile
View file @
8747655a
...
...
@@ -52,6 +52,7 @@ JSSRC= \
window/Wizard.js
\
window/NotesEdit.js
\
window/Backup.js
\
window/Restore.js
\
panel/NotesView.js
\
grid/SelectFeature.js
\
grid/ObjectGrid.js
\
...
...
www/manager/storage/ContentView.js
View file @
8747655a
...
...
@@ -223,7 +223,32 @@ Ext.define('PVE.storage.ContentView', {
features
:
[
groupingFeature
],
tbar
:
[
{
text
:
'
Restore
'
xtype
:
'
pveButton
'
,
text
:
'
Restore
'
,
selModel
:
sm
,
disabled
:
true
,
enableFn
:
function
(
rec
)
{
return
rec
&&
rec
.
data
.
content
===
'
backup
'
;
},
handler
:
function
(
b
,
e
,
rec
)
{
var
vmtype
;
if
(
rec
.
data
.
volid
.
match
(
/vzdump-qemu-/
))
{
vmtype
=
'
qemu
'
;
}
else
if
(
rec
.
data
.
volid
.
match
(
/vzdump-openvz-/
))
{
vmtype
=
'
openvz
'
;
}
else
{
return
;
}
var
win
=
Ext
.
create
(
'
PVE.window.Restore
'
,
{
nodename
:
nodename
,
volid
:
rec
.
data
.
volid
,
volidText
:
PVE
.
Utils
.
render_storage_content
(
rec
.
data
.
volid
,
{},
rec
),
vmtype
:
vmtype
});
win
.
show
();
win
.
on
(
'
destroy
'
,
reload
);
}
},
{
xtype
:
'
pveButton
'
,
...
...
www/manager/window/Restore.js
0 → 100644
View file @
8747655a
Ext
.
define
(
'
PVE.window.Restore
'
,
{
extend
:
'
Ext.window.Window
'
,
// fixme: PVE.window.Edit?
resizable
:
false
,
initComponent
:
function
()
{
var
me
=
this
;
if
(
!
me
.
nodename
)
{
throw
"
no node name specified
"
;
}
if
(
!
me
.
volid
)
{
throw
"
no volume ID specified
"
;
}
if
(
!
me
.
vmtype
)
{
throw
"
no vmtype specified
"
;
}
var
storagesel
=
Ext
.
create
(
'
PVE.form.StorageSelector
'
,
{
nodename
:
me
.
nodename
,
name
:
'
storage
'
,
value
:
''
,
fieldLabel
:
'
Storage
'
,
storageContent
:
(
me
.
vmtype
===
'
openvz
'
)
?
'
rootdir
'
:
'
images
'
,
allowBlank
:
true
});
me
.
formPanel
=
Ext
.
create
(
'
Ext.form.Panel
'
,
{
bodyPadding
:
10
,
border
:
false
,
fieldDefaults
:
{
labelWidth
:
60
,
anchor
:
'
100%
'
},
items
:
[
{
xtype
:
'
displayfield
'
,
value
:
me
.
volidText
||
me
.
volid
,
fieldLabel
:
'
Source
'
},
storagesel
,
{
xtype
:
'
pveVMIDSelector
'
,
name
:
'
vmid
'
,
value
:
PVE
.
data
.
ResourceStore
.
findNextVMID
(),
validateExists
:
false
}
]
});
var
form
=
me
.
formPanel
.
getForm
();
form
.
on
(
'
validitychange
'
,
function
(
f
,
valid
)
{
submitBtn
.
setDisabled
(
!
valid
);
});
var
submitBtn
=
Ext
.
create
(
'
Ext.Button
'
,
{
text
:
'
Restore
'
,
handler
:
function
(){
var
storage
=
storagesel
.
getValue
();
var
values
=
form
.
getValues
();
var
params
=
{
storage
:
storage
,
vmid
:
values
.
vmid
};
if
(
me
.
vmtype
===
'
openvz
'
)
{
url
=
'
/nodes/
'
+
me
.
nodename
+
'
/openvz
'
;
params
.
ostemplate
=
me
.
volid
;
}
else
if
(
me
.
vmtype
===
'
qemu
'
)
{
url
=
'
/nodes/
'
+
me
.
nodename
+
'
/qemu
'
;
params
.
archive
=
me
.
volid
;
}
else
{
throw
'
unknown VM type
'
;
}
PVE
.
Utils
.
API2Request
({
url
:
url
,
params
:
params
,
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
'
)
?
"
Restore CT
"
:
"
Restore VM
"
;
Ext
.
apply
(
me
,
{
title
:
title
,
width
:
450
,
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