Compare commits

...

2 Commits

Author SHA1 Message Date
DebaucheryLibrarian c9087edd3c 0.23.3 2024-06-06 01:47:24 +02:00
DebaucheryLibrarian ea0e8f5f09 Added PSA. 2024-06-06 01:47:22 +02:00
5 changed files with 43 additions and 4 deletions

View File

@ -64,6 +64,11 @@ module.exports = {
usernameLength: [2, 24],
usernamePattern: /^[a-zA-Z0-9_-]+$/,
},
psa: {
text: 'Welcome to traxxx!', // html enabled
type: 'notice', // notice, alert
enabled: false,
},
stashes: {
nameLength: [2, 24],
namePattern: /^[a-zA-Z0-9!?$&\s_-]+$/,

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{
"name": "traxxx-web",
"version": "0.23.2",
"version": "0.23.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "0.23.2",
"version": "0.23.3",
"dependencies": {
"@brillout/json-serializer": "^0.5.8",
"@dicebear/collection": "^7.0.5",

View File

@ -77,5 +77,5 @@
"postcss-custom-media": "^10.0.2",
"postcss-nesting": "^12.0.2"
},
"version": "0.23.2"
"version": "0.23.3"
}

View File

@ -16,6 +16,13 @@
ref="content"
class="content"
>
<p
v-if="psa.enabled"
class="psa"
:class="{ [psa.type]: true }"
v-html="psa.text"
/>
<slot @scroll="scroll" />
</div>
@ -39,7 +46,12 @@
</template>
<script setup>
import { ref, onMounted, nextTick } from 'vue';
import {
ref,
onMounted,
nextTick,
inject,
} from 'vue';
import events from '#/src/events.js';
@ -47,6 +59,9 @@ import Header from '#/components/header/header.vue';
import Sidebar from '#/components/sidebar/sidebar.vue';
import BottomNavigation from '#/components/footer/navigation.vue';
const pageContext = inject('pageContext');
const { psa } = pageContext.env;
const content = ref(null);
const feedback = ref(null);
const feedbackContainer = ref(null);
@ -114,6 +129,24 @@ onMounted(() => {
transform: translate(100%, 0);
}
}
.psa {
padding: .5rem 1rem;
margin: 0;
box-shadow: inset 0 0 3px var(--shadow-weak-20);
background: var(--notice);
color: var(--text-light);
text-align: center;
font-weight: bold;
&.alert {
background: var(--warn);
}
a {
color: inherit;
}
}
</style>
<style scoped>

View File

@ -198,6 +198,7 @@ export default async function initServer() {
maxMatches: config.database.manticore.maxMatches,
maxAggregateSize: config.database.manticore.maxAggregateSize,
media: config.media,
psa: config.psa,
},
meta: {
unseenNotifications,