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
ee052d10
Commit
ee052d10
authored
Jan 11, 2012
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve ACLView
parent
fd05b226
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
262 additions
and
66 deletions
+262
-66
Makefile
www/manager/Makefile
+3
-0
ACLView.js
www/manager/dc/ACLView.js
+84
-26
GroupView.js
www/manager/dc/GroupView.js
+0
-12
RoleView.js
www/manager/dc/RoleView.js
+0
-12
UserView.js
www/manager/dc/UserView.js
+0
-16
GroupSelector.js
www/manager/form/GroupSelector.js
+54
-0
RoleSelector.js
www/manager/form/RoleSelector.js
+47
-0
UserSelector.js
www/manager/form/UserSelector.js
+74
-0
No files found.
www/manager/Makefile
View file @
ee052d10
...
...
@@ -23,6 +23,9 @@ JSSRC= \
form/ComboGrid.js
\
form/KVComboBox.js
\
form/Boolean.js
\
form/GroupSelector.js
\
form/UserSelector.js
\
form/RoleSelector.js
\
form/VMIDSelector.js
\
form/NetworkCardSelector.js
\
form/DiskFormatSelector.js
\
...
...
www/manager/dc/ACLView.js
View file @
ee052d10
Ext
.
define
(
'
PVE.dc.ACLAdd
'
,
{
extend
:
'
PVE.window.Edit
'
,
alias
:
[
'
widget.pveACLAdd
'
],
initComponent
:
function
()
{
var
me
=
this
;
me
.
create
=
true
;
var
items
=
[
{
xtype
:
me
.
path
?
'
hiddenfield
'
:
'
textfield
'
,
name
:
'
path
'
,
value
:
me
.
path
,
allowBlank
:
false
,
fieldLabel
:
gettext
(
'
Path
'
)
}
];
if
(
me
.
aclType
===
'
group
'
)
{
me
.
title
=
gettext
(
'
Add
'
)
+
'
:
'
+
gettext
(
"
Group Permission
"
);
items
.
push
({
xtype
:
'
pveGroupSelector
'
,
name
:
'
groups
'
,
fieldLabel
:
gettext
(
'
Group
'
)
});
}
else
if
(
me
.
aclType
===
'
user
'
)
{
me
.
title
=
gettext
(
'
Add
'
)
+
'
:
'
+
gettext
(
"
User Permission
"
);
items
.
push
({
xtype
:
'
pveUserSelector
'
,
name
:
'
users
'
,
fieldLabel
:
gettext
(
'
User
'
)
});
}
else
{
throw
"
unknown ACL type
"
;
}
items
.
push
({
xtype
:
'
pveRoleSelector
'
,
name
:
'
roles
'
,
value
:
'
NoAccess
'
,
fieldLabel
:
gettext
(
'
Role
'
)
});
if
(
!
me
.
path
)
{
items
.
push
({
xtype
:
'
pvecheckbox
'
,
name
:
'
propagate
'
,
checked
:
true
,
fieldLabel
:
gettext
(
'
Propagate
'
)
});
}
var
ipanel
=
Ext
.
create
(
'
PVE.panel.InputPanel
'
,
{
items
:
items
});
Ext
.
applyIf
(
me
,
{
url
:
'
/access/acl
'
,
method
:
'
PUT
'
,
items
:
[
ipanel
]
});
me
.
callParent
();
}
});
Ext
.
define
(
'
PVE.dc.ACLView
'
,
{
extend
:
'
Ext.grid.GridPanel
'
,
...
...
@@ -76,23 +143,6 @@ Ext.define('PVE.dc.ACLView', {
store
.
load
();
};
var
run_editor
=
function
()
{
var
rec
=
sm
.
getSelection
()[
0
];
if
(
!
rec
)
{
return
;
}
console
.
dir
(
rec
);
};
var
edit_btn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Edit
'
),
disabled
:
true
,
selModel
:
sm
,
handler
:
run_editor
});
var
remove_btn
=
new
PVE
.
button
.
Button
({
text
:
gettext
(
'
Remove
'
),
disabled
:
true
,
...
...
@@ -133,34 +183,42 @@ Ext.define('PVE.dc.ACLView', {
stateful
:
false
,
tbar
:
[
{
text
:
'
Add
'
,
text
:
gettext
(
'
Add
'
)
,
menu
:
new
Ext
.
menu
.
Menu
({
items
:
[
{
text
:
gettext
(
'
Group
'
),
text
:
gettext
(
'
Group
Permission
'
),
handler
:
function
()
{
console
.
log
(
"
add group
"
);
var
win
=
Ext
.
create
(
'
PVE.dc.ACLAdd
'
,{
aclType
:
'
group
'
,
path
:
me
.
path
});
win
.
on
(
'
destroy
'
,
reload
);
win
.
show
();
}
},
{
text
:
gettext
(
'
User
'
),
text
:
gettext
(
'
User
Permission
'
),
handler
:
function
()
{
console
.
log
(
"
add user
"
);
var
win
=
Ext
.
create
(
'
PVE.dc.ACLAdd
'
,{
aclType
:
'
user
'
,
path
:
me
.
path
});
win
.
on
(
'
destroy
'
,
reload
);
win
.
show
();
}
}
]
})
},
remove_btn
,
edit_btn
remove_btn
],
viewConfig
:
{
trackOver
:
false
},
columns
:
columns
,
listeners
:
{
show
:
reload
,
itemdblclick
:
run_editor
show
:
reload
}
});
...
...
www/manager/dc/GroupView.js
View file @
ee052d10
...
...
@@ -8,10 +8,6 @@ Ext.define('PVE.dc.GroupView', {
var
store
=
new
Ext
.
data
.
Store
({
model
:
'
pve-groups
'
,
proxy
:
{
type
:
'
pve
'
,
url
:
"
/api2/json/access/groups
"
},
sorters
:
{
property
:
'
groupid
'
,
order
:
'
DESC
'
...
...
@@ -89,12 +85,4 @@ Ext.define('PVE.dc.GroupView', {
me
.
callParent
();
}
},
function
()
{
Ext
.
define
(
'
pve-groups
'
,
{
extend
:
'
Ext.data.Model
'
,
fields
:
[
'
groupid
'
,
'
comment
'
],
idProperty
:
'
groupid
'
});
});
www/manager/dc/RoleView.js
View file @
ee052d10
...
...
@@ -8,10 +8,6 @@ Ext.define('PVE.dc.RoleView', {
var
store
=
new
Ext
.
data
.
Store
({
model
:
'
pve-roles
'
,
proxy
:
{
type
:
'
pve
'
,
url
:
"
/api2/json/access/roles
"
},
sorters
:
{
property
:
'
roleid
'
,
order
:
'
DESC
'
...
...
@@ -62,12 +58,4 @@ Ext.define('PVE.dc.RoleView', {
me
.
callParent
();
}
},
function
()
{
Ext
.
define
(
'
pve-roles
'
,
{
extend
:
'
Ext.data.Model
'
,
fields
:
[
'
roleid
'
,
'
privs
'
],
idProperty
:
'
roleid
'
});
});
\ No newline at end of file
www/manager/dc/UserView.js
View file @
ee052d10
...
...
@@ -9,10 +9,6 @@ Ext.define('PVE.dc.UserView', {
var
store
=
new
Ext
.
data
.
Store
({
id
:
"
users
"
,
model
:
'
pve-users
'
,
proxy
:
{
type
:
'
pve
'
,
url
:
"
/api2/json/access/users
"
},
sorters
:
{
property
:
'
userid
'
,
order
:
'
DESC
'
...
...
@@ -188,16 +184,4 @@ Ext.define('PVE.dc.UserView', {
me
.
callParent
();
}
},
function
()
{
Ext
.
define
(
'
pve-users
'
,
{
extend
:
'
Ext.data.Model
'
,
fields
:
[
'
userid
'
,
'
firstname
'
,
'
lastname
'
,
'
email
'
,
'
comment
'
,
{
type
:
'
boolean
'
,
name
:
'
enable
'
},
{
type
:
'
date
'
,
dateFormat
:
'
timestamp
'
,
name
:
'
expire
'
}
],
idProperty
:
'
userid
'
});
});
www/manager/form/GroupSelector.js
0 → 100644
View file @
ee052d10
Ext
.
define
(
'
PVE.form.GroupSelector
'
,
{
extend
:
'
PVE.form.ComboGrid
'
,
alias
:
[
'
widget.pveGroupSelector
'
],
initComponent
:
function
()
{
var
me
=
this
;
var
store
=
new
Ext
.
data
.
Store
({
model
:
'
pve-groups
'
});
Ext
.
apply
(
me
,
{
store
:
store
,
allowBlank
:
false
,
autoSelect
:
false
,
valueField
:
'
groupid
'
,
displayField
:
'
groupid
'
,
listConfig
:
{
columns
:
[
{
header
:
gettext
(
'
Group
'
),
sortable
:
true
,
dataIndex
:
'
groupid
'
,
flex
:
1
},
{
id
:
'
comment
'
,
header
:
'
Comment
'
,
sortable
:
false
,
dataIndex
:
'
comment
'
,
flex
:
1
}
]
}
});
me
.
callParent
();
store
.
load
();
}
},
function
()
{
Ext
.
define
(
'
pve-groups
'
,
{
extend
:
'
Ext.data.Model
'
,
fields
:
[
'
groupid
'
,
'
comment
'
],
proxy
:
{
type
:
'
pve
'
,
url
:
"
/api2/json/access/groups
"
,
},
idProperty
:
'
groupid
'
});
});
www/manager/form/RoleSelector.js
0 → 100644
View file @
ee052d10
Ext
.
define
(
'
PVE.form.RoleSelector
'
,
{
extend
:
'
PVE.form.ComboGrid
'
,
alias
:
[
'
widget.pveRoleSelector
'
],
initComponent
:
function
()
{
var
me
=
this
;
var
store
=
new
Ext
.
data
.
Store
({
model
:
'
pve-roles
'
});
Ext
.
apply
(
me
,
{
store
:
store
,
allowBlank
:
false
,
autoSelect
:
false
,
valueField
:
'
roleid
'
,
displayField
:
'
roleid
'
,
listConfig
:
{
columns
:
[
{
header
:
gettext
(
'
Role
'
),
sortable
:
true
,
dataIndex
:
'
roleid
'
,
flex
:
1
}
]
}
});
me
.
callParent
();
store
.
load
();
}
},
function
()
{
Ext
.
define
(
'
pve-roles
'
,
{
extend
:
'
Ext.data.Model
'
,
fields
:
[
'
roleid
'
,
'
privs
'
],
proxy
:
{
type
:
'
pve
'
,
url
:
"
/api2/json/access/roles
"
},
idProperty
:
'
roleid
'
});
});
www/manager/form/UserSelector.js
0 → 100644
View file @
ee052d10
Ext
.
define
(
'
PVE.form.UserSelector
'
,
{
extend
:
'
PVE.form.ComboGrid
'
,
alias
:
[
'
widget.pveUserSelector
'
],
initComponent
:
function
()
{
var
me
=
this
;
var
store
=
new
Ext
.
data
.
Store
({
model
:
'
pve-users
'
});
var
render_full_name
=
function
(
firstname
,
metaData
,
record
)
{
var
first
=
firstname
||
''
;
var
last
=
record
.
data
.
lastname
||
''
;
return
first
+
"
"
+
last
;
};
Ext
.
apply
(
me
,
{
store
:
store
,
allowBlank
:
false
,
autoSelect
:
false
,
valueField
:
'
userid
'
,
displayField
:
'
userid
'
,
listConfig
:
{
columns
:
[
{
header
:
gettext
(
'
User
'
),
sortable
:
true
,
dataIndex
:
'
userid
'
,
flex
:
1
},
{
header
:
'
Name
'
,
sortable
:
true
,
renderer
:
render_full_name
,
dataIndex
:
'
firstname
'
,
flex
:
1
},
{
id
:
'
comment
'
,
header
:
'
Comment
'
,
sortable
:
false
,
dataIndex
:
'
comment
'
,
flex
:
1
}
]
}
});
me
.
callParent
();
store
.
load
({
params
:
{
enabled
:
1
}});
}
},
function
()
{
Ext
.
define
(
'
pve-users
'
,
{
extend
:
'
Ext.data.Model
'
,
fields
:
[
'
userid
'
,
'
firstname
'
,
'
lastname
'
,
'
email
'
,
'
comment
'
,
{
type
:
'
boolean
'
,
name
:
'
enable
'
},
{
type
:
'
date
'
,
dateFormat
:
'
timestamp
'
,
name
:
'
expire
'
}
],
proxy
:
{
type
:
'
pve
'
,
url
:
"
/api2/json/access/users
"
},
idProperty
:
'
userid
'
});
});
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