Git Product home page Git Product logo

Comments (20)

liuch avatar liuch commented on September 22, 2024 1

DmarcSrg does not have its own theme switcher. To implement this would have required duplicating large part of the CSS code (all the variables) and I gave up on that idea. Your browser itself knows which theme you prefer and makes the switch itself. You set it up with a plugin, and my browser uses my OS settings. By the way, in Firefox, for testing purposes, I can switch the current theme at any time in the developer tools.

Added: I don't use any plugin for that.

from dmarc-srg.

mbsouth avatar mbsouth commented on September 22, 2024 1

@liuch

Are you suggesting giving the user the ability to load CSS files using the browser?

I have expressed myself in a misleading way, please excuse me!

I didn't mean the users who query reports.
I meant administrators who install and run DMARC-SRG on their own servers and want to adapt the look and feel to their own needs (fonts, colors and so on...).

So I can upload my own CSS files to /css during installation or later on (no extra upload mechanism is needed).
An additional option like ui.custom.css is only intended to expand the <header> entries with the entered values and should allows me to use the CSS files without changing the source code and adding
<link rel="stylesheet" href="css/custom-1.css" type="text/css" /> lines.

Unfortunately I have only now noticed that the page is started with an HTML file (index.html), not with a PHP file (e.g. index.php). Of course, this makes adding lines (from a database record) more complex or impossible.

from dmarc-srg.

liuch avatar liuch commented on September 22, 2024 1

@williamdes It turns out that not all colors are picked up in Chromium with dark mode. Perhaps I should somehow reconsider the layout of css files. In Firefox the utility looks much better. This is my fault.

from dmarc-srg.

liuch avatar liuch commented on September 22, 2024 1

I understand your point of view. The feature looks logical, but I'm not sure I'll do it anytime soon. Alternatively, I would suggest replacing the index.html with a symbolic link.

from dmarc-srg.

liuch avatar liuch commented on September 22, 2024 1

This looks no better than simply using index.php as a template in order to insert a couple of lines with stylesheets and scripts.

from dmarc-srg.

schleup avatar schleup commented on September 22, 2024 1

@liuch with b7f360e I'm getting an PHP error:

dmarc-srg [error]: Error: Call to undefined func tion Liuch\DmarcSrg\str_ends_with() in /var/www/dmarc-srg/classes/Core.php:163 \nStack trace:\n#0 /var/www/dmarc-srg/index.php(28): Liuch\DmarcSrg\Core->send Html()\n#1 {main}

Seems, I have to update to PHP 8.* (using 7.3 now)
"The str_ends_with() function is a predefined function in PHP 8 that is used to perform case-sensitive searching on a given string. "

from dmarc-srg.

schleup avatar schleup commented on September 22, 2024 1

just upgraded to PHP 8.2 - works now

from dmarc-srg.

liuch avatar liuch commented on September 22, 2024 1

It's my mistake. I'm sorry. I just fixed it with a5b508d.

from dmarc-srg.

williamdes avatar williamdes commented on September 22, 2024 1

It's my mistake. I'm sorry. I just fixed it with a5b508d.

Thanks
There is another occurrence some lines below

from dmarc-srg.

williamdes avatar williamdes commented on September 22, 2024 1

Thanks a lot. I'm definitely having a bad day today. Fixed.

Get some rest ;)
Take care 😊

from dmarc-srg.

williamdes avatar williamdes commented on September 22, 2024

On the same topic, a dark mode would be cool
The chrome extension dark reader does it quite perfectly for most of the css code

from dmarc-srg.

liuch avatar liuch commented on September 22, 2024

Are you suggesting giving the user the ability to load CSS files using the browser? What to do with files that are no longer needed, give users the option to delete them? This needs thought.

from dmarc-srg.

liuch avatar liuch commented on September 22, 2024

@williamdes, The dark theme implemented a year ago. I use it every day. See here: 609cbbe.

from dmarc-srg.

williamdes avatar williamdes commented on September 22, 2024

@williamdes, The dark theme implemented a year ago. I use it every day. See here: 609cbbe.

That's probably why it's so perfect, the extension most probably enables it
How can it be enabled in the UI?

from dmarc-srg.

williamdes avatar williamdes commented on September 22, 2024

Could we add a config statement to add additional scripts and stylesheets ?
this would allow people to add analytics scripts or like here css files to override stuff ?

from dmarc-srg.

liuch avatar liuch commented on September 22, 2024

This is not possible in the current version of DmarcSrg. The tool is not involved in the formation of the index.html file in any way. It is given directly by the web server. Alternatively, I could place an empty file like css/custom.css with a link to it in the index.html and a promise to never change it.

Anyway, I need to think it over.

from dmarc-srg.

williamdes avatar williamdes commented on September 22, 2024

This is not possible in the current version of DmarcSrg. The tool is not involved in the formation of the index.html file in any way. It is given directly by the web server. Alternatively, I could place an empty file like css/custom.css with a link to it in the index.html and a promise to never change it.

Anyway, I need to think it over.

Ah yes indeed
Could we switch to index.php and introduce a simple routing system?
index.php?route=/reports/list for example

from dmarc-srg.

liuch avatar liuch commented on September 22, 2024

Done. Just add something like this: $custom_css = 'css/your_file.css'; to your config/conf.php file.

from dmarc-srg.

williamdes avatar williamdes commented on September 22, 2024

@liuch can you change the requirements for the PHP version of dmarc-srg
str_ends_with is not present in older PHP versions

from dmarc-srg.

liuch avatar liuch commented on September 22, 2024

Thanks a lot. I'm definitely having a bad day today. Fixed.

from dmarc-srg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.