Update to readme and gitignore
This commit is contained in:
parent
c18e0a8f56
commit
c77ee6f9e6
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
.vscode/
|
.vscode/
|
||||||
|
*.sql
|
||||||
@ -1,4 +1,3 @@
|
|||||||
# Economic System for FLOBNB
|
# Economic System for mining tokens
|
||||||
|
|
||||||
Homepage to find all the details related to FLOBnb project
|
The webpage displays details of the distribution of mining# tokens
|
||||||
# economicsystem-mining
|
|
||||||
|
|||||||
63
index.html
63
index.html
@ -542,6 +542,7 @@
|
|||||||
clone.querySelector('sm-switch').setAttribute('checked', is_admin);
|
clone.querySelector('sm-switch').setAttribute('checked', is_admin);
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_element(id, value) {
|
function update_element(id, value) {
|
||||||
@ -646,6 +647,7 @@
|
|||||||
|
|
||||||
let transactionsLazyLoader
|
let transactionsLazyLoader
|
||||||
function render_user_transactions(transaction_dictionary) {
|
function render_user_transactions(transaction_dictionary) {
|
||||||
|
const frag = document.createDocumentFragment();
|
||||||
let arrayOfTransactions = []
|
let arrayOfTransactions = []
|
||||||
for (let vectorClock in transaction_dictionary) {
|
for (let vectorClock in transaction_dictionary) {
|
||||||
// do something for each key in the object
|
// do something for each key in the object
|
||||||
@ -715,6 +717,7 @@
|
|||||||
update_overview_ui_data();
|
update_overview_ui_data();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
let promise3 = floCloudAPI.requestObjectData("mining_base")
|
let promise3 = floCloudAPI.requestObjectData("mining_base")
|
||||||
Promise.all([promise1, promise2, promise3])
|
Promise.all([promise1, promise2, promise3])
|
||||||
.then((r) => resolve(r))
|
.then((r) => resolve(r))
|
||||||
@ -1111,14 +1114,10 @@
|
|||||||
consumer_email: document.getElementById("subadmin-form-email").value,
|
consumer_email: document.getElementById("subadmin-form-email").value,
|
||||||
consumer_amount: parseFloat(document.getElementById("subadmin-form-amount").value),
|
consumer_amount: parseFloat(document.getElementById("subadmin-form-amount").value),
|
||||||
investor_floid: document.getElementById("subadmin-form-investorFLOID").value,
|
investor_floid: document.getElementById("subadmin-form-investorFLOID").value,
|
||||||
property_floid: document.getElementById("subadmin-form-propertyFLOID")
|
property_floid: document.getElementById("subadmin-form-propertyFLOID").value,
|
||||||
.value,
|
days_stayed: document.getElementById("subadmin-form-numberOfDays").value,
|
||||||
days_stayed: document.getElementById("subadmin-form-numberOfDays")
|
referrer_floid: document.getElementById("subadmin-form-referrerFLOID").value,
|
||||||
.value,
|
referrer_name: document.getElementById("subadmin-form-referrerName").value,
|
||||||
referrer_floid: document.getElementById("subadmin-form-referrerFLOID")
|
|
||||||
.value,
|
|
||||||
referrer_name: document.getElementById("subadmin-form-referrerName")
|
|
||||||
.value,
|
|
||||||
from_date: document.getElementById("subadmin-form-fromDate").value,
|
from_date: document.getElementById("subadmin-form-fromDate").value,
|
||||||
to_date: document.getElementById("subadmin-form-toDate").value,
|
to_date: document.getElementById("subadmin-form-toDate").value,
|
||||||
};
|
};
|
||||||
@ -1150,7 +1149,7 @@
|
|||||||
const user_shares_details = await fetch(`https://miningapitest.duckdns.org/getUserShares?id={id}`)
|
const user_shares_details = await fetch(`https://miningapitest.duckdns.org/getUserShares?id={id}`)
|
||||||
return await user_shares_details.json()
|
return await user_shares_details.json()
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_miner_status(miner_data){
|
function render_miner_status(miner_data){
|
||||||
const frag = document.createDocumentFragment();
|
const frag = document.createDocumentFragment();
|
||||||
var miner_floIDs = Object.keys(floGlobals.appObjects.mining_base.miners)
|
var miner_floIDs = Object.keys(floGlobals.appObjects.mining_base.miners)
|
||||||
@ -1169,16 +1168,6 @@
|
|||||||
document.getElementById("approve-newuser-section").append(frag);
|
document.getElementById("approve-newuser-section").append(frag);
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_mining_shares(miner_shares){
|
|
||||||
var userinfo = await fetch('https://miningapitest.duckdns.org/getUsers')
|
|
||||||
userinfo = await userinfo.json()
|
|
||||||
|
|
||||||
miner_shares.forEach((share) => {
|
|
||||||
debugger
|
|
||||||
// floGlobals.appObjects.mining_base[userinfo['users'][]]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function calculate_share_difference(){
|
async function calculate_share_difference(){
|
||||||
// for each line of share api's response
|
// for each line of share api's response
|
||||||
var miner_shares = await fetch(`https://miningapitest.duckdns.org/getShares`)
|
var miner_shares = await fetch(`https://miningapitest.duckdns.org/getShares`)
|
||||||
@ -1186,6 +1175,30 @@
|
|||||||
process_mining_shares(miner_shares['shares'])
|
process_mining_shares(miner_shares['shares'])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function process_mining_shares(miner_shares){
|
||||||
|
var userinfo = await fetch('https://miningapitest.duckdns.org/getUsers')
|
||||||
|
userinfo = await userinfo.json()
|
||||||
|
|
||||||
|
miner_shares.forEach((share) => {
|
||||||
|
// floGlobals.appObjects.mining_base[userinfo['users'][]]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function change_user_status(username, status){
|
||||||
|
if (status == false){
|
||||||
|
status = 0
|
||||||
|
}
|
||||||
|
else if (status == true){
|
||||||
|
status = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch(`https://miningapitest.duckdns.org/change?username=${username}&status=${status}`)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
console.log(data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
async function onLoadStartUp() {
|
async function onLoadStartUp() {
|
||||||
//floDapps.addStartUpFunction('Sample', Promised Function)
|
//floDapps.addStartUpFunction('Sample', Promised Function)
|
||||||
//floDapps.setAppObjectStores({sampleObs1:{}, sampleObs2:{options{autoIncrement:true, keyPath:'SampleKey'}, Indexes:{sampleIndex:{}}}})
|
//floDapps.setAppObjectStores({sampleObs1:{}, sampleObs2:{options{autoIncrement:true, keyPath:'SampleKey'}, Indexes:{sampleIndex:{}}}})
|
||||||
@ -1230,20 +1243,18 @@
|
|||||||
update_user_ui_data()
|
update_user_ui_data()
|
||||||
|
|
||||||
//App functions....
|
//App functions....
|
||||||
|
|
||||||
|
|
||||||
fetch('https://miningapitest.duckdns.org/getUsers')
|
fetch('https://miningapitest.duckdns.org/getUsers')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
// Check if all the user data is present in the cloud object
|
// Check if all the user data is present in the cloud object
|
||||||
console.log('user data')
|
console.log('user data')
|
||||||
console.log(data)
|
console.log(data)
|
||||||
let unregistered_floids = find_unregistered_floids(data['users'])
|
//let unregistered_floids = find_unregistered_floids(data['users'])
|
||||||
render_miner_status(unregistered_floids)
|
|
||||||
|
|
||||||
// Write a function which will calculate the number of shares required
|
|
||||||
var share_diff = calculate_share_difference()
|
|
||||||
})
|
})
|
||||||
.catch(error => console.error('Error:', error))
|
.catch(error => console.error('Error:', error))
|
||||||
|
|
||||||
}).catch((error) => console.error(error));
|
}).catch((error) => console.error(error));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user