Marzban
Marzban copied to clipboard
Search by note implemented
Partially implements #902.
Details:
- crud.py's get_users(): search param added.
-
get_users
view: search param added. - CLI's list_users command: search option added.
- Dashboard: username param replaced by search param.
- Dashboard built and CLI documentation re-generated.
Side effects:
- CONTRIBUTING.md improved.
Do we need to mark username(s) params as deprecated? Since they support multiple usernames (unlike search) I didn't touch them yet. Is a multi-username search functionality necessary?
Do we need to mark username(s) params as deprecated? Since they support multiple usernames (unlike search) I didn't touch them yet. Is a multi-username search functionality necessary?
multi-username search can be used with api for third party programs and should be available i think its better to have 2 separated search option for user and note, this can help us to have more accurate result
This options would be great if exist : set multiple input to search for (user1,user2,user3) set the owner(admin) name (search for the input only in users of specific admin) config if must search for the input in users or notes or both (search only in notes seems useless) config if search for exact input or *input*
and as notes can contain any character, is your current PR working correct with utf-8 characters and symbols?
Do we need to mark username(s) params as deprecated? Since they support multiple usernames (unlike search) I didn't touch them yet. Is a multi-username search functionality necessary?
multi-username search can be used with api for third party programs and should be available i think its better to have 2 separated search option for user and note, this can help us to have more accurate result
I don't feel comfortable with the username param's dual function (Search if there's only 1 given username and exact match if there are multiple usernames, It somehow makes its behavior inconsistent). Using an exact match for usernames
and admins
[^1] (if implemented) and a partial match for search
might be better. Of course, it will be a breaking change for clients who use username
for search.
[^1]: Admin param should only be available to superusers since normal users can only see their users and it makes no sense to allow them to filter users by their admin users.
This options would be great if exist : set multiple input to search for (user1,user2,user3) set the owner(admin) name (search for the input only in users of specific admin) config if must search for the input in users or notes or both (search only in notes seems useless) config if search for exact input or input
and as notes can contain any character, is your current PR working correct with utf-8 characters and symbols?
-
set multiple input to search for (user1,user2,user3): I don't think it's really necessary.
username
's exact match might be enough for third-party apps. - set the owner(admin) name (search for the input only in users of specific admin): I can handle the API (PS: as I said, it only makes sense for superusers), but I don't want to change the front end too much. Maybe @gozarman can help.
-
config if must search for the input in users or notes or both (search only in notes seems useless): Is it necessary? Maye
username
's exact match andsearch
's partial match be more than enough. -
config if search for exact input or *input*: Does exact match for
search
make sense when there's ausername
param?
- and as notes can contain any character, is your current PR working correct with utf-8 characters and symbols? It's a DB/ORM thing. There should be no problem (As my tests also confirm this).
And I think the username
and admin
params' changes should be a separate PR.
I checked API codes and your back-end changes You are right, all the options mentioned are already available the only absent feature is to add multiple input to search in notes! which is totally useless so sorry for confusing anyone here with my previous comment