Merge branch 'test_cookie_version'
This commit is contained in:
commit
c66d0285e3
8 changed files with 88 additions and 57 deletions
2
dist/.vite/manifest.json
vendored
2
dist/.vite/manifest.json
vendored
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"gamutable.js": {
|
||||
"file": "assets/gamutable-Cq_WjPEr.js",
|
||||
"file": "assets/gamutable-Bcxw5aDx.js",
|
||||
"name": "gamutable",
|
||||
"src": "gamutable.js",
|
||||
"isEntry": true
|
||||
|
|
56
dist/assets/gamutable-Bcxw5aDx.js
vendored
Normal file
56
dist/assets/gamutable-Bcxw5aDx.js
vendored
Normal file
File diff suppressed because one or more lines are too long
51
dist/assets/gamutable-Cq_WjPEr.js
vendored
51
dist/assets/gamutable-Cq_WjPEr.js
vendored
File diff suppressed because one or more lines are too long
|
@ -128,3 +128,10 @@ function gamutable_vider_localstorage():int {
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function gamutableGetGlobals(string $name, string $defaut = ''):string {
|
||||
if (empty($name)) {
|
||||
return '';
|
||||
}
|
||||
return $GLOBALS[$name] ?? $defaut;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,10 @@
|
|||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Global pour indiquer le numero de version de gamutable
|
||||
*/
|
||||
// $GLOBALS['gamutable_version_demandee'] = 1;
|
||||
|
||||
if (_request('var_mode') == 'gamutable') {
|
||||
include_spip('inc/invalideur');
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
[(#SET{htmlvuebloc,#INCLURE{fond=#ENV{fichierVueBloc}}|replace{'"',"'"}})]
|
||||
]
|
||||
|
||||
#SET{vider_localstorage,#NULL|gamutable_vider_localstorage}
|
||||
[(#SET{gamutable_version_demandee,#VAL{gamutable_version_demandee}|gamutableGetGlobals{1}})]
|
||||
|
||||
<div id="vueGamutable">
|
||||
<BOUCLE_un(CONDITION){si #ENV{apiuri}|oui}>
|
||||
|
@ -56,7 +56,7 @@
|
|||
trier="[(#ENV{trier})]"
|
||||
langpdf="[(#ENV{langpdf})]"
|
||||
:id_auteur="[(#SESSION{id_auteur}|intval)]"
|
||||
:vider_localstorage="#GET{vider_localstorage}"
|
||||
:gamutable_version_demandee="#GET{gamutable_version_demandee,1}"
|
||||
></gamu-table>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -94,7 +94,7 @@
|
|||
trier="[(#ENV{trier_deux})]"
|
||||
langpdf="[(#ENV{langpdf})]"
|
||||
:id_auteur="[(#SESSION{id_auteur}|intval)]"
|
||||
:vider_localstorage="#GET{vider_localstorage}"
|
||||
:gamutable_version_demandee="#GET{gamutable_version_demandee,1}"
|
||||
></gamu-table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -188,6 +188,7 @@
|
|||
<script setup>
|
||||
import { watch, ref, onMounted, computed, nextTick, inject } from "vue";
|
||||
import VueSelect from "vue-next-select";
|
||||
import { VueCookieNext as $c } from 'vue-cookie-next'
|
||||
import {
|
||||
orderBy,
|
||||
ordonnerSelect,
|
||||
|
@ -195,6 +196,9 @@ import {
|
|||
recupJson,
|
||||
trouver_index,
|
||||
} from "./helpers";
|
||||
|
||||
$c.config({ expire: '360d' })
|
||||
|
||||
const $papa = inject("$papa");
|
||||
const props = defineProps({
|
||||
tparpage: {
|
||||
|
@ -268,6 +272,9 @@ const props = defineProps({
|
|||
filtreselect: {
|
||||
type: String,
|
||||
},
|
||||
gamutable_version_demandee: {
|
||||
type: Number
|
||||
}
|
||||
});
|
||||
let table = ref([]);
|
||||
let header_top = ref({});
|
||||
|
@ -318,6 +325,15 @@ let filtreColValeurs = [];
|
|||
|
||||
onMounted(() => {
|
||||
localforage.setDriver(localforage[props.stockage.toUpperCase()]);
|
||||
const gamutable_version_production = $c.getCookie('gamutable_version_production') ?? 1;
|
||||
console.log('gamutable_version_production ', gamutable_version_production);
|
||||
|
||||
if (+props.gamutable_version_demandee > gamutable_version_production) {
|
||||
console.log("⚠ Vidange du localstorage ⚠");
|
||||
$c.setCookie('gamutable_version_production', +props.gamutable_version_demandee )
|
||||
localStorage.clear(); // suppression des configs (entetes) + suppression des donnes si stockage localstorage
|
||||
localforage.clear(); // suppression de indexeddbb
|
||||
}
|
||||
chargerJson("maj");
|
||||
});
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ export default defineConfig(({ mode }) => {
|
|||
host: true,
|
||||
port: port,
|
||||
strictPort: true,
|
||||
cors: true
|
||||
cors: true,
|
||||
},
|
||||
|
||||
// required for in-browser template compilation
|
||||
|
|
Loading…
Add table
Reference in a new issue