Clean up v2.

This commit is contained in:
James Cole
2025-07-20 12:32:53 +02:00
parent 680f554981
commit a60882d5f5
8 changed files with 45 additions and 24 deletions

View File

@@ -48,6 +48,10 @@ window.bootstrap = bootstrap;
// always grab the preference "marker" from Firefly III.
getFreshVariable('lastActivity').then((serverValue) => {
if(null === serverValue) {
console.log('Server value is null in getFreshVariable.');
throw new Error('401 in getFreshVariable.');
}
const localValue = store.get('lastActivity');
store.set('cacheValid', localValue === serverValue);
store.set('lastActivity', serverValue);
@@ -78,6 +82,8 @@ getFreshVariable('lastActivity').then((serverValue) => {
window.bootstrapped = true;
});
});
}).catch((error) => {
console.error('Error while bootstrapping: ' + error);
});
window.axios = axios;
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

View File

@@ -30,3 +30,4 @@
border:0;
}
.skip-links {display: none;}

View File

@@ -1,5 +1,5 @@
/*!
* adminlte-filteres.scss
* adminlte-filtered.scss
* Copyright (c) 2024 james@firefly-iii.org.
*
* This file is part of Firefly III (https://github.com/firefly-iii).
@@ -23,7 +23,7 @@
// copied from:
/*!
* AdminLTE v4.0.0-alpha2
* AdminLTE v4.0.0-rc3
* Author: Colorlib
* Website: AdminLTE.io <https://adminlte.io>
* License: Open source - MIT <https://opensource.org/licenses/MIT>
@@ -84,7 +84,6 @@
// Bootstrap Utilities
@import "bootstrap/scss/utilities/api";
// AdminLTE Configuration
// ---------------------------------------------------
@import "admin-lte/src/scss/variables";
@@ -97,9 +96,12 @@
@import "admin-lte/src/scss/parts/components";
@import "admin-lte/src/scss/parts/extra-components";
// @import "admin-lte/src/scss/parts/pages";
@import "admin-lte/src/scss/pages/login_and_register";
//
// Part: Pages
//
@import "admin-lte/src/scss/pages/login_and_register";
@import "admin-lte/src/scss/parts/miscellaneous";
// AdminLTE Accessibility Styles - WCAG 2.1 AA Compliance
@import "admin-lte/src/scss/accessibility";

View File

@@ -26,6 +26,9 @@ $danger: #CD5029 !default;
$primary: #1E6581 !default;
$success: #64B624 !default;
.skip-links {display: none;}
/*
Remove bottom margin from unstyled lists
*/

View File

@@ -26,13 +26,17 @@ export function getFreshVariable(name, defaultValue = null) {
return getter.getByName(name).then((response) => {
// console.log('Get from API');
return Promise.resolve(parseResponse(name, response));
}).catch(() => {
// preference does not exist (yet).
// POST it and then return it anyway.
let poster = (new Post);
poster.post(name, defaultValue).then((response) => {
return Promise.resolve(parseResponse(name, response));
});
}).catch((response) => {
if(response.status === 404) {
// preference does not exist (yet).
// POST it and then return it anyway.
let poster = (new Post);
poster.post(name, defaultValue).then((response) => {
return Promise.resolve(parseResponse(name, response));
});
return;
}
return Promise.resolve(null);
});
}

View File

@@ -21,5 +21,9 @@
export function showInternalsButton() {
// console.log('showInternalsButton');
document.querySelector('.toggle-page-internals').classList.remove('d-none');
let obj = document.querySelector('.toggle-page-internals');
if (obj === null) {
return;
}
obj.classList.remove('d-none');
}

View File

@@ -83,7 +83,8 @@ export default defineConfig(({command, mode, isSsrBuild, isPreview}) => {
server: {
cors: true,
origin: 'https://192.168.96.154:5173',
// make sure this IP matches the IP of the dev machine.
origin: 'https://192.168.96.162:5173',
watch: {
usePolling: true,
},