forked from Simnation/Main
ed
This commit is contained in:
parent
48a36209b5
commit
884f3df7cf
262 changed files with 223207 additions and 2 deletions
|
@ -0,0 +1,59 @@
|
|||
class SpeedcamsProfit{
|
||||
constructor(){
|
||||
this.name = "speedcamsprofit";
|
||||
}
|
||||
|
||||
static allowAddNew(){
|
||||
return false;
|
||||
}
|
||||
|
||||
static GetColumns(){
|
||||
return ["state", "type", "name", "totalProfit", "lastTime", "lastProfit", "id"]
|
||||
}
|
||||
|
||||
static TableDataCreate(row, key){
|
||||
if(key == "id"){
|
||||
|
||||
if(row.allowRoute){
|
||||
let coords = {}
|
||||
coords.x = row.positionX;
|
||||
coords.y = row.positionY;
|
||||
|
||||
coords = JSON.stringify(coords);
|
||||
|
||||
return `
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary btn-sm" data-entering='${coords}' onclick="GenerateRoute(this, false)">
|
||||
<i class="fa-solid fa-location-dot"></i>
|
||||
<button>
|
||||
</td>`;
|
||||
}
|
||||
else{
|
||||
return `<td></td>`;
|
||||
}
|
||||
}
|
||||
else if(key == "type"){
|
||||
|
||||
let text = getTranslation("speedcamtype." + row[key]);
|
||||
let badge = `<div class="badge badge-warning font-bold">${text}</div>`;
|
||||
if(row[key] == "mobile"){
|
||||
badge = `<div class="badge badge-primary font-bold">${text}</div>`;
|
||||
}
|
||||
|
||||
return `<td>${badge}</td>`;
|
||||
}
|
||||
else if(key == "state"){
|
||||
|
||||
let text = getTranslation("speedcam_active." + row[key]);
|
||||
let badge = `<div class="badge badge-error font-bold">${text}</div>`;
|
||||
if(row[key] == 1){
|
||||
badge = `<div class="badge badge-success font-bold">${text}</div>`;
|
||||
}
|
||||
|
||||
return `<td>${badge}</td>`;
|
||||
}
|
||||
else{
|
||||
return `<td>${row[key]}</td>`;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue