fix 500 on project/*

This commit is contained in:
b1ek 2023-03-17 20:53:27 +10:00
parent 64e780b7af
commit e4f08d0778
Signed by: blek
GPG Key ID: 14546221E3595D0C
4 changed files with 41 additions and 1 deletions

View File

@ -26,7 +26,8 @@ config = {
host: DB_HOSTNAME || config.host, host: DB_HOSTNAME || config.host,
define: { define: {
timestamps: false timestamps: false
} },
logging: false
}; };
/** @type Sequelize */ /** @type Sequelize */

View File

@ -0,0 +1,37 @@
import { Terminal } from 'xterm';
import { saveAs } from 'file-saver';
const fs = require('../fs');
/**
*
* @param { string[] } argv
* @param { Terminal } terminal
*/
module.exports = (argv, terminal) => {
if (argv.indexOf('--help') != -1) {
terminal.write(
`Usage: ${argv[0]} [DESTANATION]\n
Import files from your system to this filesystem.
`
);
return;
}
let el = document.getElementById('upload_file_btn');
if (el == null) {
el = document.createElement('input');
el.style.display = 'none';
el.type = 'file';
el.id = 'upload_file_btn';
el.setAttribute('multiple', 'multiple');
document.body.appendChild(el);
}
const dir = argv[1] || '.';
el.click();
let files = el.files;
global.f = files
}

View File

@ -8,6 +8,7 @@ let cmds = {
'mkdir': require('./mkdir'), 'mkdir': require('./mkdir'),
'wget': require('./wget'), 'wget': require('./wget'),
'export_file': require('./export_file'), 'export_file': require('./export_file'),
'import_file': require('./import_file'),
// alias l='ls -l' // alias l='ls -l'
'l': (a,t) => {require('./ls')([...a, '-l'], t)}, 'l': (a,t) => {require('./ls')([...a, '-l'], t)},

View File

@ -1,4 +1,5 @@
const handler = require('express-async-handler'); const handler = require('express-async-handler');
const Helpers = require('../helpers');
async function project(req, res) { async function project(req, res) {
res.template( res.template(