Compare commits
2 Commits
010c8fd0bb
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 96a22bad25 | |||
| 24562a53ac |
13
api/package-lock.json
generated
Normal file
13
api/package-lock.json
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "api",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"wol": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/wol/-/wol-1.0.7.tgz",
|
||||
"integrity": "sha512-kg7ETY8g3V5+3GVhUfWCVjeXuCmfrX6xfw4cw4c88+MtoxkbFmcs9Y5yhT1wwOL8inogFUQZ8JMzH9OekaaawQ=="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,5 +9,8 @@
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wol": "^1.0.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ const express = require("express");
|
||||
const bodyParser = require("body-parser");
|
||||
const cors = require("cors");
|
||||
const fs = require("fs");
|
||||
const wol = require("wol")
|
||||
const wol = require("wol");
|
||||
|
||||
try {
|
||||
var links = require('../src/links.json');
|
||||
@@ -96,9 +96,10 @@ app.post("/sui/api/appUpdate", jsonParser, (req, res) => {
|
||||
});
|
||||
|
||||
app.get("/sui/api/wakeDakota", (req, res) => {
|
||||
wol.wake('18:C0:4D:81:57:68', function(err, res){
|
||||
wol.wake('18:C0:4D:81:57:68', function(err,res){
|
||||
console.log(res);
|
||||
});
|
||||
res.status(200).send("success");
|
||||
});
|
||||
|
||||
// app is listening on port 5000
|
||||
|
||||
101
api/server.js.save
Normal file
101
api/server.js.save
Normal file
@@ -0,0 +1,101 @@
|
||||
const express = require("express");
|
||||
const bodyParser = require("body-parser");
|
||||
const cors = require("cors");
|
||||
const fs = require("fs");
|
||||
const wol = require("wol");
|
||||
|
||||
try {
|
||||
var links = require('../src/links.json');
|
||||
} catch(err) {
|
||||
let body = `{
|
||||
"bookmarks" : [
|
||||
{
|
||||
"category": "Example",
|
||||
"links": [
|
||||
{
|
||||
"name": "Gitea",
|
||||
"url": "https://home.halfaperture.com/gitea"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}`;
|
||||
fs.writeFileSync('../src/links.json',body);
|
||||
var links = require('../src/links.json');
|
||||
}
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
const providers = require('../src/providers.json');
|
||||
const themes = require('../src/themes.json');
|
||||
const messages = require('../src/messages.json');
|
||||
|
||||
// initializing app
|
||||
const app = express();
|
||||
|
||||
// initializing cors middleware for all routes
|
||||
app.use(cors());
|
||||
var jsonParser = bodyParser.json();
|
||||
|
||||
// creating route to make request to server for API
|
||||
app.get("/sui/api/apps", (req, res) => {
|
||||
fs.readFile('../src/apps.json', (err, data) => {
|
||||
if (err) throw err;
|
||||
let apps = JSON.parse(data);
|
||||
res.status(200).send(apps.apps);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
app.get("/sui/api/links", (req, res) => {
|
||||
res.status(200).send(links.bookmarks);
|
||||
});
|
||||
|
||||
app.get("/sui/api/providers", (req, res) => {
|
||||
res.status(200).send(providers.providers);
|
||||
});
|
||||
|
||||
app.get("/sui/api/themes", (req, res) => {
|
||||
res.status(200).send(themes.themes);
|
||||
});
|
||||
|
||||
app.get("/sui/api/personaldata", (req, res) => {
|
||||
res.status(200).send(personaldata);
|
||||
});
|
||||
|
||||
app.get("/sui/api/messages", (req, res) => {
|
||||
res.status(200).send(messages.messages);
|
||||
});
|
||||
|
||||
app.post("/sui/api/appUpdate", jsonParser, (req, res) => {
|
||||
let data = JSON.stringify(req.body)
|
||||
fs.writeFileSync('../src/apps.json',data)
|
||||
var applications = require('../src/apps.json');
|
||||
res.status(200).send(applications.apps)
|
||||
});
|
||||
|
||||
app.post("/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.listen(5000, () => {
|
||||
}); console.log("node server is running on port 5000");
|
||||
});
|
||||
21728
package-lock.json
generated
21728
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -14,11 +14,13 @@
|
||||
"express": "^4.18.1",
|
||||
"formik": "^2.2.9",
|
||||
"history": "^5.1.0",
|
||||
"mysql": "^2.18.1",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-router-dom": "^6.1.1",
|
||||
"react-scripts": "4.0.3",
|
||||
"web-vitals": "^1.1.2",
|
||||
"wol": "^1.0.7",
|
||||
"yup": "^0.32.11"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,24 +1 @@
|
||||
{
|
||||
"apps" : [
|
||||
{"name":"Deluge","url":"home.halfaperture.com/deluge","icon":"water","urlbase":"/Deluge","NSFW":"NSFW"},
|
||||
{"name":"Gitea","url":"home.halfaperture.com/gitea","icon":"tea","urlbase":"/Gitea","NSFW":"SAFE"},
|
||||
{"name":"Grafana","url":"home.halfaperture.com/grafana","icon":"chart-areaspline-variant","urlbase":"/Grafana","NSFW":"SAFE"},
|
||||
{"name":"Guacamole","url":"home.halfaperture.com/guacamole","icon":"remote-desktop","urlbase":"/Guacamole","NSFW":"SAFE"},
|
||||
{"name":"Jackett","url":"home.halfaperture.com/jackett","icon":"tshirt-crew","urlbase":"/Jackett","NSFW":"NSFW"},
|
||||
{"name":"Lidarr","url":"home.halfaperture.com/lidarr","icon":"music-circle","urlbase":"/Lidarr","NSFW":"NSFW"},
|
||||
{"name":"NextCloud","url":"home.halfaperture.com/nextcloud","icon":"cloud","urlbase":"/NextCloud","NSFW":"SAFE"},
|
||||
{"name":"NZBHydra","url":"home.halfaperture.com/nzbhydra","icon":"snake","urlbase":"/NZBHydra","NSFW":"NSFW"},
|
||||
{"name":"PiHole","url":"home.halfaperture.com/admin","icon":"pi-hole","urlbase":"/Admin","NSFW":"SAFE"},
|
||||
{"name":"Plex","url":"home.halfaperture.com/plex","icon":"plex","urlbase":"/Plex","NSFW":"SAFE"},
|
||||
{"name":"OctoPrint","url":"home.halfaperture.com/octoprint","icon":"printer-3d","urlbase":"/octoprint","NSFW":"SAFE"},
|
||||
{"name":"Ombi","url":"home.halfaperture.com/requests","icon":"magnify","urlbase":"/Ombi","NSFW":"NSFW"},
|
||||
{"name":"Organizr","url":"home.halfaperture.com","icon":"home","urlbase":"/Organizr","NSFW":"SAFE"},
|
||||
{"name":"Radarr","url":"home.halfaperture.com/radarr","icon":"movie-open","urlbase":"/Radarr","NSFW":"NSFW"},
|
||||
{"name":"Readarr","url":"home.halfaperture.com/readarr","icon":"library","urlbase":"/Readarr","NSFW":"NSFW"},
|
||||
{"name":"SABnzbd","url":"home.halfaperture.com/sabnzbd","icon":"download","urlbase":"/SABnzbd","NSFW":"NSFW"},
|
||||
{"name":"Sonarr","url":"home.halfaperture.com/sonarr","icon":"television-classic","urlbase":"/Sonarr","NSFW":"NSFW"},
|
||||
{"name":"Tautulli","url":"home.halfaperture.com/stats","icon":"chart-bar","urlbase":"/Stats","NSFW":"NSFW"},
|
||||
{"name":"uBooquity","url":"home.halfaperture.com/ubooquity","icon":"book-open-outline","urlbase":"/uBooquity","NSFW":"SAFE"},
|
||||
{"name":"Wiki","url":"home.halfaperture.com/wiki","icon":"wikipedia","urlbase":"/Wiki","NSFW":"SAFE"}
|
||||
]
|
||||
}
|
||||
{"apps":[{"name":"Code Server", "url":"sean.bet/code","icon":"microsoft-visual-studio-code","urlbase":"/Code","NSFW":"SAFE"},{"name":"Deluge","url":"sean.bet/deluge","icon":"water","urlbase":"/Deluge","NSFW":"NSFW"},{"name":"Gitea","url":"sean.bet/gitea","icon":"tea","urlbase":"/Gitea","NSFW":"SAFE"},{"name":"Grafana","url":"sean.bet/grafana","icon":"chart-areaspline-variant","urlbase":"/Grafana","NSFW":"SAFE"},{"name":"Guacamole","url":"sean.bet/guacamole","icon":"remote-desktop","urlbase":"/Guacamole","NSFW":"SAFE"},{"name":"Jackett","url":"sean.bet/jackett","icon":"tshirt-crew","urlbase":"/Jackett","NSFW":"NSFW"},{"name":"Lidarr","url":"sean.bet/lidarr","icon":"music-circle","urlbase":"/Lidarr","NSFW":"NSFW"},{"name":"NextCloud","url":"sean.bet/nextcloud","icon":"cloud","urlbase":"/NextCloud","NSFW":"SAFE"},{"name":"NZBHydra","url":"sean.bet/nzbhydra","icon":"snake","urlbase":"/NZBHydra","NSFW":"NSFW"},{"name":"PiHole","url":"sean.bet/admin","icon":"pi-hole","urlbase":"/Admin","NSFW":"SAFE"},{"name":"Plex","url":"sean.bet/plex","icon":"plex","urlbase":"/Plex","NSFW":"SAFE"},{"name":"OctoPrint","url":"sean.bet/octoprint","icon":"printer-3d","urlbase":"/octoprint","NSFW":"SAFE"},{"name":"Ombi","url":"sean.bet/requests","icon":"magnify","urlbase":"/Ombi","NSFW":"NSFW"},{"name":"Organizr","url":"sean.bet","icon":"home","urlbase":"/Organizr","NSFW":"SAFE"},{"name":"Radarr","url":"sean.bet/radarr","icon":"movie-open","urlbase":"/Radarr","NSFW":"NSFW"},{"name":"Readarr","url":"sean.bet/readarr","icon":"library","urlbase":"/Readarr","NSFW":"NSFW"},{"name":"SABnzbd","url":"sean.bet/sabnzbd","icon":"download","urlbase":"/SABnzbd","NSFW":"NSFW"},{"name":"Sonarr","url":"sean.bet/sonarr","icon":"television-classic","urlbase":"/Sonarr","NSFW":"NSFW"},{"name":"Tautulli","url":"sean.bet/stats","icon":"chart-bar","urlbase":"/Stats","NSFW":"NSFW"},{"name":"uBooquity","url":"sean.bet/ubooquity","icon":"book-open-outline","urlbase":"/uBooquity","NSFW":"SAFE"},{"name":"Wiki","url":"sean.bet/wiki","icon":"wikipedia","urlbase":"/Wiki","NSFW":"SAFE"}]}
|
||||
|
||||
16
src/components/WolButton.js
Normal file
16
src/components/WolButton.js
Normal file
@@ -0,0 +1,16 @@
|
||||
function WolButton(props) {
|
||||
return (
|
||||
<div className="wake"><input type="button" id="wolbutton" onClick={runWakeCommand}></input>
|
||||
<label htmlFor="wolbutton"><span className="iconify" data-icon="mdi-monitor"></span></label></div>
|
||||
);
|
||||
}
|
||||
|
||||
export default WolButton;
|
||||
|
||||
function runWakeCommand() {
|
||||
const requestOptions = {
|
||||
method: 'GET',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
};
|
||||
fetch("/sui/api/wakeDakota", requestOptions)
|
||||
}
|
||||
@@ -290,7 +290,7 @@ table a{
|
||||
display: grid;
|
||||
grid-column-gap: 5px;
|
||||
grid-row-gap: 5px;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
grid-template-rows: 64px;
|
||||
padding-bottom: var(--module-spacing);
|
||||
}
|
||||
@@ -418,7 +418,10 @@ table a{
|
||||
#nav_item h4{
|
||||
color: var(--color-text-acc);
|
||||
}
|
||||
|
||||
#nav item button{
|
||||
display: block;
|
||||
color: var(--color-text-pri);
|
||||
}
|
||||
#nav_item a{
|
||||
font-size: 1.25em;
|
||||
display: block;
|
||||
@@ -427,6 +430,7 @@ table a{
|
||||
line-height: 2;
|
||||
justify-self: center;
|
||||
color: var(--color-text-pri);
|
||||
border-radius: 1em;
|
||||
}
|
||||
#nav_item a:hover{
|
||||
text-decoration: none;
|
||||
@@ -684,7 +688,7 @@ table a{
|
||||
}
|
||||
|
||||
#modal-footer{
|
||||
display:flex;
|
||||
display:grid;
|
||||
font-size:2em;
|
||||
justify-content: center;
|
||||
}
|
||||
@@ -705,6 +709,10 @@ table a{
|
||||
#modal-footer input[type="checkbox"]:checked + label{
|
||||
color: var(--color-text-acc);
|
||||
}
|
||||
#modal-footer input[type="button"]{
|
||||
display: none;
|
||||
color: var(--color-text-pri);
|
||||
}
|
||||
|
||||
.sneaky{
|
||||
right: 1em;
|
||||
@@ -888,6 +896,12 @@ table a{
|
||||
color: #FDF1EF;
|
||||
}
|
||||
|
||||
.theme-loyal{
|
||||
background-color: #000000;
|
||||
border: 4px solid #ffffff;
|
||||
color: #ff0000;
|
||||
}
|
||||
|
||||
/* MEDIA QUERIES */
|
||||
|
||||
@media screen and (max-width: 1260px)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"links": [
|
||||
{
|
||||
"name": "Nextcloud",
|
||||
"url": "https://home.halfaperture.com/nextcloud/apps/files"
|
||||
"url": "https://sean.bet/nextcloud/apps/files"
|
||||
},
|
||||
{
|
||||
"name": "OneDrive",
|
||||
@@ -144,12 +144,16 @@
|
||||
},
|
||||
{
|
||||
"name": "Guacamole",
|
||||
"url": "https://home.halfaperture.com/guacamole"
|
||||
"url": "https://sean.bet/guacamole"
|
||||
},
|
||||
{
|
||||
"name": "Unifi",
|
||||
"url": "https://network.unifi.ui.com"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Code Server",
|
||||
"url": "https://sean.bet/code"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -197,8 +201,8 @@
|
||||
"url": "https://outlook.office365.com/ecp/"
|
||||
},
|
||||
{
|
||||
"name": "Classic Protection",
|
||||
"url": "https://protection.office.com"
|
||||
"name": "Dev Ops",
|
||||
"url": "https://dev.azure.com/CottonIT/"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import HideButton from '../components/HideButton'
|
||||
import HideButton from '../components/HideButton';
|
||||
import WolButton from '../components/WolButton';
|
||||
import { setTheme } from "../assets/functions";
|
||||
import { Outlet, Link } from "react-router-dom";
|
||||
|
||||
@@ -18,6 +19,8 @@ function Settings() {
|
||||
</nav>
|
||||
<nav id="nav_item">
|
||||
<header id="modal-footer">
|
||||
<WolButton />
|
||||
<br/>
|
||||
<HideButton
|
||||
checked = {isChecked}
|
||||
/>
|
||||
@@ -30,4 +33,4 @@ function Settings() {
|
||||
);
|
||||
}
|
||||
|
||||
export default Settings;
|
||||
export default Settings;
|
||||
|
||||
@@ -179,6 +179,15 @@
|
||||
"colortextpri": "#FDF1EF",
|
||||
"colortextacc": "#F97E82",
|
||||
"colorborder": "#F97E82"
|
||||
},
|
||||
{
|
||||
"name": "loyal",
|
||||
"imagebackground": "none",
|
||||
"colorbackground": "#111111",
|
||||
"colorserachbackground": "#ffffff20",
|
||||
"colortextpri": "#AA0000",
|
||||
"colortextacc": "#dddddd",
|
||||
"colorborder": "#dddddd"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user