Line 1 to 219 defines the following allocation functionalities for the web app :
initClick:Initialize SDK functionality on click.js-sdk function is called.
Here await keyword tells that the async function stops the execution until the config data is fetched.
listAllocationsClick: List Allocations on mouse click . Retrieved via js-sdk function.
createAllocationClick :Create allocation on click.Allocation is created via js-sdk function.
Hereawait keyword tells that the async create allocation function to stop the execution until the allocation config is provided . config constant provides configuration for the allocation.
createAllocationWithBlobbersClick: Create allocation on a specific set /preferred blobbers.The blobber list is fetched via getBlobberListforAllocation function .Js-sdk method is called.
getAllocationDetailsClick :Get Allocation details in web app by calling listAllocationsClick function defined above.
reloadAllocationClick : Reloads the allocation in web app by calling js-sdk method.
freezeAllocationClick : Freeze Allocation on click in web app by calling js-sdk method.Await execution until allocation id is provided.
cancelAllocationClick :Cancel Allocation on click .Functionality provided by js-sdk function.
updateAllocationClick : Update Allocation configuration.Functionality provided by js-sdk method .Execution of updateAllocation method is awaited until updated allocation config is provided in term of allocation expiry or size.
getBlobberListForAllocation: Get list of blobbers available to host allocation.Calls js-sdk method.
getAllocationBlobbersClick :Get Blobbers for Allocation .awaits execution of getBlobberListForAllocation function specified above.
getBlobberIdsClick :Get blobber ID's on click.Calls js-sdk method .
getAllocationFromAuthTicketClick : Get Allocation with AuthTicket.Calls js-sdk .
createReadPoolClick : Create Read Pool for Storage SC. Calls js-sdk method
getReadPoolInfoClick: Get Read pool information.Calls js-sdk method.
lockWritePoolClick: Lock Tokens into Write Pool. Calls js-sdk method.
getBlobbersClick: Get Blobbers for honoring allocation. Calls js-sdk method.
decodeAuthTicket: A function for decoding AuthTicket generated by file share. Calls js-sdk method.
greetClick: A function for displaying a greeting message.
selectAllocation: A helper function for setting allocation.
selectFile: A helper function for selecting file for operations.
showLogs: Show logs for web app functionalities.Calls js-sdk method.
hideLogs: Hide logs for web app functionalities. Calls js-sdk method