admin update

This commit is contained in:
2025-08-01 09:38:00 +02:00
parent 19387bcac8
commit 8965547896
16 changed files with 2706 additions and 507 deletions

View File

@@ -2,7 +2,7 @@ var apx = apx || {};
apx.apxauth = {};
apx.apxauth.loadwco = async (id, ctx) => {
// check if not authenticate, do nothing cause by default screensignin and wait authentification
// if authenticate, if url xhash then redirect if no url then change wco-link=screenmytribes
// if authenticate, if url xhash then redirect if no url then change wco-link=screenmyworld
// if (dayjs(apx.data.headers.xdays).diff(dayjs(), "hours") >= 24) apx.apxauth.checkisauth();
//load main.mustache of the component
//when wco-xxx change it run this function
@@ -35,7 +35,7 @@ apx.apxauth.getdata = (id, ctx) => {
? apx.data.appdata.emailsupport
: "";
switch (ctx.link) {
case "logout":
case "myworld":
if (!data.profils) data.profils = [];
apx.data.headers.xprofils.forEach((p) => {
if (!["anonymous", "pagans", "persons"].includes(p)) {
@@ -45,15 +45,47 @@ apx.apxauth.getdata = (id, ctx) => {
data.noprofils = data.profils.length == 0;
data.member = apx.data.headers.xprofils.includes("persons");
data.websites = apx.data.appdata.websites;
// get tribes activities
/*["", "https://wall-ants.ndda.fr"];
data.optionlinks=apx.data.tpldata[tpldataname].optionlinks
data.town=apx.data.town
data.nation=apx.data.nation
if (1==1 || apx.data.headers.xprofils.includes('major')){
apx.data.tpldata[tpldataname].optionlinksmajor.forEach(o=>data.optionlinks.push(o))
apx.save()
}
// get towns list
axios
.get(`/api/apxtri/tribes/activities`, {
.get(`/api/apxtri/odmdb/idx/apxtri/towns/towns`, {
headers: apx.data.headers,
})
.then((rep) => {})
.catch((err) => {});
*/
.then((rep) => {
console.log(rep)
if (rep.status==200){
apx.data.itms.towns=rep.data.data.idx
data.townsnumber= Object.keys(apx.data.itms.towns).length;
apx.data.wco.townsnumber={textContent:Object.keys(apx.data.itms.towns).length};
apx.listendatawco('townsnumber');
apx.save()
}
})
.catch((err) => {
console.log("ERROR, geting towns itms not available",err)
});
axios
.get(`/api/apxtri/odmdb/idx/apxtri/pagans/lst_alias`, {
headers: apx.data.headers,
})
.then((rep) => {
if (rep.status==200){
console.log(rep)
data.pagansnumber=rep.data.data.idx.length
apx.data.wco.pagansnumber={textContent:rep.data.data.idx.length};
apx.listendatawco('pagansnumber');
apx.save();
}
})
.catch((err) => {
console.log("ERROR, geting pagans itms not available",err)
});
break;
default:
break;
@@ -253,7 +285,7 @@ apx.apxauth.authentifyme = async (
//location.reload();
document
.getElementById(idparent)
.setAttribute("wco-link", "mytribes");
.setAttribute("wco-link", "myworld");
}
})
.catch((err) => {
@@ -484,7 +516,7 @@ apx.apxauth.authenticatedetachedSignature = async (
message
) => {
/**
* Check that alias (pubkey) signe a message
* Check that alias (pubkey) sign a message
* @alias {string} alias link to the publickey
* @pubK {string} publiKey text format
* @detachedSignature {string} a detachedsignatured get from apx.apxauth.detachedSignature

View File

@@ -1,39 +0,0 @@
<div class="flex flex-col space-y-1 text-center">
<div class="mt-1">
<h1 class="mb-6">
Bonjour {{xalias}},
</h1>
<p>
Si cet appareil ne vous appartiens pas et que vous n'utilisez pas l'application, vous devriez vous deconnecter.
</p>
<p class="text-center text-gray-500">
Nettoyer mes traces de cet appareil?
<a class="font-semibold leading-6 text-secondary hover:text-primary"
onclick="apx.apxauth.logout('{{id}}','logout','logout','apxauth')">Se deconnecter</a>
</p>
</div>
<div class="mt-4">
<p class="text-center text-gray-500">
Voir mes échanges?
<a class="font-semibold leading-6 text-secondary hover:text-primary"
href="https://wall-ants.ndda.fr/apxwallet_fr.html" >Mon activité </a>
</p>
{{#member}}
<p>
Vous êtes membre de {{xtribe}} {{#noprofils}} sand profil particulier {{/noprofils}} {{^noprofils}}avec le(s) profil(s):<br><span class="text-info"> {{#profils}} {{.}}<br> {{/profils}} </span> {{/noprofils}}
</p>
{{/member}}
{{^member}}
<p> Vous n'êtes pas encore membre de {{xtribe}} </p>
<p class=" mt-1 text-center text-gray-500">
Envie d'jouter cette tribut {{xtribe}}?
<a class="font-semibold leading-6 text-secondary hover:text-primary"
onclick="apx.apxauth.jointribe('{{id}}')">Rejoindre {{xtribe}}</a>
</p>
{{/member}}
<p>Les applications ou pages web de {{xtribe}} à visiter:<br>
{{#websites}}<a class="font-semibold leading-6 text-secondary hover:text-primary" href='{{{href}}}'>{{{name}}}</a><br> {{/websites}}
</p>
<button class="btn btn-primary" onclick="apx.apxauth.runtest()">testbtn</button>
</div>
</div>

View File

@@ -1,23 +0,0 @@
<div class="flex flex-col space-y-1 text-center">
<div class="mt-1">
<h1 class="mb-6">
Bonjour {{xalias}},
</h1>
</div>
<div class="mt-4">
<p class="text-center text-gray-500">
Redirige vers
<a class="font-semibold leading-6 text-secondary hover:text-primary"
onclick="apx.apxauth.redirecturlwithauth('http://recruiter.smatchit.newdev.ants/src/offer_fr.html','smatchit','recruiter',true);" >Redirige vers recruiter.smatchit.io/offer_fr.html&xhash....</a>
</p>
{{#member}}
<p>
Vous êtes membre de {{xtribe}} {{#noprofils}} sand profil particulier {{/noprofils}} {{^noprofils}}avec le(s) profil(s):<br><span class="text-info"> {{#profils}} {{.}}<br> {{/profils}} </span> {{/noprofils}}
</p>
{{/member}}
<p>Les applications ou pages web de {{xtribe}} à visiter:<br>
{{#websites}}<a class="font-semibold leading-6 text-secondary hover:text-primary" href='{{{href}}}'>{{{name}}}</a><br> {{/websites}}
</p>
<button class="btn btn-primary" onclick="apx.apxauth.runtest()">testbtn</button>
</div>
</div>

View File

@@ -0,0 +1,41 @@
<div class="p-2">
Authentifié avec l'alias: <span class="text-success">{{xalias}}</span> dans <span class="text-success">{{town}}-{{nation}}</span>
</div>
<div class="p-4 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 justify-items-center">
{{#optionlinks}}
<div class="indicator">
{{#notification_count}}
<span class="indicator-item badge badge-{{typebadge}} text-white">{{notification_count}}</span>
{{/notification_count}}
<a {{{onclick}}} title="{{title}}" class="grid w-20 h-20 bg-base-200 rounded-lg place-items-center hover:bg-base-300 transition-colors">
{{{svg}}}
</a>
</div>
{{/optionlinks}}
</div>
<div class="flex justify-center p-2">
<div class="stats stats-horizontal shadow">
<div class="stat place-items-center">
<div class="stat-title">Nombre d'uniques</div>
<div class="stat-value" data-wco="pagansnumber">{{pagansnumber}}</div>
<div class="stat-desc">identités actives</div>
</div>
<div class="stat place-items-center">
<div class="stat-title">Nombre de towns</div>
<div class="stat-value text-secondary" data-wco="townsnumber">{{townsnumber}}</div>
<div class="stat-desc text-secondary">Actives en ce moment</div>
</div>
</div>
</div>
<div class="p-4 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 justify-items-center">
{{#mytribes}}
<div class="indicator">
{{#notification_count}}
<span class="indicator-item badge badge-{{typebadge}} text-white">{{notification_count}}</span>
{{/notification_count}}
<a {{{onclick}}} title="{{title}}" class="grid w-20 h-20 bg-base-200 rounded-lg place-items-center hover:bg-base-300 transition-colors">
{{{tribename}}}
</a>
</div>
{{/mytribes}}
</div>