Add version to JS files to flush cache #659

This commit is contained in:
jokob-sk
2024-05-01 18:25:48 +10:00
parent 525b05db5a
commit 584fdb7734
13 changed files with 50 additions and 45 deletions

View File

@@ -891,12 +891,12 @@ input[readonly] {
.interactable-option::before {
content: '1x 📝 | 2x 🚮';
position: absolute;
right: 0;
position: sticky;
right: 0px;
top: 0;
color: white;
float: right;
background-color: rgb(0, 0, 0);
padding: 3px;
transition: opacity 0.5s;
opacity: 0.1;
border-radius: 3px;

View File

@@ -627,8 +627,8 @@
<script src="lib/AdminLTE/bower_components/fullcalendar/dist/fullcalendar.min.js"></script>
<script src="lib/AdminLTE/bower_components/fullcalendar/dist/locale-all.js"></script>
<!-- ----------------------------------------------------------------------- -->
<script src="js/ui_components.js"></script>
<script src="js/db_methods.js"></script>
<script src="js/ui_components.js?v=<?php include 'php/templates/version.php'; ?>"></script>
<script src="js/db_methods.js?v=<?php include 'php/templates/version.php'; ?>"></script>
<!-- ----------------------------------------------------------------------- -->
<!-- Dark-Mode Patch -->

View File

@@ -25,7 +25,7 @@
checkPermissions([$dbPath, $confPath]);
?>
<script src="js/ui_components.js"></script>
<script src="js/ui_components.js?v=<?php include 'php/templates/version.php'; ?>"></script>
<!-- Page ------------------------------------------------------------------ -->
<div class="content-wrapper">
@@ -127,7 +127,7 @@
</div>
<div class="box-body">
<div class="chart">
<script src="lib/AdminLTE/bower_components/chart.js/Chart.js"></script>
<script src="lib/AdminLTE/bower_components/chart.js/Chart.js?v=<?php include 'php/templates/version.php'; ?>"></script>
<canvas id="OnlineChart" style="width:100%; height: 150px; margin-bottom: 15px;"></canvas>
</div>
</div>

View File

@@ -230,7 +230,7 @@ function cacheStrings()
// Get translated language string
function getString (key) {
// handle initial laod to make sure everything is set-up and cached
// handle initial load to make sure everything is set-up and cached
handleFirstLoad(getString)
UI_LANG = getSetting("UI_LANG");
@@ -864,6 +864,15 @@ function getGuid() {
// -----------------------------------------------------------------------------
function showSpinner(stringKey='Loading')
{
if(stringKey == "")
{
text = ''
} else
{
text = getString(stringKey)
}
if($("#loadingSpinner").length)
{
$("#loadingSpinner").show();
@@ -875,7 +884,7 @@ function showSpinner(stringKey='Loading')
<div class="pa_semitransparent-panel"></div>
<div class="panel panel-default pa_spinner">
<table>
<td width="130px" align="middle">${getString(stringKey)}</td>
<td width="130px" align="middle">${text}</td>
<td><i class="ion ion-ios-loop-strong fa-spin fa-2x fa-fw"></td>
</table>
</div>
@@ -1109,9 +1118,9 @@ function isAppInitialized()
// Define a function that will execute the code only once
function executeOnce() {
if ( !isAppInitialized()) {
showSpinner('')
showSpinner()
if ( !isAppInitialized()) {
// Use cache to keep track of completed AJAX calls
var tmp_completedCalls = getCache("completedCalls")

View File

@@ -227,6 +227,8 @@ function initListInteractionOptions(selectorId) {
$options.on('click', function() {
const $option = $(this);
console.log('aaa');
// Increment click counter
clickCounter++;

View File

@@ -325,8 +325,8 @@ getData();
</script>
<!-- ----------------------------------------------------------------------- -->
<script src="js/ui_components.js"></script>
<script src="js/db_methods.js"></script>
<script src="js/ui_components.js?v=<?php include 'php/templates/version.php'; ?>"></script>
<script src="js/db_methods.js?v=<?php include 'php/templates/version.php'; ?>"></script>
<!-- ----------------------------------------------------------------------- -->

View File

@@ -30,8 +30,8 @@ require dirname(__FILE__).'/security.php';
<!-- jQuery 3 -->
<script src="lib/AdminLTE/bower_components/jquery/dist/jquery.min.js"></script>
<script src="js/common.js"></script>
<script src="js/modal.js"></script>
<script src="js/common.js?v=<?php include 'php/templates/version.php'; ?>"></script>
<script src="js/modal.js?v=<?php include 'php/templates/version.php'; ?>"></script>
<!-- Bootstrap 3.3.7 -->
<link rel="stylesheet" href="lib/AdminLTE/bower_components/bootstrap/dist/css/bootstrap.min.css">

0
front/php/templates/language/pl_pl.json Normal file → Executable file
View File

View File

@@ -16,6 +16,6 @@
echo file_get_contents($filename);
}
else{
echo "File not found";
echo date('Y-m-d H:i:s') . " - N/A";
}
?>

View File

@@ -606,7 +606,7 @@
}
]
},
{
{
"function": "LESS_NAME_CLEANUP",
"type": "integer.checkbox",
"default_value": 0,

View File

@@ -53,9 +53,9 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
<!-- Page ------------------------------------------------------------------ -->
<!-- Page ------------------------------------------------------------------ -->
<script src="js/settings_utils.js"></script>
<script src="js/db_methods.js"></script>
<script src="js/ui_components.js"></script>
<script src="js/settings_utils.js?v=<?php include 'php/templates/version.php'; ?>"></script>
<script src="js/db_methods.js?v=<?php include 'php/templates/version.php'; ?>"></script>
<script src="js/ui_components.js?v=<?php include 'php/templates/version.php'; ?>"></script>
<script src="lib/crypto/crypto-js.min.js"></script>
@@ -63,7 +63,7 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
<!-- Content header--------------------------------------------------------- -->
<section class="content-header">
<?php require 'php/templates/notification.php'; ?>
<div class="col-sm-5">
@@ -487,7 +487,7 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
options = createArray(val);
options.forEach(option => {
inputHtml += `<option value="${option}" disabled>${option}</option>`;
inputHtml += `<option value="${option}" >${option}</option>`;
});
@@ -522,7 +522,7 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
options.forEach(option => {
inputHtml += `<option value="${option}" disabled>${option}</option>`;
inputHtml += `<option value="${option}" >${option}</option>`;
});
inputHtml += '</select></div>' +
@@ -568,7 +568,7 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
// generate settings in the correct group section
$(`#${group} .panel-body`).append(setHtml);
// init remove list item buttons
// init remove and edit listitem click gestures
if(['subnets', 'list' ].includes(setType))
{
initListInteractionOptions(codeName)