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
c8e44125
Commit
c8e44125
authored
Apr 24, 2012
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable buttons on capability changes
parent
1ade470d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
28 deletions
+40
-28
Workspace.js
www/manager/Workspace.js
+40
-28
No files found.
www/manager/Workspace.js
View file @
c8e44125
...
...
@@ -232,10 +232,10 @@ Ext.define('PVE.StdWorkspace', {
var
me
=
this
;
Ext
.
History
.
init
();
Ext
.
state
.
Manager
.
setProvider
(
Ext
.
create
(
'
PVE.StateProvider
'
));
var
caps
=
Ext
.
state
.
Manager
.
get
(
'
GuiCap
'
);
var
sprovider
=
Ext
.
create
(
'
PVE.StateProvider
'
);
Ext
.
state
.
Manager
.
setProvider
(
sprovider
);
var
selview
=
new
PVE
.
form
.
ViewSelector
({});
var
rtree
=
Ext
.
createWidget
(
'
pveResourceTree
'
,
{
...
...
@@ -281,6 +281,40 @@ Ext.define('PVE.StdWorkspace', {
}
});
var
caps
=
sprovider
.
get
(
'
GuiCap
'
);
var
createVM
=
Ext
.
createWidget
(
'
button
'
,
{
pack
:
'
end
'
,
margins
:
'
3 5 0 0
'
,
baseCls
:
'
x-btn
'
,
text
:
gettext
(
"
Create VM
"
),
disabled
:
!
caps
.
vms
[
'
VM.Allocate
'
],
handler
:
function
()
{
var
wiz
=
Ext
.
create
(
'
PVE.qemu.CreateWizard
'
,
{});
wiz
.
show
();
}
});
var
createCT
=
Ext
.
createWidget
(
'
button
'
,
{
pack
:
'
end
'
,
margins
:
'
3 5 0 0
'
,
baseCls
:
'
x-btn
'
,
text
:
gettext
(
"
Create CT
"
),
disabled
:
!
caps
.
vms
[
'
VM.Allocate
'
],
handler
:
function
()
{
var
wiz
=
Ext
.
create
(
'
PVE.openvz.CreateWizard
'
,
{});
wiz
.
show
();
}
});
sprovider
.
on
(
'
statechange
'
,
function
(
sp
,
key
,
value
)
{
if
(
key
===
'
GuiCap
'
&&
value
)
{
caps
=
value
;
createVM
.
setDisabled
(
!
caps
.
vms
[
'
VM.Allocate
'
]);
createCT
.
setDisabled
(
!
caps
.
vms
[
'
VM.Allocate
'
]);
}
});
Ext
.
apply
(
me
,
{
layout
:
{
type
:
'
border
'
},
border
:
false
,
...
...
@@ -328,31 +362,9 @@ Ext.define('PVE.StdWorkspace', {
var
rt
=
me
.
down
(
'
pveResourceTree
'
);
rt
.
clearTree
();
}
},
{
pack
:
'
end
'
,
margins
:
'
3 5 0 0
'
,
xtype
:
'
button
'
,
baseCls
:
'
x-btn
'
,
text
:
gettext
(
"
Create VM
"
),
disabled
:
!
caps
.
vms
[
'
VM.Allocate
'
],
handler
:
function
()
{
var
wiz
=
Ext
.
create
(
'
PVE.qemu.CreateWizard
'
,
{});
wiz
.
show
();
}
},
{
pack
:
'
end
'
,
margins
:
'
3 5 0 0
'
,
xtype
:
'
button
'
,
baseCls
:
'
x-btn
'
,
text
:
gettext
(
"
Create CT
"
),
disabled
:
!
caps
.
vms
[
'
VM.Allocate
'
],
handler
:
function
()
{
var
wiz
=
Ext
.
create
(
'
PVE.openvz.CreateWizard
'
,
{});
wiz
.
show
();
}
}
},
createVM
,
createCT
]
},
{
...
...
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