Path: blob/1.0-develop/resources/views/admin/nodes/index.blade.php
7460 views
@extends('layouts.admin')12@section('title')3List Nodes4@endsection56@section('scripts')7@parent8{!! Theme::css('vendor/fontawesome/animation.min.css') !!}9@endsection1011@section('content-header')12<h1>Nodes<small>All nodes available on the system.</small></h1>13<ol class="breadcrumb">14<li><a href="{{ route('admin.index') }}">Admin</a></li>15<li class="active">Nodes</li>16</ol>17@endsection1819@section('content')20<div class="row">21<div class="col-xs-12">22<div class="box box-primary">23<div class="box-header with-border">24<h3 class="box-title">Node List</h3>25<div class="box-tools search01">26<form action="{{ route('admin.nodes') }}" method="GET">27<div class="input-group input-group-sm">28<input type="text" name="filter[name]" class="form-control pull-right" value="{{ request()->input('filter.name') }}" placeholder="Search Nodes">29<div class="input-group-btn">30<button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>31<a href="{{ route('admin.nodes.new') }}"><button type="button" class="btn btn-sm btn-primary" style="border-radius: 0 3px 3px 0;margin-left:-1px;">Create New</button></a>32</div>33</div>34</form>35</div>36</div>37<div class="box-body table-responsive no-padding">38<table class="table table-hover">39<tbody>40<tr>41<th></th>42<th>Name</th>43<th>Location</th>44<th>Memory</th>45<th>Disk</th>46<th class="text-center">Servers</th>47<th class="text-center">SSL</th>48<th class="text-center">Public</th>49</tr>50@foreach ($nodes as $node)51<tr>52<td class="text-center text-muted left-icon" data-action="ping" data-secret="{{ $node->getDecryptedKey() }}" data-location="{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/api/system"><i class="fa fa-fw fa-refresh fa-spin"></i></td>53<td>{!! $node->maintenance_mode ? '<span class="label label-warning"><i class="fa fa-wrench"></i></span> ' : '' !!}<a href="{{ route('admin.nodes.view', $node->id) }}">{{ $node->name }}</a></td>54<td>{{ $node->location->short }}</td>55<td>{{ $node->memory }} MiB</td>56<td>{{ $node->disk }} MiB</td>57<td class="text-center">{{ $node->servers_count }}</td>58<td class="text-center" style="color:{{ ($node->scheme === 'https') ? '#50af51' : '#d9534f' }}"><i class="fa fa-{{ ($node->scheme === 'https') ? 'lock' : 'unlock' }}"></i></td>59<td class="text-center"><i class="fa fa-{{ ($node->public) ? 'eye' : 'eye-slash' }}"></i></td>60</tr>61@endforeach62</tbody>63</table>64</div>65@if($nodes->hasPages())66<div class="box-footer with-border">67<div class="col-md-12 text-center">{!! $nodes->appends(['query' => Request::input('query')])->render() !!}</div>68</div>69@endif70</div>71</div>72</div>73@endsection7475@section('footer-scripts')76@parent77<script>78(function pingNodes() {79$('td[data-action="ping"]').each(function(i, element) {80$.ajax({81type: 'GET',82url: $(element).data('location'),83headers: {84'Authorization': 'Bearer ' + $(element).data('secret'),85},86timeout: 500087}).done(function (data) {88$(element).find('i').tooltip({89title: 'v' + data.version,90});91$(element).removeClass('text-muted').find('i').removeClass().addClass('fa fa-fw fa-heartbeat faa-pulse animated').css('color', '#50af51');92}).fail(function (error) {93var errorText = 'Error connecting to node! Check browser console for details.';94try {95errorText = error.responseJSON.errors[0].detail || errorText;96} catch (ex) {}9798$(element).removeClass('text-muted').find('i').removeClass().addClass('fa fa-fw fa-heart-o').css('color', '#d9534f');99$(element).find('i').tooltip({ title: errorText });100});101}).promise().done(function () {102setTimeout(pingNodes, 10000);103});104})();105</script>106@endsection107108109