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
6b478975
Commit
6b478975
authored
May 06, 2013
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clone: add target node selector
parent
085f9d9b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
9 deletions
+37
-9
NodeSelector.js
www/manager/form/NodeSelector.js
+15
-5
Clone.js
www/manager/qemu/Clone.js
+21
-3
SnapshotTree.js
www/manager/qemu/SnapshotTree.js
+1
-1
No files found.
www/manager/form/NodeSelector.js
View file @
6b478975
...
...
@@ -7,6 +7,9 @@ Ext.define('PVE.form.NodeSelector', {
selectCurNode
:
false
,
// only allow those nodes (array)
allowedNodes
:
undefined
,
initComponent
:
function
()
{
var
me
=
this
;
...
...
@@ -66,18 +69,25 @@ Ext.define('PVE.form.NodeSelector', {
}
var
offline
=
[];
var
notAllowed
=
[];
Ext
.
Array
.
each
(
value
.
split
(
/
\s
*,
\s
*/
),
function
(
node
)
{
var
rec
=
me
.
store
.
findRecord
(
me
.
valueField
,
node
);
if
(
!
(
rec
&&
rec
.
data
)
||
!
Ext
.
isNumeric
(
rec
.
data
.
mem
))
{
offline
.
push
(
node
);
}
}
else
if
(
me
.
allowedNodes
&&
!
Ext
.
Array
.
contains
(
me
.
allowedNodes
,
node
))
{
notAllowed
.
push
(
node
);
}
});
if
(
offline
.
length
==
0
)
{
return
true
;
}
if
(
notAllowed
.
length
!
==
0
)
{
return
"
Node
"
+
offline
.
join
(
'
,
'
)
+
"
is disabled (not allowed for this action)!
"
;
}
return
"
Node
"
+
offline
.
join
(
'
,
'
)
+
"
seems to be offline!
"
;
if
(
offline
.
length
!==
0
)
{
return
"
Node
"
+
offline
.
join
(
'
,
'
)
+
"
seems to be offline!
"
;
}
return
true
;
}
});
...
...
www/manager/qemu/Clone.js
View file @
6b478975
...
...
@@ -18,6 +18,10 @@ Ext.define('PVE.window.Clone', {
params
.
name
=
values
.
name
;
}
if
(
values
.
target
)
{
params
.
target
=
values
.
target
;
}
if
(
values
.
clonemode
===
'
copy
'
)
{
params
.
full
=
1
;
if
(
values
.
storage
)
{
...
...
@@ -64,7 +68,11 @@ Ext.define('PVE.window.Clone', {
Ext
.
Msg
.
alert
(
'
Error
'
,
response
.
htmlStatus
);
},
success
:
function
(
response
,
options
)
{
me
.
submitBtn
.
setDisabled
(
response
.
result
.
data
!==
1
);
var
res
=
response
.
result
.
data
;
me
.
submitBtn
.
setDisabled
(
res
.
hasFeature
!==
1
);
me
.
targetSel
.
allowedNodes
=
res
.
nodes
;
me
.
targetSel
.
validate
();
}
});
},
...
...
@@ -88,6 +96,16 @@ Ext.define('PVE.window.Clone', {
var
col1
=
[];
var
col2
=
[];
me
.
targetSel
=
Ext
.
create
(
'
PVE.form.NodeSelector
'
,
{
name
:
'
target
'
,
fieldLabel
:
'
Target node
'
,
selectCurNode
:
true
,
allowBlank
:
false
,
onlineValidator
:
true
});
col1
.
push
(
me
.
targetSel
);
var
modelist
=
[[
'
copy
'
,
'
Full Clone
'
]];
if
(
me
.
isTemplate
)
{
modelist
.
push
([
'
clone
'
,
'
Linked Clone
'
]);
...
...
@@ -112,7 +130,7 @@ Ext.define('PVE.window.Clone', {
me
.
verifyFeature
();
});
col
1
.
push
(
me
.
kv1
);
col
2
.
push
(
me
.
kv1
);
me
.
snapshotSel
=
Ext
.
create
(
'
PVE.form.SnapshotSelector
'
,
{
name
:
'
snapname
'
,
...
...
@@ -130,7 +148,7 @@ Ext.define('PVE.window.Clone', {
}
});
col
1
.
push
(
me
.
snapshotSel
);
col
2
.
push
(
me
.
snapshotSel
);
col1
.
push
(
{
...
...
www/manager/qemu/SnapshotTree.js
View file @
6b478975
...
...
@@ -78,7 +78,7 @@ Ext.define('PVE.qemu.SnapshotTree', {
method
:
'
GET
'
,
success
:
function
(
response
,
options
)
{
var
res
=
response
.
result
.
data
;
if
(
res
===
1
)
{
if
(
res
.
hasFeature
)
{
Ext
.
getCmp
(
'
snapshotBtn
'
).
enable
();
}
}
...
...
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