Compare commits
2 Commits
91e70f8a34
...
SQLBackend
| Author | SHA1 | Date | |
|---|---|---|---|
| c340821d39 | |||
| 9bc1abe9a5 |
@@ -23,6 +23,12 @@ CREATE TABLE `tabs` (
|
|||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `categories` (
|
||||||
|
`id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` VARCHAR(50),
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
);
|
||||||
|
|
||||||
CREATE TABLE `messages` (
|
CREATE TABLE `messages` (
|
||||||
`id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
|
`id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
`message` VARCHAR(255),
|
`message` VARCHAR(255),
|
||||||
@@ -54,4 +60,4 @@ CREATE TABLE `themes` (
|
|||||||
`colortextacc` VARCHAR(9),
|
`colortextacc` VARCHAR(9),
|
||||||
`colorborder` VARCHAR(9),
|
`colorborder` VARCHAR(9),
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -87,11 +87,13 @@ app.get("/sui/api/providers", (req, res) => {
|
|||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
res.status(200).send(results);
|
res.status(200).send(results);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/sui/api/themes", (req, res) => {
|
app.get("/sui/api/themes", (req, res) => {
|
||||||
res.status(200).send(themes.themes);
|
con.query('SELECT * FROM themes', (error, results, fields) => {
|
||||||
|
if (error) throw error;
|
||||||
|
res.status(200).send(results);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/sui/api/personaldata", (req, res) => {
|
app.get("/sui/api/personaldata", (req, res) => {
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ export function greet() {
|
|||||||
let currentTime = new Date();
|
let currentTime = new Date();
|
||||||
let greet = Math.floor(currentTime.getHours() / 6);
|
let greet = Math.floor(currentTime.getHours() / 6);
|
||||||
let easterEggChance = Math.floor(Math.random() * 100);
|
let easterEggChance = Math.floor(Math.random() * 100);
|
||||||
let rawgreetings = fetch("/sui/api/messages");
|
let greetings = require("../messages.json");
|
||||||
let greetings = rawgreetings.json();
|
|
||||||
let timeBased = [];
|
let timeBased = [];
|
||||||
let easterEggs = [];
|
let easterEggs = [];
|
||||||
for (var i = 0; i < greetings.messages.length; i++) {
|
for (var i = 0; i < greetings.messages.length; i++) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ function PersonalInfo() {
|
|||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
const response = await fetch("/sui/api/personaldata");
|
const response = await fetch("/sui/api/personaldata");
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
setState(data);
|
setState(data[0]);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user