Some misc fixes

This commit is contained in:
Gravy Boat 2024-12-20 20:08:22 -03:30
parent ad7f906d0a
commit 1c8246b177
No known key found for this signature in database
GPG key ID: C33ED8C4275CF6D0
7 changed files with 18 additions and 22 deletions

View file

@ -1,4 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 53.5">
<path fill="#F16436" fill-rule="evenodd"
d="M0 6.9082l27.9532.0756L26.269 0h73.7449l-.0164 8.1433C87.5 10.6348 78.6726 16.775 74.825 36.34H72.046l-1.5815 4.359h2.3079l3.9906 12.8087H37.961l3.9184-12.8086h2.325l-1.6467-4.359h-2.7642l-5.1516-13.7535C13.5203 21.3437 2.6748 16.9042 0 6.9082zM58.6772 39.062c-3.082-5.6216-5.1058-1.197-11.4454-6.9496-2.4727-2.2436-3.4588-8.8199 2.097-10.8301-2.5255 5.5749 4.0297 7.8558 5.5898 4.6685.709-1.4486 1.6039-4.1204-.9798-5.9518-1.392-.9867-1.9281-3.9125-.7364-5.5388.3837 1.2093 1.5938 2.5013 3.916 1.5411-4.9192-8.1404 2.934-10.9457 6.7104-10.5817-3.9686.441-6.025 3.977-4.2196 7.8269 1.15 2.452 2.9006 3.6589 3.4097 5.6657-1.6952.1263-2.1852.9065-2.1495 2.362.0268 1.0895 2.5496 2.6646 2.9494-.4456 1.175 2.4245-.2407 3.8496-1.0129 4.9984-1.7824 2.6515-.1036 5.4107 2.1097 3.3067.9547-.9074 1.6155-2.5812.4048-5.318 2.229 1.776 4.5057 6.5447.9079 10.677-1.756 2.017-6.9514 1.391-7.551 4.5693z" />
</svg>
<svg width="252" height="161" viewBox="0 0 252 161" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M192.422 50.7705C192.422 50.7705 243.874 42.6221 252 18.8572H173.181V0H0L21.3339 24.8619V50.3349C21.3339 50.3349 75.1642 47.5237 95.9867 63.3816C124.489 89.9139 63.9294 125.779 63.9294 125.779L53.5449 160.291C69.7837 144.762 100.733 124.673 157.478 125.641C135.884 132.495 114.171 143.201 97.2667 160.291H211.977L201.175 125.779C201.175 125.779 118.036 76.5444 192.422 50.7736V50.7705Z" fill="white"/>
</svg>

Before

Width:  |  Height:  |  Size: 1,022 B

After

Width:  |  Height:  |  Size: 521 B

View file

@ -8,7 +8,7 @@ type PlayerHeadProps = JSX.IntrinsicElements['img'] & {
};
function crafatar(uuid: string) {
return `https://crafatar.com/avatars/${uuid}?size=48`;
return `https://crafatar.com/avatars/${uuid}?size=48&overlay`;
}
function PlayerHead(props: PlayerHeadProps) {

View file

@ -127,7 +127,7 @@ export type ModalProps = {
function Modal(props: ModalProps) {
return (
<div class="min-w-xs flex flex-col gap-y-2 border border-white/5 rounded-lg bg-page p-4 text-center" ref={mergeRefs(props.ref)}>
<div class="min-w-md flex flex-col gap-y-2 border border-white/5 rounded-lg bg-page p-4 text-center" ref={mergeRefs(props.ref)}>
{props.children}
</div>
);

View file

@ -19,7 +19,7 @@ export type PopupProps = Omit<Parameters<typeof Portal>[0], 'children'> & Parent
function Popup(props: PopupProps) {
let popupRef!: HTMLDivElement;
function onMouseDown(e: MouseEvent) {
function onClick(e: MouseEvent) {
e.stopPropagation();
if (!popupRef || !props.visible())
return;
@ -31,9 +31,9 @@ function Popup(props: PopupProps) {
createEffect(() => {
if (props.visible())
document.addEventListener('mousedown', onMouseDown);
document.addEventListener('click', onClick);
else
document.removeEventListener('mousedown', onMouseDown);
document.removeEventListener('click', onClick);
});
return (

View file

@ -18,17 +18,6 @@ export function NotificationProvider(props: ParentProps) {
let unlisten: UnlistenFn | undefined;
onMount(() => {
document.addEventListener('keypress', (e) => {
if (e.key === 'n')
setNotifications(notifications => ({
...notifications,
[Math.random().toString()]: {
title: 'Test',
message: 'This is a test notification',
},
}));
});
events.ingressPayload.listen((e) => {
setNotifications(notifications => ({
...notifications,

View file

@ -9,11 +9,13 @@ import useCommand, { tryResult } from '~ui/hooks/useCommand';
import useSettings from '~ui/hooks/useSettings';
import { join } from 'pathe';
import { createEffect, createSignal, For, Show, untrack } from 'solid-js';
import useNotifications from "~ui/hooks/useNotifications.tsx";
function ClusterLogs() {
const [cluster] = useClusterContext();
const [logs] = useCommand(() => bridge.commands.getClusterLogs(cluster()!.uuid));
const { settings } = useSettings();
const notifications = useNotifications();
const [activeLogFile, setActiveLogFile] = createSignal<string | null>(null);
const [logContent, setLogContent] = createSignal<string | null>(null);
@ -46,7 +48,11 @@ function ClusterLogs() {
return;
const id = await tryResult(() => bridge.commands.uploadLog(cluster()!.uuid, log));
open(`https://mclo.gs/${id}`);
open(`https://mclo.gs/${id}`).then(() => notifications.set("logs", {
title: "Log Uploaded",
message: "Opening in your browser."
}));
}
const missingLogs = () => logs() === undefined || logs()?.length === 0 || false;

View file

@ -15,7 +15,7 @@ export const configuredXss: FilterXSS = new FilterXSS({
kbd: ['id'],
input: ['checked', 'disabled', 'type'],
iframe: ['width', 'height', 'allowfullscreen', 'frameborder', 'start', 'end'],
img: [...(whiteList.img || []), 'usemap', 'style'],
img: [...(whiteList.img || []), 'usemap', 'style', 'align'],
map: ['name'],
area: [...(whiteList.a || []), 'coords'],
a: [...(whiteList.a || []), 'rel'],
@ -23,6 +23,8 @@ export const configuredXss: FilterXSS = new FilterXSS({
th: [...(whiteList.th || []), 'style'],
picture: [],
source: ['media', 'sizes', 'src', 'srcset', 'type'],
p: [...(whiteList.p || []), 'align'],
div: [...(whiteList.p || []), 'align'],
// Other
center: [],