diff --git a/src/core/config.py b/src/core/config.py index 745ffb7..9a54cfe 100644 --- a/src/core/config.py +++ b/src/core/config.py @@ -25,7 +25,7 @@ class Config(object): SECRET_KEY = secrets.token_hex(32) PERMANENT_SESSION_LIFETIME = timedelta(days = 7).total_seconds() - SQLALCHEMY_DATABASE_URI = "sqlite:///static/db/database.db" + SQLALCHEMY_DATABASE_URI = "sqlite:///static/db/webfm.db" SQLALCHEMY_TRACK_MODIFICATIONS = False LOGIN_PATH = "FLASK_LOGIN" # Value can be OIDC or FLASK_LOGIN diff --git a/src/core/routes/Routes.py b/src/core/routes/Routes.py index d329a11..7db690f 100644 --- a/src/core/routes/Routes.py +++ b/src/core/routes/Routes.py @@ -44,7 +44,7 @@ def home(): @app.route('/api/list-files/<_hash>', methods=['GET', 'POST']) -def listFilesRoute(_hash = None): +def listFiles(_hash = None): if request.method == 'POST': view = get_window_controller().get_window(1).get_view(0) dot_dots = view.get_dot_dots() @@ -78,7 +78,7 @@ def listFilesRoute(_hash = None): return msgHandler.createMessageJSON("danger", msg) @app.route('/api/file-manager-action/<_type>/<_hash>') -def file_manager_action(_type, _hash = None): +def fileManagerAction(_type, _hash = None): view = get_window_controller().get_window(1).get_view(0) if _type == "reset-path" and _hash == None: @@ -103,8 +103,8 @@ def file_manager_action(_type, _hash = None): return msgHandler.createMessageJSON("success", msg) -@app.route('/api/get-favorites', methods=['GET', 'POST']) -def getAllFavoritesRoute(): +@app.route('/api/list-favorites', methods=['GET', 'POST']) +def listFavorites(): if request.method == 'POST': list = db.session.query(Favorites).all() faves = [] @@ -121,7 +121,7 @@ def loadFavorite(_id): if request.method == 'POST': try: ID = int(_id) - fave = db.session.query(Favorites).filter_by(id=ID).first() + fave = db.session.query(Favorites).filter_by(id = ID).first() view = get_window_controller().get_window(1).get_view(0) view.set_path(fave.link) return '{"refresh": "true"}' @@ -135,7 +135,7 @@ def loadFavorite(_id): @app.route('/api/manage-favorites/<_action>', methods=['GET', 'POST']) -def manageFavoritesRoute(_action): +def manageFavorites(_action): if request.method == 'POST': ACTION = _action.strip() view = get_window_controller().get_window(1).get_view(0) @@ -146,7 +146,7 @@ def manageFavoritesRoute(_action): db.session.add(fave) msg = "Added to Favorites successfully..." else: - fave = db.session.query(Favorites).filter_by(link=path).first() + fave = db.session.query(Favorites).filter_by(link = path).first() db.session.delete(fave) msg = "Deleted from Favorites successfully..." diff --git a/src/core/static/js/ajax.js b/src/core/static/js/ajax.js index 87a4307..4c95d39 100644 --- a/src/core/static/js/ajax.js +++ b/src/core/static/js/ajax.js @@ -5,7 +5,7 @@ const listFilesAjax = async (hash) => { const getFavesAjax = async () => { const data = "empty=NULL"; - doAjax("api/get-favorites", data, "favorites"); + doAjax("api/list-favorites", data, "favorites"); } const loadFavoriteLink = async (id) => { diff --git a/src/core/static/js/libs/react/babel.js b/src/core/static/js/libs/react/babel.js new file mode 100644 index 0000000..c86b8bd --- /dev/null +++ b/src/core/static/js/libs/react/babel.js @@ -0,0 +1,61686 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["Babel"] = factory(); + else + root["Babel"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ((function(modules) { + // Check all modules for deduplicated modules + for(var i in modules) { + if(Object.prototype.hasOwnProperty.call(modules, i)) { + switch(typeof modules[i]) { + case "function": break; + case "object": + // Module can be created from a template + modules[i] = (function(_m) { + var args = _m.slice(1), fn = modules[_m[0]]; + return function (a,b,c) { + fn.apply(this, [a,b,c].concat(args)); + }; + }(modules[i])); + break; + default: + // Module is a copy of another module + modules[i] = modules[modules[i]]; + break; + } + } + } + return modules; +}([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.version = exports.buildExternalHelpers = exports.availablePresets = exports.availablePlugins = undefined; + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + exports.transform = transform; + exports.transformFromAst = transformFromAst; + exports.registerPlugin = registerPlugin; + exports.registerPlugins = registerPlugins; + exports.registerPreset = registerPreset; + exports.registerPresets = registerPresets; + exports.transformScriptTags = transformScriptTags; + exports.disableScriptTags = disableScriptTags; + + var _babelCore = __webpack_require__(290); + + var Babel = _interopRequireWildcard(_babelCore); + + var _transformScriptTags = __webpack_require__(629); + + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + + var isArray = Array.isArray || function (arg) { + return Object.prototype.toString.call(arg) === '[object Array]'; + }; + + /** + * Loads the given name (or [name, options] pair) from the given table object + * holding the available presets or plugins. + * + * Returns undefined if the preset or plugin is not available; passes through + * name unmodified if it (or the first element of the pair) is not a string. + */ + function loadBuiltin(builtinTable, name) { + if (isArray(name) && typeof name[0] === 'string') { + if (builtinTable.hasOwnProperty(name[0])) { + return [builtinTable[name[0]]].concat(name.slice(1)); + } + return; + } else if (typeof name === 'string') { + return builtinTable[name]; + } + // Could be an actual preset/plugin module + return name; + } + + /** + * Parses plugin names and presets from the specified options. + */ + function processOptions(options) { + // Parse preset names + var presets = (options.presets || []).map(function (presetName) { + var preset = loadBuiltin(availablePresets, presetName); + + if (preset) { + // workaround for babel issue + // at some point, babel copies the preset, losing the non-enumerable + // buildPreset key; convert it into an enumerable key. + if (isArray(preset) && _typeof(preset[0]) === 'object' && preset[0].hasOwnProperty('buildPreset')) { + preset[0] = _extends({}, preset[0], { buildPreset: preset[0].buildPreset }); + } + } else { + throw new Error('Invalid preset specified in Babel options: "' + presetName + '"'); + } + return preset; + }); + + // Parse plugin names + var plugins = (options.plugins || []).map(function (pluginName) { + var plugin = loadBuiltin(availablePlugins, pluginName); + + if (!plugin) { + throw new Error('Invalid plugin specified in Babel options: "' + pluginName + '"'); + } + return plugin; + }); + + return _extends({ + babelrc: false + }, options, { + presets: presets, + plugins: plugins + }); + } + + function transform(code, options) { + return Babel.transform(code, processOptions(options)); + } + + function transformFromAst(ast, code, options) { + return Babel.transformFromAst(ast, code, processOptions(options)); + } + var availablePlugins = exports.availablePlugins = {}; + var availablePresets = exports.availablePresets = {}; + var buildExternalHelpers = exports.buildExternalHelpers = Babel.buildExternalHelpers; + /** + * Registers a named plugin for use with Babel. + */ + function registerPlugin(name, plugin) { + if (availablePlugins.hasOwnProperty(name)) { + console.warn('A plugin named "' + name + '" is already registered, it will be overridden'); + } + availablePlugins[name] = plugin; + } + /** + * Registers multiple plugins for use with Babel. `newPlugins` should be an object where the key + * is the name of the plugin, and the value is the plugin itself. + */ + function registerPlugins(newPlugins) { + Object.keys(newPlugins).forEach(function (name) { + return registerPlugin(name, newPlugins[name]); + }); + } + + /** + * Registers a named preset for use with Babel. + */ + function registerPreset(name, preset) { + if (availablePresets.hasOwnProperty(name)) { + console.warn('A preset named "' + name + '" is already registered, it will be overridden'); + } + availablePresets[name] = preset; + } + /** + * Registers multiple presets for use with Babel. `newPresets` should be an object where the key + * is the name of the preset, and the value is the preset itself. + */ + function registerPresets(newPresets) { + Object.keys(newPresets).forEach(function (name) { + return registerPreset(name, newPresets[name]); + }); + } + + // All the plugins we should bundle + registerPlugins({ + 'check-es2015-constants': __webpack_require__(66), + 'external-helpers': __webpack_require__(322), + 'inline-replace-variables': __webpack_require__(323), + 'syntax-async-functions': __webpack_require__(67), + 'syntax-async-generators': __webpack_require__(195), + 'syntax-class-constructor-call': __webpack_require__(196), + 'syntax-class-properties': __webpack_require__(197), + 'syntax-decorators': __webpack_require__(125), + 'syntax-do-expressions': __webpack_require__(198), + 'syntax-exponentiation-operator': __webpack_require__(199), + 'syntax-export-extensions': __webpack_require__(200), + 'syntax-flow': __webpack_require__(126), + 'syntax-function-bind': __webpack_require__(201), + 'syntax-function-sent': __webpack_require__(325), + 'syntax-jsx': __webpack_require__(127), + 'syntax-object-rest-spread': __webpack_require__(202), + 'syntax-trailing-function-commas': __webpack_require__(128), + 'transform-async-functions': __webpack_require__(326), + 'transform-async-to-generator': __webpack_require__(129), + 'transform-async-to-module-method': __webpack_require__(328), + 'transform-class-constructor-call': __webpack_require__(203), + 'transform-class-properties': __webpack_require__(204), + 'transform-decorators': __webpack_require__(205), + 'transform-decorators-legacy': __webpack_require__(329).default, // <- No clue. Nope. + 'transform-do-expressions': __webpack_require__(206), + 'transform-es2015-arrow-functions': __webpack_require__(68), + 'transform-es2015-block-scoped-functions': __webpack_require__(69), + 'transform-es2015-block-scoping': __webpack_require__(70), + 'transform-es2015-classes': __webpack_require__(71), + 'transform-es2015-computed-properties': __webpack_require__(72), + 'transform-es2015-destructuring': __webpack_require__(73), + 'transform-es2015-duplicate-keys': __webpack_require__(130), + 'transform-es2015-for-of': __webpack_require__(74), + 'transform-es2015-function-name': __webpack_require__(75), + 'transform-es2015-instanceof': __webpack_require__(332), + 'transform-es2015-literals': __webpack_require__(76), + 'transform-es2015-modules-amd': __webpack_require__(131), + 'transform-es2015-modules-commonjs': __webpack_require__(77), + 'transform-es2015-modules-systemjs': __webpack_require__(208), + 'transform-es2015-modules-umd': __webpack_require__(209), + 'transform-es2015-object-super': __webpack_require__(78), + 'transform-es2015-parameters': __webpack_require__(79), + 'transform-es2015-shorthand-properties': __webpack_require__(80), + 'transform-es2015-spread': __webpack_require__(81), + 'transform-es2015-sticky-regex': __webpack_require__(82), + 'transform-es2015-template-literals': __webpack_require__(83), + 'transform-es2015-typeof-symbol': __webpack_require__(84), + 'transform-es2015-unicode-regex': __webpack_require__(85), + 'transform-es3-member-expression-literals': __webpack_require__(336), + 'transform-es3-property-literals': __webpack_require__(337), + 'transform-es5-property-mutators': __webpack_require__(338), + 'transform-eval': __webpack_require__(339), + 'transform-exponentiation-operator': __webpack_require__(132), + 'transform-export-extensions': __webpack_require__(210), + 'transform-flow-comments': __webpack_require__(340), + 'transform-flow-strip-types': __webpack_require__(211), + 'transform-function-bind': __webpack_require__(212), + 'transform-jscript': __webpack_require__(341), + 'transform-object-assign': __webpack_require__(342), + 'transform-object-rest-spread': __webpack_require__(213), + 'transform-object-set-prototype-of-to-assign': __webpack_require__(343), + 'transform-proto-to-assign': __webpack_require__(344), + 'transform-react-constant-elements': __webpack_require__(345), + 'transform-react-display-name': __webpack_require__(214), + 'transform-react-inline-elements': __webpack_require__(346), + 'transform-react-jsx': __webpack_require__(215), + 'transform-react-jsx-compat': __webpack_require__(347), + 'transform-react-jsx-self': __webpack_require__(349), + 'transform-react-jsx-source': __webpack_require__(350), + 'transform-regenerator': __webpack_require__(86), + 'transform-runtime': __webpack_require__(353), + 'transform-strict-mode': __webpack_require__(216), + 'undeclared-variables-check': __webpack_require__(354) + }); + + // All the presets we should bundle + registerPresets({ + es2015: __webpack_require__(217), + es2016: __webpack_require__(218), + es2017: __webpack_require__(219), + latest: __webpack_require__(356), + react: __webpack_require__(357), + 'stage-0': __webpack_require__(358), + 'stage-1': __webpack_require__(220), + 'stage-2': __webpack_require__(221), + 'stage-3': __webpack_require__(222), + + // ES2015 preset with es2015-modules-commonjs removed + // Plugin list copied from babel-preset-es2015/index.js + 'es2015-no-commonjs': { + plugins: [__webpack_require__(83), __webpack_require__(76), __webpack_require__(75), __webpack_require__(68), __webpack_require__(69), __webpack_require__(71), __webpack_require__(78), __webpack_require__(80), __webpack_require__(72), __webpack_require__(74), __webpack_require__(82), __webpack_require__(85), __webpack_require__(66), __webpack_require__(81), __webpack_require__(79), __webpack_require__(73), __webpack_require__(70), __webpack_require__(84), [__webpack_require__(86), { async: false, asyncGenerators: false }]] + }, + + // ES2015 preset with plugins set to loose mode. + // Based off https://github.com/bkonkle/babel-preset-es2015-loose/blob/master/index.js + 'es2015-loose': { + plugins: [[__webpack_require__(83), { loose: true }], __webpack_require__(76), __webpack_require__(75), __webpack_require__(68), __webpack_require__(69), [__webpack_require__(71), { loose: true }], __webpack_require__(78), __webpack_require__(80), __webpack_require__(130), [__webpack_require__(72), { loose: true }], [__webpack_require__(74), { loose: true }], __webpack_require__(82), __webpack_require__(85), __webpack_require__(66), [__webpack_require__(81), { loose: true }], __webpack_require__(79), [__webpack_require__(73), { loose: true }], __webpack_require__(70), __webpack_require__(84), [__webpack_require__(77), { loose: true }], [__webpack_require__(86), { async: false, asyncGenerators: false }]] + } + }); + + var version = exports.version = ("6.26.0"); + + // Listen for load event if we're in a browser and then kick off finding and + // running of scripts with "text/babel" type. + if (typeof window !== 'undefined' && window && window.addEventListener) { + window.addEventListener('DOMContentLoaded', function () { + return transformScriptTags(); + }, false); + } + + /** + * Transform + {% block body_scripts_additional %} diff --git a/src/core/templates/pages/index.html b/src/core/templates/pages/index.html index d0791a7..8184a25 100644 --- a/src/core/templates/pages/index.html +++ b/src/core/templates/pages/index.html @@ -14,8 +14,8 @@ {% endblock body_header_additional %} {% block body_content_additional %} -
-
+
+
{% endblock body_content_additional %} {% block body_footer_additional %} @@ -23,7 +23,7 @@ {% block body_scripts_additional %} - +