lotus/curiosrc/web/static/sector/index.html
Andrew Jackson (Ajax) 1a789d3acb
feat: curioweb: Improve UX, add top menu (#11901)
* cfg edit 1

* jsonschema deps

* feat: lp mig - first few steps

* lp mig: default tasks

* code comments

* docs

* lp-mig-progress

* shared

* comments and todos

* fix: curio: rename lotus-provider to curio (#11645)

* rename provider to curio

* install gotext

* fix lint errors, mod tidy

* fix typo

* fix API_INFO and add gotext to circleCI

* add back gotext

* add gotext after remerge

* lp: channels doc

* finish easy-migration TODOs

* out generate

* merging and more renames

* avoid make-all

* minor doc stuff

* cu: make gen

* make gen fix

* make gen

* tryfix

* go mod tidy

* minor ez migration fixes

* ez setup - ui cleanups

* better error message

* guided setup colors

* better path to saveconfigtolayer

* loadconfigwithupgrades fix

* readMiner oops

* guided - homedir

* err if miner is running

* prompt error should exit

* process already running, miner_id sectors in migration

* dont prompt for language a second time

* check miner stopped

* unlock repo

* render and sql oops

* curio easyMig - some fixes

* easyMigration runs successfully

* lint

* part 2 of last

* message

* merge addtl

* fixing guided setup for myself

* warn-on-no-post

* EditorLoads

* cleanups and styles

* create info

* fix tests

* make gen

* sector early bird

* sectors v2

* sector termination v1

* terminate2

* mjs

* minor things

* flag bad sectors

* fix errors

* add dealweight and deals

* change column width

* ui looking better

* cleanups

* fix pipeline page

* comments

* curioweb: Add missing sector info file

* curioweb: fix hapi root template

---------

Co-authored-by: LexLuthr <88259624+LexLuthr@users.noreply.github.com>
Co-authored-by: LexLuthr <lexluthr@protocol.ai>
Co-authored-by: LexLuthr <lexluthr@curiostorage.org>
Co-authored-by: Łukasz Magiera <magik6k@gmail.com>
2024-04-19 19:08:21 +04:00

129 lines
4.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Sector List</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script type="module" src="/ux/curio-ux.mjs"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/2.0.3/css/dataTables.dataTables.min.css" />
<script src="https://cdn.datatables.net/2.0.2/js/dataTables.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/2.0.3/css/dataTables.bootstrap5.min.css" />
<link rel="stylesheet" href="https://cdn.datatables.net/scroller/2.4.1/css/scroller.dataTables.min.css" />
<script src="https://cdn.datatables.net/scroller/2.4.1/js/dataTables.scroller.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/responsive/3.0.1/css/responsive.dataTables.min.css" />
<script src="https://cdn.datatables.net/responsive/3.0.1/js/dataTables.responsive.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/3.0.1/css/buttons.dataTables.min.css" />
<script src="https://cdn.datatables.net/buttons/3.0.1/js/dataTables.buttons.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/select/2.0.0/css/select.dataTables.min.css" />
<script src="https://cdn.datatables.net/select/2.0.0/js/dataTables.select.min.js"></script>
</head>
<body style="visibility:hidden" data-bs-theme="dark">
<curio-ux>
<section class="section container-fluid">
<div class="row justify-content-center content">
<div class="col-md-auto" style="max-width: 95%">
<table id="sectorTable" class="hover">
<tr>
<td>Loading...</td>
</tr>
</table>
</div>
</div>
</section>
</curio-ux>
<script>
let dt = new DataTable('#sectorTable', {
ajax: '/api/sector/all',
columns: [
{title: "", data: null},
{title: "Miner", data:'MinerID'},
{title: "Sector", data:'SectorNum'},
{title: "Expiry", data:'ExpiresAt'},
{title: "🔗", data:'IsOnChain'},
{title: "Proving", data:'Proving'},
{title: "Has Sealed", data:'HasSealed'},
{title: "Has Unsealed", data:'HasUnsealed'},
{title: "DealWeight", data:"DealWeight"},
{title: "Deals", data:"Deals"},
{title: "Fil+", data:'IsFilPlus'},
{title: "Has Snap", data:'HasSnap'},
{title: "Size", data:"SealInfo"},
{title: "Flag", data:"Flag"}
],
layout: {
topStart: 'buttons',
bottomStart: 'info',
},
buttons: [
{
extend: 'copy',
text: '📋'
},
'csv',
{
extend: 'selected',
text: 'Terminate & Delete',
action: function (e, dt, button, config) {
var res = dt.rows({ selected: true }).data().map(function (row) {
return {MinerID: row.MinerID, Sector: row.SectorNum};
});
if (confirm("Terminate & Delete: "+res.join(", "))) {
axios.post('/api/sector/terminate', res)
.then(function (response) {
console.log(response);
document.cookie = "sector_refresh=true; path=/";
location.reload();
})
.catch(function (error) {
console.log(error);
});
}
}
},
{
text: 'Refresh',
action: function (e, dt, button, config) {
document.cookie = "sector_refresh=true; path=/";
location.reload();
}
}
],
responsive: true,
columnDefs: [
{
orderable: false,
render: DataTable.render.select(),
targets: 0
},
{
targets: 13,
visible: false, // Make the "Flag" column hidden
searchable: false,
}
],
order: [[13, 'desc'], [1, 'asc'], [2, 'asc']],
select: {
style: 'multi',
selector: 'td:first-child',
items: 'row',
rows: '%d rows selected',
headerCheckbox: true,
},
scrollY: window.innerHeight - 250,
deferRender: true,
scroller: true,
});
</script>
</body>
</html>