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": {
|
"gamutable.js": {
|
||||||
"file": "assets/gamutable-Cq_WjPEr.js",
|
"file": "assets/gamutable-Bcxw5aDx.js",
|
||||||
"name": "gamutable",
|
"name": "gamutable",
|
||||||
"src": "gamutable.js",
|
"src": "gamutable.js",
|
||||||
"isEntry": true
|
"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;
|
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')) {
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* Global pour indiquer le numero de version de gamutable
|
||||||
|
*/
|
||||||
|
// $GLOBALS['gamutable_version_demandee'] = 1;
|
||||||
|
|
||||||
if (_request('var_mode') == 'gamutable') {
|
if (_request('var_mode') == 'gamutable') {
|
||||||
include_spip('inc/invalideur');
|
include_spip('inc/invalideur');
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
[(#SET{htmlvuebloc,#INCLURE{fond=#ENV{fichierVueBloc}}|replace{'"',"'"}})]
|
[(#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">
|
<div id="vueGamutable">
|
||||||
<BOUCLE_un(CONDITION){si #ENV{apiuri}|oui}>
|
<BOUCLE_un(CONDITION){si #ENV{apiuri}|oui}>
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
trier="[(#ENV{trier})]"
|
trier="[(#ENV{trier})]"
|
||||||
langpdf="[(#ENV{langpdf})]"
|
langpdf="[(#ENV{langpdf})]"
|
||||||
:id_auteur="[(#SESSION{id_auteur}|intval)]"
|
:id_auteur="[(#SESSION{id_auteur}|intval)]"
|
||||||
:vider_localstorage="#GET{vider_localstorage}"
|
:gamutable_version_demandee="#GET{gamutable_version_demandee,1}"
|
||||||
></gamu-table>
|
></gamu-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
trier="[(#ENV{trier_deux})]"
|
trier="[(#ENV{trier_deux})]"
|
||||||
langpdf="[(#ENV{langpdf})]"
|
langpdf="[(#ENV{langpdf})]"
|
||||||
:id_auteur="[(#SESSION{id_auteur}|intval)]"
|
:id_auteur="[(#SESSION{id_auteur}|intval)]"
|
||||||
:vider_localstorage="#GET{vider_localstorage}"
|
:gamutable_version_demandee="#GET{gamutable_version_demandee,1}"
|
||||||
></gamu-table>
|
></gamu-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -188,6 +188,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { watch, ref, onMounted, computed, nextTick, inject } from "vue";
|
import { watch, ref, onMounted, computed, nextTick, inject } from "vue";
|
||||||
import VueSelect from "vue-next-select";
|
import VueSelect from "vue-next-select";
|
||||||
|
import { VueCookieNext as $c } from 'vue-cookie-next'
|
||||||
import {
|
import {
|
||||||
orderBy,
|
orderBy,
|
||||||
ordonnerSelect,
|
ordonnerSelect,
|
||||||
|
@ -195,6 +196,9 @@ import {
|
||||||
recupJson,
|
recupJson,
|
||||||
trouver_index,
|
trouver_index,
|
||||||
} from "./helpers";
|
} from "./helpers";
|
||||||
|
|
||||||
|
$c.config({ expire: '360d' })
|
||||||
|
|
||||||
const $papa = inject("$papa");
|
const $papa = inject("$papa");
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
tparpage: {
|
tparpage: {
|
||||||
|
@ -268,6 +272,9 @@ const props = defineProps({
|
||||||
filtreselect: {
|
filtreselect: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
gamutable_version_demandee: {
|
||||||
|
type: Number
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let table = ref([]);
|
let table = ref([]);
|
||||||
let header_top = ref({});
|
let header_top = ref({});
|
||||||
|
@ -318,6 +325,15 @@ let filtreColValeurs = [];
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
localforage.setDriver(localforage[props.stockage.toUpperCase()]);
|
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");
|
chargerJson("maj");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ export default defineConfig(({ mode }) => {
|
||||||
host: true,
|
host: true,
|
||||||
port: port,
|
port: port,
|
||||||
strictPort: true,
|
strictPort: true,
|
||||||
cors: true
|
cors: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
// required for in-browser template compilation
|
// required for in-browser template compilation
|
||||||
|
|
Loading…
Add table
Reference in a new issue