|
| 1 | +{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}} |
| 2 | + |
| 3 | +{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}} |
| 4 | +{{-- of this software and associated documentation files (the "Software"), to deal --}} |
| 5 | +{{-- in the Software without restriction, including without limitation the rights --}} |
| 6 | +{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}} |
| 7 | +{{-- copies of the Software, and to permit persons to whom the Software is --}} |
| 8 | +{{-- furnished to do so, subject to the following conditions: --}} |
| 9 | + |
| 10 | +{{-- The above copyright notice and this permission notice shall be included in all --}} |
| 11 | +{{-- copies or substantial portions of the Software. --}} |
| 12 | + |
| 13 | +{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}} |
| 14 | +{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}} |
| 15 | +{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}} |
| 16 | +{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}} |
| 17 | +{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}} |
| 18 | +{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}} |
| 19 | +{{-- SOFTWARE. --}} |
| 20 | +@extends('layouts.master') |
| 21 | + |
| 22 | +@section('title') |
| 23 | + @lang('server.tasks.header') |
| 24 | +@endsection |
| 25 | + |
| 26 | +@section('content-header') |
| 27 | + <h1>@lang('server.tasks.header')<small>@lang('server.tasks.header_sub')</small></h1> |
| 28 | + <ol class="breadcrumb"> |
| 29 | + <li><a href="{{ route('index') }}">@lang('strings.home')</a></li> |
| 30 | + <li><a href="{{ route('server.index', $server->uuidShort) }}">{{ $server->name }}</a></li> |
| 31 | + <li class="active">@lang('navigation.server.task_management')</li> |
| 32 | + </ol> |
| 33 | +@endsection |
| 34 | + |
| 35 | +@section('content') |
| 36 | +<div class="row"> |
| 37 | + <div class="col-xs-12"> |
| 38 | + <div class="box"> |
| 39 | + <div class="box-header with-border"> |
| 40 | + <h3 class="box-title">@lang('server.tasks.current')</h3> |
| 41 | + </div> |
| 42 | + <div class="box-body table-responsive no-padding"> |
| 43 | + <table class="table table-hover"> |
| 44 | + <tbody> |
| 45 | + <tr> |
| 46 | + <th>@lang('strings.action')</th> |
| 47 | + <th>@lang('strings.data')</th> |
| 48 | + <th>@lang('strings.queued')</th> |
| 49 | + <th>@lang('strings.last_run')</th> |
| 50 | + <th>@lang('strings.next_run')</th> |
| 51 | + <th></th> |
| 52 | + <th></th> |
| 53 | + </tr> |
| 54 | + @foreach($tasks as $task) |
| 55 | + <tr @if($task->active === 0)class="muted muted-hover"@endif> |
| 56 | + <td class="middle">{{ $actions[$task->action] }}</td> |
| 57 | + <td class="middle"><code>{{ $task->data }}</code></td> |
| 58 | + <td class="middle"> |
| 59 | + @if ($task->queued) |
| 60 | + <span class="label label-success">@lang('strings.yes')</span> |
| 61 | + @else |
| 62 | + <span class="label label-default">@lang('strings.no')</span> |
| 63 | + @endif |
| 64 | + </td> |
| 65 | + <td class="middle">{{ Carbon::parse($task->last_run)->toDayDateTimeString() }}<br /><span class="text-muted small">({{ Carbon::parse($task->last_run)->diffForHumans() }})</span></td> |
| 66 | + <td class="middle"> |
| 67 | + @if($task->active !== 0) |
| 68 | + {{ Carbon::parse($task->next_run)->toDayDateTimeString() }}<br /><span class="text-muted small">({{ Carbon::parse($task->next_run)->diffForHumans() }})</span> |
| 69 | + @else |
| 70 | + <em>n/a</em> |
| 71 | + @endif |
| 72 | + </td> |
| 73 | + @can('delete-task', $server) |
| 74 | + <td class="text-center middle"><a href="#" data-action="delete-task" data-id="{{ $task->id }}"><i class="fa fa-fw fa-trash-o text-danger" data-toggle="tooltip" data-placement="top" title="@lang('strings.delete')"></i></a></td> |
| 75 | + @endcan |
| 76 | + @can('toggle-task', $server) |
| 77 | + <td class="text-center middle"><a href="#" data-action="toggle-task" data-active="{{ $task->active }}" data-id="{{ $task->id }}"><i class="fa fa-fw fa-eye-slash text-primary" data-toggle="tooltip" data-placement="top" title="@lang('server.tasks.toggle')"></i></a></td> |
| 78 | + @endcan |
| 79 | + </tr> |
| 80 | + @endforeach |
| 81 | + |
| 82 | + </tbody> |
| 83 | + </table> |
| 84 | + </div> |
| 85 | + <div class="box-footer"> |
| 86 | + <a href="{{ route('server.tasks.new', $server->uuidShort) }}"> |
| 87 | + <button class="btn btn-sm btn-primary">@lang('server.tasks.new_task')</button> |
| 88 | + </a> |
| 89 | + </div> |
| 90 | + </div> |
| 91 | + </div> |
| 92 | +</div> |
| 93 | +@endsection |
| 94 | + |
| 95 | +@section('footer-scripts') |
| 96 | + @parent |
| 97 | + {!! Theme::js('js/frontend/server.socket.js') !!} |
| 98 | + {!! Theme::js('js/frontend/tasks.js') !!} |
| 99 | +@endsection |
0 commit comments