mirror of
https://github.com/chaoticbackup/chaoticbackup.github.io.git
synced 2026-08-21 08:04:18 -05:00
debug, purge local db
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -101,6 +101,10 @@ class CollectionDB {
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
purgeDB() {
|
||||
this.db.deleteDatabase();
|
||||
}
|
||||
}
|
||||
|
||||
class API {
|
||||
@@ -170,6 +174,21 @@ class API {
|
||||
}
|
||||
}
|
||||
|
||||
// Input format
|
||||
// [{cards: 'attacks'}, {portal: 'attacks'}]
|
||||
async buildCollection(input) {
|
||||
return await Promise.all(input.map((item) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if ('cards' in item)
|
||||
return this.cards.setupType(item.cards, resolve);
|
||||
if ('portal' in item)
|
||||
return this.portal.setupType(item.portal, resolve);
|
||||
console.error('cards or portal');
|
||||
return reject();
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
get tribes() {
|
||||
return ["Danian", "Generic", "Mipedian", "OverWorld", "UnderWorld"];
|
||||
}
|
||||
@@ -194,19 +213,11 @@ class API {
|
||||
};
|
||||
}
|
||||
|
||||
// Input format
|
||||
// [{cards: 'attacks'}, {portal: 'attacks'}]
|
||||
async buildCollection(input) {
|
||||
return await Promise.all(input.map((item) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if ('cards' in item)
|
||||
return this.cards.setupType(item.cards, resolve);
|
||||
if ('portal' in item)
|
||||
return this.portal.setupType(item.portal, resolve);
|
||||
console.error('cards or portal');
|
||||
return reject();
|
||||
});
|
||||
}));
|
||||
purgeDB()
|
||||
{
|
||||
this.cards.purgeDB();
|
||||
this.portal.purgeDB();
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,18 +57,16 @@ export default class Home extends React.Component {
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{textAlign: 'left'}}>
|
||||
<p>Showing page {this.p} of {numpages} {prev()} {next()}</p>
|
||||
<p>
|
||||
Entries per page:
|
||||
{/*<input type="text" style={{width: '40px'}} value={this.n}
|
||||
onChange={(event) => {let x = event.target.value; if (!isNaN(x)) this.n=x;}
|
||||
/>*/}
|
||||
<input type="button" value="5" disabled={this.n=="5"} onClick={(e) => this.n=e.target.value} />
|
||||
<input type="button" value="10" disabled={this.n=="10"} onClick={(e) => this.n=e.target.value} />
|
||||
<input type="button" value="20" disabled={this.n=="20"} onClick={(e) => this.n=e.target.value} />
|
||||
<input type="button" value="50" disabled={this.n=="50"} onClick={(e) => this.n=e.target.value} />
|
||||
</p>
|
||||
<div style={{textAlign: 'left'}} className="entries">
|
||||
{this.content.length} results - page {this.p} of {numpages} {prev()} {next()}
|
||||
<br/>Entries per page:
|
||||
{/*<input type="text" style={{width: '40px'}} value={this.n}
|
||||
onChange={(event) => {let x = event.target.value; if (!isNaN(x)) this.n=x;}
|
||||
/>*/}
|
||||
<input type="button" value="5" disabled={this.n=="5"} onClick={(e) => this.n=e.target.value} />
|
||||
<input type="button" value="10" disabled={this.n=="10"} onClick={(e) => this.n=e.target.value} />
|
||||
<input type="button" value="20" disabled={this.n=="20"} onClick={(e) => this.n=e.target.value} />
|
||||
<input type="button" value="50" disabled={this.n=="50"} onClick={(e) => this.n=e.target.value} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -5,6 +5,7 @@ import {observer, inject} from 'mobx-react';
|
||||
import s from '../styles/app.style';
|
||||
|
||||
/* Components */
|
||||
import API from './SpreadsheetData';
|
||||
import {PageNotFound, UnderConstruction, Donate} from './Snippets';
|
||||
import EnterTheCode from './entercode/index';
|
||||
import Collection from './collection/index';
|
||||
@@ -137,7 +138,7 @@ function Base(props) {
|
||||
</div>
|
||||
</div>
|
||||
<div className="footer-language">
|
||||
<a href="javascript:showLanguageSelection();" className="page-options" title="Change Language">
|
||||
<a href="" onClick={(e) => {API.purgeDB(); return;}} className="page-options" title="Change Language">
|
||||
<img src="/src/img/flag_usa_.gif" alt="English (Change Language)" width="40" height="27"/>
|
||||
<br />English (Change Language)
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user