fix __dirapi by conf.dirapi
This commit is contained in:
@@ -9,7 +9,7 @@ root {{{dirapi}}}/;
|
||||
location ~* /nationchains/schema/ {
|
||||
#outside of nationchains for git purpose
|
||||
rewrite /nationchains/schema/(.*$) /$1 break;
|
||||
root {{{dirapi}}}/adminapi/www/adminapx/schema/;
|
||||
root {{{dirapi}}}/adminapi/schema/;
|
||||
}
|
||||
# /plugins/pluginame/components/xxx?plugin=pluginname&pluginkey=key
|
||||
# acess if exist pluginkey
|
||||
|
@@ -9,6 +9,8 @@
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<!-- fontawesome icon cdn -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.1/css/all.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
|
||||
<link rel="stylesheet" href="static/style/apxobjmanager.css">
|
||||
<script>
|
||||
const apxlocal = {
|
||||
headers: { xalias: "anonymous", xhash: "anonymous", xdays: 0, xtribe: "town", xapp: "adminapx", xlang: "en" },
|
||||
@@ -36,6 +38,7 @@
|
||||
<script src="static/js/apxtribes.js"></script>
|
||||
<script src="static/js/apxtowns.js"></script>
|
||||
<script src="static/js/apxapp.js"></script>
|
||||
<script src="static/js/apxobjmanager.js"></script>
|
||||
<style>
|
||||
.fakeimg {
|
||||
height: 200px;
|
||||
@@ -89,8 +92,9 @@
|
||||
aria-expanded="false">Mayor's Town</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" add2data tpl="static/tpl/townowner_en.mustache"
|
||||
onclick="app.load('apxmain','townowner',towns.loadtpldata())">Own this town</a></li>
|
||||
<li><a class="dropdown-item" href="#">Manage Tribes</a></li>
|
||||
onclick="app.load('apxmain','townowner',towns.loadtpldata('owner'))">Own this town</a></li>
|
||||
<li><a class="dropdown-item" add2data tpl="static/tpl/towntribes_en.mustache"
|
||||
onclick="app.load('apxmain','towntribes',towns.loadtpldata('tribes'))">Manage Tribes</a></li>
|
||||
<li><a class="dropdown-item" href="#">Backup Town/Tribes</a></li>
|
||||
<li>
|
||||
<hr class="dropdown-divider">
|
||||
|
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"schema":"schema/",
|
||||
"objects":[{"name":"nations","lastversion":0},{"name":"paganss","lastversion":0},{"name":"towns","lastversion":0},{"name":"tribes","lastversion":0}],
|
||||
"comment":"schema are in english to get translate part a /lg/schemaname_lg.json allow to replace by lg language the relevant key. Each time a modification is done in schema lastupdate take a timestamp"
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"title": "Description d'une nation",
|
||||
"description":"Nation schema in the apxtrib world",
|
||||
"$comment":"",
|
||||
"properties":{
|
||||
"nationId":{
|
||||
"title":"Nom de nation",
|
||||
"description":"Nom unique idenbtifiant une nation composé de a-z et de 0-9 permet de fereder des règles de fonctionnement"
|
||||
},
|
||||
"dtcreate":{
|
||||
"title":"Date de creation",
|
||||
"description":"Creation de la nation"
|
||||
},
|
||||
"contracts":{
|
||||
"title":"Le contrat social",
|
||||
"description":"Indique l'emplacement du contrat qu'accepte toutes les villes"
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"title": "L'identité d'un pagan",
|
||||
"description": "Decrit les informations de l'identité numérique public",
|
||||
"properties": {
|
||||
"publickey": {
|
||||
"title": "Clé public associés à l'alias",
|
||||
"description": "Cle public généré par openpgp.js lors de la creation d'un compte"
|
||||
},
|
||||
"alias": {
|
||||
"title": "Alias",
|
||||
"description": "Chaine de texte memnotechnique qui se retiens plus facilement qu'une clé public"
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"title": "Une Personne au niveau d'une tribut avec des informations personnelle",
|
||||
"description": "Un alias peut se stoquer comme un objet Person avec des informations supplémentaire permettant de qualifier son profil",
|
||||
"properties": {
|
||||
"alias": {"title":"Une identité numérique d'apxtrib"},
|
||||
"dt_create": {"title":"Date de creation de cette personne"},
|
||||
"dt_update": { "title":"Date de derniére mise à jour"},
|
||||
"dt_lastlogin": { "title":"Date de derniere authentification" },
|
||||
"dt_close": { "title": "Date de fermeture de compte" },
|
||||
"recoveryauth":{"title":"Information pour recuperer ses codes d'accès"},
|
||||
"biography": {"title":"Description courte"},
|
||||
"imgavatar": {"title":"Url de l'image utilisée comme avatar"},
|
||||
"accessrights": {"title":"Droits d'accès"}
|
||||
}
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"title": "Contiens la cle privée avec un email de recovery",
|
||||
"description": "Cs trouve au niveau d'une person (sous la responsabilité d'une tribut et permet pour un alias de recevoir par email une clé privée",
|
||||
"properties":{
|
||||
"email": { "title":"email de recuperation" },
|
||||
"alias": {"title": "Alias qui doit exister comme une Person dans une tribu"},
|
||||
"privatekey": { "title": "Private key link to alias" },
|
||||
"passphrase": {"title":"Passphrase to uncipher privatekey"}
|
||||
}
|
||||
}
|
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"$schema":"http://json-schema.org/schema#",
|
||||
"$id":"schema/nations",
|
||||
"title": "Nation definition",
|
||||
"description": "A nation from apXtrib world",
|
||||
"$comment":"see ./lg/nations_lg.json for description in your languange lg",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"nationId": {
|
||||
"title":"Unique nation name",
|
||||
"description":"A unique string that define a nation a-z and 0-9 onlyin a social world",
|
||||
"type": "string",
|
||||
"pattern":"^[a-z0-9]*$"
|
||||
},
|
||||
"dtcreate": {
|
||||
"title":"Creation date",
|
||||
"description":"Nation date of creation",
|
||||
"type": "string",
|
||||
"format":"datetime"
|
||||
},
|
||||
"contracts":{
|
||||
"title":"Social contract of the nation",
|
||||
"description":"A uri of the signed js contract that rules this nation",
|
||||
"type": "string",
|
||||
"format":"uri"
|
||||
}
|
||||
},
|
||||
"required": ["nationId", "dtcreate","contracts"],
|
||||
"additionalProperties":false,
|
||||
"apxprimarykey":["nationId"],
|
||||
"apxsearchindex": [
|
||||
{ "key": "nationId", "value": [] }
|
||||
]
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"$id": "https://smatchit.io/schema/pagan",
|
||||
"$comment": "To create account bin apxtrib",
|
||||
"title": "Pagans identity",
|
||||
"description": "A numeric id in the nationchains world",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"publickey": {
|
||||
"title": "Alias's publickey",
|
||||
"description": "Public key generate with openpgp.js",
|
||||
"type": "string",
|
||||
"format": "pgpAE256"
|
||||
},
|
||||
"alias": {
|
||||
"title": "Alias",
|
||||
"description": "text to remember easiky a public key",
|
||||
"type": "string",
|
||||
"minLength": 5,
|
||||
"pattern": "^[a-z0-9]*$"
|
||||
}
|
||||
},
|
||||
"required": ["publickey", "alias"],
|
||||
"apxprimarykey": ["alias"],
|
||||
"apxsecondarykey": ["publickey"],
|
||||
"apxsearchindex": [
|
||||
{ "key": "alias", "val": "publickey" },
|
||||
{ "key": "publickey", "val": "alias" }
|
||||
]
|
||||
}
|
@@ -1,85 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "/schema/person",
|
||||
"title": "Person minimum definition to link a person to a pagan identity",
|
||||
"description": "A person is a human with a apxtrib identity (Public Private Key. Information stored (not cipher) for a person are only visible from the town's Mayor and the tribe's Druid. You need at least trus the druid that trust the mayor (for sensitive data Mayor and Druid can be the same apx Identity.) Only a pagan that have the privateKey can read cipher data. The purpose of this sschema is to link a person to a tribe and manage basic activities, profil will be a tribe object if need more personnal information",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"alias": {
|
||||
"type": "string",
|
||||
"minLength": 5,
|
||||
"pattern": "^[a-z0-9]*$"
|
||||
},
|
||||
"owner": {
|
||||
"title": "Alias that own this object",
|
||||
"type": "string",
|
||||
"format": "Alias"
|
||||
},
|
||||
"dt_create": {
|
||||
"type": "string",
|
||||
"format": "datetime",
|
||||
"default": "dayjs.now()"
|
||||
},
|
||||
"dt_update": {
|
||||
"type": "string",
|
||||
"format": "datetime"
|
||||
},
|
||||
"dt_lastlogin": {
|
||||
"type": "string",
|
||||
"format": "datetime"
|
||||
},
|
||||
"dt_close": {
|
||||
"type": "string",
|
||||
"format": "datetime"
|
||||
},
|
||||
"recoveryauth": {
|
||||
"type": "object",
|
||||
"$ref": "schema/recoveryauth.json"
|
||||
},
|
||||
"firstname": {
|
||||
"type": "string"
|
||||
},
|
||||
"lastname": {
|
||||
"type": "string"
|
||||
},
|
||||
"dt_birth":{
|
||||
"type":"string",
|
||||
"format":"date"
|
||||
},
|
||||
"gender":{
|
||||
"type":"string",
|
||||
"enum":[ "M","MME","OTHER"]
|
||||
},
|
||||
"emailcom":{"type":"string","format":"email"},
|
||||
"biography": {
|
||||
"type": "string",
|
||||
"pattern": "^.{O,150}$"
|
||||
},
|
||||
"imgavatar": {
|
||||
"type": "string"
|
||||
},
|
||||
"accessrights": {
|
||||
"title": "Accessright per Object or per Object.key belonging to tribe",
|
||||
"description": "A Person has to exist and want to create read update delete, if Own means if owner = alias of user requested some CRUD action to owner then he can act on this object or object.key List of Object with CRUDO value like {Person:'RUDO',"Person.recoveryauth":'O',...}",
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"alias",
|
||||
"accessright"
|
||||
],
|
||||
"apxprimarykey": "alias",
|
||||
"apxunique": [
|
||||
""
|
||||
],
|
||||
"apxsearchindex": [
|
||||
{
|
||||
"key": "alias",
|
||||
"value": []
|
||||
},
|
||||
{
|
||||
"key": "recovery.email",
|
||||
"value": "alias"
|
||||
}
|
||||
]
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "/schema/recoveryauth",
|
||||
"title": "Store numeric identity to recover it by email",
|
||||
"description": "This object store numeric identity alias with an email mainly used at Person level to recover by email a private and passphrase key associate to alias",
|
||||
"properties":{
|
||||
"email": { "type": "string", "format": "email" },
|
||||
"alias": {"type": "string", "format":"Pagan"},
|
||||
"privatekey": { "type": "string", "format": "eccCorve25519armored" }
|
||||
}
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "/schema/person",
|
||||
"title": "Person minimum definition to link a person to a pagan identity",
|
||||
"description": "A person is a human with a apxtrib identity (Public Private Key. Information stored (not cipher) for a person are only visible from the town's Mayor and the tribe's Druid. You need at least trus the druid that trust the mayor (for sensitive data Mayor and Druid can be the same apx Identity.) Only a pagan that have the privateKey can read cipher data. The purpose of this sschema is to link a person to a tribe and manage basic activities, profil will be a tribe object if need more personnal information",
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "/schema/seeker",
|
||||
"title": "Data Profil of a person that is in a seek process",
|
||||
"description": "All those data have to store any useffull logistical data and profil about a seeker (skill, ...) ",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"emailseek":{"type":"string","format":"email"},
|
||||
"mainlivinglocation":{"type":"object","$ref":"https://schema.org/PostalAddress"},
|
||||
"secondlivinglocation":{"type":"object","$ref":"https://schema.org/PostalAddress"},
|
||||
"thirdlivinglocation":{"type":"object","$ref":"https://schema.org/PostalAddress"},
|
||||
"seekcriterias":{"type":"array","$ref":"schema/seekcriteria.json"},
|
||||
"skills":{"type":"array","$ref":"schema/skills.json"},
|
||||
"educations":{"type":"array","$ref":"schema/educations.json"},
|
||||
"experiences":{"type":"array","$ref":"schema/experiences.json"}
|
||||
}
|
||||
}
|
@@ -1,37 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "schema/towns",
|
||||
"title": "Town",
|
||||
"description": "A town belonging to a nation from apXtrib world",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"townId": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z0-9]*$"
|
||||
},
|
||||
"nationId": {
|
||||
"type": "string",
|
||||
"$apxenumkey": "socialworld/objects/nations/searchindex/nations_uuid_uuid.json"
|
||||
},
|
||||
"mayorId": {
|
||||
"type": "string",
|
||||
"$apxenumkey": "socialworld/objects/nations/searchindex/nations_uuid_uuid.json"
|
||||
},
|
||||
"status": {
|
||||
"default": "active",
|
||||
"type": "string",
|
||||
"enum":["chain","unchain","tochain"]
|
||||
}
|
||||
},
|
||||
"dns": {
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": ["townId", "status", "nationId", "dns"],
|
||||
"apxprimarykey": "townId",
|
||||
"apxsearchindex": [
|
||||
{ "key": "status", "value": "townId" },
|
||||
{ "key": "nationId", "value": "townId" },
|
||||
{ "key": "townId", "value": [] }
|
||||
]
|
||||
}
|
@@ -1,37 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "nationchains/schema/tribes",
|
||||
"title": "Tribes",
|
||||
"description": "A tribe belonging to a town",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"tribeId":{
|
||||
"type":"string",
|
||||
"pattern":"^[a-z0-9]*$"
|
||||
},
|
||||
"townId": {
|
||||
"type": "string",
|
||||
"$ref": "nationchains/towns/idx/towns_uuid_uuid.json"
|
||||
},
|
||||
"nationId": {
|
||||
"type": "string",
|
||||
"$ref": "nationchains/nations/idx/nations_uuid_uuid.json"
|
||||
},
|
||||
"status": {
|
||||
"default": "unchain",
|
||||
"type": "string",
|
||||
"enum": ["chain","tochain","unchain"]
|
||||
},
|
||||
"dns": {
|
||||
"type": "array",
|
||||
"items":{"type":"string", "uniqueItems":true}
|
||||
|
||||
}
|
||||
},
|
||||
"required": ["townId", "status", "nationId", "dns"],
|
||||
"apxprimarykey": ["tribeId"],
|
||||
"apxsearchindex": [
|
||||
{ "key": "status", "value": "tribeId" },
|
||||
{ "key": "tribeId", "value": [] }
|
||||
]
|
||||
}
|
@@ -1,45 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "nationchains/schema/www",
|
||||
"title": "Town",
|
||||
"description": "A pace web available for a domaine, with accessright",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"townId": {
|
||||
"description": "|Towns|townnamedesc",
|
||||
"desclong": "|Townss|townnamedesclong",
|
||||
"info": "|Towns|townnameinfo",
|
||||
"type": "string",
|
||||
"pattern":"^[a-z0-9]*$"
|
||||
},
|
||||
"nationId": {
|
||||
"description": "|Towns|nationdesc",
|
||||
"desclong": "|Townss|nationdesclong",
|
||||
"type": "string",
|
||||
"$apxenumkey": "socialworld/objects/nations/searchindex/nations_uuid_uuid.json"
|
||||
},
|
||||
"status": {
|
||||
"desc": "|Towns|statusdesc",
|
||||
"default": "active",
|
||||
"type": "string",
|
||||
"$apxenumkey": "data",
|
||||
"data": {
|
||||
"chain": { "desc": "|Towns|statuschain" },
|
||||
"tochain": { "desc": "|Towns|statustosync" },
|
||||
"unchain": { "desc": "|Towns|statusunchain" }
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"desc": "|Towns|urldesc",
|
||||
"type": "string",
|
||||
"apxtype":"url"
|
||||
}
|
||||
},
|
||||
"required": ["townId", "status", "nationId", "url"],
|
||||
"apxprimarykey": "townId",
|
||||
"apxsearchindex": [
|
||||
{ "key": "status", "value": "townId" },
|
||||
{ "key": "nationId", "value": "townId" },
|
||||
{ "key": "townId", "value": [] }
|
||||
]
|
||||
}
|
27
adminapi/www/adminapx/static/js/apxobjmanager.js
Normal file
27
adminapi/www/adminapx/static/js/apxobjmanager.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/*eslint no-undef:0*/
|
||||
/*eslint-env browser*/
|
||||
|
||||
"use strict";
|
||||
var objman = objman || {};
|
||||
|
||||
|
||||
objman.objedit = (idcomponent,id) => {
|
||||
const objdoc = document.getElementById(idcomponent);
|
||||
objdoc.querySelector(".objlist").classList.add("d-none");
|
||||
objdoc.querySelector(".objitm").classList.remove("d-none");
|
||||
objdoc.querySelector(".objaddedit").classList.add("hide");
|
||||
objdoc.querySelector(".inputfilter").classList.add("hide");
|
||||
objdoc.querySelector(".btnfilter").classList.add("hide");
|
||||
objdoc.querySelector(".objlistreturn").classList.remove("d-none");
|
||||
//recupere les data et le schema
|
||||
};
|
||||
objman.returnlist = (idcomponent) => {
|
||||
const objdoc = document.getElementById(idcomponent);
|
||||
objdoc.querySelector(".objlist").classList.remove("d-none");
|
||||
objdoc.querySelector(".objitm").classList.add("d-none");
|
||||
objdoc.querySelector(".objaddedit").classList.remove("hide");
|
||||
objdoc.querySelector(".inputfilter").classList.remove("hide");
|
||||
objdoc.querySelector(".btnfilter").classList.remove("hide");
|
||||
objdoc.querySelector(".objlistreturn").classList.add("d-none");
|
||||
};
|
||||
|
@@ -129,7 +129,7 @@ pagans.createIdentity = async (alias, passphrase = "") => {
|
||||
apx.data.tmp = keys; // to make it available for btn download
|
||||
document.getElementById("generatekeys").classList.add("d-none");
|
||||
document.getElementById("trustintribe").classList.remove("d-none");
|
||||
document.getElementById("downloadkeys").classList.remove("d-none");
|
||||
//document.getElementById("downloadkeys").classList.remove("d-none");
|
||||
document.getElementById("createId").classList.remove("d-none");
|
||||
};
|
||||
|
||||
@@ -188,6 +188,12 @@ pagans.registerIdentity = async () => {
|
||||
.post("api/pagans", data, { headers: apx.data.headers })
|
||||
.then((reppagan) => {
|
||||
console.log(reppagan);
|
||||
if (reppagan.status==200) {
|
||||
document.getElementById('downloadkeys').classList.remove('d-none');
|
||||
alert("Your identity is created, don't forget to download your key")
|
||||
}else{
|
||||
alert('Check the console an error appear');
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("sorry", err);
|
||||
|
@@ -4,26 +4,59 @@
|
||||
"use strict";
|
||||
var towns = towns || {};
|
||||
|
||||
towns.loadtpldata = () => {
|
||||
towns.loadtpldata = (fortpl) => {
|
||||
// adapte tpldata to template tpl
|
||||
const dataowner = apx.data.tpldata.setup;
|
||||
dataowner.alias=apx.data.headers.xalias;
|
||||
dataowner.auth = dataowner.alias!="anonymous";
|
||||
dataowner.devtown = dataowner.townId == "devfarm";
|
||||
if (dataowner.mayorid) dataowner.owner = dataowner.mayorid == dataowner.alias;
|
||||
console.log('Data return to template',dataowner)
|
||||
return dataowner;
|
||||
if (fortpl == "owner") {
|
||||
const dataowner = apx.data.tpldata.setup;
|
||||
dataowner.alias = apx.data.headers.xalias;
|
||||
dataowner.auth = dataowner.alias != "anonymous";
|
||||
dataowner.devtown = dataowner.townId == "devfarm";
|
||||
if (dataowner.mayorId)
|
||||
dataowner.owner = dataowner.mayorId == dataowner.alias;
|
||||
console.log("Data return to template", dataowner);
|
||||
return dataowner;
|
||||
}
|
||||
if (fortpl == "tribes") {
|
||||
const data= {
|
||||
idcomponent: "tribesmanager",
|
||||
objectname:"tribes",
|
||||
itm: [
|
||||
{ tribeId: "tribe1", druidId: "philc" },
|
||||
{ tribeId: "tribe2", druidId: "toto" },
|
||||
]
|
||||
};
|
||||
data.tplform=`
|
||||
<div class='mb-3'>
|
||||
<label for='tribeIdinput' class='form-label'>Tribes Name</label>
|
||||
<input type='text' class='form-control' id='tribIdinput' placeholder='A unique name'>
|
||||
</div>
|
||||
<div class='mb-3'>
|
||||
<label for='druidIdinput' class='form-label'>Druid Alias</label>
|
||||
<input type='text' class='form-control' id='druidIdinput' placeholder='An existing alias to become Tribe's Druid'>
|
||||
</div>
|
||||
<div class='input-group mb-3 objaction'>
|
||||
<button class=' objsave btn btn-outline-primary btn-sm' onclick='towns.addupdatetribe('{{tribeId');'><i class='bi-cloud-arrow-up'></i></button>
|
||||
</div>`;
|
||||
return data;
|
||||
}
|
||||
};
|
||||
towns.owntown = (newowner) => {
|
||||
// only the owner can give ownership to someone else
|
||||
if (!newowner) {newowner=apx.data.headers.xalias}
|
||||
axios.get(`api/towns/changeowner/${newowner}`,{ headers: apx.data.headers }).then(rep=>{
|
||||
console.log(rep)
|
||||
apx.data.tpldata.setup.moyorId=newowner;
|
||||
apx.save();
|
||||
app.load('apxmain','townowner',towns.loadtpldata())
|
||||
}).catch(err=>{
|
||||
console.log(err)
|
||||
})
|
||||
|
||||
if (!newowner) {
|
||||
newowner = apx.data.headers.xalias;
|
||||
}
|
||||
axios
|
||||
.get(`api/towns/changeowner/${newowner}`, { headers: apx.data.headers })
|
||||
.then((rep) => {
|
||||
console.log(rep);
|
||||
apx.data.tpldata.setup.mayorId = newowner;
|
||||
apx.save();
|
||||
app.load("apxmain", "townowner", towns.loadtpldata());
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
};
|
||||
towns.addtribe=(tribeId)=>{
|
||||
|
||||
}
|
8
adminapi/www/adminapx/static/style/apxobjmanager.css
Normal file
8
adminapi/www/adminapx/static/style/apxobjmanager.css
Normal file
@@ -0,0 +1,8 @@
|
||||
.objmanager .list-group-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.objmanager .hide {
|
||||
visibility: hidden;
|
||||
}
|
@@ -4,8 +4,8 @@
|
||||
<p>Step by step </p>
|
||||
<div class="input-group mb-3">
|
||||
<input class="form-control me-1" type="search" placeholder="Search" aria-label="Search">
|
||||
<button class="btn btn-outline-primary" onclick="app.search(this)">
|
||||
<i class="fa-solid fa-magnifying-glass"></i>
|
||||
<button class="btn btn-outline-primary btn-sm" onclick="app.search(this)">
|
||||
<i class="bi-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
<h4 class="mt-4">Articles</h4>
|
||||
|
@@ -20,7 +20,7 @@
|
||||
{{^mayorId}}
|
||||
<p>
|
||||
This town is not own by a mayor, anyone can use a pagan account to tell that he is owning this, so please,
|
||||
{{#auth}} you are authenticate under alias: {{alias}} <button class="btn btn-primary" onclick="towns.owntown();">Own this town</button>
|
||||
{{#auth}} you are authenticate under alias: {{alias}} <button class="btn btn-primary" onclick="towns.owntown('{{alias}}');">Own this town</button>
|
||||
{{/auth}}
|
||||
{{^auth}} you have to be authenticat with an alias to own this town. go to Pagan / create login logout and authentify yourself and come back here.
|
||||
{{/auth}}
|
||||
@@ -30,13 +30,13 @@
|
||||
{{#devtown}}
|
||||
<p>You need to change town name (by default it is for dev "devfarm") by running on serveur as sudoer user: </p>
|
||||
<code>node apxtrib.js nationId:nationRequested townId:nameNotalreadyUse dns:domainToAccessTown </code>
|
||||
<p>Come back here.</p>
|
||||
<p>Then Come back here.</p>
|
||||
{{/devtown}}
|
||||
{{^devtown}}
|
||||
<p> As owner you({{alias}}) can give the ownership of this town to an other alias. Be carefull when you click on this button you lose all your accessright on this town.</p>
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control" placeholder="Give alias to take the ownership" aria-label="New owner alias" aria-describedby="button-chgown">
|
||||
<button class="btn btn-outline-secondary" type="button" id="button-chgown">Give him the role on this town</button>
|
||||
<input id="newowner" type="text" class="form-control" placeholder="Give alias to take the ownership" aria-label="New owner alias" aria-describedby="button-chgown">
|
||||
<button class="btn btn-outline-secondary" type="button" id="button-chgown" onclick="towns.owntown(document.getelementbyId('newowner').value)">Give him the role on this town</button>
|
||||
</div>
|
||||
|
||||
{{/devtown}}
|
||||
|
42
adminapi/www/adminapx/static/tpl/towntribes_en.mustache
Normal file
42
adminapi/www/adminapx/static/tpl/towntribes_en.mustache
Normal file
@@ -0,0 +1,42 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<h4 class="text-center">Manage your tribes</h4>
|
||||
<div id="{{idcomponent}}" class="col-sm-6 objmanager" >
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p>Tribes</p>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
<div class="input-group mb-3">
|
||||
<input class="inputfilter form-control me-1" type="search" placeholder="Filter" aria-label="Search">
|
||||
<button class="btnfilter btn btn-outline-primary btn-sm" onclick="objman.filter('{{idcomponent}}';this)">
|
||||
<i class="bi-search"></i>
|
||||
</button>
|
||||
<button class=" objaddedit btn btn-outline-primary btn-sm" onclick="objman.objedit('{{idcomponent}}');"><i class="bi-plus"></i></button>
|
||||
<button class=" objaddedit btn btn-outline-primary btn-sm" onclick="objman.objedit('{{schema}}');"><i class="bi-filetype-json"></i></button>
|
||||
<button class="objlistreturn btn btn-outline-primary btn-sm d-none" onclick="objman.returnlist('{{idcomponent}}')"><i class="bi-list-ul"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="objlist">
|
||||
<ul class="list-group">
|
||||
{{#itm}}
|
||||
<li class="list-group-item">
|
||||
<span>{{tribeId}} ({{druidId}})</span>
|
||||
<div>
|
||||
<button class="btn btn-outline-primary btn-sm" onclick="objman.objedit('{{idcomponent}}','{{tribeId}}')"><i class="bi-pen"></i></button>
|
||||
<button class="btn btn-outline-primary btn-sm" onclick="{{fctdel}}('{{objectname}}',{{tribeId}})"><i class="bi-trash"></i></button>
|
||||
</div>
|
||||
</li>
|
||||
{{/itm}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="objitm d-none">
|
||||
{{{tplform}}}
|
||||
<div class="msgaction"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6" >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user