Feat: Implementation of New UI (Bar, Homepage, Commander, BSets), Removing NGINX dependency, Dockerfile added
This commit is contained in:
parent
64a4c5fb87
commit
238b594b1e
31 changed files with 734 additions and 202 deletions
|
@ -65,6 +65,7 @@ function getColorName(colorArray) {
|
|||
|
||||
async function createJson() {
|
||||
console.log("Fetching data...")
|
||||
console.log(process.env.NODE_ENV)
|
||||
const bsets = await db.bset.findMany({
|
||||
relationLoadStrategy: "join",
|
||||
include: {
|
||||
|
@ -165,7 +166,12 @@ async function createJson() {
|
|||
}
|
||||
})
|
||||
|
||||
writeFileSync(import.meta.dirname + "/json/misc/bsets.json",JSON.stringify(bsets_list_export), 'utf8')
|
||||
if(process.env.NODE_ENV == "production") {
|
||||
console.log('Production detected !')
|
||||
writeFileSync("/app/data/misc/bsets.json",JSON.stringify(bsets_list_export), 'utf8')
|
||||
} else {
|
||||
writeFileSync(import.meta.dirname + "/json/misc/bsets.json",JSON.stringify(bsets_list_export), 'utf8')
|
||||
}
|
||||
|
||||
|
||||
//for (const card of all_cards) {
|
||||
|
@ -173,7 +179,12 @@ async function createJson() {
|
|||
|
||||
for (const index of Object.keys(commanderData)) {
|
||||
let JSONToWrite = commanderData[index].sort((a,b) => b.percent_decks - a.percent_decks)
|
||||
writeFileSync(import.meta.dirname + "/json/commander/" + index + ".json",JSON.stringify(JSONToWrite), 'utf8')
|
||||
if(process.env.NODE_ENV == "production") {
|
||||
console.log('Production detected !')
|
||||
writeFileSync("/app/data/commander/" + index + ".json",JSON.stringify(JSONToWrite), 'utf8')
|
||||
} else {
|
||||
writeFileSync(import.meta.dirname + "/json/commander/" + index + ".json",JSON.stringify(JSONToWrite), 'utf8')
|
||||
}
|
||||
}
|
||||
|
||||
for (const index of Object.keys(bset_cards_data_export)) {
|
||||
|
@ -181,7 +192,12 @@ async function createJson() {
|
|||
for (const type of Object.keys(JSONToWrite)) {
|
||||
JSONToWrite[type] = JSONToWrite[type].sort((a,b) => b.percent_decks - a.percent_decks)
|
||||
}
|
||||
writeFileSync(import.meta.dirname + "/json/bset/" + index + ".json",JSON.stringify(JSONToWrite), 'utf8')
|
||||
if(process.env.NODE_ENV == "production") {
|
||||
console.log('Production detected !')
|
||||
writeFileSync("/app/data/bset/" + index + ".json",JSON.stringify(JSONToWrite), 'utf8')
|
||||
} else {
|
||||
writeFileSync(import.meta.dirname + "/json/bset/" + index + ".json",JSON.stringify(JSONToWrite), 'utf8')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue