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
Show 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', {
...
@@ -7,6 +7,9 @@ Ext.define('PVE.form.NodeSelector', {
selectCurNode
:
false
,
selectCurNode
:
false
,
// only allow those nodes (array)
allowedNodes
:
undefined
,
initComponent
:
function
()
{
initComponent
:
function
()
{
var
me
=
this
;
var
me
=
this
;
...
@@ -66,19 +69,26 @@ Ext.define('PVE.form.NodeSelector', {
...
@@ -66,19 +69,26 @@ Ext.define('PVE.form.NodeSelector', {
}
}
var
offline
=
[];
var
offline
=
[];
var
notAllowed
=
[];
Ext
.
Array
.
each
(
value
.
split
(
/
\s
*,
\s
*/
),
function
(
node
)
{
Ext
.
Array
.
each
(
value
.
split
(
/
\s
*,
\s
*/
),
function
(
node
)
{
var
rec
=
me
.
store
.
findRecord
(
me
.
valueField
,
node
);
var
rec
=
me
.
store
.
findRecord
(
me
.
valueField
,
node
);
if
(
!
(
rec
&&
rec
.
data
)
||
!
Ext
.
isNumeric
(
rec
.
data
.
mem
))
{
if
(
!
(
rec
&&
rec
.
data
)
||
!
Ext
.
isNumeric
(
rec
.
data
.
mem
))
{
offline
.
push
(
node
);
offline
.
push
(
node
);
}
else
if
(
me
.
allowedNodes
&&
!
Ext
.
Array
.
contains
(
me
.
allowedNodes
,
node
))
{
notAllowed
.
push
(
node
);
}
}
});
});
if
(
offline
.
length
==
0
)
{
if
(
notAllowed
.
length
!
==
0
)
{
return
true
;
return
"
Node
"
+
offline
.
join
(
'
,
'
)
+
"
is disabled (not allowed for this action)!
"
;
}
}
if
(
offline
.
length
!==
0
)
{
return
"
Node
"
+
offline
.
join
(
'
,
'
)
+
"
seems to be offline!
"
;
return
"
Node
"
+
offline
.
join
(
'
,
'
)
+
"
seems to be offline!
"
;
}
}
return
true
;
}
});
});
if
(
me
.
selectCurNode
&&
PVE
.
curSelectedNode
.
data
.
node
)
{
if
(
me
.
selectCurNode
&&
PVE
.
curSelectedNode
.
data
.
node
)
{
...
...
www/manager/qemu/Clone.js
View file @
6b478975
...
@@ -18,6 +18,10 @@ Ext.define('PVE.window.Clone', {
...
@@ -18,6 +18,10 @@ Ext.define('PVE.window.Clone', {
params
.
name
=
values
.
name
;
params
.
name
=
values
.
name
;
}
}
if
(
values
.
target
)
{
params
.
target
=
values
.
target
;
}
if
(
values
.
clonemode
===
'
copy
'
)
{
if
(
values
.
clonemode
===
'
copy
'
)
{
params
.
full
=
1
;
params
.
full
=
1
;
if
(
values
.
storage
)
{
if
(
values
.
storage
)
{
...
@@ -64,7 +68,11 @@ Ext.define('PVE.window.Clone', {
...
@@ -64,7 +68,11 @@ Ext.define('PVE.window.Clone', {
Ext
.
Msg
.
alert
(
'
Error
'
,
response
.
htmlStatus
);
Ext
.
Msg
.
alert
(
'
Error
'
,
response
.
htmlStatus
);
},
},
success
:
function
(
response
,
options
)
{
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', {
...
@@ -88,6 +96,16 @@ Ext.define('PVE.window.Clone', {
var
col1
=
[];
var
col1
=
[];
var
col2
=
[];
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
'
]];
var
modelist
=
[[
'
copy
'
,
'
Full Clone
'
]];
if
(
me
.
isTemplate
)
{
if
(
me
.
isTemplate
)
{
modelist
.
push
([
'
clone
'
,
'
Linked Clone
'
]);
modelist
.
push
([
'
clone
'
,
'
Linked Clone
'
]);
...
@@ -112,7 +130,7 @@ Ext.define('PVE.window.Clone', {
...
@@ -112,7 +130,7 @@ Ext.define('PVE.window.Clone', {
me
.
verifyFeature
();
me
.
verifyFeature
();
});
});
col
1
.
push
(
me
.
kv1
);
col
2
.
push
(
me
.
kv1
);
me
.
snapshotSel
=
Ext
.
create
(
'
PVE.form.SnapshotSelector
'
,
{
me
.
snapshotSel
=
Ext
.
create
(
'
PVE.form.SnapshotSelector
'
,
{
name
:
'
snapname
'
,
name
:
'
snapname
'
,
...
@@ -130,7 +148,7 @@ Ext.define('PVE.window.Clone', {
...
@@ -130,7 +148,7 @@ Ext.define('PVE.window.Clone', {
}
}
});
});
col
1
.
push
(
me
.
snapshotSel
);
col
2
.
push
(
me
.
snapshotSel
);
col1
.
push
(
col1
.
push
(
{
{
...
...
www/manager/qemu/SnapshotTree.js
View file @
6b478975
...
@@ -78,7 +78,7 @@ Ext.define('PVE.qemu.SnapshotTree', {
...
@@ -78,7 +78,7 @@ Ext.define('PVE.qemu.SnapshotTree', {
method
:
'
GET
'
,
method
:
'
GET
'
,
success
:
function
(
response
,
options
)
{
success
:
function
(
response
,
options
)
{
var
res
=
response
.
result
.
data
;
var
res
=
response
.
result
.
data
;
if
(
res
===
1
)
{
if
(
res
.
hasFeature
)
{
Ext
.
getCmp
(
'
snapshotBtn
'
).
enable
();
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