You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and dots ('.'), can be up to 35 characters long. Letters must be lowercase.
 
 
 
 

34 lines
1.0 KiB

import { Modal } from "../skama_code/ui/modal.js"
import { Auth } from "../skama_code/auth/auth.js"
import { My } from "../skama_code/commun/my.js"
import login from "./login.js";
export default function profile(temp_engine) {
let modal = new Modal("modal_profile", temp_engine);
modal.after_load(() => {
modal.show();
$('#name').append(My.agent.name);
$('#faction').append(My.agent.faction);
$('#credit').append(My.agent.credits);
$('#hq').append(My.agent.hq);
$('#shipcount').append(My.agent.ships_cpt);
$('#btn-token').on('click', () => {
navigator.clipboard.writeText(My.agent.token);
alert('Token copied !');
})
$('#btn-logout').on('click', () => {
const auth = new Auth();
auth.unload_token();
login(temp_engine);
})
$('#btn-close').on('click', () =>
{
modal.close();
});
});
modal.load("templates/modal_profile.html");
}