Compare commits
21 Commits
312e9ca11f
...
SQLBackend
| Author | SHA1 | Date | |
|---|---|---|---|
| c340821d39 | |||
| 9bc1abe9a5 | |||
| 91e70f8a34 | |||
| 22957f6159 | |||
| 010c8fd0bb | |||
| eea19594e2 | |||
| 8a3db49489 | |||
| 7e7434d7e2 | |||
| 09f3b6dfc3 | |||
| b159318494 | |||
| 89a64a8fef | |||
| e639989424 | |||
| 88b63a3291 | |||
| ea8d98b940 | |||
| 4a01fe4b3b | |||
| 56f700c423 | |||
| becf4fa546 | |||
|
|
7c36a566f1 | ||
|
|
fb23c9cf55 | ||
| 17e9255405 | |||
| c305fec4f3 |
63
SQLDefinitions/tables.sql
Normal file
63
SQLDefinitions/tables.sql
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
CREATE TABLE `apps` (
|
||||||
|
`id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` VARCHAR(30),
|
||||||
|
`url` VARCHAR(50),
|
||||||
|
`icon` VARCHAR(30),
|
||||||
|
`urlbase` VARCHAR(15),
|
||||||
|
`NSFW` VARCHAR(10),
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `links` (
|
||||||
|
`id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`category` VARCHAR(20),
|
||||||
|
`name` VARCHAR(50),
|
||||||
|
`url` VARCHAR(100),
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `tabs` (
|
||||||
|
`id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` VARCHAR(50),
|
||||||
|
`NSFW` BOOLEAN,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `categories` (
|
||||||
|
`id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` VARCHAR(50),
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `messages` (
|
||||||
|
`id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`message` VARCHAR(255),
|
||||||
|
`easteregg` BOOLEAN,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `personaldata` (
|
||||||
|
`fname` VARCHAR(20),
|
||||||
|
`lname` VARCHAR(30),
|
||||||
|
`email` VARCHAR(50)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `providers` (
|
||||||
|
`id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` VARCHAR(20),
|
||||||
|
`url` VARCHAR(100),
|
||||||
|
`prefix` VARCHAR(5),
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `themes` (
|
||||||
|
`id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` VARCHAR(20),
|
||||||
|
`imagebackground` VARCHAR(100),
|
||||||
|
`colorbackground` VARCHAR(9),
|
||||||
|
`colorserachbackground` VARCHAR(9),
|
||||||
|
`colortextpri` VARCHAR(9),
|
||||||
|
`colortextacc` VARCHAR(9),
|
||||||
|
`colorborder` VARCHAR(9),
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
);
|
||||||
@@ -2,13 +2,65 @@ const express = require("express");
|
|||||||
const bodyParser = require("body-parser");
|
const bodyParser = require("body-parser");
|
||||||
const cors = require("cors");
|
const cors = require("cors");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
const wol = require("wol");
|
||||||
|
const mysql = require("mysql");
|
||||||
|
const sql = "SELECT * FROM "
|
||||||
|
|
||||||
const links = require('../src/links.json');
|
var con = mysql.createConnection({
|
||||||
const providers = require('../src/providers.json');
|
host: "localhost",
|
||||||
|
user: "hpadmin",
|
||||||
|
password: "changeme",
|
||||||
|
database: "home_page"
|
||||||
|
});
|
||||||
|
|
||||||
|
//Read bookmarks
|
||||||
|
try {
|
||||||
|
var links = require('../src/links.json');
|
||||||
|
} catch(err) {
|
||||||
|
let body = `{
|
||||||
|
"bookmarks" : [
|
||||||
|
{
|
||||||
|
"category": "Example",
|
||||||
|
"links": [
|
||||||
|
{
|
||||||
|
"name": "Gitea",
|
||||||
|
"url": "https://sean.bet/gitea"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}`;
|
||||||
|
fs.writeFileSync('../src/links.json',body);
|
||||||
|
var links = require('../src/links.json');
|
||||||
|
}
|
||||||
|
|
||||||
|
//Read personal data
|
||||||
|
try {
|
||||||
|
var personaldata = require('../src/personaldata.json');
|
||||||
|
} catch(err) {
|
||||||
|
let body = `{
|
||||||
|
"fname":"",
|
||||||
|
"lname":"",
|
||||||
|
"email":""
|
||||||
|
}`;
|
||||||
|
fs.writeFileSync('../src/personaldata.json',body);
|
||||||
|
var personaldata = require('../src/personaldata.json');
|
||||||
|
}
|
||||||
|
|
||||||
|
//Read app list
|
||||||
|
if (fs.existsSync('../src/apps.json')) {
|
||||||
|
console.log("apps.json exists");
|
||||||
|
}else {
|
||||||
|
let body = `{
|
||||||
|
"apps" : [
|
||||||
|
{"name":"Example","url":"your.site.com/example","icon":"web","urlbase":"/Example","NSFW":"SAFE"}
|
||||||
|
]
|
||||||
|
}`;
|
||||||
|
fs.writeFileSync('../src/apps.json',body);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Read everything else
|
||||||
const themes = require('../src/themes.json');
|
const themes = require('../src/themes.json');
|
||||||
const personaldata = require('../src/personaldata.json');
|
|
||||||
const messages = require('../src/messages.json');
|
|
||||||
|
|
||||||
// initializing app
|
// initializing app
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
@@ -20,10 +72,10 @@ var jsonParser = bodyParser.json();
|
|||||||
app.get("/sui/api/apps", (req, res) => {
|
app.get("/sui/api/apps", (req, res) => {
|
||||||
fs.readFile('../src/apps.json', (err, data) => {
|
fs.readFile('../src/apps.json', (err, data) => {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
let test = JSON.parse(data);
|
let apps = JSON.parse(data);
|
||||||
res.status(200).send(test.apps);
|
res.status(200).send(apps.apps);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/sui/api/links", (req, res) => {
|
app.get("/sui/api/links", (req, res) => {
|
||||||
@@ -31,19 +83,31 @@ app.get("/sui/api/links", (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.get("/sui/api/providers", (req, res) => {
|
app.get("/sui/api/providers", (req, res) => {
|
||||||
res.status(200).send(providers.providers);
|
con.query('SELECT * FROM providers', (error, results, fields) => {
|
||||||
|
if (error) throw error;
|
||||||
|
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) => {
|
||||||
res.status(200).send(personaldata);
|
con.query('SELECT * FROM personaldata', (error, results, fields) => {
|
||||||
|
if (error) throw error;
|
||||||
|
res.status(200).send(results);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/sui/api/messages", (req, res) => {
|
app.get("/sui/api/messages", (req, res) => {
|
||||||
res.status(200).send(messages.messages);
|
con.query('SELECT * FROM messages', (error, results, fields) => {
|
||||||
|
if (error) throw error;
|
||||||
|
res.status(200).send(results);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post("/sui/api/appUpdate", jsonParser, (req, res) => {
|
app.post("/sui/api/appUpdate", jsonParser, (req, res) => {
|
||||||
@@ -53,9 +117,13 @@ app.post("/sui/api/appUpdate", jsonParser, (req, res) => {
|
|||||||
res.status(200).send(applications.apps)
|
res.status(200).send(applications.apps)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.get("/sui/api/wakeDakota", (req, res) => {
|
||||||
|
wol.wake('18:C0:4D:81:57:68', function(err, res){
|
||||||
|
console.log(res);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// app is listening on port 5000
|
// app is listening on port 5000
|
||||||
app.listen(5000, () => {
|
app.listen(5000, () => {
|
||||||
console.log("node server is running on port 5000");
|
console.log("node server is running on port 5000");
|
||||||
});
|
});
|
||||||
|
|||||||
1545
package-lock.json
generated
1545
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"proxy": "http://localhost:5000",
|
"proxy": "http://localhost:5000",
|
||||||
"homepage": "https://home.halfaperture.com/sui",
|
"homepage": "https://sean.bet/sui",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@testing-library/jest-dom": "^5.16.1",
|
"@testing-library/jest-dom": "^5.16.1",
|
||||||
"@testing-library/react": "^11.2.7",
|
"@testing-library/react": "^11.2.7",
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
{
|
{
|
||||||
"apps" : [
|
"apps" : [
|
||||||
{"name":"Deluge","url":"home.halfaperture.com/deluge","icon":"water","urlbase":"/Deluge","NSFW":"NSFW"},
|
{"name":"Deluge","url":"sean.bet/deluge","icon":"water","urlbase":"/Deluge","NSFW":"NSFW"},
|
||||||
{"name":"Gitea","url":"home.halfaperture.com/gitea","icon":"tea","urlbase":"/Gitea","NSFW":"SAFE"},
|
{"name":"Gitea","url":"sean.bet/gitea","icon":"tea","urlbase":"/Gitea","NSFW":"SAFE"},
|
||||||
{"name":"Grafana","url":"home.halfaperture.com/grafana","icon":"chart-areaspline-variant","urlbase":"/Grafana","NSFW":"SAFE"},
|
{"name":"Grafana","url":"sean.bet/grafana","icon":"chart-areaspline-variant","urlbase":"/Grafana","NSFW":"SAFE"},
|
||||||
{"name":"Guacamole","url":"home.halfaperture.com/guacamole","icon":"remote-desktop","urlbase":"/Guacamole","NSFW":"SAFE"},
|
{"name":"Guacamole","url":"sean.bet/guacamole","icon":"remote-desktop","urlbase":"/Guacamole","NSFW":"SAFE"},
|
||||||
{"name":"Jackett","url":"home.halfaperture.com/jackett","icon":"tshirt-crew","urlbase":"/Jackett","NSFW":"NSFW"},
|
{"name":"Jackett","url":"sean.bet/jackett","icon":"tshirt-crew","urlbase":"/Jackett","NSFW":"NSFW"},
|
||||||
{"name":"Lidarr","url":"home.halfaperture.com/lidarr","icon":"music-circle","urlbase":"/Lidarr","NSFW":"NSFW"},
|
{"name":"Lidarr","url":"sean.bet/lidarr","icon":"music-circle","urlbase":"/Lidarr","NSFW":"NSFW"},
|
||||||
{"name":"LazyLibrarian","url":"home.halfaperture.com/lazylibrarian","icon":"library","urlbase":"/LazyLibrarian","NSFW":"NSFW"},
|
{"name":"NextCloud","url":"sean.bet/nextcloud","icon":"cloud","urlbase":"/NextCloud","NSFW":"SAFE"},
|
||||||
{"name":"NextCloud","url":"home.halfaperture.com/nextcloud","icon":"cloud","urlbase":"/NextCloud","NSFW":"SAFE"},
|
{"name":"NZBHydra","url":"sean.bet/nzbhydra","icon":"snake","urlbase":"/NZBHydra","NSFW":"NSFW"},
|
||||||
{"name":"NZBHydra","url":"home.halfaperture.com/nzbhydra","icon":"snake","urlbase":"/NZBHydra","NSFW":"NSFW"},
|
{"name":"PiHole","url":"sean.bet/admin","icon":"pi-hole","urlbase":"/Admin","NSFW":"SAFE"},
|
||||||
{"name":"PiHole","url":"home.halfaperture.com/admin","icon":"pi-hole","urlbase":"/Admin","NSFW":"SAFE"},
|
{"name":"Plex","url":"sean.bet/plex","icon":"plex","urlbase":"/Plex","NSFW":"SAFE"},
|
||||||
{"name":"Plex","url":"home.halfaperture.com/plex","icon":"plex","urlbase":"/Plex","NSFW":"SAFE"},
|
{"name":"OctoPrint","url":"sean.bet/octoprint","icon":"printer-3d","urlbase":"/octoprint","NSFW":"SAFE"},
|
||||||
{"name":"OctoPrint","url":"home.halfaperture.com/octoprint","icon":"printer-3d","urlbase":"/octoprint","NSFW":"SAFE"},
|
{"name":"Ombi","url":"sean.bet/requests","icon":"magnify","urlbase":"/Ombi","NSFW":"NSFW"},
|
||||||
{"name":"Ombi","url":"home.halfaperture.com/requests","icon":"magnify","urlbase":"/Ombi","NSFW":"NSFW"},
|
{"name":"Organizr","url":"sean.bet","icon":"home","urlbase":"/Organizr","NSFW":"SAFE"},
|
||||||
{"name":"Organizr","url":"home.halfaperture.com","icon":"home","urlbase":"/Organizr","NSFW":"SAFE"},
|
{"name":"Radarr","url":"sean.bet/radarr","icon":"movie-open","urlbase":"/Radarr","NSFW":"NSFW"},
|
||||||
{"name":"Radarr","url":"home.halfaperture.com/radarr","icon":"movie-open","urlbase":"/Radarr","NSFW":"NSFW"},
|
{"name":"Readarr","url":"sean.bet/readarr","icon":"library","urlbase":"/Readarr","NSFW":"NSFW"},
|
||||||
{"name":"SABnzbd","url":"home.halfaperture.com/sabnzbd","icon":"download","urlbase":"/SABnzbd","NSFW":"NSFW"},
|
{"name":"SABnzbd","url":"sean.bet/sabnzbd","icon":"download","urlbase":"/SABnzbd","NSFW":"NSFW"},
|
||||||
{"name":"Sonarr","url":"home.halfaperture.com/sonarr","icon":"television-classic","urlbase":"/Sonarr","NSFW":"NSFW"},
|
{"name":"Sonarr","url":"sean.bet/sonarr","icon":"television-classic","urlbase":"/Sonarr","NSFW":"NSFW"},
|
||||||
{"name":"Tautulli","url":"home.halfaperture.com/stats","icon":"chart-bar","urlbase":"/Stats","NSFW":"NSFW"},
|
{"name":"Tautulli","url":"sean.bet/stats","icon":"chart-bar","urlbase":"/Stats","NSFW":"NSFW"},
|
||||||
{"name":"uBooquity","url":"home.halfaperture.com/ubooquity","icon":"book-open-outline","urlbase":"/uBooquity","NSFW":"SAFE"},
|
{"name":"uBooquity","url":"sean.bet/ubooquity","icon":"book-open-outline","urlbase":"/uBooquity","NSFW":"SAFE"},
|
||||||
{"name":"Wiki","url":"home.halfaperture.com/wiki","icon":"wikipedia","urlbase":"/Wiki","NSFW":"SAFE"}
|
{"name":"Wiki","url":"sean.bet/wiki","icon":"wikipedia","urlbase":"/Wiki","NSFW":"SAFE"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +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 greetings = require('../messages.json');
|
let greetings = require("../messages.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++) {
|
||||||
@@ -159,9 +159,12 @@ export function updateLabel(text) {
|
|||||||
case "t":
|
case "t":
|
||||||
document.getElementById("searchType").innerHTML = "Trakt search";
|
document.getElementById("searchType").innerHTML = "Trakt search";
|
||||||
break;
|
break;
|
||||||
case "y":
|
case "yt":
|
||||||
document.getElementById("searchType").innerHTML = "YouTube search";
|
document.getElementById("searchType").innerHTML = "YouTube search";
|
||||||
break;
|
break;
|
||||||
|
case "y":
|
||||||
|
document.getElementById("searchType").innerHTML = "You search";
|
||||||
|
break;
|
||||||
case "w":
|
case "w":
|
||||||
document.getElementById("searchType").innerHTML = "Wikipedia search";
|
document.getElementById("searchType").innerHTML = "Wikipedia search";
|
||||||
break;
|
break;
|
||||||
@@ -218,9 +221,12 @@ export function search(text) {
|
|||||||
case "tv":
|
case "tv":
|
||||||
window.location = "https://www.thetvdb.com/search?query=" + subtext;
|
window.location = "https://www.thetvdb.com/search?query=" + subtext;
|
||||||
break;
|
break;
|
||||||
case "y":
|
case "yt":
|
||||||
window.location = "https://www.youtube.com/results?search_query=" + subtext;
|
window.location = "https://www.youtube.com/results?search_query=" + subtext;
|
||||||
break;
|
break;
|
||||||
|
case "y":
|
||||||
|
window.location = "https://www.you.com/search?q=" + subtext;
|
||||||
|
break;
|
||||||
case "w":
|
case "w":
|
||||||
window.location = "https://en.wikipedia.org/w/index.php?search=" + subtext;
|
window.location = "https://en.wikipedia.org/w/index.php?search=" + subtext;
|
||||||
break;
|
break;
|
||||||
@@ -239,7 +245,7 @@ export function search(text) {
|
|||||||
case "d":
|
case "d":
|
||||||
window.location = "https://www.duckduckgo.com";
|
window.location = "https://www.duckduckgo.com";
|
||||||
break;
|
break;
|
||||||
case "y":
|
case "yt":
|
||||||
window.location = "https://www.youtube.com";
|
window.location = "https://www.youtube.com";
|
||||||
break;
|
break;
|
||||||
case "r":
|
case "r":
|
||||||
@@ -281,4 +287,4 @@ export function replaceAll(search, replacement) {
|
|||||||
|
|
||||||
export default function main () {
|
export default function main () {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ function ApplicationDetails(props) {
|
|||||||
<input id="name" className="settingsText" type="text" defaultValue={props.name}></input>
|
<input id="name" className="settingsText" type="text" defaultValue={props.name}></input>
|
||||||
<input id="url" className="settingsText" type="text" defaultValue={props.url}></input>
|
<input id="url" className="settingsText" type="text" defaultValue={props.url}></input>
|
||||||
<input id="icon" className="settingsText" type="text" defaultValue={props.icon}></input>
|
<input id="icon" className="settingsText" type="text" defaultValue={props.icon}></input>
|
||||||
<input id="baseurl" className="settingsText" type="text" defaultValue={props.urlbase}></input>
|
<input id="urlbase" className="settingsText" type="text" defaultValue={props.urlbase}></input>
|
||||||
<input id="NSFW" className="settingsCheckbox" type="checkbox" defaultChecked={nsfwChecked}></input>
|
<input id="NSFW" className="settingsCheckbox" type="checkbox" defaultChecked={nsfwChecked}></input>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ApplicationDetails;
|
export default ApplicationDetails;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const ApplicationSettings = () => {
|
|||||||
const addRow = () => {
|
const addRow = () => {
|
||||||
setState([
|
setState([
|
||||||
...state,
|
...state,
|
||||||
{ key: state.length +1,name: "", url: "home.halfaperture.com/", icon: "", urlbase: "/", NSFW: false}
|
{ key: state.length +1,name: "", url: "sean.bet/", icon: "", urlbase: "/", NSFW: false}
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ const ApplicationSettings = () => {
|
|||||||
case "icon":
|
case "icon":
|
||||||
icons.push(item.value)
|
icons.push(item.value)
|
||||||
break;
|
break;
|
||||||
case "baseurl":
|
case "urlbase":
|
||||||
urlbases.push(item.value)
|
urlbases.push(item.value)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -62,7 +62,7 @@ const ApplicationSettings = () => {
|
|||||||
"name" : names[index],
|
"name" : names[index],
|
||||||
"url" : urls[index],
|
"url" : urls[index],
|
||||||
"icon" : icons[index],
|
"icon" : icons[index],
|
||||||
"baseurl" : urlbases[index],
|
"urlbase" : urlbases[index],
|
||||||
"NSFW" : NSFWs[index]
|
"NSFW" : NSFWs[index]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -108,4 +108,4 @@ const ApplicationSettings = () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ApplicationSettings;
|
export default ApplicationSettings;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Messages from './Messages';
|
|||||||
function MessageInfo() {
|
function MessageInfo() {
|
||||||
const [state, setState] = useState([]);
|
const [state, setState] = useState([]);
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
const response = await fetch("/sui/api/messages");
|
const response = await fetch("/sui/api/messages");
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
setState(data);
|
setState(data);
|
||||||
@@ -13,14 +13,13 @@ function MessageInfo() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getData();
|
getData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id="messageForm">
|
<div id="messageForm">
|
||||||
{state.map((greetings, index) => (
|
{state.map((greetings, index) => (
|
||||||
<Messages
|
<Messages
|
||||||
key={index}
|
key={index}
|
||||||
group={index+1}
|
group={index+1}
|
||||||
index={greetings.index}
|
|
||||||
greeting={greetings.message}
|
greeting={greetings.message}
|
||||||
easterEgg={greetings.easteregg}
|
easterEgg={greetings.easteregg}
|
||||||
/>
|
/>
|
||||||
@@ -29,4 +28,4 @@ function MessageInfo() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MessageInfo
|
export default MessageInfo
|
||||||
|
|||||||
@@ -1,17 +1,15 @@
|
|||||||
function Messages(props) {
|
function Messages(props) {
|
||||||
|
|
||||||
var eeChecked;
|
var eeChecked;
|
||||||
if(props.easterEgg === "TRUE") {
|
if(props.easterEgg === 1) {
|
||||||
eeChecked = true;
|
eeChecked = true;
|
||||||
} else if(props.easterEgg === "FALSE") {
|
} else if(props.easterEgg === 0) {
|
||||||
eeChecked = false;
|
eeChecked = false;
|
||||||
} else {
|
} else {
|
||||||
eeChecked = false;
|
eeChecked = false;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div id="messageGrid" title={props.group}>
|
<div id="messageGrid" title={props.group}>
|
||||||
<label htmlFor="index">Index</label>
|
|
||||||
<input id="index" type="text" defaultValue={props.index}></input>
|
|
||||||
<label htmlFor="greeting">Greeting</label>
|
<label htmlFor="greeting">Greeting</label>
|
||||||
<input id="greeting" type="text" defaultValue={props.greeting}></input>
|
<input id="greeting" type="text" defaultValue={props.greeting}></input>
|
||||||
<label htmlFor="Easter Egg">Easter Egg</label>
|
<label htmlFor="Easter Egg">Easter Egg</label>
|
||||||
@@ -20,4 +18,4 @@ function Messages(props) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Messages;
|
export default Messages;
|
||||||
|
|||||||
@@ -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(() => {
|
||||||
@@ -23,4 +23,4 @@ function PersonalInfo() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default PersonalInfo;
|
export default PersonalInfo;
|
||||||
|
|||||||
@@ -882,6 +882,11 @@ table a{
|
|||||||
border: 4px solid #49C4B1;
|
border: 4px solid #49C4B1;
|
||||||
color: #a3b2c8;
|
color: #a3b2c8;
|
||||||
}
|
}
|
||||||
|
.theme-bento{
|
||||||
|
background-color: #456F85;
|
||||||
|
border: 4px solid #F97E82;
|
||||||
|
color: #FDF1EF;
|
||||||
|
}
|
||||||
|
|
||||||
/* MEDIA QUERIES */
|
/* MEDIA QUERIES */
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
"links": [
|
"links": [
|
||||||
{
|
{
|
||||||
"name": "Nextcloud",
|
"name": "Nextcloud",
|
||||||
"url": "https://home.halfaperture.com/nextcloud"
|
"url": "https://sean.bet/nextcloud/apps/files"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "OneDrive",
|
"name": "OneDrive",
|
||||||
@@ -98,15 +98,15 @@
|
|||||||
"links": [
|
"links": [
|
||||||
{
|
{
|
||||||
"name": "Plex",
|
"name": "Plex",
|
||||||
"url": "http://plex.tv"
|
"url": "https://app.plex.tv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Twitch",
|
"name": "Twitch",
|
||||||
"url": "http://twitch.tv"
|
"url": "https://twitch.tv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Netflix",
|
"name": "Netflix",
|
||||||
"url": "http://netflix.com"
|
"url": "https://netflix.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "YouTube",
|
"name": "YouTube",
|
||||||
@@ -144,7 +144,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Guacamole",
|
"name": "Guacamole",
|
||||||
"url": "https://home.halfaperture.com/guacamole"
|
"url": "https://sean.bet/guacamole"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Unifi",
|
"name": "Unifi",
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
{"name":"Spotify","url":"https://open.spotify.com/search/results/","prefix":"/s"},
|
{"name":"Spotify","url":"https://open.spotify.com/search/results/","prefix":"/s"},
|
||||||
{"name":"TheTVDB","url":"https://www.thetvdb.com/search?query=","prefix":"/tv"},
|
{"name":"TheTVDB","url":"https://www.thetvdb.com/search?query=","prefix":"/tv"},
|
||||||
{"name":"Trakt","url":"https://trakt.tv/search?query=","prefix":"/t"},
|
{"name":"Trakt","url":"https://trakt.tv/search?query=","prefix":"/t"},
|
||||||
{"name":"YouTube","url":"https://www.youtube.com/results?search_query=","prefix":"/y"},
|
{"name":"YouTube","url":"https://www.youtube.com/results?search_query=","prefix":"/yt"},
|
||||||
|
{"name":"You","url":"https://www.you.com/search?q=","prefix":"/y"},
|
||||||
{"name":"Wikipedia","url":"https://en.wikipedia.org/w/index.php?search=","prefix":"/w"},
|
{"name":"Wikipedia","url":"https://en.wikipedia.org/w/index.php?search=","prefix":"/w"},
|
||||||
{"name":"Plex","url":"https://app.plex.tv/desktop/#!/search?query=","prefix":"/p"},
|
{"name":"Plex","url":"https://app.plex.tv/desktop/#!/search?query=","prefix":"/p"},
|
||||||
{"name":"Rotten Tomatoes","url":"https://www.rottentomatoes.com/search?search=","prefix":"/rt"}
|
{"name":"Rotten Tomatoes","url":"https://www.rottentomatoes.com/search?search=","prefix":"/rt"}
|
||||||
|
|||||||
@@ -170,6 +170,15 @@
|
|||||||
"colortextpri": "#a3b2c8",
|
"colortextpri": "#a3b2c8",
|
||||||
"colortextacc": "#49C4B1",
|
"colortextacc": "#49C4B1",
|
||||||
"colorborder": "#49C4B1"
|
"colorborder": "#49C4B1"
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"name": "bento",
|
||||||
|
"imagebackground": "none",
|
||||||
|
"colorbackground": "#456F85",
|
||||||
|
"colorserachbackground": "#F97E8259",
|
||||||
|
"colortextpri": "#FDF1EF",
|
||||||
|
"colortextacc": "#F97E82",
|
||||||
|
"colorborder": "#F97E82"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
3
start-node.sh
Executable file
3
start-node.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
cd /home/magnum/home-page/api
|
||||||
|
node server.js
|
||||||
Reference in New Issue
Block a user