-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from VoltaML/visual-upgrade
UI upgrade, reworked themes, logs, theme editor, custom themes
- Loading branch information
Showing
98 changed files
with
3,502 additions
and
1,962 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,6 @@ docs/.vitepress/dist | |
external | ||
/tmp | ||
/data | ||
/data/settings.json | ||
/AITemplate | ||
|
||
# Ignore for black | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from logging import LogRecord, StreamHandler | ||
from typing import TYPE_CHECKING, Optional | ||
|
||
from api import websocket_manager | ||
from api.websockets.data import Data | ||
from core.functions import debounce | ||
|
||
if TYPE_CHECKING: | ||
from core.config.config import Configuration | ||
|
||
|
||
class WebSocketLoggingHandler(StreamHandler): | ||
"Broadcasts log messages to all connected clients." | ||
|
||
def __init__(self, config: Optional["Configuration"]): | ||
super().__init__() | ||
self.buffer = [] | ||
self.config = config | ||
|
||
def emit(self, record: LogRecord): | ||
if not self.config: | ||
return | ||
if self.config.api.enable_websocket_logging is False: | ||
return | ||
|
||
msg = f"{record.levelname} {self.format(record)}" | ||
self.buffer.insert(0, msg) | ||
|
||
# Prevent buffer from growing too large | ||
if len(self.buffer) > 100: | ||
self.send() | ||
|
||
self.debounced_send() | ||
|
||
@debounce(0.5) | ||
def debounced_send(self): | ||
self.send() | ||
|
||
def send(self): | ||
msg = "\n".join(self.buffer) | ||
self.buffer.clear() | ||
websocket_manager.broadcast_sync(Data(data={"message": msg}, data_type="log")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"volta": { | ||
"base": "dark", | ||
"blur": "6px", | ||
"backgroundImage": "https://raw.githubusercontent.com/VoltaML/voltaML-fast-stable-diffusion/2cf7a8abf1e5035a0dc57a67cd13505653c492f6/static/volta-dark-background.svg" | ||
}, | ||
"common": { | ||
"fontSize": "15px", | ||
"fontWeight": "600" | ||
}, | ||
"Card": { | ||
"color": "rgba(24, 24, 28, 0.6)" | ||
}, | ||
"Layout": { | ||
"color": "rgba(16, 16, 20, 0.6)", | ||
"siderColor": "rgba(24, 24, 28, 0)" | ||
}, | ||
"Tabs": { | ||
"colorSegment": "rgba(24, 24, 28, 0.6)" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"volta": { | ||
"base": "dark", | ||
"blur": "0" | ||
}, | ||
"common": { | ||
"fontSize": "15px", | ||
"fontWeight": "600" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"volta": { | ||
"base": "light", | ||
"blur": "6px", | ||
"backgroundImage": "https://raw.githubusercontent.com/VoltaML/voltaML-fast-stable-diffusion/2cf7a8abf1e5035a0dc57a67cd13505653c492f6/static/volta-light-background.svg" | ||
}, | ||
"common": { | ||
"fontSize": "15px", | ||
"fontWeight": "600" | ||
}, | ||
"Card": { | ||
"color": "rgba(255, 255, 255, 0.6)" | ||
}, | ||
"Layout": { | ||
"color": "rgba(255, 255, 255, 0.6)", | ||
"siderColor": "rgba(24, 24, 28, 0)" | ||
}, | ||
"Tabs": { | ||
"colorSegment": "rgba(255, 255, 255, 0.6)" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"volta": { | ||
"base": "light", | ||
"blur": "0" | ||
}, | ||
"common": { | ||
"fontSize": "15px", | ||
"fontWeight": "600" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { d as defineComponent, e as openBlock, f as createElementBlock, g as createVNode, w as withCtx, h as unref, c3 as NResult, i as NCard } from "./index.js"; | ||
const _hoisted_1 = { style: { "width": "100vw", "height": "100vh", "display": "flex", "align-items": "center", "justify-content": "center", "backdrop-filter": "blur(4px)" } }; | ||
const _sfc_main = /* @__PURE__ */ defineComponent({ | ||
__name: "404View", | ||
setup(__props) { | ||
return (_ctx, _cache) => { | ||
return openBlock(), createElementBlock("div", _hoisted_1, [ | ||
createVNode(unref(NCard), { style: { "max-width": "40vw", "border-radius": "12px" } }, { | ||
default: withCtx(() => [ | ||
createVNode(unref(NResult), { | ||
status: "404", | ||
title: "You got lucky, this page doesn't exist!", | ||
description: "Next time, there will be a rickroll.", | ||
size: "large" | ||
}) | ||
]), | ||
_: 1 | ||
}) | ||
]); | ||
}; | ||
} | ||
}); | ||
export { | ||
_sfc_main as default | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.