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
67c60602
Commit
67c60602
authored
Oct 28, 2015
by
Wolfgang Link
Committed by
Dietmar Maurer
Oct 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add resize LXC Mountpoint at the GUI
parent
21ba6546
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
154 additions
and
2 deletions
+154
-2
Makefile
www/manager/Makefile
+1
-0
MPResize.js
www/manager/lxc/MPResize.js
+104
-0
Resources.js
www/manager/lxc/Resources.js
+49
-2
No files found.
www/manager/Makefile
View file @
67c60602
...
...
@@ -150,6 +150,7 @@ JSSRC= \
lxc/SnapshotTree.js
\
lxc/Snapshot.js
\
lxc/ResourceEdit.js
\
lxc/MPResize.js
\
pool/StatusView.js
\
pool/Summary.js
\
pool/Config.js
\
...
...
www/manager/lxc/MPResize.js
0 → 100644
View file @
67c60602
Ext
.
define
(
'
PVE.window.MPResize
'
,
{
extend
:
'
Ext.window.Window
'
,
resizable
:
false
,
resize_disk
:
function
(
disk
,
size
)
{
var
me
=
this
;
var
params
=
{
disk
:
disk
,
size
:
'
+
'
+
size
+
'
G
'
};
PVE
.
Utils
.
API2Request
({
params
:
params
,
url
:
'
/nodes/
'
+
me
.
nodename
+
'
/lxc/
'
+
me
.
vmid
+
'
/resize
'
,
waitMsgTarget
:
me
,
method
:
'
PUT
'
,
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
gettext
(
'
Error
'
),
response
.
htmlStatus
);
},
success
:
function
(
response
,
opts
)
{
var
upid
=
response
.
result
.
data
;
var
win
=
Ext
.
create
(
'
PVE.window.TaskViewer
'
,
{
upid
:
upid
});
win
.
show
();
me
.
close
();
}
});
},
initComponent
:
function
()
{
var
me
=
this
;
if
(
!
me
.
nodename
)
{
throw
"
no node name specified
"
;
}
if
(
!
me
.
vmid
)
{
throw
"
no VM ID specified
"
;
}
var
items
=
[
{
xtype
:
'
displayfield
'
,
name
:
'
disk
'
,
value
:
me
.
disk
,
fieldLabel
:
gettext
(
'
Disk
'
),
vtype
:
'
StorageId
'
,
allowBlank
:
false
}
];
me
.
hdsizesel
=
Ext
.
createWidget
(
'
numberfield
'
,
{
name
:
'
size
'
,
minValue
:
0
,
maxValue
:
128
*
1024
,
decimalPrecision
:
3
,
value
:
'
0
'
,
fieldLabel
:
gettext
(
'
Size Increment
'
)
+
'
(GB)
'
,
allowBlank
:
false
});
items
.
push
(
me
.
hdsizesel
);
me
.
formPanel
=
Ext
.
create
(
'
Ext.form.Panel
'
,
{
bodyPadding
:
10
,
border
:
false
,
fieldDefaults
:
{
labelWidth
:
120
,
anchor
:
'
100%
'
},
items
:
items
});
var
form
=
me
.
formPanel
.
getForm
();
var
submitBtn
;
me
.
title
=
gettext
(
'
Resize disk
'
);
submitBtn
=
Ext
.
create
(
'
Ext.Button
'
,
{
text
:
gettext
(
'
Resize disk
'
),
handler
:
function
()
{
if
(
form
.
isValid
())
{
var
values
=
form
.
getValues
();
me
.
resize_disk
(
me
.
disk
,
values
.
size
);
}
}
});
Ext
.
apply
(
me
,
{
modal
:
true
,
width
:
250
,
height
:
150
,
border
:
false
,
layout
:
'
fit
'
,
buttons
:
[
submitBtn
],
items
:
[
me
.
formPanel
]
});
me
.
callParent
();
if
(
!
me
.
disk
)
{
return
;
}
}
});
www/manager/lxc/Resources.js
View file @
67c60602
...
...
@@ -112,6 +112,23 @@ Ext.define('PVE.lxc.RessourceView', {
win
.
on
(
'
destroy
'
,
reload
);
};
var
run_resize
=
function
()
{
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
return
;
}
var
win
=
Ext
.
create
(
'
PVE.window.MPResize
'
,
{
disk
:
rec
.
data
.
key
,
nodename
:
nodename
,
vmid
:
vmid
});
win
.
show
();
win
.
on
(
'
destroy
'
,
reload
);
};
var
edit_btn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Edit
'
),
selModel
:
sm
,
...
...
@@ -126,15 +143,45 @@ Ext.define('PVE.lxc.RessourceView', {
handler
:
run_editor
});
var
resize_btn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Resize disk
'
),
selModel
:
sm
,
disabled
:
true
,
handler
:
run_resize
});
var
set_button_status
=
function
()
{
var
sm
=
me
.
getSelectionModel
();
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
edit_btn
.
disable
();
resize_btn
.
disable
();
return
;
}
var
key
=
rec
.
data
.
key
;
var
value
=
rec
.
data
.
value
;
var
rowdef
=
rows
[
key
];
var
isDisk
=
(
rowdef
.
tdCls
==
'
pve-itype-icon-storage
'
);
edit_btn
.
setDisabled
(
rec
.
data
[
'
delete
'
]
||
!
rowdef
.
editor
);
resize_btn
.
setDisabled
(
!
isDisk
);
};
Ext
.
applyIf
(
me
,
{
url
:
'
/api2/json/
'
+
baseurl
,
selModel
:
sm
,
cwidth1
:
170
,
tbar
:
[
edit_btn
],
tbar
:
[
edit_btn
,
resize_btn
],
rows
:
rows
,
listeners
:
{
show
:
reload
,
itemdblclick
:
run_editor
itemdblclick
:
run_editor
,
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