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
781dc419
Commit
781dc419
authored
Nov 04, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement storage content deletion GUI
parent
c4616bac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
6 deletions
+50
-6
ContentView.js
www/manager/storage/ContentView.js
+50
-6
No files found.
www/manager/storage/ContentView.js
View file @
781dc419
...
...
@@ -189,13 +189,13 @@ Ext.define('PVE.storage.ContentView', {
throw
"
no storage ID specified
"
;
}
var
url
=
"
/api2/json
/nodes/
"
+
nodename
+
"
/storage/
"
+
storage
+
"
/content
"
;
var
baseurl
=
"
/nodes/
"
+
nodename
+
"
/storage/
"
+
storage
+
"
/content
"
;
var
store
=
new
Ext
.
data
.
Store
({
model
:
'
pve-storage-content
'
,
groupField
:
'
content
'
,
proxy
:
{
type
:
'
pve
'
,
url
:
url
url
:
'
/api2/json
'
+
baseurl
,
},
sorters
:
{
property
:
'
volid
'
,
...
...
@@ -211,6 +211,51 @@ 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
,
{
store
:
store
,
stateful
:
false
,
...
...
@@ -222,9 +267,7 @@ Ext.define('PVE.storage.ContentView', {
{
text
:
'
Restore
'
},
{
text
:
'
Delete
'
},
remove_btn
,
{
text
:
'
Upload
'
,
handler
:
function
()
{
...
...
@@ -258,7 +301,8 @@ Ext.define('PVE.storage.ContentView', {
}
],
listeners
:
{
show
:
reload
show
:
reload
,
selectionchange
:
set_button_status
}
});
...
...
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