Listado de brokers

This commit is contained in:
Juan Pablo Vial
2025-03-06 20:34:43 -03:00
parent 18dd8c4ec0
commit c7ee440e03
6 changed files with 226 additions and 0 deletions

View File

@ -0,0 +1,15 @@
@extends('layout.base')
@section('page_title')
Operadores
@hasSection('brokers_title')
- @yield('brokers_title')
@endif
@endsection
@section('page_content')
<div class="ui container">
<h2 class="ui header">Operadores</h2>
@yield('brokers_content')
</div>
@endsection

View File

@ -0,0 +1,52 @@
<div class="ui top attached right aligned basic segment">
<button type="button" class="ui mini tertiary icon button" id="refresh_button">
<i class="sync alternate icon"></i>
</button>
<button type="button" class="ui mini tertiary icon button" id="up_button">
<i class="arrow up icon"></i>
</button>
</div>
<table class="ui table" id="projects">
<thead>
<tr>
<th>Proyecto</th>
</tr>
</thead>
<tbody>
@foreach($projects as $project)
<tr data-index="{{$project->id}}">
<td class="link" colspan="2">{{$project->descripcion}}</td>
</tr>
@endforeach
</tbody>
</table>
@push('page_scripts')
<script>
$(document).ready(function () {
document.querySelectorAll('#projects td.link').forEach(column => {
column.style.cursor = 'pointer'
column.addEventListener('click', () => {
const index = column.parentNode.dataset.index
if (typeof brokers.data.contracts[index] !== 'undefined') {
brokers.data.project_id = index
brokers.draw().brokers(index)
return
}
brokers.get().contracts(index)
})
})
document.getElementById('refresh_button').addEventListener('click', () => {
if (brokers.data.project_id === null) {
return
}
brokers.actions().refresh()
})
document.getElementById('up_button').addEventListener('click', () => {
brokers.actions().up()
})
})
</script>
@endpush