-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·224 lines (219 loc) · 9.45 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<?
const services={
account: service_require("server/account/account.new"),
minecraftServer: service_require("web/minecraftServerInfo/minecraftServerInfo"),
musikPlayer: service_require("server/currently-playing/musikPlayer"),
projects: service_require("server/projects/projects"),
spotify: service_require("server/currently-playing/spotify"),
storage: service_require("server/serverStorage/serverStorage"),
};
const {
randomIndex,
jsonStringify,
importHead,
overflowRemove,
}=globals.functions;;
const hostname=require("os").hostname();
const isDev=hostname!=="lff-raspberrypi";
const {allowed,data}=services.account.authUserByInput(input);
?><!DOCTYPE html>
<!--IndexHtml update at 23.12.2022 at 23:32-->
<html>
<head>
<?=importHead({
input,
title:"Landos Webseite!",
css:[
"/css/main.css",
"/css/dynamic.css?imports=red,green,underLineHOVER,cursorPOINTER",
"/web/indexHtml/style.css",
],
script:[],
botIndex: !isDev,
})?>
<link rel=canonical href=https://lff.one>
<meta name=author content="Lando Fernandez-Falk">
<meta name=description content="Lando Fernandez-Falk seine Webseite!">
<meta name=keywords content="HTML, JavaScript, Programm, LFF5644, LFF, Tostedt, Hamburg, Lando, 5644, Lando5644, Lando Fernandez-Falk, lando.fernandez-falk, Lando Fernandez Falk">
<meta property=og:type content=website>
<meta property=og:url content=https://lff.one>
<meta property=og:site_name content="Landos Website">
</head>
<body>
<h1>
Landos Webseite
<span class=green title=Copyright>©</span>
<span class=red title="Hier wird immer das jzige Jahr drin stehen!"><?=new Date().getFullYear()?></span>
</h1>
<p>
<span class=green>Bot</span>: <?
let msg="<span title=\"zu der zeit fält mir nichts ein!\">Hallo!</span>"
const date=new Date();
const hour=date.getHours();
const hours=services.storage.readStorage("botMsgs_hours");
const msgObject=hours.find(item=>
(
item.from<=hour&&
item.to>=hour
)||
(
item.allowed?
item.allowed:
[]
)
.includes(hour)
);
if(msgObject){
const index=randomIndex(msgObject.msgs.length-1);
msg=msgObject.msgs[index];
}
?><?=msg?>
</p>
<p>
<span class="underLineHOVER cursorPOINTER" onclick="location.href='/account'">Account</span>:
<a href=/account><?=allowed?data.account.nickname:"Nicht Angemeldet!"?></a>
<i style="font-size: 90%;"><?=allowed?"Für infos klicken":"Zum Anmelden / Registrieren klicken"?></i>
</p>
<?let spotifyInfo="";spotify:{
if(!services.spotify.infos){break spotify;}
const {
playing,
track:{
name,
imgs,
mp3,
url,
},
}=services.spotify.infos;
if(!playing){break spotify;}
spotifyInfo=`
<p>
<span class="underLineHOVER cursorPOINTER" onclick="location.href='/currently-playing#spotify'" title="Was Ich jz grade auf Spotify höre!">Spotify</span>
:
${imgs.length>0?`<img class=cursorPOINTER alt=songIcon src="${imgs[2].url}" onclick="location.href='${imgs[1].url}'" height=20 align=top> `:""}
${mp3?`
<audio id="audio_spotify" src="${mp3}" autobuffer></audio>
<img align=top height=20 class=cursorPOINTER src="/files/img/playBTN.png" onclick="spotify_audioToggle(this,document.getElementById('audio_spotify'))">
`:""}
<a ${url?`onclick="return confirm('ACHTUNG! Weiterleitung auf Spotify!\\n\\n${url}\\n\\nVoller Songname: '+this.title);" href="${url}"`:`onclick="alert('Song ohne link!\\n\\nVoller Songname: '+this.title)"`} title="${name}">${overflowRemove(name,20)}</a>
</p>
`.split("\t").join("").split("\n").join("")+"\n";
}?><?=spotifyInfo?><?let musikPlayerInfo=""; {
const currentlyPlaying=services.musikPlayer.currentlyPlaying;
if(currentlyPlaying&¤tlyPlaying.isPlaying){
musikPlayerInfo=`
<p>
<span class="underLineHOVER cursorPOINTER" title="Wiedergabe ${isDev?'auf':'im'} ${isDev?hostname:'Radio'}" onclick="location.href='/currently-playing#musikPlayer'">MusikPlayer</span>
:
<${currentlyPlaying.track.album?`a title="Album: ${currentlyPlaying.track.album}${currentlyPlaying.track.discNumber?` CD: ${currentlyPlaying.track.discNumber}`:""} Track: ${currentlyPlaying.track.name}${currentlyPlaying.track.trackNumber?` Title Nummer: ${currentlyPlaying.track.trackNumber}`:""}" href="https://google.com/search?q=${escape(currentlyPlaying.track.album+": "+currentlyPlaying.track.name)}"`:`span title="Track: ${currentlyPlaying.track.name}`}>
<span>${overflowRemove(currentlyPlaying.track.name,20)}</span>
</${currentlyPlaying.track.album?"a":"span"}>
</p>
`.split("\n").join("").split("\t").join("");
}
}?><?=musikPlayerInfo?>
<p class=hidden id=battery></p>
<?spotifyInfo:{
let html="";
if(
!services.minecraftServer.serviceRunning||
services.minecraftServer.status
.filter(item=>
item.socketOnline&&
item.running&&
item.players.length>0
)
.length===0
) break spotifyInfo;
const servers=services.minecraftServer.status
.filter(item=>
item.socketOnline&&
item.running&&
item.players.length>0
);
const onlinePlayers=servers
.map(item=>item.players.length)
.filter(item=>item!==0)
.reduce((x,y)=>x+y)
html=(`
<p>
<span
class="underLineHOVER cursorPOINTER"
onclick="location.href='/minecraftServerInfo'"
title="Zur Server Übersicht!"
>
Minecraft-Server
</span>
: <b>${onlinePlayers}</b> Spieler ${onlinePlayers===1?"ist":"sind"} Aktiv
</p>
`)
.split("\t").join("")
.split("\n").join("")
?><?="\n\t\t"+html+"\n"?><?
}?>
<h2>Links</h2>
<p><li><a href=/serverInfo>Server-Auslastung /-Infomationen</a></li></p>
<p><li><a href=/ls onclick="return confirm('Warnung: Datei-Explorer ist derzeit \'Verbuggt\' und daher Abgeschaltet!\n\nTrozdem Öffnen?');">Datei-Explorer</a></li></p>
<p><li><a href=/home>Meine Browser-Homepage</a></li></p>
<p><li><a href=/ls#/z onclick="return confirm('Warnung: Datei-Explorer ist derzeit \'Verbuggt\' und daher Abgeschaltet!\n\nTrozdem Öffnen?');">Andere-Sachen</a></li></p>
<p><li><a href=//dev.lff.one onclick="return confirm('Warnung: Entwicklungsserver Offline! Entwicklungsstand ist in echtzeit auf der Hauptwebseite!\n\nTrozdem Öffnen?');">Developer/Programmierer/Entwickler-Stand</a></li></p>
<h2>Projekte</h2><?
const projects=services.projects.getProjects();
const whatShow=input.projects_show;
?>
<table border=<?=input.tableBorder==="0"||!input.tableBorder?"0":"1px"?>>
<tr>
<th>Projekt</th>
<th class="ProjectVersion<?=whatShow==='ProjectVersion'||whatShow==='all'||!whatShow?'':' hidden'?>">Version</th>
<th class="ProjectVersionTag<?=whatShow==='ProjectVersionTag'||whatShow==='all'?'':' hidden'?>">Versions-Tag</th>
<th class="ProjectGitRepo<?=whatShow==='ProjectGitRepo'||whatShow==='all'?'':' hidden'?>">GitHub</th>
</tr>
<?
const tabs="\t\t\t\t";
const tabs_parens="\t\t\t";
let project;
for(project of projects){
if(project.adminsOnly) continue;
let html="";
html+=`${tabs_parens}<tr>\n`;
html+=`${tabs}<td><a${project.old?` onclick="return oldProject();"`:""} class=${project.old?'"project old"':"project"} href="/${project.id}"${project.info?` title="${project.info}"`:""}>${project.name}</a></td>\n`;
if(whatShow==='ProjectVersion'||whatShow==='all'||!whatShow){html+=`${tabs}<td>${project.version}</td>\n`;}
if(project.versionTag){
const color=project.versionTagColor;
if(whatShow==='ProjectVersionTag'||whatShow==='all'){html+=`${tabs}<td${color?` style="color:${color}"`:""}>${project.versionTag}</td>\n`};
}else{
if(whatShow==='ProjectVersionTag'||whatShow==='all'){html+=`${tabs}<td></td>\n`;}
}
if(project.git){
const gitHubUrl="https://github.com/"+project.git;
if(whatShow==='ProjectGitRepo'||whatShow==='all'){html+=`${tabs}<td><a href="${gitHubUrl}">${project.git.split("/")[1]}</a></td>\n`;}
}else{
if(whatShow==='ProjectGitRepo'||whatShow==='all'){html+=`${tabs}<td></td>\n`;}
}
html+=`${tabs_parens}</tr>\n`;
?><?=html?><? // Write 'html' into the html file!
}
?> </table>
<div style="max-width: 250px;">
<fieldset>
<legend>Einstellungen</legend>
<form id=form_settings method=post>
<p><label><input<?=whatShow==='ProjectVersion'||!whatShow?' checked':''?> type=radio value=ProjectVersion name=projects_show> Versionen anzeigen</label></p>
<p><label><input<?=whatShow==='ProjectVersionTag'?' checked':''?> type=radio value=ProjectVersionTag name=projects_show> Versions-Tag anzeigen</label></p>
<p><label><input<?=whatShow==='ProjectGitRepo'?' checked':''?> type=radio value=ProjectGitRepo name=projects_show> GitHub-Links anzeigen</label></p>
<p><label><input<?=whatShow==='0'?' checked':''?> type=radio value=0 name=projects_show> Nur Projekte anzeigen</label></p>
<p><label><input<?=whatShow==='all'?' checked':''?> type=radio value=all name=projects_show> Alle anzeigen</label></p>
<p><label><input<?=input.tableBorder==='0'||!input.tableBorder?'':' checked'?> type=checkbox value=1 name=tableBorder> Rahmen anzeigen</label></p>
<p><button form=form_settings>Übernehmen</button> <button form="" onclick="location.href='/';">Reset</button></p>
</form>
</fieldset>
<?
if(allowed&&data.account.username==="l3p3"){
console.log(data.account);
?><h1>Werbung</h1><p><a href=//l3p3.de>L3P3.de</a></p><?
}
?>
</div>
<script src=/web/indexHtml/app.js></script>
</body>
</html>