2023-05-29 05:14:08 +02:00
|
|
|
<template>
|
|
|
|
<div class="_panel">
|
|
|
|
<div
|
|
|
|
:class="$style.container"
|
|
|
|
:style="{
|
2023-05-29 22:16:41 +02:00
|
|
|
backgroundImage: `url(${$instance.bannerUrl})`,
|
2023-05-29 05:14:08 +02:00
|
|
|
}"
|
|
|
|
>
|
|
|
|
<div :class="$style.iconContainer">
|
|
|
|
<img
|
|
|
|
:src="
|
2023-05-29 22:17:42 +02:00
|
|
|
$instance.iconUrl ||
|
|
|
|
$instance.faviconUrl ||
|
|
|
|
'/favicon.ico'
|
|
|
|
"
|
2023-05-29 22:16:41 +02:00
|
|
|
alt="Instance logo"
|
2023-05-29 05:14:08 +02:00
|
|
|
:class="$style.icon"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div :class="$style.bodyContainer">
|
|
|
|
<div :class="$style.body">
|
|
|
|
<MkA :class="$style.name" to="/about" behavior="window">{{
|
2023-05-29 05:59:36 +02:00
|
|
|
$instance.name
|
2023-05-29 05:14:08 +02:00
|
|
|
}}</MkA>
|
|
|
|
<div :class="$style.host">{{ host }}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-07-17 00:32:32 +02:00
|
|
|
import type { Widget, WidgetComponentExpose } from "./widget";
|
2023-05-29 05:14:08 +02:00
|
|
|
import {
|
|
|
|
WidgetComponentEmits,
|
|
|
|
WidgetComponentProps,
|
2023-07-17 00:32:32 +02:00
|
|
|
useWidgetPropsManager,
|
2023-05-29 05:14:08 +02:00
|
|
|
} from "./widget";
|
2023-07-17 00:32:32 +02:00
|
|
|
import type { GetFormResultType } from "@/scripts/form";
|
2023-05-29 05:14:08 +02:00
|
|
|
import { host } from "@/config";
|
|
|
|
|
|
|
|
const name = "serverInfo";
|
|
|
|
|
|
|
|
const widgetPropsDef = {};
|
|
|
|
|
|
|
|
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
|
|
|
|
|
2023-05-29 18:31:02 +02:00
|
|
|
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
|
2023-05-29 05:47:22 +02:00
|
|
|
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
|
2023-05-29 05:14:08 +02:00
|
|
|
|
|
|
|
const { widgetProps, configure } = useWidgetPropsManager(
|
|
|
|
name,
|
|
|
|
widgetPropsDef,
|
|
|
|
props,
|
2023-07-06 03:28:27 +02:00
|
|
|
emit,
|
2023-05-29 05:14:08 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
defineExpose<WidgetComponentExpose>({
|
|
|
|
name,
|
|
|
|
configure,
|
|
|
|
id: props.widget ? props.widget.id : null,
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.container {
|
|
|
|
position: relative;
|
|
|
|
background-size: cover;
|
|
|
|
background-position: center;
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.iconContainer {
|
|
|
|
display: inline-block;
|
|
|
|
text-align: center;
|
|
|
|
padding: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
display: inline-block;
|
|
|
|
width: 60px;
|
|
|
|
height: 60px;
|
|
|
|
border-radius: 8px;
|
|
|
|
box-sizing: border-box;
|
|
|
|
border: solid 3px var(--panelBorder);
|
|
|
|
}
|
|
|
|
|
|
|
|
.bodyContainer {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
min-width: 0;
|
|
|
|
padding: 0 16px 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.body {
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: clip;
|
|
|
|
}
|
|
|
|
|
|
|
|
.name,
|
|
|
|
.host {
|
|
|
|
color: var(--fg);
|
2023-07-06 03:28:27 +02:00
|
|
|
text-shadow:
|
|
|
|
-1px -1px 0 var(--bg),
|
|
|
|
1px -1px 0 var(--bg),
|
|
|
|
-1px 1px 0 var(--bg),
|
|
|
|
1px 1px 0 var(--bg);
|
2023-05-29 05:14:08 +02:00
|
|
|
}
|
|
|
|
|
2023-05-29 22:16:41 +02:00
|
|
|
.name {
|
2023-05-29 05:14:08 +02:00
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
</style>
|