Browse Source

Merge pull request #145 from Weilbyte/next

readme change, build script, fixes
pull/146/head
Weilbyte 2 years ago
committed by GitHub
parent
commit
7663aba775
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      PVEDiscordDark/sass/PVEDiscordDark.css
  2. 1
      PVEDiscordDark/sass/_vars.sass
  3. 12
      PVEDiscordDark/sass/special/_icons.sass
  4. 8
      PVEDiscordDark/sass/x/_tree.sass
  5. 58
      PVEDiscordDark/sassy.py
  6. 14
      README.md

2
PVEDiscordDark/sass/PVEDiscordDark.css

File diff suppressed because one or more lines are too long

1
PVEDiscordDark/sass/_vars.sass

@ -5,4 +5,5 @@ $red: #ba2b2d
$redlight: #d23d3f $redlight: #d23d3f
$dark: #2C2F33 $dark: #2C2F33
$darker: #23272a $darker: #23272a
$lightGray: #666
$light: #4A4D53 $light: #4A4D53

12
PVEDiscordDark/sass/special/_icons.sass

@ -84,18 +84,26 @@
.fa-fw.x-grid-icon-custom.fa .fa-fw.x-grid-icon-custom.fa
&.fa-database &.fa-database
color: $blurple color: $lightGray
&.available
color: $blurple
&.fa-desktop &.fa-desktop
color: $blurple color: $blurple
&.stopped
color: $lightGray
&.fa-cube &.fa-cube
color: $blurple color: $blurple
&.stopped
color: $lightGray
&.fa-file-o &.fa-file-o
&:before &:before
color: rgba($blurple, 0.6) color: rgba($blurple, 0.6)
&:after &:after
color: $blurple color: $lightGray
background: transparent background: transparent
text-shadow: none text-shadow: none
&.fa-tags
color: $lightGray
.lxc:after .lxc:after
background: transparent !important background: transparent !important

8
PVEDiscordDark/sass/x/_tree.sass

@ -31,25 +31,29 @@
color: $blurple !important color: $blurple !important
&.x-tree-icon-leaf.fa &.x-tree-icon-leaf.fa
&.fa-cube &.fa-cube
color: $blurple !important color: $lightGray !important
&.running &.running
color: $blurple !important color: $blurple !important
&.fa-fw.fa-unlock &.fa-fw.fa-unlock
color: white color: white
&.fa-desktop &.fa-desktop
color: $blurple !important color: $blurple !important
&.stopped
color: $lightGray !important
&.fa-database &.fa-database
color: $blurple !important color: $blurple !important
&.fa-file-o &.fa-file-o
&:before &:before
color: rgba($blurple, 0.6) color: rgba($blurple, 0.6)
&:after &:after
color: $blurple color: $lightGray
background: transparent background: transparent
text-shadow: none text-shadow: none
&.fa-building.online &.fa-building.online
&:before &:before
color: $blurple color: $blurple
&.fa-tags
color: $lightGray !important
&.lock-migrate:after &.lock-migrate:after
color: $yellow color: $yellow

58
PVEDiscordDark/sassy.py

@ -0,0 +1,58 @@
# Script to compile SASS to CSS
# Requires libsass and watchdog pip packages
#
# Input: PVEDiscordDark.sass
# Output: PVEDiscordDark.css (compressed, no sourcemap)
#
# Passing 'w' or 'watch' as argument to the script will auto-compile on every SASS change
import time
import os
import sys
try:
import sass
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
except ImportError:
print("FATAL: libsass or watchdog package not installed but required")
exit(1)
self_location = os.path.dirname(os.path.realpath(__file__))
sass_src_name = "PVEDiscordDark.sass"
sass_src_path = os.path.join(self_location, "sass", sass_src_name)
sass_out_path = os.path.splitext(sass_src_path)[0] + ".css"
sass_out_last_generated = 0
def compile():
global sass_out_last_generated
if time.time() - sass_out_last_generated < 0.5:
return
with open(sass_out_path, "w") as f:
try:
f.write(sass.compile(filename=sass_src_path, output_style="compressed"))
print(f"Compiled {sass_src_name} to {os.path.basename(sass_out_path)}")
except sass.CompileError as e:
print(f"ERROR: {e}")
sass_out_last_generated = time.time()
if __name__ == "__main__":
if not os.path.exists(sass_src_path):
print(f"FATAL: SASS source file ({sass_src_name}) not found")
exit(1)
should_watch = len(sys.argv) > 1 and (sys.argv[1] == "w" or sys.argv[1] == "w")
compile()
if should_watch:
handler = PatternMatchingEventHandler(["*.sass"])
handler.on_modified = lambda event: compile()
observer = Observer()
observer.schedule(handler, os.path.dirname(sass_src_path), recursive=True)
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join()

14
README.md

@ -10,7 +10,7 @@
The theme now runs its own JavaScript code which patches the colors for certain components (and charts). This approach is much better, and safer than what was used previously. The theme now runs its own JavaScript code which patches the colors for certain components (and charts). This approach is much better, and safer than what was used previously.
## Installation ## Installation
The installation is done via the CLI utility. Run the following commands on the PVE node serving the Web UI: The installation is done via the CLI utility. Run the following commands on the PVE node serving the Web UI: Clearing browser cache is necessary to see the changes.
``` ```
~# wget https://raw.githubusercontent.com/Weilbyte/PVEDiscordDark/master/PVEDiscordDark.sh ~# wget https://raw.githubusercontent.com/Weilbyte/PVEDiscordDark/master/PVEDiscordDark.sh
@ -21,9 +21,10 @@ Or this oneliner
bash <(curl -s https://raw.githubusercontent.com/Weilbyte/PVEDiscordDark/master/PVEDiscordDark.sh ) install bash <(curl -s https://raw.githubusercontent.com/Weilbyte/PVEDiscordDark/master/PVEDiscordDark.sh ) install
``` ```
Note that you will need to run the install command every time `pve-manager` is updated (i.e. after every Proxmox update)
## Uninstallation ## Uninstallation
To uninstall the theme, simply run the utility with the `uninstall` command. To uninstall the theme, simply run the utility with the `uninstall` command. Clearing browser cache is necessary to see the changes.
## Installer & Security ## Installer & Security
The new installer relies on the `/meta/supported` and `/meta/imagelist` files being present in the repository. It also includes a silent mode. Run `bash PVEDiscordDark.sh -h` for usage instructions. The new installer relies on the `/meta/supported` and `/meta/imagelist` files being present in the repository. It also includes a silent mode. Run `bash PVEDiscordDark.sh -h` for usage instructions.
@ -39,7 +40,12 @@ The `offline` folder must have the following files: `meta/[imagelist, supported]
You can find a zip containing the installer and offline folder under the artifact section of the GitHub Actions under this repository or as an asset attached to releases. You can find a zip containing the installer and offline folder under the artifact section of the GitHub Actions under this repository or as an asset attached to releases.
## Notes ## Contributors
Thanks to [jonasled](https://github.com/jonasled) for helping out with the old version, and thanks to [SmallEngineMechanic](https://github.com/smallenginemechanic) for catching bugs for the rewrite! Thanks to everybody who contributed to this project, and additional thanks to [Crinisus](https://github.com/crinisus) for catching bugs for the rewrite!
<a href="https://github.com/weilbyte/pvediscorddark/graphs/contributors">
<img src="https://contrib.rocks/image?repo=weilbyte/pvediscorddark" />
</a>
*Awoo'ing on this repo is encouraged.* *Awoo'ing on this repo is encouraged.*

Loading…
Cancel
Save