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
94693266
Commit
94693266
authored
Nov 04, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use new button class
parent
fe212ada
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
49 deletions
+30
-49
ContentView.js
www/manager/storage/ContentView.js
+30
-49
No files found.
www/manager/storage/ContentView.js
View file @
94693266
...
...
@@ -203,6 +203,8 @@ Ext.define('PVE.storage.ContentView', {
}
});
var
sm
=
Ext
.
create
(
'
Ext.selection.RowModel
'
,
{});
var
groupingFeature
=
Ext
.
create
(
'
Ext.grid.feature.Grouping
'
,{
groupHeaderTpl
:
'
ContentType: {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})
'
});
...
...
@@ -211,53 +213,9 @@ Ext.define('PVE.storage.ContentView', {
store
.
load
();
};
var
remove_btn
=
new
Ext
.
Button
({
text
:
'
Delete
'
,
disabled
:
true
,
handler
:
function
()
{
var
sm
=
me
.
getSelectionModel
();
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
return
;
}
var
volid
=
rec
.
data
.
volid
;
var
msg
=
'
Are you sure you want to delete volume "
'
+
volid
+
'
"
'
;
Ext
.
Msg
.
confirm
(
'
Deletion Confirmation
'
,
msg
,
function
(
btn
)
{
if
(
btn
!==
'
yes
'
)
{
return
;
}
PVE
.
Utils
.
API2Request
({
url
:
baseurl
+
'
/
'
+
volid
,
method
:
'
DELETE
'
,
waitMsgTarget
:
me
,
callback
:
function
()
{
reload
();
},
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
'
Error
'
,
response
.
htmlStatus
);
}
});
});
}
});
var
set_button_status
=
function
()
{
var
sm
=
me
.
getSelectionModel
();
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
||
rec
.
data
.
content
===
'
images
'
)
{
remove_btn
.
setDisabled
(
true
);
return
;
}
remove_btn
.
setDisabled
(
false
);
};
Ext
.
apply
(
me
,
{
Ext
.
apply
(
me
,
{
store
:
store
,
selModel
:
sm
,
stateful
:
false
,
viewConfig
:
{
trackOver
:
false
...
...
@@ -267,7 +225,31 @@ Ext.define('PVE.storage.ContentView', {
{
text
:
'
Restore
'
},
remove_btn
,
{
xtype
:
'
pveButton
'
,
text
:
'
Delete
'
,
selModel
:
sm
,
disabled
:
true
,
confirmMsg
:
function
(
rec
)
{
return
'
Are you sure you want to delete volume "
'
+
rec
.
data
.
volid
+
'
"
'
;
},
enableFn
:
function
(
rec
)
{
return
rec
&&
rec
.
data
.
content
!==
'
images
'
;
},
handler
:
function
(
b
,
e
,
rec
)
{
PVE
.
Utils
.
API2Request
({
url
:
baseurl
+
'
/
'
+
rec
.
data
.
volid
,
method
:
'
DELETE
'
,
waitMsgTarget
:
me
,
callback
:
function
()
{
reload
();
},
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
'
Error
'
,
response
.
htmlStatus
);
}
});
}
},
{
text
:
'
Upload
'
,
handler
:
function
()
{
...
...
@@ -301,8 +283,7 @@ Ext.define('PVE.storage.ContentView', {
}
],
listeners
:
{
show
:
reload
,
selectionchange
:
set_button_status
show
:
reload
}
});
...
...
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