Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
a4db8b5293 | |||
9d931d1835 | |||
1dd8f95607 | |||
2531a1328c | |||
11adffcd60 | |||
c186858c56 | |||
bebae5b6e6 | |||
a19b5cc8ef | |||
26e6f3ba79 | |||
8464142b0c | |||
8c676fd6e6 | |||
239ce81d4c | |||
7f915c26cc | |||
bb93a71464 | |||
ca48456500 | |||
20f647b5e8 | |||
0ff0ba9d2d | |||
ce83133133 | |||
7d298610b2 |
13
.eslintignore
Normal file
@ -0,0 +1,13 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/build
|
||||
/.svelte-kit
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# Ignore files for PNPM, NPM and YARN
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
yarn.lock
|
30
.eslintrc.cjs
Normal file
@ -0,0 +1,30 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:svelte/recommended',
|
||||
'prettier'
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['@typescript-eslint'],
|
||||
parserOptions: {
|
||||
sourceType: 'module',
|
||||
ecmaVersion: 2020,
|
||||
extraFileExtensions: ['.svelte']
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
es2017: true,
|
||||
node: true
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.svelte'],
|
||||
parser: 'svelte-eslint-parser',
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
10
.gitignore
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/build
|
||||
/.svelte-kit
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
13
.prettierignore
Normal file
@ -0,0 +1,13 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/build
|
||||
/.svelte-kit
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# Ignore files for PNPM, NPM and YARN
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
yarn.lock
|
9
.prettierrc
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"useTabs": true,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 100,
|
||||
"plugins": ["prettier-plugin-svelte"],
|
||||
"pluginSearchDirs": ["."],
|
||||
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
||||
}
|
6
old/.dockerignore
Normal file
@ -0,0 +1,6 @@
|
||||
LICENSE
|
||||
*.md
|
||||
.gitignore
|
||||
.git
|
||||
Dockerfile
|
||||
.dockerignore
|
12
old/Dockerfile
Normal file
@ -0,0 +1,12 @@
|
||||
FROM fedora:latest as compressor
|
||||
RUN dnf install brotli nodejs npm jq -y
|
||||
RUN npm i uglifyjs-folder uglifycss html-minifier-terser -g
|
||||
COPY . /data/in
|
||||
RUN bash /data/in/deploy/deploy.sh
|
||||
|
||||
FROM fholzer/nginx-brotli:latest
|
||||
RUN rm /etc/nginx/nginx.conf
|
||||
RUN apk update
|
||||
RUN apk add --upgrade libxml2 libxslt
|
||||
COPY ./deploy/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY --from=compressor /data/out/ /site-static/
|
@ -1,32 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<title>FJLA Gateway</title>
|
||||
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="description" content="FJLA Gateway"/>
|
||||
<meta name="viewport" content="width=device-width, initial=scale=1.0">
|
||||
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="./stylesheets/fonts.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="./stylesheets/style.css"/>
|
||||
<script src="./scripts/iconactions.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1 class="pagetitle">FJLA Gateway</h1>
|
||||
<h2 Class="pagesubtitle">All Services</h2>
|
||||
|
||||
<div class="gatecontainer">
|
||||
<div onclick="gotoAmpache()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/ampache-normal.png"/>
|
||||
<div class="icontext">
|
||||
<h1 class="gatetitle">Ampache</h1>
|
||||
<h2 class="gatesubtitle">Music Streaming</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoNextcloud()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/nextcloud-normal.webp"/>
|
||||
<div class="icontext">
|
||||
@ -34,7 +20,6 @@
|
||||
<h2 class="gatesubtitle">Personal Cloud</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoHomeAssistant()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/home-assistant-normal.webp"/>
|
||||
<div class="icontext">
|
||||
@ -42,7 +27,6 @@
|
||||
<h2 class="gatesubtitle">Smart Home</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoJellyfin()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/jellyfin-normal.webp"/>
|
||||
<div class="icontext">
|
||||
@ -50,7 +34,6 @@
|
||||
<h2 class="gatesubtitle">Video Streaming</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoGallery()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/gallery-normal.webp"/>
|
||||
<div class="icontext">
|
||||
@ -58,9 +41,7 @@
|
||||
<h2 class="gatesubtitle">Family Photos</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="gatecontainer">
|
||||
<div onclick="gotoProxmox()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/proxmox-normal.webp"/>
|
||||
@ -69,15 +50,6 @@
|
||||
<h2 class="gatesubtitle">Virtualisation</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoCUPS()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/cups-normal.webp"/>
|
||||
<div class="icontext">
|
||||
<h1 class="gatetitle">CUPS</h1>
|
||||
<h2 class="gatesubtitle">Print Server</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoOmada()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/tplink-normal.webp"/>
|
||||
<div class="icontext">
|
||||
@ -85,15 +57,6 @@
|
||||
<h2 class="gatesubtitle">Wireless Network</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoJellyfin()" class="gateicon hidden">
|
||||
<img class="gateimage" src="./assets/gate-logos/"/>
|
||||
<div class="icontext">
|
||||
<h1 class="gatetitle">Blank</h1>
|
||||
<h2 class="gatesubtitle">-</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoGateway()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/back-normal.webp"/>
|
||||
<div class="icontext">
|
||||
@ -101,11 +64,8 @@
|
||||
<h2 class="gatesubtitle">Go to Home</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="gatecontainer">
|
||||
|
||||
<div onclick="gotoMail()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/mail-normal.webp">
|
||||
<div class="icontext">
|
||||
@ -113,7 +73,6 @@
|
||||
<h2 class="gatesubtitle">Your email</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoVoicemail()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/voicemail-normal.webp">
|
||||
<div class="icontext">
|
||||
@ -121,8 +80,6 @@
|
||||
<h2 class="gatesubtitle">FreePBX UCP</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div onclick="gotoAccount()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/account-normal.webp">
|
||||
<div class="icontext">
|
||||
@ -130,7 +87,6 @@
|
||||
<h2 class="gatesubtitle">Your Settings</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoHelp()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/lifebuoy-normal.webp">
|
||||
<div class="icontext">
|
||||
@ -138,8 +94,6 @@
|
||||
<h2 class="gatesubtitle">Tell me more</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 219 KiB After Width: | Height: | Size: 219 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
38
old/deploy/deploy.sh
Normal file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
ROOTIN="/data/in"
|
||||
ROOTOUT="/data/out"
|
||||
|
||||
echo "Running UglifyJS on /data/in folder"
|
||||
uglifyjs-folder "$ROOTIN" -x ".js" -eo "$ROOTOUT"
|
||||
|
||||
echo "Running UglifyCSS"
|
||||
CSSIN="/data/in/stylesheets/"
|
||||
CSSOUT="/data/out/stylesheets"
|
||||
|
||||
cd $CSSIN
|
||||
echo "Changed directory"
|
||||
for f in *
|
||||
do
|
||||
if [ -f "$f" ]; then
|
||||
uglifycss "$f" --output "$f";
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Moving 'styles' to 'out'"
|
||||
cp -r $CSSIN $CSSOUT
|
||||
|
||||
echo "Running html-minifier-terser on /folder"
|
||||
HTMLIN="/data/in/"
|
||||
HTMLOUT="/data/out"
|
||||
html-minifier-terser --collapse-whitespace --remove-comments --file-ext html --input-dir /data/in/ --output-dir /data/out/
|
||||
|
||||
#echo "Moving JSON Manifest file from root to output"
|
||||
#cat /data/in/manifest.json | jq -c > /data/out/manifest.json
|
||||
|
||||
echo "Moving other files folder from in/ to out/"
|
||||
cp -r /data/in/assets /data/out/assets
|
||||
cp -r /data/in/fonts /data/out/fonts
|
||||
|
||||
echo "Running GZIP & Brotli on all HTML, JS, CSS, JSON, SVG & TTF files"
|
||||
find /data/out -type f -name \*.html -or -name \*.js -or -name \*.css -or -name \*.json -or -name \*.svg -or -name \*.ttf | while read file; do gzip -k -9 $file; brotli -k -q 11 $file; done
|
38
old/deploy/nginx.conf
Normal file
@ -0,0 +1,38 @@
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 64;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
add_header Content-Security-Policy "default-src 'self'";
|
||||
|
||||
location / {
|
||||
root /site-static/;
|
||||
index index.html;
|
||||
gzip_static on;
|
||||
brotli_static on;
|
||||
expires 3d;
|
||||
add_header Cache-Control "public, no-transform";
|
||||
}
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="description" content="FJLA Gateway"/>
|
||||
<meta name="viewport" content="width=device-width, initial=scale=1.0">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="./stylesheets/fonts.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="./stylesheets/style.css"/>
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
@ -6,7 +6,7 @@
|
||||
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="description" content="FJLA Gateway"/>
|
||||
<meta name="viewport" content="width=device-width, initial=scale=1.0">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="./stylesheets/fonts.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="./stylesheets/style.css"/>
|
@ -1,37 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<title>FJLA Gateway</title>
|
||||
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="description" content="FJLA Gateway"/>
|
||||
<meta name="viewport" content="width=device-width, initial=scale=1.0">
|
||||
|
||||
<meta name="description" content="The gateway to FJLA services"/>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="./stylesheets/fonts.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="./stylesheets/style.css"/>
|
||||
<script src="./scripts/iconactions.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1 class="pagetitle">FJLA Gateway</h1>
|
||||
<a hidden href="./faults.html"><h2 class="pagesubtitle errornote">Active Fault</h2></a>
|
||||
|
||||
<form action="https://duckduckgo.com/">
|
||||
<input class="searchentry" type="text" id="search" name="q" autocomplete="on" placeholder="Search DuckDuckGo" autofocus>
|
||||
</form>
|
||||
<br>
|
||||
|
||||
<div class="gatecontainer">
|
||||
<div onclick="gotoAmpache()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/ampache-normal.png"/>
|
||||
<div class="icontext">
|
||||
<h1 class="gatetitle">Ampache</h1>
|
||||
<h2 class="gatesubtitle">Music Streaming</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoNextcloud()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/nextcloud-normal.webp"/>
|
||||
<div class="icontext">
|
||||
@ -39,7 +24,6 @@
|
||||
<h2 class="gatesubtitle">Personal Cloud</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoHomeAssistant()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/home-assistant-normal.webp"/>
|
||||
<div class="icontext">
|
||||
@ -47,7 +31,6 @@
|
||||
<h2 class="gatesubtitle">Smart Home</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoJellyfin()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/jellyfin-normal.webp"/>
|
||||
<div class="icontext">
|
||||
@ -55,7 +38,6 @@
|
||||
<h2 class="gatesubtitle">Video Streaming</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoGallery()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/gallery-normal.webp"/>
|
||||
<div class="icontext">
|
||||
@ -63,12 +45,8 @@
|
||||
<h2 class="gatesubtitle">Family Photos</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="gatecontainer">
|
||||
|
||||
<div onclick="gotoMail()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/mail-normal.webp">
|
||||
<div class="icontext">
|
||||
@ -76,7 +54,6 @@
|
||||
<h2 class="gatesubtitle">Your email</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoVoicemail()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/voicemail-normal.webp">
|
||||
<div class="icontext">
|
||||
@ -84,7 +61,6 @@
|
||||
<h2 class="gatesubtitle">FreePBX UCP</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoAll()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/question-normal.webp">
|
||||
<div class="icontext">
|
||||
@ -92,7 +68,6 @@
|
||||
<h2 class="gatesubtitle">Full list of services</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoAccount()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/account-normal.webp">
|
||||
<div class="icontext">
|
||||
@ -100,7 +75,6 @@
|
||||
<h2 class="gatesubtitle">Your Settings</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="gotoHelp()" class="gateicon">
|
||||
<img class="gateimage" src="./assets/gate-logos/lifebuoy-normal.webp">
|
||||
<div class="icontext">
|
||||
@ -108,8 +82,6 @@
|
||||
<h2 class="gatesubtitle">Tell me more</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
@ -3,7 +3,7 @@ function gotoGateway() {
|
||||
}
|
||||
|
||||
function gotoAmpache() {
|
||||
window.location = ("https://music.fjla.uk")
|
||||
window.alert("Ampache has been replaced by Jellyfin.")
|
||||
}
|
||||
|
||||
function gotoNextcloud() {
|
||||
@ -15,7 +15,7 @@ function gotoHomeAssistant() {
|
||||
}
|
||||
|
||||
function gotoJellyfin() {
|
||||
window.location = ("https://media.fjla.uk")
|
||||
window.location = ("https://jf.fjla.uk")
|
||||
}
|
||||
|
||||
function gotoGallery() {
|
||||
@ -23,7 +23,7 @@ function gotoGallery() {
|
||||
}
|
||||
|
||||
function gotoAccount() {
|
||||
window.location = ("https://ipa0522.home.fjla.net")
|
||||
window.location = ("https://ipa0822.home.fjla.net")
|
||||
}
|
||||
|
||||
function gotoHelp() {
|
||||
@ -35,7 +35,7 @@ function gotoAll() {
|
||||
}
|
||||
|
||||
function gotoMail() {
|
||||
window.location = ("https://mx1.fb-infra.uk/mail")
|
||||
window.location = ("https://mx0123.fb-infra.uk/mail")
|
||||
}
|
||||
|
||||
function gotoVoicemail() {
|
3463
package-lock.json
generated
Normal file
32
package.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "gateway.fjla.uk",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
||||
"format": "prettier --plugin-search-dir . --write ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-auto": "^2.0.0",
|
||||
"@sveltejs/adapter-node": "^1.3.1",
|
||||
"@sveltejs/kit": "^1.20.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||
"@typescript-eslint/parser": "^5.45.0",
|
||||
"eslint": "^8.28.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-svelte": "^2.30.0",
|
||||
"prettier": "^2.8.0",
|
||||
"prettier-plugin-svelte": "^2.10.1",
|
||||
"svelte": "^4.0.5",
|
||||
"svelte-check": "^3.4.3",
|
||||
"tslib": "^2.4.1",
|
||||
"typescript": "^5.0.0",
|
||||
"vite": "^4.4.2"
|
||||
},
|
||||
"type": "module"
|
||||
}
|
58
src/app.css
Normal file
@ -0,0 +1,58 @@
|
||||
body {
|
||||
background-color:#004284;
|
||||
background-image:url("/img/jellyfish-portrait-l.webp");
|
||||
background-attachment:fixed;
|
||||
background-repeat:no-repeat;
|
||||
background-position:left top;
|
||||
background-size:cover
|
||||
}
|
||||
|
||||
/* Font Declarations */
|
||||
|
||||
/* museomoderno-200 - latin */
|
||||
@font-face {
|
||||
font-family: 'MuseoModerno';
|
||||
font-style: normal;
|
||||
font-weight: 200;
|
||||
src: local(''),
|
||||
url('/fonts/museomoderno-v20-latin-200.woff2') format('woff2'), /* Super Modern Browsers */
|
||||
url('/fonts/museomoderno-v20-latin-200.woff') format('woff'), /* Modern Browsers */
|
||||
url('/fonts/museomoderno-v20-latin-200.ttf') format('truetype'), /* Safari, Android, iOS */
|
||||
url('/fonts/museomoderno-v20-latin-200.svg#MuseoModerno') format('svg'); /* Legacy iOS */
|
||||
}
|
||||
|
||||
/* museomoderno-regular - latin */
|
||||
@font-face {
|
||||
font-family: 'MuseoModerno';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local(''),
|
||||
url('/fonts/museomoderno-v20-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
|
||||
url('/fonts/museomoderno-v20-latin-regular.woff') format('woff'), /* Modern Browsers */
|
||||
url('/fonts/museomoderno-v20-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
|
||||
url('/fonts/museomoderno-v20-latin-regular.svg#MuseoModerno') format('svg'); /* Legacy iOS */
|
||||
}
|
||||
|
||||
/* museomoderno-600 - latin */
|
||||
@font-face {
|
||||
font-family: 'MuseoModerno';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: local(''),
|
||||
url('/fonts/museomoderno-v20-latin-600.woff2') format('woff2'), /* Super Modern Browsers */
|
||||
url('/fonts/museomoderno-v20-latin-600.woff') format('woff'), /* Modern Browsers */
|
||||
url('/fonts/museomoderno-v20-latin-600.ttf') format('truetype'), /* Safari, Android, iOS */
|
||||
url('/fonts/museomoderno-v20-latin-600.svg#MuseoModerno') format('svg'); /* Legacy iOS */
|
||||
}
|
||||
|
||||
/* museomoderno-800 - latin */
|
||||
@font-face {
|
||||
font-family: 'MuseoModerno';
|
||||
font-style: normal;
|
||||
font-weight: 800;
|
||||
src: local(''),
|
||||
url('/fonts/museomoderno-v20-latin-800.woff2') format('woff2'), /* Super Modern Browsers */
|
||||
url('/fonts/museomoderno-v20-latin-800.woff') format('woff'), /* Modern Browsers */
|
||||
url('/fonts/museomoderno-v20-latin-800.ttf') format('truetype'), /* Safari, Android, iOS */
|
||||
url('/fonts/museomoderno-v20-latin-800.svg#MuseoModerno') format('svg'); /* Legacy iOS */
|
||||
}
|
12
src/app.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
// See https://kit.svelte.dev/docs/types#app
|
||||
// for information about these interfaces
|
||||
declare global {
|
||||
namespace App {
|
||||
// interface Error {}
|
||||
// interface Locals {}
|
||||
// interface PageData {}
|
||||
// interface Platform {}
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
14
src/app.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>FJLA Gateway</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="description" content="The gateway to FJLA services"/>
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
<div style="display: contents">%sveltekit.body%</div>
|
||||
</body>
|
||||
</html>
|
25
src/lib/components/indicatorDot.svelte
Normal file
@ -0,0 +1,25 @@
|
||||
<script lang="ts">
|
||||
export let status: string | undefined
|
||||
console.log(status)
|
||||
</script>
|
||||
|
||||
<span class="dot {status?.toLowerCase() || ''}"></span>
|
||||
|
||||
<style>
|
||||
.dot {
|
||||
display: inline-block;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
border-radius: 50%;
|
||||
background-color: grey;
|
||||
}
|
||||
.ok {
|
||||
background-color: green;
|
||||
}
|
||||
.unavailable {
|
||||
background-color: red;
|
||||
}
|
||||
.unknown {
|
||||
background-color: orange;
|
||||
}
|
||||
</style>
|
71
src/lib/components/itemBox.svelte
Normal file
@ -0,0 +1,71 @@
|
||||
<script lang="ts">
|
||||
import { detailMap, defaultVal } from "$lib/scripts/serviceMap";
|
||||
import type { ServiceData } from "$lib/types/serviceData";
|
||||
|
||||
export let detail: string
|
||||
|
||||
const service: ServiceData = detailMap.get(detail) || defaultVal
|
||||
|
||||
</script>
|
||||
|
||||
<a href="{service.url}">
|
||||
<div class="box">
|
||||
<img class="logo" src="/img/box/{service.imgPath}" alt="">
|
||||
<header>
|
||||
{service.formattedName}
|
||||
</header>
|
||||
<div class="tooltip">
|
||||
<p class="tooltipDesc">{service.description}</p>
|
||||
<p>Login with: {service.loginMethod}</p>
|
||||
<!--<p>Current status: {detail.statusMessage || "Unknown"}</p>-->
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<style>
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
}
|
||||
.box {
|
||||
display: flex;
|
||||
background-color: rgba(64,64,64,0.6);
|
||||
margin: 10px 10px;
|
||||
padding: 20px 20px;
|
||||
min-width: 200px;
|
||||
border-radius: 30px;
|
||||
transition: 0.25s;
|
||||
}
|
||||
.box:hover .tooltip {
|
||||
visibility: visible;
|
||||
background-color: rgba(64, 64, 64, 0.8);
|
||||
}
|
||||
.logo {
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
}
|
||||
header {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding-left: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
.tooltip {
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
margin-top: 50px;
|
||||
text-align: center;
|
||||
z-index: 1;
|
||||
padding: 10px;
|
||||
border-radius: 20px;
|
||||
transition-property: all;
|
||||
transition-duration: 0.2s;
|
||||
width: 35%;
|
||||
max-width: 250px;
|
||||
font-family: sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
.tooltipDesc {
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
10
src/lib/scripts/checks/homeassistant.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export async function checkHA()/*: Promise<string>*/ {
|
||||
const url = "https://ha.fjla.uk"
|
||||
const data = await fetch(url)
|
||||
const text = await data.text()
|
||||
if ( data.status === 200 && text.includes("ha-launch-screen-info-box")) {
|
||||
return "OK"
|
||||
} else {
|
||||
return "Unavailable"
|
||||
}
|
||||
}
|
10
src/lib/scripts/checks/jellyfin.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export async function checkJellyfin()/*: Promise<string>*/ {
|
||||
const url = "https://jf.fjla.uk"
|
||||
const data = await fetch(url)
|
||||
const text = await data.text()
|
||||
if ( data.status === 200 && text.includes("<title>Jellyfin</title>")) {
|
||||
return "OK"
|
||||
} else {
|
||||
return "Unavailable"
|
||||
}
|
||||
}
|
10
src/lib/scripts/checks/nextcloud.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export async function checkNextcloud()/*: Promise<string>*/ {
|
||||
const url = "https://cloud.fjla.uk"
|
||||
const data = await fetch(url)
|
||||
const text = await data.text()
|
||||
if ( data.status === 200 && text.includes("Login")) {
|
||||
return "OK"
|
||||
} else {
|
||||
return "Unavailable"
|
||||
}
|
||||
}
|
10
src/lib/scripts/checks/owlboard.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export async function checkOwlBoard()/*: Promise<string>*/ {
|
||||
const url = "https://owlboard.info"
|
||||
const data = await fetch(url)
|
||||
const text = await data.text()
|
||||
if ( data.status === 200 && text.includes("Train Details & PIS")) {
|
||||
return "OK"
|
||||
} else {
|
||||
return "Unavailable"
|
||||
}
|
||||
}
|
10
src/lib/scripts/checks/traccar.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export async function checkTraccar()/*: Promise<string>*/ {
|
||||
const url = "https://traccar.fjla.uk"
|
||||
const data = await fetch(url)
|
||||
const text = await data.text()
|
||||
if ( data.status === 200 && text.includes("Traccar GPS Tracking System")) {
|
||||
return "OK"
|
||||
} else {
|
||||
return "Unavailable"
|
||||
}
|
||||
}
|