Skip to content

Commit

Permalink
Merge pull request #88 from Weilbyte/next
Browse files Browse the repository at this point in the history
Take in changes from next to master
  • Loading branch information
Weilbyte committed Sep 9, 2021
2 parents b4d16aa + e3255e8 commit f9a877b
Show file tree
Hide file tree
Showing 12 changed files with 88 additions and 274 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019
Copyright 2021 Weilbyte

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
191 changes: 0 additions & 191 deletions PVEDiscordDark.py

This file was deleted.

Binary file added PVEDiscordDark/images/dd_date-trigger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion PVEDiscordDark/sass/PVEDiscordDark.css

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions PVEDiscordDark/sass/proxmox/_pveDc.sass
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
div[id^="pveDcHealth-"][id$="-body"], div[id^="pveDcGuests-"][id$="-body"], div[id^="pveDcSummary-"][id$="-innerCt"] > div:nth-child(3) > div:nth-child(2), div[id^="pveDcSummary-"][id$="-innerCt"] > div:nth-child(5) > div:nth-child(2) > div > div
div[id^="pveDcHealth-"][id$="-body"], div[id^="pveDcGuests-"][id$="-body"],
div[id^="pveDcSummary-"][id$="-innerCt"] > div:nth-child(3) > div:nth-child(2), div[id^="pveDcSummary-"][id$="-innerCt"] > div:nth-child(5) > div:nth-child(2) > div > div,
div[id^="pveDcSummary-"][id$="-innerCt"] > div:nth-child(3) > div:nth-child(2) > div
background-color: $darker

div[id^="pveDcSummary-"][id$="-innerCt"] > div:nth-child(4) > div:nth-child(3)
border: 1px solid $darker
border: 1px solid $darker
3 changes: 3 additions & 0 deletions PVEDiscordDark/sass/special/_icons.sass
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
.fa-usb:before
color: white

.fa-object-group:before
color: white

.fa-hdd-o:before
color: white

Expand Down
14 changes: 9 additions & 5 deletions PVEDiscordDark/sass/special/_specific.sass
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
background: $darker

div[id^="toolbar-"][id$="-innerCt"] div[id^="toolbar-"][id$="-targetEl"] div ul li div
background-color: $dark
background-color: $dark

div[id^="pveGuestStatusView-"][id$="-body"]
background: $darker
Expand Down Expand Up @@ -89,9 +89,13 @@ a[id^="menuitem-"][id$="-itemEl"] div[class*="fa-trash-o"]:before
background-color: transparent !important
border: 1px solid #d23d3f !important
div[id="menu-1029-targetEl"] > div[class*="x-menu-item"]
background: $dark
background: $dark
div[id="menu-1029-targetEl"] > div[class*="x-menu-item"] > a[class*="x-menu-item-focus"]
background: $darker
background: $darker
div[id="menu-1029-targetEl"] > div[class*="x-menu-item"] > div[class*="x-menu-item"] > a[aria-disabled="true"]
opacity: 0.5
background: $darker
opacity: 0.5
background: $darker

// Panels on "My Settings"
div[id^="form-"][id$="-innerCt"][style="height: 160px; width: 356px;"], div[id^="fieldset-"][id$="-innerCt"]
background: $darker
3 changes: 3 additions & 0 deletions PVEDiscordDark/sass/x/_form.sass
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@

.x-form-cb-label-default
color: inherit

.x-form-field-date .x-form-date-trigger
background-image: url('/pve2/images/dd_date-trigger.png')
5 changes: 5 additions & 0 deletions PVEDiscordDark/sass/x/_misc.sass
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@
.install-mask
color: white
background-color: $darker

hr[class*="x-component"]
border-width: 1px
border-bottom-width: 0px
border-color: rgba($blurple, 0.35)
61 changes: 61 additions & 0 deletions PVEDiscordDark/serve.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Script to assist with PVEDiscordDark development
#
# By default serves HTTP on port 3000, any *.js request gets the JS script, any *.css request gets the CSS file and any image request gets corresponding image
# Meant to be used with the "Requestly" browser extension to redirect PVEDD requests from PVE server to localhost:3000
#

from http.server import HTTPServer, BaseHTTPRequestHandler
import json
import os

PORT = 3000
DIR_SASS = os.path.join(os.path.dirname(__file__), "sass")
DIR_IMAGES = os.path.join(os.path.dirname(__file__), "images")
DIR_JS = os.path.join(os.path.dirname(__file__), "js")


class Server(BaseHTTPRequestHandler):
def log_message(self, format, *args):
return

def _set_headers(self, status, type):
self.send_response(status)
self.send_header("Content-type", type)
self.end_headers()

def do_GET(self):
status = 200
type = "application/json"
data = None

file = self.path.rpartition("/")[2]
ext = file.rpartition(".")[2]

if ext == "css":
data = open(os.path.join(DIR_SASS, "PVEDiscordDark.css"), "rb").read()
type = "text/css"
elif ext == "js":
data = open(os.path.join(DIR_JS, "PVEDiscordDark.js"), "rb").read()
type = "application/javascript"
elif ext == "png" or ext == "jpg" or ext == "jpeg":
try:
data = open(os.path.join(DIR_IMAGES, file), "rb").read()
type = f"image/{ext}"
except FileNotFoundError:
status = 404
else:
status = 400
self._set_headers(status, type)
if status == 200:
self.wfile.write(data)
else:
self.wfile.write(json.dumps({"error": status}).encode())


if __name__ == "__main__":
print(f"Serving on localhost:{PORT}")
server = HTTPServer(server_address=("", PORT), RequestHandlerClass=Server)
try:
server.serve_forever()
except KeyboardInterrupt:
quit()
Loading

0 comments on commit f9a877b

Please sign in to comment.