Closed ks-arshitk closed 1 year ago
@ks-arshitk I don't understand which action you are referring to. What is the request associated with the action? Actions are short for "Controller Actions" (https://docs.craftcms.com/api/v3/craft-web-request.html#isactionrequest). The plugin doesn't record UI actions that have no request counterpart (e.g selecting a user or opening a dropdown). Also note that your settings only record non-ajax actions. To record all CP actions you need to check the "Record Control Panel AJAX Requests" as well.
@matfish2 I already enable "Record Control Panel AJAX Requests" and it store that request. But there is problem, it store all ajax request and database size increase or in table it show all ajax entry or find any specific entry is difficult.
Is there any way to store specific entry ?
Is there any way to store specific entry ?
Yes. Use the requestFilter
setting. It allows you to fine-tune the exact requests you wish to record.
https://github.com/matfish2/craft-activity-log#advanced-request-filtering
Forgot you were using Craft 3. Added requestFilter
on version 0.1.9
.
I am showing list of request stored on Database to Front end, but initially all the stored request are shown, which is causing extra load for me, what I want, is to filter request list on initial page load
@ks-arshitk if I understand correctly you still want those requests stored to the DB, but you want to filter on initial page load?
Because if you are not interested in storing the requests in the first place you can use the requestFilter
function as indicated above.
@matfish2 I want to store two types of request but display one type of request to user. One type of request is only for developer, so i don't want show to user.
I suppose you mean a per-user request filter that filters which requests are loaded to page in the first place (before any client-side filtering occurs). That's an interesting idea. I'll see how it can be implemented. Although my initial idea was that this is a plugin for admin eyes only, and shouldn't be reviewed by "ordinary" users.
@matfish2
so i don't want show to user.
Users means Admin I don't want show to admin
But you still want those requests recorded for another user (the Developer), right?
This would require something like a filterRequestViewing
function/setting, that accepts the current user and returns a modified initial query. Need to think about it.
@matfish2 So what did you think about this?
@ks-arshitk Please download v0.2.0 and try the following setting (just an example. Remove/change filters/username[s] as necessary):
'viewFilters'=> [
[
'users'=>['admin'], // Username(s) of relevant users
'filters'=>[ // Filters to be applied for said users
'isCp'=>true, // Only Control Panel requests
'isAction'=>true, // Only Action requests
'isAjax'=>false, // Only page Requests
'siteId'=>1, // or (e.g) [1,2] for multiple sites
'actions'=>[ // Only display those actions
['user-settings','save-group'] // full action array, can be found under `actionSegments` in `activitylogs` table
]
]
]
@matfish2 it show all the request
please check it
'viewFilters'=> [[
'users'=>[],
'filters'=>[
'isCp'=>true,
'isAction'=>true,
'isAjax'=>true,
'siteId'=>1,
'actions'=>[
["Login"]
]
]
]],
@ks-arshitk:
a. You didn't specify any users
in the array. You need to give it at least one username (e.g admin
). You can find the username under Users in Craft.
b. There is no ["Login"]
action. Action is called ["users","login"]
. It must match the activitylog.actionSegements
column in the DB.
@matfish2 Thank you. It's work :+1:
Versions Craft: 3.6.12.1 Activity Logs: 0.1.8
Question
If any action perform outside the details page then that action can't store in activity log
Activity setting
Thank you