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
e97d821c
Commit
e97d821c
authored
Jul 03, 2015
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy grid/PoolMembers.js from manager to manager5
parent
b299a28f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
181 additions
and
0 deletions
+181
-0
PoolMembers.js
www/manager5/grid/PoolMembers.js
+181
-0
No files found.
www/manager5/grid/PoolMembers.js
0 → 100644
View file @
e97d821c
Ext
.
define
(
'
PVE.pool.AddVM
'
,
{
extend
:
'
PVE.window.Edit
'
,
initComponent
:
function
()
{
/*jslint confusion: true */
var
me
=
this
;
if
(
!
me
.
pool
)
{
throw
"
no pool specified
"
;
}
me
.
create
=
true
;
me
.
isAdd
=
true
;
me
.
url
=
"
/pools/
"
+
me
.
pool
;
me
.
method
=
'
PUT
'
;
Ext
.
apply
(
me
,
{
subject
:
gettext
(
'
Virtual Machine
'
),
width
:
350
,
items
:
[
{
xtype
:
'
pveVMIDSelector
'
,
name
:
'
vms
'
,
validateExists
:
true
,
value
:
''
,
fieldLabel
:
"
VM ID
"
}
]
});
me
.
callParent
();
}
});
Ext
.
define
(
'
PVE.pool.AddStorage
'
,
{
extend
:
'
PVE.window.Edit
'
,
initComponent
:
function
()
{
/*jslint confusion: true */
var
me
=
this
;
if
(
!
me
.
pool
)
{
throw
"
no pool specified
"
;
}
me
.
create
=
true
;
me
.
isAdd
=
true
;
me
.
url
=
"
/pools/
"
+
me
.
pool
;
me
.
method
=
'
PUT
'
;
Ext
.
apply
(
me
,
{
subject
:
gettext
(
'
Storage
'
),
width
:
350
,
items
:
[
{
xtype
:
'
PVE.form.StorageSelector
'
,
name
:
'
storage
'
,
nodename
:
'
localhost
'
,
autoSelect
:
false
,
value
:
''
,
fieldLabel
:
gettext
(
"
Storage
"
)
}
]
});
me
.
callParent
();
}
});
Ext
.
define
(
'
PVE.grid.PoolMembers
'
,
{
extend
:
'
Ext.grid.GridPanel
'
,
alias
:
[
'
widget.pvePoolMembers
'
],
// fixme: dynamic status update ?
initComponent
:
function
()
{
var
me
=
this
;
if
(
!
me
.
pool
)
{
throw
"
no pool specified
"
;
}
var
store
=
Ext
.
create
(
'
Ext.data.Store
'
,
{
model
:
'
PVEResources
'
,
sorters
:
[
{
property
:
'
type
'
,
direction
:
'
ASC
'
}
],
proxy
:
{
type
:
'
pve
'
,
root
:
'
data.members
'
,
url
:
"
/api2/json/pools/
"
+
me
.
pool
}
});
var
coldef
=
PVE
.
data
.
ResourceStore
.
defaultColums
();
var
reload
=
function
()
{
store
.
load
();
};
var
sm
=
Ext
.
create
(
'
Ext.selection.RowModel
'
,
{});
var
remove_btn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Remove
'
),
disabled
:
true
,
selModel
:
sm
,
confirmMsg
:
function
(
rec
)
{
return
Ext
.
String
.
format
(
gettext
(
'
Are you sure you want to remove entry {0}
'
),
"
'
"
+
rec
.
data
.
id
+
"
'
"
);
},
handler
:
function
(
btn
,
event
,
rec
)
{
var
params
=
{
'
delete
'
:
1
};
if
(
rec
.
data
.
type
===
'
storage
'
)
{
params
.
storage
=
rec
.
data
.
storage
;
}
else
if
(
rec
.
data
.
type
===
'
qemu
'
||
rec
.
data
.
type
===
'
openvz
'
)
{
params
.
vms
=
rec
.
data
.
vmid
;
}
else
{
throw
"
unknown resource type
"
;
}
PVE
.
Utils
.
API2Request
({
url
:
'
/pools/
'
+
me
.
pool
,
method
:
'
PUT
'
,
params
:
params
,
waitMsgTarget
:
me
,
callback
:
function
()
{
reload
();
},
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
gettext
(
'
Error
'
),
response
.
htmlStatus
);
}
});
}
});
Ext
.
apply
(
me
,
{
store
:
store
,
selModel
:
sm
,
tbar
:
[
{
text
:
gettext
(
'
Add
'
),
menu
:
new
Ext
.
menu
.
Menu
({
items
:
[
{
text
:
gettext
(
'
Virtual Machine
'
),
iconCls
:
'
pve-itype-icon-qemu
'
,
handler
:
function
()
{
var
win
=
Ext
.
create
(
'
PVE.pool.AddVM
'
,
{
pool
:
me
.
pool
});
win
.
on
(
'
destroy
'
,
reload
);
win
.
show
();
}
},
{
text
:
gettext
(
'
Storage
'
),
iconCls
:
'
pve-itype-icon-storage
'
,
handler
:
function
()
{
var
win
=
Ext
.
create
(
'
PVE.pool.AddStorage
'
,
{
pool
:
me
.
pool
});
win
.
on
(
'
destroy
'
,
reload
);
win
.
show
();
}
}
]
})
},
remove_btn
],
viewConfig
:
{
stripeRows
:
true
},
columns
:
coldef
,
listeners
:
{
show
:
reload
}
});
me
.
callParent
();
}
});
\ No newline at end of file
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