-
-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add group management #1076
Add group management #1076
Conversation
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
…ngful) and remove ID column from clients group page. Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
…sts. Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
… is not possible. Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've had a little bit of a review but it seems that the coding standards used is completely different to that of the project. It might be worth running it through a linter to get it to fix the formatting.
@liamsorsby This code is still a draft more than anything else. Even if it is a completely working draft. This time, I used Do you have recommendations for a linter? It is no problem that the code is following a different style than the rest of the project as this web interface is about to get phased out in favor of our new React-based web interface. It turned out to be easier to code like I did now.
As said, I'm not following any guideline here and do not see it beneficial to enforce this now in the last few months of lifetime of this project. As long as the code works - there will be not much maintenance to invest here. If you, however, can recommend a linter that would put all my code into the expected for automatically, then I'm obviously not against using this. |
…ormatting and simplify the code in some places. Signed-off-by: DL6ER <[email protected]>
If your using vscode I think there is a plugin for phpcs which should do most of the work for you. |
Used command: PHP_CodeSniffer/bin/phpcbf --standard=PSR12 [...].php Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
I develop on a coding terminal that has no local PHP installation. And, as I do not want to be tied to vscode as editor in any way, and since I prefer to not install a lot of additional stuff on this machine ( |
Signed-off-by: DL6ER <[email protected]>
…esponse. Signed-off-by: DL6ER <[email protected]>
…is is actually not all that unlikely as a user might have the page open for longer time and wants to add(edit/delete a group/client/domain/adlist when their session has already expired. Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
From the mentioned ways of how we could do it, I currently prefer my idea "Auto Save". |
…s.php page) Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
…orting" button enabling the user to go back to ID sorting (initial behavior, makes sure group 0 is at the top). Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/dev-bad-handling-of-capitalization-of-domain-names/25660/40 |
Signed-off-by: DL6ER <[email protected]>
…ed/hide the IP column by default. Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Not sure I get some of the changes.
Ideally, we shouldn't even add unminified 3rd-party files either, but this would require a build step, since not all of the current 3rd-party libraries provide minified dist files, unfortunately. Regardless, we shouldn't just add so many 3rd-party libraries so easy IMHO. Also, not cleaning the patches up before the merge doesn't help git history. Just my 2 cents. I haven't even tried the devel branch, I'm just expressing my opinion. |
Also forgot to mention, there's so many duplicated code. I know abstracting can be hard, but this is exactly what causes maintenance issues in the longterm. I've attempted to move some common code in 25cea0f but there's a lot more. For example tailog.js and tailog-FTL.js, and some of the group*.js files logic could be abstracted to common functions. |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/make-some-advance-api/26786/12 |
@XhmikosR Sorry, I missed your comments, previously. Here are my replies:
There were issues with the multiselect environment used for group management on the client, domains, and adlist pages (not rendering properly). These issues disappeared after the update. I have not build DataTables myself but used the pre-built variant from here: http://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js
This file is needed by
I agree. This will change with the NG web interface. However, I don't think all that many micro-optimizations should still go into this web interface.
What do you mean by "add so many 3rd-party libraries so easy". Do you suggest to write more functionality ourselves instead of just using ready external libraries for it? Or extracting only what we need from them? This implementation already took me several days as it was not only writing the code, also getting how conceptually it can be implemented was difficult. If there is some external library that allows me to add a function in a matter of seconds, we should always do this. There is enough pain involved with coding stuff that is completely new. Pre-mature optimization will only cost time and probably won't result in anything. Later optimization should be thought about carefully as well: Do we want to invest the time into making optimizations the user will never see? Or shall we rather invest our time into adding new features, e.g. for the NG web repo? I prefer the latter.
I know. And I'll right away admit that the lack of abstraction comes due to a certain level of laziness, not because it is hard. I already said above that it took me several (!) hours to get this features conceptualized, implemented, and tested. All four pages are similar, however there are some few, partially very subtle, differences. The plan always was that there will be no "in the long term" for this web interface and it was necessary to get this feature added before the beta which was initially thought to start in mid-December. My main contribution to Pi-hole is code for new features and bug fixes. Optimizations are fine, however, when I can use an hour to implement a new feature or to micro-optimize something, I prefer to do the former. It is something our users will benefit from in a much more direct manner. All this doesn't mean I do not value optimizations, however, we should be clear that the faster we can get NG web done, the better as it will remove any support burden on this PHP-driven web interface. |
I have #1116 which is I plan to document if everything still works.
I'd suggest that we don't add so many useless stuff from now on. We can check what is needed and only include the needed stuff.
I definitely don't mean reinventing the wheel. I just want o add only what we need and not extra stuff; see my point above.
The problem is that one can easily identify duplicate JS code. I'm not blaming you or anyone, I;m just saying we should try to reuse code instead. One example is devel...js-tweaks. We could definitely combine tailog.js and tailog-FTL.js too. I know this isn't an easy task but we need to take this stuff into consideration because otherwise we'll just keep bloating the codebase. |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/show-100-entries-instead-of-10/44479/2 |
By submitting this pull request, I confirm the following:
git rebase
)git commit --signoff
)What does this PR aim to accomplish?:
Add group management for the per-client blocking
How does this PR accomplish the above?:
Add four new pages where users can configure
What documentation changes (if any) are needed to support this PR?:
We should write a tutorial or at least some documentation. Even if I tried to make it as easy as possible to use.