-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* flesh out controller ux use esbuild over an npm package for frontend js * include dev mode flag * fix test * set default max price fix #237
- Loading branch information
Showing
17 changed files
with
440 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
dealbot.toml | ||
*~ | ||
controller/static/script.js | ||
node_modules | ||
|
||
|
||
# Binaries for programs and plugins | ||
*.exe | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import "./jquery-global"; | ||
import "bootstrap-cron-picker/dist/cron-picker"; | ||
|
||
$().ready(() => { | ||
$('#newSchedule').cronPicker(); | ||
|
||
$("#addDone").hide(); | ||
if ($('#newSR').is(':checked')) { | ||
$("#newstorage").hide(); | ||
} else { | ||
$("#newretrieval").hide(); | ||
} | ||
$("#newSR").on('change', () => { | ||
if ($('#newSR').is(':checked')) { | ||
$("#newretrieval").show(); | ||
$("#newstorage").hide(); | ||
} else { | ||
$("#newretrieval").hide(); | ||
$("#newstorage").show(); | ||
} | ||
}) | ||
|
||
if (!$('#newRepeat').is(':checked')) { | ||
$("#setschedule").hide(); | ||
} | ||
$("#newRepeat").on('change', () => { | ||
if ($('#newRepeat').is(':checked')) { | ||
$("#setschedule").show(); | ||
} else { | ||
$("#setschedule").hide(); | ||
} | ||
}) | ||
|
||
$("#addtask button").on('click', doSubmit); | ||
$("schedulesection form").on('submit', doSubmit); | ||
}) | ||
|
||
function doSubmit(e) { | ||
if (e.preventDefault) { | ||
e.preventDefault() | ||
} | ||
|
||
// loop over miners | ||
let miners = $("#newMiner").val().trim().split('\n') | ||
|
||
let remaining = miners.length; | ||
let done = () => { | ||
remaining--; | ||
if (!remaining) { | ||
$("#addDone").show() | ||
} | ||
} | ||
|
||
for (let i = 0; i < miners.length; i++) { | ||
let miner = miners[i]; | ||
let url = "/tasks/storage"; | ||
let data = {}; | ||
if ($('#newSR').is(':checked')) { | ||
url = "/tasks/retrieval"; | ||
data = { | ||
"Miner": miner, | ||
"PayloadCID": $('#newCid').val(), | ||
"CARExport": false, | ||
"MaxPriceAttoFIL": 20000000000, | ||
} | ||
} else { | ||
data = { | ||
"Miner": miner, | ||
"Size": $('#newSize').val(), | ||
"StartOffset": 6152, // 3 days? | ||
"FastRetrieval": $('#newFast').is(':checked'), | ||
"Verified": $('#newVerified').is(':checked'), | ||
"MaxPriceAttoFIL": 20000000000, | ||
} | ||
} | ||
|
||
if ($('#newRepeat').is(':checked')) { | ||
data.Schedule = $('#newSchedule').val() | ||
data.ScheduleLimit = $('#newScheduleLimit').val() | ||
} | ||
if ($('#newScheduleTag').val() !='') { | ||
data.Tag = $('#newScheduleTag').val() | ||
} | ||
|
||
$.ajax({ | ||
type: "POST", | ||
url: url, | ||
data: data, | ||
success: done, | ||
}); | ||
} | ||
|
||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import jquery from 'jquery'; | ||
window.jQuery = jquery; | ||
window.$ = jquery; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "dealbot-controller", | ||
"version": "1.0.0", | ||
"description": "dealbot controller webapp logic", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/filecoin-project/dealbot.git" | ||
}, | ||
"author": "Protocol Labs", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/filecoin-project/dealbot/issues" | ||
}, | ||
"homepage": "https://github.com/filecoin-project/dealbot#readme", | ||
"devDependencies": { | ||
"bootstrap-cron-picker": "^1.0.0", | ||
"jquery": "^3.6.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.