Initial resources kit.
18
.editorconfig
Normal file
@ -0,0 +1,18 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
[docker-compose.yml]
|
||||
indent_size = 4
|
17
.gitattributes
vendored
@ -1,8 +1,11 @@
|
||||
* text=auto
|
||||
*.css linguist-vendored
|
||||
*.scss linguist-vendored
|
||||
*.js linguist-vendored
|
||||
* text=auto eol=lf
|
||||
|
||||
*.blade.php diff=html
|
||||
*.css diff=css
|
||||
*.html diff=html
|
||||
*.md diff=markdown
|
||||
*.php diff=php
|
||||
|
||||
/.github export-ignore
|
||||
CHANGELOG.md export-ignore
|
||||
/tests export-ignore
|
||||
/phpunit.xml export-ignore
|
||||
/.ci export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
2
artisan
@ -11,7 +11,7 @@ define('LARAVEL_START', microtime(true));
|
||||
| Composer provides a convenient, automatically generated class loader
|
||||
| for our application. We just need to utilize it! We'll require it
|
||||
| into the script here so that we do not have to worry about the
|
||||
| loading of any our classes "manually". Feels great to relax.
|
||||
| loading of any of our classes manually. It's great to relax.
|
||||
|
|
||||
*/
|
||||
|
||||
|
@ -31,7 +31,7 @@ return [
|
||||
| framework when an event needs to be broadcast. You may set this to
|
||||
| any of the connections defined in the "connections" array below.
|
||||
|
|
||||
| Supported: "pusher", "redis", "log", "null"
|
||||
| Supported: "pusher", "ably", "redis", "log", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
@ -51,17 +51,30 @@ return [
|
||||
'connections' => [
|
||||
|
||||
'pusher' => [
|
||||
'driver' => 'pusher',
|
||||
'key' => env('PUSHER_APP_KEY'),
|
||||
'secret' => env('PUSHER_APP_SECRET'),
|
||||
'app_id' => env('PUSHER_APP_ID'),
|
||||
'driver' => 'pusher',
|
||||
'key' => env('PUSHER_APP_KEY'),
|
||||
'secret' => env('PUSHER_APP_SECRET'),
|
||||
'app_id' => env('PUSHER_APP_ID'),
|
||||
'options' => [
|
||||
//
|
||||
'cluster' => env('PUSHER_APP_CLUSTER'),
|
||||
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
|
||||
'port' => env('PUSHER_PORT', 443),
|
||||
'scheme' => env('PUSHER_SCHEME', 'https'),
|
||||
'encrypted' => true,
|
||||
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
|
||||
],
|
||||
'client_options' => [
|
||||
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
|
||||
],
|
||||
],
|
||||
|
||||
'ably' => [
|
||||
'driver' => 'ably',
|
||||
'key' => env('ABLY_KEY'),
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'driver' => 'redis',
|
||||
'connection' => 'default',
|
||||
],
|
||||
|
||||
|
34
config/cors.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cross-Origin Resource Sharing (CORS) Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure your settings for cross-origin resource sharing
|
||||
| or "CORS". This determines what cross-origin operations may execute
|
||||
| in web browsers. You are free to adjust these settings as needed.
|
||||
|
|
||||
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
||||
|
|
||||
*/
|
||||
|
||||
'paths' => ['api/*', 'sanctum/csrf-cookie'],
|
||||
|
||||
'allowed_methods' => ['*'],
|
||||
|
||||
'allowed_origins' => ['*'],
|
||||
|
||||
'allowed_origins_patterns' => ['*'],
|
||||
|
||||
'allowed_headers' => ['*'],
|
||||
|
||||
'exposed_headers' => [],
|
||||
|
||||
'max_age' => 0,
|
||||
|
||||
'supports_credentials' => false,
|
||||
|
||||
];
|
@ -1,28 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* hashing.php
|
||||
* Copyright (c) 2019 james@firefly-iii.org.
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Hash Driver
|
||||
@ -32,10 +11,42 @@ return [
|
||||
| passwords for your application. By default, the bcrypt algorithm is
|
||||
| used; however, you remain free to modify this option if you wish.
|
||||
|
|
||||
| Supported: "bcrypt", "argon"
|
||||
| Supported: "bcrypt", "argon", "argon2id"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'bcrypt',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bcrypt Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the configuration options that should be used when
|
||||
| passwords are hashed using the Bcrypt algorithm. This will allow you
|
||||
| to control the amount of time it takes to hash the given password.
|
||||
|
|
||||
*/
|
||||
|
||||
'bcrypt' => [
|
||||
'rounds' => env('BCRYPT_ROUNDS', 10),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Argon Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the configuration options that should be used when
|
||||
| passwords are hashed using the Argon algorithm. These will allow you
|
||||
| to control the amount of time it takes to hash the given password.
|
||||
|
|
||||
*/
|
||||
|
||||
'argon' => [
|
||||
'memory' => 65536,
|
||||
'threads' => 1,
|
||||
'time' => 4,
|
||||
],
|
||||
|
||||
];
|
||||
|
1073
package-lock.json
generated
Normal file
33
package.json
@ -1,31 +1,16 @@
|
||||
{
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"development": "mix",
|
||||
"watch": "mix watch",
|
||||
"watch-poll": "mix watch -- --watch-options-poll=1000",
|
||||
"hot": "mix watch --hot",
|
||||
"production": "mix --production",
|
||||
"prod": "mix --production"
|
||||
},
|
||||
"dependencies": {
|
||||
"date-fns": "^2.30.0",
|
||||
"stream-browserify": "^3.0.0"
|
||||
"dev": "vite",
|
||||
"build": "vite build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@johmun/vue-tags-input": "^2",
|
||||
"@vue/compiler-sfc": "^3.3.4",
|
||||
"axios": "^1.3",
|
||||
"bootstrap-sass": "^3",
|
||||
"cross-env": "^7.0",
|
||||
"font-awesome": "^4.7.0",
|
||||
"jquery": "^3",
|
||||
"laravel-mix": "^6.0",
|
||||
"postcss": "^8.4",
|
||||
"uiv": "^1.4",
|
||||
"vue": "^2.7",
|
||||
"vue-i18n": "^8",
|
||||
"vue-loader": "^15",
|
||||
"vue-template-compiler": "^2.7"
|
||||
"axios": "^1.1.2",
|
||||
"laravel-vite-plugin": "^0.7.5",
|
||||
"vite": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"alpinejs": "^3.12.3"
|
||||
}
|
||||
}
|
||||
|
BIN
public/v4/assets/img/AdminLTEFullLogo.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
public/v4/assets/img/AdminLTELogo.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
public/v4/assets/img/avatar.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
public/v4/assets/img/avatar2.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
public/v4/assets/img/avatar3.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
public/v4/assets/img/avatar4.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
public/v4/assets/img/avatar5.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
public/v4/assets/img/boxed-bg.jpg
Normal file
After Width: | Height: | Size: 121 KiB |
BIN
public/v4/assets/img/boxed-bg.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
public/v4/assets/img/credit/american-express.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
public/v4/assets/img/credit/cirrus.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
public/v4/assets/img/credit/mastercard.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
public/v4/assets/img/credit/paypal.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
public/v4/assets/img/credit/paypal2.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
public/v4/assets/img/credit/visa.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
public/v4/assets/img/default-150x150.png
Normal file
After Width: | Height: | Size: 339 B |
BIN
public/v4/assets/img/icons.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
public/v4/assets/img/photo1.png
Normal file
After Width: | Height: | Size: 647 KiB |
BIN
public/v4/assets/img/photo2.png
Normal file
After Width: | Height: | Size: 413 KiB |
BIN
public/v4/assets/img/photo3.jpg
Normal file
After Width: | Height: | Size: 362 KiB |
BIN
public/v4/assets/img/photo4.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
public/v4/assets/img/prod-1.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
public/v4/assets/img/prod-2.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
public/v4/assets/img/prod-3.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
public/v4/assets/img/prod-4.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
public/v4/assets/img/prod-5.jpg
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
public/v4/assets/img/user1-128x128.jpg
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
public/v4/assets/img/user2-160x160.jpg
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
public/v4/assets/img/user3-128x128.jpg
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
public/v4/assets/img/user4-128x128.jpg
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
public/v4/assets/img/user5-128x128.jpg
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
public/v4/assets/img/user6-128x128.jpg
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
public/v4/assets/img/user7-128x128.jpg
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
public/v4/assets/img/user8-128x128.jpg
Normal file
After Width: | Height: | Size: 4.9 KiB |
15329
public/v4/css/adminlte.css
Normal file
1
public/v4/css/adminlte.css.map
Normal file
7
public/v4/css/adminlte.min.css
vendored
Normal file
1
public/v4/css/adminlte.min.css.map
Normal file
15293
public/v4/css/adminlte.rtl.css
Normal file
1
public/v4/css/adminlte.rtl.css.map
Normal file
7
public/v4/css/adminlte.rtl.min.css
vendored
Normal file
1
public/v4/css/adminlte.rtl.min.css.map
Normal file
613
public/v4/js/adminlte.js
Normal file
@ -0,0 +1,613 @@
|
||||
/*!
|
||||
* AdminLTE v4.0.0-alpha2 (https://adminlte.io)
|
||||
* Copyright 2014-2023 Colorlib <https://colorlib.com>
|
||||
* Licensed under MIT (https://github.com/ColorlibHQ/AdminLTE/blob/master/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.adminlte = {}));
|
||||
})(this, (function (exports) { 'use strict';
|
||||
|
||||
const domContentLoadedCallbacks = [];
|
||||
const onDOMContentLoaded = (callback) => {
|
||||
if (document.readyState === 'loading') {
|
||||
// add listener on the first call when the document is in loading state
|
||||
if (!domContentLoadedCallbacks.length) {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
for (const callback of domContentLoadedCallbacks) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
domContentLoadedCallbacks.push(callback);
|
||||
}
|
||||
else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
/* SLIDE UP */
|
||||
const slideUp = (target, duration = 500) => {
|
||||
target.style.transitionProperty = 'height, margin, padding';
|
||||
target.style.transitionDuration = `${duration}ms`;
|
||||
target.style.boxSizing = 'border-box';
|
||||
target.style.height = `${target.offsetHeight}px`;
|
||||
target.style.overflow = 'hidden';
|
||||
window.setTimeout(() => {
|
||||
target.style.height = '0';
|
||||
target.style.paddingTop = '0';
|
||||
target.style.paddingBottom = '0';
|
||||
target.style.marginTop = '0';
|
||||
target.style.marginBottom = '0';
|
||||
}, 1);
|
||||
window.setTimeout(() => {
|
||||
target.style.display = 'none';
|
||||
target.style.removeProperty('height');
|
||||
target.style.removeProperty('padding-top');
|
||||
target.style.removeProperty('padding-bottom');
|
||||
target.style.removeProperty('margin-top');
|
||||
target.style.removeProperty('margin-bottom');
|
||||
target.style.removeProperty('overflow');
|
||||
target.style.removeProperty('transition-duration');
|
||||
target.style.removeProperty('transition-property');
|
||||
}, duration);
|
||||
};
|
||||
/* SLIDE DOWN */
|
||||
const slideDown = (target, duration = 500) => {
|
||||
target.style.removeProperty('display');
|
||||
let { display } = window.getComputedStyle(target);
|
||||
if (display === 'none') {
|
||||
display = 'block';
|
||||
}
|
||||
target.style.display = display;
|
||||
const height = target.offsetHeight;
|
||||
target.style.overflow = 'hidden';
|
||||
target.style.height = '0';
|
||||
target.style.paddingTop = '0';
|
||||
target.style.paddingBottom = '0';
|
||||
target.style.marginTop = '0';
|
||||
target.style.marginBottom = '0';
|
||||
window.setTimeout(() => {
|
||||
target.style.boxSizing = 'border-box';
|
||||
target.style.transitionProperty = 'height, margin, padding';
|
||||
target.style.transitionDuration = `${duration}ms`;
|
||||
target.style.height = `${height}px`;
|
||||
target.style.removeProperty('padding-top');
|
||||
target.style.removeProperty('padding-bottom');
|
||||
target.style.removeProperty('margin-top');
|
||||
target.style.removeProperty('margin-bottom');
|
||||
}, 1);
|
||||
window.setTimeout(() => {
|
||||
target.style.removeProperty('height');
|
||||
target.style.removeProperty('overflow');
|
||||
target.style.removeProperty('transition-duration');
|
||||
target.style.removeProperty('transition-property');
|
||||
}, duration);
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------
|
||||
* AdminLTE layout.ts
|
||||
* License MIT
|
||||
* --------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
const CLASS_NAME_HOLD_TRANSITIONS = 'hold-transition';
|
||||
const CLASS_NAME_APP_LOADED = 'app-loaded';
|
||||
/**
|
||||
* Class Definition
|
||||
* ====================================================
|
||||
*/
|
||||
class Layout {
|
||||
constructor(element) {
|
||||
this._element = element;
|
||||
}
|
||||
holdTransition() {
|
||||
let resizeTimer;
|
||||
window.addEventListener('resize', () => {
|
||||
document.body.classList.add(CLASS_NAME_HOLD_TRANSITIONS);
|
||||
clearTimeout(resizeTimer);
|
||||
resizeTimer = setTimeout(() => {
|
||||
document.body.classList.remove(CLASS_NAME_HOLD_TRANSITIONS);
|
||||
}, 400);
|
||||
});
|
||||
}
|
||||
}
|
||||
onDOMContentLoaded(() => {
|
||||
const data = new Layout(document.body);
|
||||
data.holdTransition();
|
||||
setTimeout(() => {
|
||||
document.body.classList.add(CLASS_NAME_APP_LOADED);
|
||||
}, 400);
|
||||
});
|
||||
|
||||
/**
|
||||
* --------------------------------------------
|
||||
* AdminLTE push-menu.ts
|
||||
* License MIT
|
||||
* --------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
const DATA_KEY$3 = 'lte.push-menu';
|
||||
const EVENT_KEY$3 = `.${DATA_KEY$3}`;
|
||||
const EVENT_OPEN = `open${EVENT_KEY$3}`;
|
||||
const EVENT_COLLAPSE = `collapse${EVENT_KEY$3}`;
|
||||
const CLASS_NAME_SIDEBAR_MINI = 'sidebar-mini';
|
||||
const CLASS_NAME_SIDEBAR_COLLAPSE = 'sidebar-collapse';
|
||||
const CLASS_NAME_SIDEBAR_OPEN = 'sidebar-open';
|
||||
const CLASS_NAME_SIDEBAR_EXPAND = 'sidebar-expand';
|
||||
const CLASS_NAME_SIDEBAR_OVERLAY = 'sidebar-overlay';
|
||||
const CLASS_NAME_MENU_OPEN$1 = 'menu-open';
|
||||
const SELECTOR_APP_SIDEBAR = '.app-sidebar';
|
||||
const SELECTOR_SIDEBAR_MENU = '.sidebar-menu';
|
||||
const SELECTOR_NAV_ITEM$1 = '.nav-item';
|
||||
const SELECTOR_NAV_TREEVIEW = '.nav-treeview';
|
||||
const SELECTOR_APP_WRAPPER = '.app-wrapper';
|
||||
const SELECTOR_SIDEBAR_EXPAND = `[class*="${CLASS_NAME_SIDEBAR_EXPAND}"]`;
|
||||
const SELECTOR_SIDEBAR_TOGGLE = '[data-lte-toggle="sidebar"]';
|
||||
const Defaults = {
|
||||
sidebarBreakpoint: 992
|
||||
};
|
||||
/**
|
||||
* Class Definition
|
||||
* ====================================================
|
||||
*/
|
||||
class PushMenu {
|
||||
constructor(element, config) {
|
||||
this._element = element;
|
||||
this._config = Object.assign(Object.assign({}, Defaults), config);
|
||||
}
|
||||
// TODO
|
||||
menusClose() {
|
||||
const navTreeview = document.querySelectorAll(SELECTOR_NAV_TREEVIEW);
|
||||
navTreeview.forEach(navTree => {
|
||||
navTree.style.removeProperty('display');
|
||||
navTree.style.removeProperty('height');
|
||||
});
|
||||
const navSidebar = document.querySelector(SELECTOR_SIDEBAR_MENU);
|
||||
const navItem = navSidebar === null || navSidebar === void 0 ? void 0 : navSidebar.querySelectorAll(SELECTOR_NAV_ITEM$1);
|
||||
if (navItem) {
|
||||
navItem.forEach(navI => {
|
||||
navI.classList.remove(CLASS_NAME_MENU_OPEN$1);
|
||||
});
|
||||
}
|
||||
}
|
||||
expand() {
|
||||
const event = new Event(EVENT_OPEN);
|
||||
document.body.classList.remove(CLASS_NAME_SIDEBAR_COLLAPSE);
|
||||
document.body.classList.add(CLASS_NAME_SIDEBAR_OPEN);
|
||||
this._element.dispatchEvent(event);
|
||||
}
|
||||
collapse() {
|
||||
const event = new Event(EVENT_COLLAPSE);
|
||||
document.body.classList.remove(CLASS_NAME_SIDEBAR_OPEN);
|
||||
document.body.classList.add(CLASS_NAME_SIDEBAR_COLLAPSE);
|
||||
this._element.dispatchEvent(event);
|
||||
}
|
||||
addSidebarBreakPoint() {
|
||||
var _a, _b, _c;
|
||||
const sidebarExpandList = (_b = (_a = document.querySelector(SELECTOR_SIDEBAR_EXPAND)) === null || _a === void 0 ? void 0 : _a.classList) !== null && _b !== void 0 ? _b : [];
|
||||
const sidebarExpand = (_c = Array.from(sidebarExpandList).find(className => className.startsWith(CLASS_NAME_SIDEBAR_EXPAND))) !== null && _c !== void 0 ? _c : '';
|
||||
const sidebar = document.getElementsByClassName(sidebarExpand)[0];
|
||||
const sidebarContent = window.getComputedStyle(sidebar, '::before').getPropertyValue('content');
|
||||
this._config = Object.assign(Object.assign({}, this._config), { sidebarBreakpoint: Number(sidebarContent.replace(/[^\d.-]/g, '')) });
|
||||
if (window.innerWidth <= this._config.sidebarBreakpoint) {
|
||||
this.collapse();
|
||||
}
|
||||
else {
|
||||
if (!document.body.classList.contains(CLASS_NAME_SIDEBAR_MINI)) {
|
||||
this.expand();
|
||||
}
|
||||
if (document.body.classList.contains(CLASS_NAME_SIDEBAR_MINI) && document.body.classList.contains(CLASS_NAME_SIDEBAR_COLLAPSE)) {
|
||||
this.collapse();
|
||||
}
|
||||
}
|
||||
}
|
||||
toggle() {
|
||||
if (document.body.classList.contains(CLASS_NAME_SIDEBAR_COLLAPSE)) {
|
||||
this.expand();
|
||||
}
|
||||
else {
|
||||
this.collapse();
|
||||
}
|
||||
}
|
||||
init() {
|
||||
this.addSidebarBreakPoint();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
onDOMContentLoaded(() => {
|
||||
var _a;
|
||||
const sidebar = document === null || document === void 0 ? void 0 : document.querySelector(SELECTOR_APP_SIDEBAR);
|
||||
if (sidebar) {
|
||||
const data = new PushMenu(sidebar, Defaults);
|
||||
data.init();
|
||||
window.addEventListener('resize', () => {
|
||||
data.init();
|
||||
});
|
||||
}
|
||||
const sidebarOverlay = document.createElement('div');
|
||||
sidebarOverlay.className = CLASS_NAME_SIDEBAR_OVERLAY;
|
||||
(_a = document.querySelector(SELECTOR_APP_WRAPPER)) === null || _a === void 0 ? void 0 : _a.append(sidebarOverlay);
|
||||
sidebarOverlay.addEventListener('touchstart', event => {
|
||||
event.preventDefault();
|
||||
const target = event.currentTarget;
|
||||
const data = new PushMenu(target, Defaults);
|
||||
data.collapse();
|
||||
});
|
||||
sidebarOverlay.addEventListener('click', event => {
|
||||
event.preventDefault();
|
||||
const target = event.currentTarget;
|
||||
const data = new PushMenu(target, Defaults);
|
||||
data.collapse();
|
||||
});
|
||||
const fullBtn = document.querySelectorAll(SELECTOR_SIDEBAR_TOGGLE);
|
||||
fullBtn.forEach(btn => {
|
||||
btn.addEventListener('click', event => {
|
||||
event.preventDefault();
|
||||
let button = event.currentTarget;
|
||||
if ((button === null || button === void 0 ? void 0 : button.dataset.lteToggle) !== 'sidebar') {
|
||||
button = button === null || button === void 0 ? void 0 : button.closest(SELECTOR_SIDEBAR_TOGGLE);
|
||||
}
|
||||
if (button) {
|
||||
event === null || event === void 0 ? void 0 : event.preventDefault();
|
||||
const data = new PushMenu(button, Defaults);
|
||||
data.toggle();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* --------------------------------------------
|
||||
* AdminLTE treeview.ts
|
||||
* License MIT
|
||||
* --------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
// const NAME = 'Treeview'
|
||||
const DATA_KEY$2 = 'lte.treeview';
|
||||
const EVENT_KEY$2 = `.${DATA_KEY$2}`;
|
||||
const EVENT_EXPANDED$2 = `expanded${EVENT_KEY$2}`;
|
||||
const EVENT_COLLAPSED$2 = `collapsed${EVENT_KEY$2}`;
|
||||
// const EVENT_LOAD_DATA_API = `load${EVENT_KEY}`
|
||||
const CLASS_NAME_MENU_OPEN = 'menu-open';
|
||||
const SELECTOR_NAV_ITEM = '.nav-item';
|
||||
const SELECTOR_NAV_LINK = '.nav-link';
|
||||
const SELECTOR_TREEVIEW_MENU = '.nav-treeview';
|
||||
const SELECTOR_DATA_TOGGLE$1 = '[data-lte-toggle="treeview"]';
|
||||
const Default$1 = {
|
||||
animationSpeed: 300
|
||||
};
|
||||
/**
|
||||
* Class Definition
|
||||
* ====================================================
|
||||
*/
|
||||
class Treeview {
|
||||
constructor(element, config) {
|
||||
this._element = element;
|
||||
this._config = Object.assign(Object.assign({}, Default$1), config);
|
||||
}
|
||||
open() {
|
||||
var _a;
|
||||
const event = new Event(EVENT_EXPANDED$2);
|
||||
this._element.classList.add(CLASS_NAME_MENU_OPEN);
|
||||
const childElement = (_a = this._element) === null || _a === void 0 ? void 0 : _a.querySelector(SELECTOR_TREEVIEW_MENU);
|
||||
if (childElement) {
|
||||
slideDown(childElement, this._config.animationSpeed);
|
||||
}
|
||||
this._element.dispatchEvent(event);
|
||||
}
|
||||
close() {
|
||||
var _a;
|
||||
const event = new Event(EVENT_COLLAPSED$2);
|
||||
this._element.classList.remove(CLASS_NAME_MENU_OPEN);
|
||||
const childElement = (_a = this._element) === null || _a === void 0 ? void 0 : _a.querySelector(SELECTOR_TREEVIEW_MENU);
|
||||
if (childElement) {
|
||||
slideUp(childElement, this._config.animationSpeed);
|
||||
}
|
||||
this._element.dispatchEvent(event);
|
||||
}
|
||||
toggle() {
|
||||
if (this._element.classList.contains(CLASS_NAME_MENU_OPEN)) {
|
||||
this.close();
|
||||
}
|
||||
else {
|
||||
this.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
onDOMContentLoaded(() => {
|
||||
const button = document.querySelectorAll(SELECTOR_DATA_TOGGLE$1);
|
||||
button.forEach(btn => {
|
||||
btn.addEventListener('click', event => {
|
||||
const target = event.target;
|
||||
const targetItem = target.closest(SELECTOR_NAV_ITEM);
|
||||
const targetLink = target.closest(SELECTOR_NAV_LINK);
|
||||
if ((target === null || target === void 0 ? void 0 : target.getAttribute('href')) === '#' || (targetLink === null || targetLink === void 0 ? void 0 : targetLink.getAttribute('href')) === '#') {
|
||||
event.preventDefault();
|
||||
}
|
||||
if (targetItem) {
|
||||
const data = new Treeview(targetItem, Default$1);
|
||||
data.toggle();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* --------------------------------------------
|
||||
* AdminLTE direct-chat.ts
|
||||
* License MIT
|
||||
* --------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* Constants
|
||||
* ====================================================
|
||||
*/
|
||||
const DATA_KEY$1 = 'lte.direct-chat';
|
||||
const EVENT_KEY$1 = `.${DATA_KEY$1}`;
|
||||
const EVENT_EXPANDED$1 = `expanded${EVENT_KEY$1}`;
|
||||
const EVENT_COLLAPSED$1 = `collapsed${EVENT_KEY$1}`;
|
||||
const SELECTOR_DATA_TOGGLE = '[data-lte-toggle="chat-pane"]';
|
||||
const SELECTOR_DIRECT_CHAT = '.direct-chat';
|
||||
const CLASS_NAME_DIRECT_CHAT_OPEN = 'direct-chat-contacts-open';
|
||||
/**
|
||||
* Class Definition
|
||||
* ====================================================
|
||||
*/
|
||||
class DirectChat {
|
||||
constructor(element) {
|
||||
this._element = element;
|
||||
}
|
||||
toggle() {
|
||||
if (this._element.classList.contains(CLASS_NAME_DIRECT_CHAT_OPEN)) {
|
||||
const event = new Event(EVENT_COLLAPSED$1);
|
||||
this._element.classList.remove(CLASS_NAME_DIRECT_CHAT_OPEN);
|
||||
this._element.dispatchEvent(event);
|
||||
}
|
||||
else {
|
||||
const event = new Event(EVENT_EXPANDED$1);
|
||||
this._element.classList.add(CLASS_NAME_DIRECT_CHAT_OPEN);
|
||||
this._element.dispatchEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* Data Api implementation
|
||||
* ====================================================
|
||||
*/
|
||||
onDOMContentLoaded(() => {
|
||||
const button = document.querySelectorAll(SELECTOR_DATA_TOGGLE);
|
||||
button.forEach(btn => {
|
||||
btn.addEventListener('click', event => {
|
||||
event.preventDefault();
|
||||
const target = event.target;
|
||||
const chatPane = target.closest(SELECTOR_DIRECT_CHAT);
|
||||
if (chatPane) {
|
||||
const data = new DirectChat(chatPane);
|
||||
data.toggle();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* --------------------------------------------
|
||||
* AdminLTE card-widget.ts
|
||||
* License MIT
|
||||
* --------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* Constants
|
||||
* ====================================================
|
||||
*/
|
||||
const DATA_KEY = 'lte.card-widget';
|
||||
const EVENT_KEY = `.${DATA_KEY}`;
|
||||
const EVENT_COLLAPSED = `collapsed${EVENT_KEY}`;
|
||||
const EVENT_EXPANDED = `expanded${EVENT_KEY}`;
|
||||
const EVENT_REMOVE = `remove${EVENT_KEY}`;
|
||||
const EVENT_MAXIMIZED = `maximized${EVENT_KEY}`;
|
||||
const EVENT_MINIMIZED = `minimized${EVENT_KEY}`;
|
||||
const CLASS_NAME_CARD = 'card';
|
||||
const CLASS_NAME_COLLAPSED = 'collapsed-card';
|
||||
const CLASS_NAME_COLLAPSING = 'collapsing-card';
|
||||
const CLASS_NAME_EXPANDING = 'expanding-card';
|
||||
const CLASS_NAME_WAS_COLLAPSED = 'was-collapsed';
|
||||
const CLASS_NAME_MAXIMIZED = 'maximized-card';
|
||||
const SELECTOR_DATA_REMOVE = '[data-lte-toggle="card-remove"]';
|
||||
const SELECTOR_DATA_COLLAPSE = '[data-lte-toggle="card-collapse"]';
|
||||
const SELECTOR_DATA_MAXIMIZE = '[data-lte-toggle="card-maximize"]';
|
||||
const SELECTOR_CARD = `.${CLASS_NAME_CARD}`;
|
||||
const SELECTOR_CARD_BODY = '.card-body';
|
||||
const SELECTOR_CARD_FOOTER = '.card-footer';
|
||||
const Default = {
|
||||
animationSpeed: 500,
|
||||
collapseTrigger: SELECTOR_DATA_COLLAPSE,
|
||||
removeTrigger: SELECTOR_DATA_REMOVE,
|
||||
maximizeTrigger: SELECTOR_DATA_MAXIMIZE
|
||||
};
|
||||
class CardWidget {
|
||||
constructor(element, config) {
|
||||
this._element = element;
|
||||
this._parent = element.closest(SELECTOR_CARD);
|
||||
if (element.classList.contains(CLASS_NAME_CARD)) {
|
||||
this._parent = element;
|
||||
}
|
||||
this._config = Object.assign(Object.assign({}, Default), config);
|
||||
}
|
||||
collapse() {
|
||||
var _a, _b;
|
||||
const event = new Event(EVENT_COLLAPSED);
|
||||
if (this._parent) {
|
||||
this._parent.classList.add(CLASS_NAME_COLLAPSING);
|
||||
const elm = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.querySelectorAll(`${SELECTOR_CARD_BODY}, ${SELECTOR_CARD_FOOTER}`);
|
||||
elm.forEach(el => {
|
||||
if (el instanceof HTMLElement) {
|
||||
slideUp(el, this._config.animationSpeed);
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
if (this._parent) {
|
||||
this._parent.classList.add(CLASS_NAME_COLLAPSED);
|
||||
this._parent.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
}
|
||||
}, this._config.animationSpeed);
|
||||
}
|
||||
(_b = this._element) === null || _b === void 0 ? void 0 : _b.dispatchEvent(event);
|
||||
}
|
||||
expand() {
|
||||
var _a, _b;
|
||||
const event = new Event(EVENT_EXPANDED);
|
||||
if (this._parent) {
|
||||
this._parent.classList.add(CLASS_NAME_EXPANDING);
|
||||
const elm = (_a = this._parent) === null || _a === void 0 ? void 0 : _a.querySelectorAll(`${SELECTOR_CARD_BODY}, ${SELECTOR_CARD_FOOTER}`);
|
||||
elm.forEach(el => {
|
||||
if (el instanceof HTMLElement) {
|
||||
slideDown(el, this._config.animationSpeed);
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
if (this._parent) {
|
||||
this._parent.classList.remove(CLASS_NAME_COLLAPSED);
|
||||
this._parent.classList.remove(CLASS_NAME_EXPANDING);
|
||||
}
|
||||
}, this._config.animationSpeed);
|
||||
}
|
||||
(_b = this._element) === null || _b === void 0 ? void 0 : _b.dispatchEvent(event);
|
||||
}
|
||||
remove() {
|
||||
var _a;
|
||||
const event = new Event(EVENT_REMOVE);
|
||||
if (this._parent) {
|
||||
slideUp(this._parent, this._config.animationSpeed);
|
||||
}
|
||||
(_a = this._element) === null || _a === void 0 ? void 0 : _a.dispatchEvent(event);
|
||||
}
|
||||
toggle() {
|
||||
var _a;
|
||||
if ((_a = this._parent) === null || _a === void 0 ? void 0 : _a.classList.contains(CLASS_NAME_COLLAPSED)) {
|
||||
this.expand();
|
||||
return;
|
||||
}
|
||||
this.collapse();
|
||||
}
|
||||
maximize() {
|
||||
var _a;
|
||||
const event = new Event(EVENT_MAXIMIZED);
|
||||
if (this._parent) {
|
||||
this._parent.style.height = `${this._parent.offsetHeight}px`;
|
||||
this._parent.style.width = `${this._parent.offsetWidth}px`;
|
||||
this._parent.style.transition = 'all .15s';
|
||||
setTimeout(() => {
|
||||
const htmlTag = document.querySelector('html');
|
||||
if (htmlTag) {
|
||||
htmlTag.classList.add(CLASS_NAME_MAXIMIZED);
|
||||
}
|
||||
if (this._parent) {
|
||||
this._parent.classList.add(CLASS_NAME_MAXIMIZED);
|
||||
if (this._parent.classList.contains(CLASS_NAME_COLLAPSED)) {
|
||||
this._parent.classList.add(CLASS_NAME_WAS_COLLAPSED);
|
||||
}
|
||||
}
|
||||
}, 150);
|
||||
}
|
||||
(_a = this._element) === null || _a === void 0 ? void 0 : _a.dispatchEvent(event);
|
||||
}
|
||||
minimize() {
|
||||
var _a;
|
||||
const event = new Event(EVENT_MINIMIZED);
|
||||
if (this._parent) {
|
||||
this._parent.style.height = 'auto';
|
||||
this._parent.style.width = 'auto';
|
||||
this._parent.style.transition = 'all .15s';
|
||||
setTimeout(() => {
|
||||
var _a;
|
||||
const htmlTag = document.querySelector('html');
|
||||
if (htmlTag) {
|
||||
htmlTag.classList.remove(CLASS_NAME_MAXIMIZED);
|
||||
}
|
||||
if (this._parent) {
|
||||
this._parent.classList.remove(CLASS_NAME_MAXIMIZED);
|
||||
if ((_a = this._parent) === null || _a === void 0 ? void 0 : _a.classList.contains(CLASS_NAME_WAS_COLLAPSED)) {
|
||||
this._parent.classList.remove(CLASS_NAME_WAS_COLLAPSED);
|
||||
}
|
||||
}
|
||||
}, 10);
|
||||
}
|
||||
(_a = this._element) === null || _a === void 0 ? void 0 : _a.dispatchEvent(event);
|
||||
}
|
||||
toggleMaximize() {
|
||||
var _a;
|
||||
if ((_a = this._parent) === null || _a === void 0 ? void 0 : _a.classList.contains(CLASS_NAME_MAXIMIZED)) {
|
||||
this.minimize();
|
||||
return;
|
||||
}
|
||||
this.maximize();
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* Data Api implementation
|
||||
* ====================================================
|
||||
*/
|
||||
onDOMContentLoaded(() => {
|
||||
const collapseBtn = document.querySelectorAll(SELECTOR_DATA_COLLAPSE);
|
||||
collapseBtn.forEach(btn => {
|
||||
btn.addEventListener('click', event => {
|
||||
event.preventDefault();
|
||||
const target = event.target;
|
||||
const data = new CardWidget(target, Default);
|
||||
data.toggle();
|
||||
});
|
||||
});
|
||||
const removeBtn = document.querySelectorAll(SELECTOR_DATA_REMOVE);
|
||||
removeBtn.forEach(btn => {
|
||||
btn.addEventListener('click', event => {
|
||||
event.preventDefault();
|
||||
const target = event.target;
|
||||
const data = new CardWidget(target, Default);
|
||||
data.remove();
|
||||
});
|
||||
});
|
||||
const maxBtn = document.querySelectorAll(SELECTOR_DATA_MAXIMIZE);
|
||||
maxBtn.forEach(btn => {
|
||||
btn.addEventListener('click', event => {
|
||||
event.preventDefault();
|
||||
const target = event.target;
|
||||
const data = new CardWidget(target, Default);
|
||||
data.toggleMaximize();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
exports.CardWidget = CardWidget;
|
||||
exports.DirectChat = DirectChat;
|
||||
exports.Layout = Layout;
|
||||
exports.PushMenu = PushMenu;
|
||||
exports.Treeview = Treeview;
|
||||
|
||||
}));
|
||||
//# sourceMappingURL=adminlte.js.map
|
1
public/v4/js/adminlte.js.map
Normal file
7
public/v4/js/adminlte.min.js
vendored
Normal file
1
public/v4/js/adminlte.min.js.map
Normal file
31
resources/assets/v4/api/preferences/index.js
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* basic.js
|
||||
* Copyright (c) 2021 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {api} from "boot/axios";
|
||||
|
||||
export default class Preferences {
|
||||
getByName(name) {
|
||||
return api.get('/api/v1/preferences/' + name);
|
||||
}
|
||||
|
||||
postByName(name, value) {
|
||||
return api.post('/api/v1/preferences', {name: name, data: value});
|
||||
}
|
||||
}
|
15
resources/assets/v4/app.js
Normal file
@ -0,0 +1,15 @@
|
||||
import './bootstrap';
|
||||
//import {onDOMContentLoaded} from "./util/index.js";
|
||||
|
||||
|
||||
|
||||
|
||||
//alert('hallo');
|
||||
|
||||
|
||||
// onDOMContentLoaded(() => {
|
||||
// //alert('OK dan!');
|
||||
// })
|
||||
|
||||
|
||||
//alert('OK dan 2!');
|
45
resources/assets/v4/bootstrap.js
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
/**
|
||||
* We'll load the axios HTTP library which allows us to easily issue requests
|
||||
* to our Laravel back-end. This library automatically handles sending the
|
||||
* CSRF token as a header based on the value of the "XSRF" token cookie.
|
||||
*/
|
||||
|
||||
import axios from 'axios';
|
||||
import Alpine from 'alpinejs';
|
||||
import BasicStore from './store/Basic';
|
||||
|
||||
window.axios = axios;
|
||||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
|
||||
/**
|
||||
* Echo exposes an expressive API for subscribing to channels and listening
|
||||
* for events that are broadcast by Laravel. Echo and event broadcasting
|
||||
* allows your team to easily build robust real-time web applications.
|
||||
*/
|
||||
|
||||
// import Echo from 'laravel-echo';
|
||||
|
||||
// import Pusher from 'pusher-js';
|
||||
// window.Pusher = Pusher;
|
||||
|
||||
// window.Echo = new Echo({
|
||||
// broadcaster: 'pusher',
|
||||
// key: import.meta.env.VITE_PUSHER_APP_KEY,
|
||||
// cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1',
|
||||
// wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
|
||||
// wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
|
||||
// wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
|
||||
// forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
|
||||
// enabledTransports: ['ws', 'wss'],
|
||||
// });
|
||||
|
||||
|
||||
|
||||
window.Alpine = Alpine
|
||||
|
||||
Alpine.start()
|
||||
|
||||
|
||||
window.BasicStore = new BasicStore;
|
||||
|
||||
window.BasicStore.init();
|
42
resources/assets/v4/store/Basic.js
Normal file
@ -0,0 +1,42 @@
|
||||
|
||||
|
||||
// basic store for preferred date range and some other vars.
|
||||
// used in layout.
|
||||
class Basic {
|
||||
viewRange = '1M';
|
||||
darkMode = 'browser';
|
||||
listPageSize = 10;
|
||||
locale = 'en-US';
|
||||
range = {
|
||||
start: null, end: null
|
||||
};
|
||||
currencyCode = 'AAA';
|
||||
currencyId = '0';
|
||||
constructor() {
|
||||
}
|
||||
|
||||
init() {
|
||||
console.log('init');
|
||||
// load variables from window if present
|
||||
this.loadVariable('viewRange')
|
||||
}
|
||||
|
||||
loadVariable(name) {
|
||||
console.log('loadVariable(' + name + ')');
|
||||
if(window.hasOwnProperty(name)) {
|
||||
console.log('from windows');
|
||||
this[name] = window[name];
|
||||
return;
|
||||
}
|
||||
// load from local storage
|
||||
if(window.Alpine.store(name)) {
|
||||
console.log('from alpine');
|
||||
this[name] = window.Alpine.store(name);
|
||||
return;
|
||||
}
|
||||
// grab using axios
|
||||
console.log('axios');
|
||||
}
|
||||
}
|
||||
|
||||
export default Basic;
|
22
resources/assets/v4/support/daterange.js
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
|
||||
|
||||
class DateRange {
|
||||
start=null;
|
||||
end = null;
|
||||
constructor() {
|
||||
this.start = null
|
||||
this.end = null
|
||||
}
|
||||
|
||||
setStart(start) {
|
||||
this.start = start
|
||||
}
|
||||
|
||||
setEnd(end) {
|
||||
this.end = end
|
||||
}
|
||||
}
|
||||
|
||||
export default DateRange
|
24
resources/assets/v4/util/index.js
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
const domContentLoadedCallbacks = [];
|
||||
// from admin LTE
|
||||
const onDOMContentLoaded = (callback) => {
|
||||
if (document.readyState === 'loading') {
|
||||
// add listener on the first call when the document is in loading state
|
||||
if (!domContentLoadedCallbacks.length) {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
for (const callback of domContentLoadedCallbacks) {
|
||||
callback()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
domContentLoadedCallbacks.push(callback)
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export {
|
||||
onDOMContentLoaded,
|
||||
}
|
31
vite.config.js
Normal file
@ -0,0 +1,31 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import laravel from 'laravel-vite-plugin';
|
||||
|
||||
|
||||
import fs from 'fs';
|
||||
|
||||
|
||||
const host = 'firefly.sd.local';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
laravel({
|
||||
input: ['resources/css/app.css', 'resources/js/app.js'],
|
||||
refresh: true,
|
||||
|
||||
}),
|
||||
],
|
||||
|
||||
|
||||
server: {
|
||||
usePolling: true,
|
||||
allowedHosts: '*.sd.local',
|
||||
host: '0.0.0.0',
|
||||
hmr: { host },
|
||||
cors: true,
|
||||
https: {
|
||||
key: fs.readFileSync(`/vagrant/tls-certificates/wildcard.sd.local.key`),
|
||||
cert: fs.readFileSync(`/vagrant/tls-certificates/wildcard.sd.local.crt`),
|
||||
},
|
||||
},
|
||||
});
|