Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
blockscout/apps/block_scout_web/assets/js/pages/admin/tasks.js

28 lines
663 B

import $ from 'jquery'
import '../../app'
const runTask = (event) => {
const element = event.currentTarget
const $element = $(element)
const $loading = $element.find('[data-loading-message]')
const $errorMessage = $element.find('[data-error-message]')
const $successMessage = $element.find('[data-success-message]')
const apiPath = element.dataset.api_path
$errorMessage.hide()
$successMessage.hide()
$loading.show()
$.get(apiPath)
.done(response => {
$successMessage.show()
$loading.hide()
})
.fail(() => {
$loading.hide()
$errorMessage.show()
})
}
$('#run-create-contract-methods').click(runTask)