mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
File rearrange 2
This commit is contained in:
parent
5530f03fac
commit
55d7885d21
20 changed files with 1775 additions and 0 deletions
39
modules/stuff/views/audio.ejs
Executable file
39
modules/stuff/views/audio.ejs
Executable file
|
@ -0,0 +1,39 @@
|
|||
|
||||
<html>
|
||||
|
||||
<body bgcolor="#212127">
|
||||
|
||||
<head>
|
||||
<title><%= fname %></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.6" />
|
||||
<style>
|
||||
body {
|
||||
font: normal 14px Verdana;
|
||||
color: #999999;
|
||||
}
|
||||
video {
|
||||
width: 100%
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<center>
|
||||
<h2>
|
||||
<%= fname %>
|
||||
</h2>
|
||||
<img
|
||||
id="coverArt"
|
||||
style="width:auto; max-height: 100%;"
|
||||
src="<%= url + albumArt %>"
|
||||
alt=' '
|
||||
/>
|
||||
<audio id="audioPlayer" controls style="width:100%">
|
||||
<source src="<%= url %><%= path %>?stream=true" type=<%= contentType %>>
|
||||
</audio>
|
||||
</center>
|
||||
</body>
|
||||
<script>
|
||||
console.log('a')
|
||||
document.getElementById('coverArt').style.height = window.innerHeight - 140
|
||||
</script>
|
||||
</html>
|
130
modules/stuff/views/folders.ejs
Executable file
130
modules/stuff/views/folders.ejs
Executable file
|
@ -0,0 +1,130 @@
|
|||
<html>
|
||||
|
||||
<body bgcolor="#212127">
|
||||
|
||||
<head>
|
||||
<title><%=dirname%></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.6" />
|
||||
<style>
|
||||
body {
|
||||
font: normal 14px Verdana;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
td {
|
||||
vertical-align: top;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
table-layout: fixed;
|
||||
padding: 0 12;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
textarea {
|
||||
font: normal 14px Verdana;
|
||||
color: #999999;
|
||||
background-color: #212127;
|
||||
width: 100%;
|
||||
height: 700;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #9999ff;
|
||||
}
|
||||
.subtable {
|
||||
border-collapse: collapse;
|
||||
table-layout:fixed;
|
||||
width:100%
|
||||
}
|
||||
.maintable {
|
||||
border-collapse: collapse;
|
||||
table-layout:fixed;
|
||||
width:100%
|
||||
padding:0; margin:0;
|
||||
border: none !important;
|
||||
}
|
||||
tr {
|
||||
width:32%;
|
||||
}
|
||||
.butt {
|
||||
background-color: #212127;
|
||||
color: #999999;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
border: none;
|
||||
text-align: left;
|
||||
outline: none;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<center>
|
||||
<h1>
|
||||
<%=dirname%>
|
||||
</h1>
|
||||
</center>
|
||||
<h2>
|
||||
<a href="<%= url + prevDir%>" > Up one level </a>
|
||||
</h2>
|
||||
</p>
|
||||
|
||||
<table class="maintable">
|
||||
<% for (var i = 0; i < folders.length; i++) { %>
|
||||
<tr>
|
||||
<td>
|
||||
<a
|
||||
href="<%= url + folders[i].path %>"
|
||||
style="font-size: 0px"
|
||||
>
|
||||
<button
|
||||
class="butt"
|
||||
style='<%= i % 2 === 0 ? "background-color: #2f2f37" : "" %>'
|
||||
onmouseenter='mouseEnter(this, <%= i %>)'
|
||||
onmouseleave='mouseLeave(this, <%= i %>)'
|
||||
>
|
||||
<table class="subtable">
|
||||
<tr height="62">
|
||||
<td style='width:30%;'>
|
||||
<%=folders[i].name %>
|
||||
</td>
|
||||
<td style='width:20%;'>
|
||||
<%=folders[i].mtime %>
|
||||
</td>
|
||||
<td style='width:10%;'>
|
||||
<%
|
||||
if (folders[i].isDir) {
|
||||
%> <%= "DIR" %> <%
|
||||
} else {
|
||||
if (folders[i].size === 0) {
|
||||
%> <%= "~0 MB" %> <%
|
||||
} else {
|
||||
%> <%= folders[i].size + ' MB' %> <%
|
||||
}
|
||||
}
|
||||
%>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</button>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<% } %>
|
||||
</table>
|
||||
</body>
|
||||
<script>
|
||||
console.log('hi')
|
||||
function mouseEnter (e, i) {
|
||||
e.style.backgroundColor = "#555"
|
||||
}
|
||||
function mouseLeave (e, i) {
|
||||
if (i % 2 == 0) {
|
||||
e.style.backgroundColor = "#2f2f37"
|
||||
} else {
|
||||
e.style.backgroundColor = "#212127"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</html>
|
94
modules/stuff/views/nofile.ejs
Executable file
94
modules/stuff/views/nofile.ejs
Executable file
|
@ -0,0 +1,94 @@
|
|||
<html>
|
||||
|
||||
<body bgcolor="#212127">
|
||||
|
||||
<head>
|
||||
<title>No such file/folder</title>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
body {
|
||||
font: normal 14px Verdana;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
td {
|
||||
vertical-align: top
|
||||
}
|
||||
|
||||
textarea {
|
||||
font: normal 14px Verdana;
|
||||
color: #999999;
|
||||
background-color: #212127;
|
||||
width: 100%;
|
||||
height: 700;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #9999ff;
|
||||
}
|
||||
.subtable {
|
||||
border-collapse: collapse;
|
||||
table-layout:fixed;
|
||||
width:100%
|
||||
}
|
||||
.maintable {
|
||||
border-collapse: collapse;
|
||||
table-layout:fixed;
|
||||
width:100%
|
||||
padding:0; margin:0;
|
||||
border: none !important;
|
||||
}
|
||||
tr {
|
||||
line-height: 29px;
|
||||
width:32%;
|
||||
}
|
||||
.butt {
|
||||
background-color: #212127;
|
||||
color: #999999;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
border: none;
|
||||
text-align: left;
|
||||
outline: none;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.active,
|
||||
.butt:hover {
|
||||
background-color: #555;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<center>
|
||||
<h1>
|
||||
No such file / folder:
|
||||
</br>
|
||||
<%= missingFile %>
|
||||
</br>
|
||||
<a href="<%= url %>" > Back to root </a>
|
||||
</br>
|
||||
<a
|
||||
onclick='goBack("<%=missingFile%>")'
|
||||
href="#"
|
||||
>
|
||||
Go back
|
||||
</a>
|
||||
</h1>
|
||||
</center>
|
||||
</body>
|
||||
<script>
|
||||
function goBack(path) {
|
||||
path = path.replace('./public/files', '')
|
||||
if (path[path.length - 1] == '/') {
|
||||
path = path.substring(0, path.length -2)
|
||||
}
|
||||
let p = path.split('/')
|
||||
p.pop()
|
||||
if (p.length > 1) {
|
||||
location.href = p.join('/')
|
||||
} else {
|
||||
location.href = '/'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</html>
|
34
modules/stuff/views/video.ejs
Executable file
34
modules/stuff/views/video.ejs
Executable file
|
@ -0,0 +1,34 @@
|
|||
<html>
|
||||
|
||||
<body bgcolor="#212127">
|
||||
|
||||
<head>
|
||||
<title><%= fname %></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.6" />
|
||||
<style>
|
||||
body {
|
||||
font: normal 14px Verdana;
|
||||
color: #999999;
|
||||
}
|
||||
video {
|
||||
width: 100%
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<center>
|
||||
<h2>
|
||||
<%= fname %>
|
||||
</h2>
|
||||
</center>
|
||||
<video id="videoPlayer" controls>
|
||||
<source src="<%= url %><%= path %>?stream=true" type="video/mp4">
|
||||
</video>
|
||||
</body>
|
||||
<script>
|
||||
var v = document.getElementsByTagName('video')[0]
|
||||
v.style.maxHeight = window.innerHeight - 100
|
||||
v.maxWidth = window.innerWidth
|
||||
console.log('a')
|
||||
</script>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue