Created the text module

This commit is contained in:
2023-01-08 03:33:45 +01:00
parent 8cdf6fca6c
commit b45d6944e5
2 changed files with 58 additions and 0 deletions

26
modules/text/module.js Normal file
View File

@ -0,0 +1,26 @@
const Joi = require("joi");
const {getLinkById} = require("../../server/controller/link");
module.exports.onClick = async (id, accessId, metaData, controller) => {
controller.locals.meta.title = (await getLinkById(id)).title;
controller.render(__dirname + "/web/index");
}
module.exports.info = {
name: "Link mit Text",
icon: "clipboard",
validationSchema: Joi.object({
content: Joi.string().required(),
}),
meta: [{
name: "Link-Einstellungen",
type: "default",
fields: {
content: {
type: "text",
name: "Dein Text",
description: "Der anzuzeigende Text"
}
}
}]
}

View File

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title><%= meta.title %></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
background-color: #f1f1f1;
font-family: 'Courier New', serif;
min-height: 100vh;
display: flex;
align-items: center;
}
a {
text-decoration: none;
}
span {
color: #0d6efd;
}
</style>
</head>
<body>
<div class="container">
<div class="text-center">
<h1><%= meta.title %></h1>
<p><%= meta.content %></p>
</div>
</div>
</body>
</html>