Feat: Multiplayer sessions added using CRUD database.

This commit is contained in:
2026-02-10 11:49:38 +00:00
parent bbbd21d4ad
commit fa81fddbd4
6850 changed files with 808827 additions and 8 deletions

View File

@@ -0,0 +1,83 @@
import API from "../../api.js";
import TableMixinPage from "../mixin_table.js";
import DOM from "../../dom.js";
import TableBasePage from "../base_table.js";
export default class PageUser extends TableBasePage {
static hash = hashPageUserAccount;
static attrIdRowObject = attrUserId;
callSaveTableContent = API.saveUsers;
constructor(router) {
super(router);
this.mixin = new TableMixinPage(this);
}
initialize() {
this.sharedInitialize();
this.hookupTableMain();
}
hookupFilters() {
}
loadRowTable(rowJson) {
if (rowJson == null) return;
if (_verbose) { Utils.consoleLogIfNotProductionEnvironment("applying data row: ", rowJson); }
}
getTableRecords(dirtyOnly = false) {
dirtyOnly = true;
let container = document.querySelector('.' + flagCard + '.' + flagUser);
return [this.getJsonRow(container)];
}
getJsonRow(container) {
console.log("getJsonRow: ", container);
if (container == null) return;
let inputFirstname = container.querySelector(' #' + flagFirstname);
let inputSurname = container.querySelector(' #' + flagSurname);
let inputEmail = container.querySelector(' #' + flagEmail);
let idUser = container.getAttribute(attrUserId);
let jsonRow = {
[attrUserAuth0Id]: null
, [flagEmail]: null
, [flagIsEmailVerified]: null
, [flagIsSuperUser]: null
, [flagCanAdminUser]: null
};
jsonRow[attrUserId] = idUser;
jsonRow[flagFirstname] = DOM.getElementAttributeValueCurrent(inputFirstname);
jsonRow[flagSurname] = DOM.getElementAttributeValueCurrent(inputSurname);
jsonRow[flagEmail] = DOM.getElementAttributeValueCurrent(inputEmail);
return jsonRow;
}
initialiseRowNew(tbody, row) {
}
postInitialiseRowNewCallback(tbody) {
}
hookupTableMain() {
super.hookupTableMain();
this.hookupFieldsFirstname();
this.hookupFieldsSurname();
this.hookupFieldsEmail();
}
hookupFieldsFirstname() {
this.hookupChangeHandlerTableCells('.' + flagCard + '.' + flagUser + ' #' + flagFirstname);
}
hookupFieldsSurname() {
this.hookupChangeHandlerTableCells('.' + flagCard + '.' + flagUser + ' #' + flagSurname);
}
hookupFieldsEmail() {
this.hookupChangeHandlerTableCells('.' + flagCard + '.' + flagUser + ' #' + flagEmail);
}
leave() {
super.leave();
}
}

View File

@@ -0,0 +1,86 @@
import API from "../../api";
import TableMixinPage from "../mixin_table";
import DOM from "../../dom";
import TableBasePage from "../base_table";
import Utils from "../../lib/utils";
export default class PageUsers extends TableBasePage {
static hash = hashPageUserAccounts;
static attrIdRowObject = attrUserId;
callSaveTableContent = API.saveUsers;
constructor(router) {
super(router);
this.mixin = new TableMixinPage(this);
}
initialize() {
this.sharedInitialize();
}
hookupFilters() {
this.sharedHookupFilters();
this.hookupFilterActive();
}
loadRowTable(rowJson) {
if (rowJson == null) return;
if (_verbose) { Utils.consoleLogIfNotProductionEnvironment("applying data row: ", rowJson); }
}
getJsonRow(row) {
if (row == null) return;
let inputFirstname = row.querySelector('td.' + flagFirstname + ' .' + flagFirstname);
let inputSurname = row.querySelector('td.' + flagSurname + ' .' + flagSurname);
let inputNotes = row.querySelector('td.' + flagNotes + ' .' + flagNotes);
let buttonActive = row.querySelector('td.' + flagActive + ' .' + flagActive);
let jsonRow = {
[attrUserAuth0Id]: null
, [flagEmail]: null
, [flagIsEmailVerified]: null
, [flagIsSuperUser]: null
, [flagCanAdminUser]: null
};
jsonRow[attrUserId] = row.getAttribute(attrUserId);
jsonRow[flagFirstname] = DOM.getElementAttributeValueCurrent(inputFirstname);
jsonRow[flagSurname] = DOM.getElementAttributeValueCurrent(inputSurname);
jsonRow[flagNotes] = DOM.getElementAttributeValueCurrent(inputNotes);
jsonRow[flagActive] = buttonActive.classList.contains(flagDelete);
console.log("jsonRow");
console.log(jsonRow);
return jsonRow;
}
initialiseRowNew(tbody, row) {
}
postInitialiseRowNewCallback(tbody) {
let newRows = tbody.querySelectorAll('tr.' + flagRowNew);
let newestRow = newRows[0];
let clickableElementsSelector = [].join('');
newestRow.querySelectorAll(clickableElementsSelector).forEach((clickableElement) => {
clickableElement.click();
});
}
hookupTableMain() {
super.hookupTableMain();
this.hookupFieldsFirstname();
this.hookupFieldsSurname();
this.hookupFieldsNotesTable();
this.hookupFieldsActive();
}
hookupFieldsFirstname() {
this.hookupChangeHandlerTableCells(flagFirstname);
}
hookupFieldsSurname() {
this.hookupChangeHandlerTableCells(flagSurname);
}
leave() {
super.leave();
}
}