This commit is contained in:
MrFry 2019-10-26 10:21:30 +02:00
commit 19246d6931
14 changed files with 425 additions and 239 deletions

View file

@ -18,7 +18,7 @@
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
const siteUrl = 'https://qmining.frylabs.net' // http(s)//asd.basd let url = '' // http(s)//asd.basd
const express = require('express') const express = require('express')
const bodyParser = require('body-parser') const bodyParser = require('body-parser')
@ -49,7 +49,7 @@ app.use(bodyParser.json({
app.get('/', function (req, res) { app.get('/', function (req, res) {
res.render('main/main', { res.render('main/main', {
siteurl: siteUrl siteurl: url
}) })
}) })
@ -65,5 +65,8 @@ app.post('*', function (req, res) {
}) })
exports.app = app exports.app = app
exports.setup = (x) => {
url = x.url
}
logger.Log('Main module started', logger.GetColor('yellow')) logger.Log('Main module started', logger.GetColor('yellow'))

View file

@ -18,6 +18,7 @@
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
let url = ''
const express = require('express') const express = require('express')
const app = express() const app = express()
@ -26,17 +27,20 @@ const logger = require('../utils/logger.js')
// -------------------------------------------------------------- // --------------------------------------------------------------
app.get('/', function (req, res) { app.get('/', function (req, res) {
res.redirect('https://qmining.frylabs.net' + req.url) res.redirect(url + req.url)
}) })
app.get('*', function (req, res) { app.get('*', function (req, res) {
res.redirect('https://qmining.frylabs.net' + req.url) res.redirect(url + req.url)
}) })
app.post('*', function (req, res) { app.post('*', function (req, res) {
res.redirect('https://qmining.frylabs.net' + req.url) res.redirect(url + req.url)
}) })
exports.app = app exports.app = app
exports.setup = (x) => {
url = x.url
}
logger.Log('Old module started', logger.GetColor('yellow')) logger.Log('Old module started', logger.GetColor('yellow'))

View file

@ -18,7 +18,7 @@
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
const siteUrl = 'https://qmining.frylabs.net' // http(s)//asd.basd let url = ''
const express = require('express') const express = require('express')
const bodyParser = require('body-parser') const bodyParser = require('body-parser')
@ -59,7 +59,7 @@ app.get('/', function (req, res) {
// req.hostname // req.hostname
res.render('qmining/main', { res.render('qmining/main', {
siteurl: siteUrl, siteurl: url,
qa: actions.ProcessQA() qa: actions.ProcessQA()
}) })
res.end() res.end()
@ -82,7 +82,7 @@ app.get('/legacy', function (req, res) {
data: d, data: d,
scount: scount, scount: scount,
qcount: qcount, qcount: qcount,
siteurl: siteUrl siteurl: url
}) })
logger.LogReq(req) logger.LogReq(req)
@ -135,7 +135,13 @@ app.get('/greasy', function (req, res) {
}) })
app.get('/install', function (req, res) { app.get('/install', function (req, res) {
res.redirect(siteUrl + '/moodle-test-userscript/stable.user.js?install') res.redirect(url + '/moodle-test-userscript/stable.user.js?install')
res.end()
logger.LogReq(req)
})
app.get('/install', function (req, res) {
res.redirect(url + '/moodle-test-userscript/stable.user.js')
res.end() res.end()
logger.LogReq(req) logger.LogReq(req)
}) })
@ -206,5 +212,8 @@ app.post('*', function (req, res) {
}) })
exports.app = app exports.app = app
exports.setup = (x) => {
url = x.url
}
logger.Log('Qmining module started', logger.GetColor('yellow')) logger.Log('Qmining module started', logger.GetColor('yellow'))

View file

@ -23,6 +23,7 @@ const bodyParser = require('body-parser')
const busboy = require('connect-busboy') const busboy = require('connect-busboy')
const fs = require('fs') const fs = require('fs')
const app = express() const app = express()
let url = ''
const logger = require('../utils/logger.js') const logger = require('../utils/logger.js')
// const utils = require('../utils/utils.js') // const utils = require('../utils/utils.js')
@ -49,7 +50,8 @@ app.use(bodyParser.json({
// -------------------------------------------------------------- // --------------------------------------------------------------
app.get('/*', function (req, res) { app.get('/*', function (req, res) {
let curr = listedFiles + '/' + req.url.substring('/'.length, req.url.length).split('?')[0] let parsedUrl = req.url.replace(/%20/g, ' ')
let curr = listedFiles + '/' + parsedUrl.substring('/'.length, parsedUrl.length).split('?')[0]
let relPath = curr.substring('./public/files'.length, curr.length) let relPath = curr.substring('./public/files'.length, curr.length)
if (relPath[relPath.length - 1] !== '/') { relPath += '/' } if (relPath[relPath.length - 1] !== '/') { relPath += '/' }
@ -63,37 +65,45 @@ app.get('/*', function (req, res) {
logger.LogReq(req) logger.LogReq(req)
if (fs.lstatSync(curr).isDirectory()) { try {
if (curr[curr.length - 1] !== '/') { curr += '/' } if (fs.lstatSync(curr).isDirectory()) {
if (curr[curr.length - 1] !== '/') { curr += '/' }
let f = [] let f = []
fs.readdirSync(curr).forEach((item) => { fs.readdirSync(curr).forEach((item) => {
if (item[0] !== '.') { if (item[0] !== '.') {
let res = { name: item } let res = { name: item }
let stats = fs.statSync(curr + '/' + item) let stats = fs.statSync(curr + '/' + item)
let fileSizeInBytes = stats['size'] let fileSizeInBytes = stats['size']
res.size = Math.round(fileSizeInBytes / 1000000) res.size = Math.round(fileSizeInBytes / 1000000)
res.path = relPath res.path = relPath
if (res.path[res.path.length - 1] !== '/') { res.path += '/' } if (res.path[res.path.length - 1] !== '/') { res.path += '/' }
res.path += item res.path += item
res.mtime = stats['mtime'].toLocaleString() res.mtime = stats['mtime'].toLocaleString()
f.push(res) f.push(res)
} }
})
res.render('stuff/folders', {
folders: f,
dirname: relPath,
prevDir,
url
})
} else {
let fileStream = fs.createReadStream(curr)
fileStream.pipe(res)
}
} catch (e) {
res.render('stuff/nofile', {
missingFile: curr,
url
}) })
res.render('stuff/folders', {
folders: f,
dirname: relPath,
prevDir
})
} else {
let fileStream = fs.createReadStream(curr)
fileStream.pipe(res)
} }
}) })
@ -111,5 +121,8 @@ app.post('*', function (req, res) {
}) })
exports.app = app exports.app = app
exports.setup = (x) => {
url = x.url
}
logger.Log('Stuff module started', logger.GetColor('yellow')) logger.Log('Stuff module started', logger.GetColor('yellow'))

View file

@ -32,11 +32,69 @@ const https = require('https')
const stat = require('./utils/stat.js') const stat = require('./utils/stat.js')
stat.Load() stat.Load()
const qmining = require('./modules/qmining.js').app const loggableKeywords = [
const main = require('./modules/main.js').app 'user.js'
const sio = require('./modules/sio.js').app ]
const stuff = require('./modules/stuff.js').app let modules = {
const old = require('./modules/old.js').app qmining: {
path: './modules/qmining.js',
name: 'qmining',
urls: [ 'qmining.frylabs.net', 'localhost' ]
},
main: {
path: './modules/main.js',
name: 'main',
urls: [ 'frylabs.net', 'www.frylabs.net' ]
},
sio: {
path: './modules/sio.js',
name: 'sio',
urls: [ 'sio.frylabs.net' ]
},
stuff: {
path: './modules/stuff.js',
name: 'stuff',
urls: [ 'stuff.frylabs.net' ]
},
old: {
path: './modules/old.js',
name: 'old',
urls: [ 'qmining.tk', 'www.qmining.tk' ]
}
}
const app = express()
app.use(function (req, res, next) {
res.on('finish', function () {
logger.LogReq(req, true, res.statusCode)
let toLog = loggableKeywords.some((x) => {
return req.url.includes(x)
})
if (toLog) { logger.LogReq(req) }
if (res.statusCode !== 404) { stat.LogStat(req.url) }
})
next()
})
Object.keys(modules).forEach(function (k, i) {
let x = modules[k]
try {
let mod = require(x.path)
if (mod.setup) {
mod.setup({
url: 'http://' + x.urls[0] // TODO http https or neither
})
}
x.app = mod.app
x.urls.forEach((url) => {
app.use(vhost(url, x.app))
})
} catch (e) {
console.log(e)
}
})
const locLogFile = './stats/logs' const locLogFile = './stats/logs'
const allLogFile = '/nlogs/log' const allLogFile = '/nlogs/log'
@ -93,35 +151,6 @@ function setLogTimer () {
setLogTimer() setLogTimer()
const app = express()
const loggableKeywords = [
'user.js'
]
app.use(function (req, res, next) {
res.on('finish', function () {
logger.LogReq(req, true, res.statusCode)
let toLog = loggableKeywords.some((x) => {
return req.url.includes(x)
})
if (toLog) { logger.LogReq(req) }
if (res.statusCode !== 404) { stat.LogStat(req.url) }
})
next()
})
app.use(vhost('qmining.frylabs.net', qmining))
app.use(vhost('sio.frylabs.net', sio))
app.use(vhost('stuff.frylabs.net', stuff))
app.use(vhost('frylabs.net', main))
app.use(vhost('www.frylabs.net', main))
app.use(vhost('qmining.tk', old))
app.use(vhost('www.qmining.tk', old))
app.use(vhost('localhost', qmining))
logger.Log('Node version: ' + process.version) logger.Log('Node version: ' + process.version)
logger.Log('Listening on port: ' + port) logger.Log('Listening on port: ' + port)

View file

@ -1,121 +1,134 @@
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
Question Server Question Server
GitLab: <https://gitlab.com/MrFry/question-node-server> GitLab: <https://gitlab.com/MrFry/question-node-server>
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
module.exports = { module.exports = {
GetDateString: GetDateString, GetDateString: GetDateString,
Log: Log, Log: Log,
GetColor: GetColor, GetColor: GetColor,
LogReq: LogReq LogReq: LogReq
} }
const DELIM = C('green') + '|' + C() const DELIM = C('green') + '|' + C()
const utils = require('../utils/utils.js') const utils = require('../utils/utils.js')
const locLogFile = './stats/logs' const locLogFile = './stats/logs'
const logFile = '/nlogs/nlogs' const logFile = '/nlogs/nlogs'
const allLogFile = '/nlogs/log' const allLogFile = '/nlogs/log'
const colors = [ const colors = [
'red', 'green',
'green', 'red',
'yellow', 'yellow',
'blue', 'blue',
'magenta', 'magenta',
'cyan' 'cyan'
] ]
function GetDateString () { let noLogips = utils.ReadFile('./nolog').split('\n')
const m = new Date() setInterval(() => {
const d = m.getFullYear() + '/' + noLogips = utils.ReadFile('./nolog').split('\n')
('0' + (m.getMonth() + 1)).slice(-2) + '/' + }, 1000 * 60 * 30)
('0' + m.getDate()).slice(-2) + ' ' +
('0' + m.getHours()).slice(-2) + ':' + function GetDateString () {
('0' + m.getMinutes()).slice(-2) + ':' + const m = new Date()
('0' + m.getSeconds()).slice(-2) const d = m.getFullYear() + '/' +
return GetRandomColor(m.getHours().toString()) + d + C() ('0' + (m.getMonth() + 1)).slice(-2) + '/' +
} ('0' + m.getDate()).slice(-2) + ' ' +
('0' + m.getHours()).slice(-2) + ':' +
function Log (s, c) { ('0' + m.getMinutes()).slice(-2) + ':' +
let dl = DELIM + C(c) ('0' + m.getSeconds()).slice(-2)
let log = C(c) + GetDateString() + dl + s return GetRandomColor(m.getHours().toString()) + d + C()
}
console.log(log)
utils.AppendToFile(log, logFile) function Log (s, c) {
} let dl = DELIM + C(c)
let log = C(c) + GetDateString() + dl + s
function LogReq (req, toFile, sc) {
try { console.log(log)
let ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress utils.AppendToFile(log, logFile)
}
let logEntry = GetRandomColor(ip) + ip + C()
let dl = DELIM function LogReq (req, toFile, sc) {
if (req.url.includes('lred')) { try {
dl += C('red') let ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress
}
let nolog = noLogips.some((x) => {
logEntry += dl + req.hostname + dl + req.headers['user-agent'] + dl + req.method + dl return x.includes(ip)
})
logEntry += GetRandomColor(req.url.split('?')[0]) + req.url if (nolog) {
return
if (sc !== undefined && sc === 404) { logEntry += dl + sc } }
logEntry += C() let logEntry = GetRandomColor(ip) + ip + C()
if (!toFile) { let dl = DELIM
Log(logEntry) if (req.url.includes('lred')) {
} else { dl += C('red')
let defLogs = GetDateString() + dl + logEntry }
utils.AppendToFile(defLogs, locLogFile) const hostname = req.hostname.replace('www.', '').split('.')[0]
utils.AppendToFile(defLogs, allLogFile) logEntry += dl + hostname + dl + req.headers['user-agent'] + dl + req.method + dl
}
} catch (e) { logEntry += GetRandomColor(req.url.split('?')[0]) + req.url
console.log(e)
Log('Error at logging lol', GetColor('redbg'), true) if (sc !== undefined && sc === 404) { logEntry += dl + sc }
}
} logEntry += C()
if (!toFile) {
function GetRandomColor (ip) { Log(logEntry)
if (!ip) { } else {
return 'red' let defLogs = GetDateString() + dl + logEntry
}
utils.AppendToFile(defLogs, locLogFile)
let res = ip.split('').reduce((res, x) => { utils.AppendToFile(defLogs, allLogFile)
return res + x.charCodeAt(0) }
}, 0) } catch (e) {
return C(colors[res % colors.length]) console.log(e)
} Log('Error at logging lol', GetColor('redbg'), true)
}
function GetColor (c) { }
return c
} function GetRandomColor (ip) {
if (!ip) {
function C (c) { return 'red'
if (c !== undefined) { c = c.toLowerCase() } }
if (c === 'redbg') { return '\x1b[41m' } let res = ip.split('').reduce((res, x) => {
if (c === 'bluebg') { return '\x1b[44m' } return res + x.charCodeAt(0)
if (c === 'red') { return '\x1b[31m' } }, 0)
if (c === 'green') { return '\x1b[32m' } return C(colors[res % colors.length])
if (c === 'yellow') { return '\x1b[33m' } }
if (c === 'blue') { return '\x1b[34m' }
if (c === 'magenta') { return '\x1b[35m' } function GetColor (c) {
if (c === 'cyan') { return '\x1b[36m' } return c
return '\x1b[0m' }
}
function C (c) {
if (c !== undefined) { c = c.toLowerCase() }
if (c === 'redbg') { return '\x1b[41m' }
if (c === 'bluebg') { return '\x1b[44m' }
if (c === 'green') { return '\x1b[32m' }
if (c === 'red') { return '\x1b[31m' }
if (c === 'yellow') { return '\x1b[33m' }
if (c === 'blue') { return '\x1b[34m' }
if (c === 'magenta') { return '\x1b[35m' }
if (c === 'cyan') { return '\x1b[36m' }
return '\x1b[0m'
}

View file

@ -5,6 +5,7 @@
<head> <head>
<title>FryLabs.net</title> <title>FryLabs.net</title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.8" />
<style> <style>
body { body {
font: normal 14px Verdana; font: normal 14px Verdana;

View file

@ -5,6 +5,7 @@
<head> <head>
<title>All questions</title> <title>All questions</title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.8" />
<style> <style>
body { body {
font: normal 14px Verdana; font: normal 14px Verdana;
@ -79,7 +80,12 @@
<% include aludni.ejs %> <% include aludni.ejs %>
<% for (var i = 0; i < data.Subjects.length; i++) { %> <% for (var i = 0; i < data.Subjects.length; i++) { %>
<button class="collapsible"> <button
class="collapsible"
style='<%= i % 2 === 0 ? "background-color: #2f2f37" : "" %>'
onmouseenter='mouseEnter(this, <%= i %>)'
onmouseleave='mouseLeave(this, <%= i %>)'
>
<h2> <h2>
<table id=<%=i%>> <table id=<%=i%>>
<td> <td>
@ -90,41 +96,51 @@
</td> </td>
</table> </table>
</h2> </h2>
</button> </button>
<div class="content"> <div class="content">
<% var a = data.Subjects[i].toString().split('\n')%> <% var a = data.Subjects[i].toString().split('\n')%>
<% for (var j = 1; j < a.length; j++) { %> <% for (var j = 1; j < a.length; j++) { %>
<% if (a[j][0] == '?') { %> <% if (a[j][0] == '?') { %>
</br> </br>
<% } %> <% } %>
<%=a[j] %> <%=a[j] %>
</br> </br>
<% } %> <% } %>
</div> </div>
<% } %> <% } %>
<script> <script>
var coll = document.getElementsByClassName("collapsible"); var coll = document.getElementsByClassName("collapsible");
var i; var i;
for (i = 0; i < coll.length; i++) { for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() { coll[i].addEventListener("click", function() {
this.classList.toggle("active"); this.classList.toggle("active");
var content = this.nextElementSibling; var content = this.nextElementSibling;
if (content.style.display === "block") { if (content.style.display === "block") {
content.style.display = "none"; content.style.display = "none";
} else { } else {
content.style.display = "block"; content.style.display = "block";
}
});
}
function openall () {
var coll = document.getElementsByClassName("content");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].style.display = "block";
}
} }
</script> });
}
function openall () {
var coll = document.getElementsByClassName("content");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].style.display = "block";
}
}
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>
<% include b.ejs %> <% include b.ejs %>
</body> </body>
</html> </html>

View file

@ -5,6 +5,7 @@
<head> <head>
<title>All questions</title> <title>All questions</title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.8" />
<style> <style>
body { body {
font: normal 14px Verdana; font: normal 14px Verdana;

View file

@ -5,6 +5,7 @@
<head> <head>
<title>Question mining</title> <title>Question mining</title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.8" />
<style> <style>
body { body {
font: normal 14px Verdana; font: normal 14px Verdana;

View file

@ -5,6 +5,8 @@
<head> <head>
<title>Moodle/Elearning/KMOOC manual</title> <title>Moodle/Elearning/KMOOC manual</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.8" />
<style> <style>
body { body {
font: normal 17px Verdana; font: normal 17px Verdana;
@ -196,12 +198,11 @@
</li> </li>
</ul> </ul>
<hr> Jogosultságok: <hr> Jogosultságok:
</br>GM_openInTab: help megnyitása új lapon, GM_xmlhttpRequest: online adatbázishoz. </br>GM_openInTab: help megnyitása új lapon, GM_xmlhttpRequest: online adatbázishoz. GM_info: a
GM_getResourceText: a txt beolvasáshoz. Mást nem bír beolvasni, csak amit megadsz a @resouces scriptről információ, a verzióváltozás érzékeléséhez. GM_getValue/ GM_setValue: oldal
tagnál. GM_info: a scriptről információ, a verzióváltozás érzékeléséhez. GM_getValue/ bezárásakor megmaradó változók kezelése. Előző verzió tárolására, ugyanúgy verzióváltozás
GM_setValue: oldal bezárásakor megmaradó változók kezelése. Előző verzió tárolására, ugyanúgy érzékeléséhez, néhány beállítás, illetve hogy melyik tárgyakból keressen kérdéseket. Ezek
verzióváltozás érzékeléséhez, néhány beállítás, illetve hogy melyik tárgyakból keressen függvények, és a sciptben néhol meg vannak hívva, keresd meg.
kérdéseket. Ezek függvények, és a sciptben néhol meg vannak hívva, keresd meg.
</p> Elküldött adatok online módban: Minden teszt végén az összes kérdés, és rá a moodle szerint </p> Elküldött adatok online módban: Minden teszt végén az összes kérdés, és rá a moodle szerint
helyesnek vélt válaszok. Fogadott adatok: az összes eddig ismert moodle kérdés helyesnek vélt válaszok. Fogadott adatok: az összes eddig ismert moodle kérdés
<hr> <hr>

View file

@ -3,6 +3,8 @@
<body bgcolor="#212127"> <body bgcolor="#212127">
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=0.8" />
<meta charset="UTF-8">
<style> <style>
body { body {
font: normal 14px Verdana; font: normal 14px Verdana;

View file

@ -5,6 +5,7 @@
<head> <head>
<title><%=dirname%></title> <title><%=dirname%></title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.6" />
<style> <style>
body { body {
font: normal 14px Verdana; font: normal 14px Verdana;
@ -12,7 +13,12 @@
} }
td { td {
vertical-align: top vertical-align: top;
word-wrap: break-word;
word-break: break-all;
table-layout: fixed;
padding: 0 12;
vertical-align: middle;
} }
textarea { textarea {
@ -39,7 +45,6 @@
border: none !important; border: none !important;
} }
tr { tr {
line-height: 29px;
width:32%; width:32%;
} }
.butt { .butt {
@ -53,11 +58,6 @@
font-size: 13px; font-size: 13px;
} }
.active,
.butt:hover {
background-color: #555;
}
</style> </style>
</head> </head>
<center> <center>
@ -65,27 +65,32 @@
<%=dirname%> <%=dirname%>
</h1> </h1>
</center> </center>
<a href=<%= "http://stuff.frylabs.net" + prevDir%> > Up one level </a> <a href="<%= url + prevDir%>" > Up one level </a>
</p> </p>
<table class="maintable"> <table class="maintable">
<% for (var i = 0; i < folders.length; i++) { %> <% for (var i = 0; i < folders.length; i++) { %>
<tr> <tr>
<td> <td>
<button class="butt"> <button
class="butt"
onclick='itemClick("<%= "http://stuff.frylabs.net" + folders[i].path %>")'
style='<%= i % 2 === 0 ? "background-color: #2f2f37" : "" %>'
onmouseenter='mouseEnter(this, <%= i %>)'
onmouseleave='mouseLeave(this, <%= i %>)'
>
<table class="subtable"> <table class="subtable">
<tr height="62">
<td style='width:30%;'> <td style='width:30%;'>
<a href="<%= "http://stuff.frylabs.net" + folders[i].path%>"> <%=folders[i].name %> </a> <%=folders[i].name %>
</td>
<td style='width:30%;'>
<%=folders[i].path %>
</td> </td>
<td style='width:20%;'> <td style='width:20%;'>
<%=folders[i].mtime %> <%=folders[i].mtime %>
</td> </td>
<td style='width:10%;'> <td style='width:10%;'>
<%=folders[i].size %> MB <%= folders[i].size === 0 ? "Dir" : folders[i].size + 'MB' %>
</td> </td>
</tr>
</table> </table>
</button> </button>
</td> </td>
@ -93,4 +98,20 @@
<% } %> <% } %>
</table> </table>
</body> </body>
<script>
console.log('hi')
function itemClick (e) {
location.href = e
}
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> </html>

72
views/stuff/nofile.ejs Normal file
View file

@ -0,0 +1,72 @@
<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>
</h1>
</center>
</body>
</html>