Skip to content
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

Refresh design, refactoring code for much easy templating and code reading #256

Open
wants to merge 153 commits into
base: develop
Choose a base branch
from

Conversation

bouks
Copy link

@bouks bouks commented Jul 22, 2024

Enhancements :

  • new responsive design

  • replacing png bars by css bars

  • replacing png clocks by css clocks

  • choice to have countries flags displayed with image or utf8 char

  • replacing js tooltip system by css system

  • add average filesize in pages report and downloads report

  • code cleaning

New functionnalities :

  • css vertical bars growing

  • in-table horizontal bars integrated in each data columns (and with no extra column)

  • table rows hovering

  • new world map with hovering animation

  • css vars for better and easy customisation

  • stylesheet heritage or replacement

  • Dark Mode

  • Ratios table

  • some expandable tables

  • AWStats update notification (JSON::Parse modules needed to activate). Notification shows in the footer's page

Updating considerations :

Plugins using "ShowInfoHost" and "ShowInfoURL" MUST now return a string instead of directly printing (for reports)

CONF file changes:

  • new FlagsType option to choose image or utf countries flags

  • new ShowMap option to show or not a worldmap in countries reporting

  • new StylesheetMode option to choose if your stylesheet override awstats stylesheet or if awstats stylesheet is ignored

  • removing BarHeight option (replaced by a css var in stylesheet)

CONF visual options are migrating to css (BarWidth, colors, ShowBars etc...)

Close issues :

Still WIP but usable.

image

More and updated screenshots at : #233

Remove need of images for bar rendering. Using only css classes.
Remove bgcolor, replace by newly color- css class introduced by css bars.
@bouks
Copy link
Author

bouks commented Jul 22, 2024

On the second commit, title is not complete, should be : "set background TH color to css"

Set "font-size: 9px"

-> same presentation as day of  month
Set font to sans-serif, system-ui
Remove duplicates font family
Change font size unit to rem unit
Remove pngs, use of full css
clean css
@IGLOU-EU
Copy link

Congrats, review all this old Perl is a nightmare 🤣
I like the "HtmlBar" function, much better.
Why are you keeping some embedded style like "<div style="font-size: 0.5rem;">$YearRequired" ?

@bouks
Copy link
Author

bouks commented Jul 24, 2024

@IGLOU-EU
Thanks.
I'm not a perl coder, so it's like holidays from my point of view. 😄

For the font-size, i was just converting from px to em while reading the code. But, sure, removing styles, old html attributes and set css classes is good.

We'll see. If @eldy merge the commits and is interested to move further this way (for the 8.0) i can do some rendering stuffs, opening for much easier theming and more modern design. It's not a complex work, it takes just some time.

.aws_title { font: 13px verdana, arial, helvetica, sans-serif; font-weight: bold; background-color: #BBBBBB; text-align: center; margin-bottom: 0; padding: 1px 1px 1px 1px; }
.aws_blank { font: 13px verdana, arial, helvetica, sans-serif; background-color: #FFFFFF; text-align: center; margin-bottom: 0; padding: 1px 1px 1px 1px; }
body { body { font: 0.75rem sans-serif, system-ui; background-color: #FFFFFF; margin-top: 0; margin-bottom: 0; } }
.aws_bodyl { background-image: url(/awstatsicons/other/backleft.png); background-repeat: repeat-y; }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be we should use $DirIcons here ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @eldy
It's a copypaste from awstats_default. I don't know the difference between awstats_default.css and awstats_bw.css, and their use except for example, because css is hardcoded in awstats.pl. Maybe we can keep only one.
By the way, did you hardcoded the css for a special purpose ? Or maybe we can include a default "$StyleSheet" from css folder and remove the hardcoded one ?

For the backleft image, maybe we just could remove this image. And the button.gif also.

Another consider i have is to refactor all the calculations for tables. For example, in HTMLMainMonthly, these are written 3 times, and calculated 2 times (or more if there are multiples plugins). We could just use the ShowGraph plugin calculated vars and then dispatch them for graph plugins and rendering bars table and data table.

Refactoring rendering of header, cells and footer (usable for other tables).

Add some css classes to the html tags.

Bars are integrated to the table (based on $BarWidth, =>100 is cool).
Using refactoring made with month table.

Set average footer.

Fix averages to calculate only with not empty days.

Set averages for Month table.
See previous commit.
Like previous commits.
+ set flexible
In domain tables.

Using UTF8 characters instead.
@bouks bouks changed the title Remove images bars, replace by css only Refresh design, refactoring code for much easy templating and code reading Jul 25, 2024
- "différents" > "uniques" (plus court, évite les sauts de lignes)

- "Heures" > "Heure"
- global update of redesigning, refactoring tasks

- reintroducing a world map
- Add folder in installation setup
- Update documentation
- rearrange code : declarations => datas manipulations => rendering
- avoid loops : days are now parsed only once
resolve the width problems.
set flexible, new design.
the 'bk' problem :)
bouks added 27 commits August 6, 2024 05:13
+ th not bg background
+ "remove" some tooltip (old system) waiting to refactor
The cell itself is build by awstats in sub HTMLShowHostInfo

Set background to plugins columns

Arrange paddings
"top 10" smaller
misc table at bottom
full width tables on portrait mode
style adjustments
returning only content
cleaning code
@eldy
Copy link
Owner

eldy commented Aug 8, 2024

I tested your PR,but this is what i got with the unit test
image

Graph are no more visible.
The summary part does not show any more difference between human and not human traffic
Also it is difficult to see separation between each array.
I have also some html error in some html part.
It is difficult to me to report what's wrong on each change because all changes are cumulated into the same PR making not possible for me to analyse each change and validate them one by one.

@bouks
Copy link
Author

bouks commented Aug 8, 2024

Hi @eldy

I didn't work on the graph for the moment because i don't use it and it is noted as experimental in the conf file. I though it is "on development", and i saw in issues that google one doesn't work anymore.

Sorry. It seems i don't understand very well the pr system from a fork. I did a pr for the bars and the clock, and after all my commits added to the PR.

PS: i managed to find the problem with the graphapplet plugin (printing directly, and format_byte function i included html in). I fixed it, but i can't test since i have not java in all my browsers (but all is well written in the html code with the fix). I think remember java applets in browser have been discontinued for some years.

@ShaiMagal
Copy link

ShaiMagal commented Aug 13, 2024

"Ofttopic" - problem with charts is already discussed here #249 (not solved, there is necessary to change "chart library")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants