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
fd05b226
Commit
fd05b226
authored
Jan 11, 2012
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement delete in ACLView
parent
1b7f4395
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
128 additions
and
30 deletions
+128
-30
ACLView.js
www/manager/dc/ACLView.js
+128
-30
No files found.
www/manager/dc/ACLView.js
View file @
fd05b226
...
...
@@ -3,6 +3,9 @@ Ext.define('PVE.dc.ACLView', {
alias
:
[
'
widget.pveACLView
'
],
// use fixed path
path
:
undefined
,
initComponent
:
function
()
{
var
me
=
this
;
...
...
@@ -18,6 +21,16 @@ Ext.define('PVE.dc.ACLView', {
}
});
if
(
me
.
path
)
{
store
.
filters
.
add
(
new
Ext
.
util
.
Filter
({
filterFn
:
function
(
item
)
{
if
(
item
.
data
.
path
===
me
.
path
)
{
return
true
;
}
}
}));
}
var
render_ugid
=
function
(
ugid
,
metaData
,
record
)
{
if
(
record
.
data
.
type
==
'
group
'
)
{
return
'
@
'
+
ugid
;
...
...
@@ -26,43 +39,128 @@ Ext.define('PVE.dc.ACLView', {
return
ugid
;
};
var
columns
=
[
{
header
:
gettext
(
'
User
'
)
+
'
/
'
+
gettext
(
'
Group
'
),
flex
:
1
,
sortable
:
true
,
renderer
:
render_ugid
,
dataIndex
:
'
ugid
'
},
{
header
:
gettext
(
'
Role
'
),
flex
:
1
,
sortable
:
true
,
dataIndex
:
'
roleid
'
}
];
if
(
!
me
.
path
)
{
columns
.
unshift
({
header
:
gettext
(
'
Path
'
),
flex
:
1
,
sortable
:
true
,
dataIndex
:
'
path
'
});
columns
.
push
({
header
:
gettext
(
'
Propagate
'
),
width
:
80
,
sortable
:
true
,
dataIndex
:
'
propagate
'
});
}
var
sm
=
Ext
.
create
(
'
Ext.selection.RowModel
'
,
{});
var
reload
=
function
()
{
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
,
selModel
:
sm
,
confirmMsg
:
gettext
(
'
Are you sure you want to remove this entry
'
),
handler
:
function
(
btn
,
event
,
rec
)
{
var
params
=
{
'
delete
'
:
1
,
path
:
rec
.
data
.
path
,
roles
:
rec
.
data
.
roleid
};
if
(
rec
.
data
.
type
===
'
group
'
)
{
params
.
groups
=
rec
.
data
.
ugid
;
}
else
if
(
rec
.
data
.
type
===
'
user
'
)
{
params
.
users
=
rec
.
data
.
ugid
;
}
else
{
throw
'
unknown data type
'
;
}
PVE
.
Utils
.
API2Request
({
url
:
'
/access/acl
'
,
params
:
params
,
method
:
'
PUT
'
,
waitMsgTarget
:
me
,
callback
:
function
()
{
reload
();
},
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
gettext
(
'
Error
'
),
response
.
htmlStatus
);
}
});
}
});
Ext
.
apply
(
me
,
{
store
:
store
,
selModel
:
sm
,
stateful
:
false
,
viewConfig
:
{
trackOver
:
false
},
columns
:
[
{
header
:
gettext
(
'
Path
'
),
width
:
200
,
sortable
:
true
,
dataIndex
:
'
path
'
},
tbar
:
[
{
header
:
gettext
(
'
User
'
)
+
'
/
'
+
gettext
(
'
Group
'
),
width
:
200
,
sortable
:
true
,
renderer
:
render_ugid
,
dataIndex
:
'
ugid
'
text
:
'
Add
'
,
menu
:
new
Ext
.
menu
.
Menu
({
items
:
[
{
text
:
gettext
(
'
Group
'
),
handler
:
function
()
{
console
.
log
(
"
add group
"
);
}
},
{
text
:
gettext
(
'
User
'
),
handler
:
function
()
{
console
.
log
(
"
add user
"
);
}
}
]
})
},
{
header
:
gettext
(
'
Role
'
),
width
:
150
,
sortable
:
true
,
dataIndex
:
'
roleid
'
},
{
header
:
gettext
(
'
Propagate
'
),
width
:
80
,
sortable
:
true
,
dataIndex
:
'
propagate
'
}
remove_btn
,
edit_btn
],
viewConfig
:
{
trackOver
:
false
},
columns
:
columns
,
listeners
:
{
show
:
function
()
{
store
.
load
();
}
show
:
reload
,
itemdblclick
:
run_editor
}
});
...
...
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