2017-09-26 02:43:01 +00:00
|
|
|
{{-- Pterodactyl - Panel --}}
|
2017-01-24 22:57:08 +00:00
|
|
|
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
|
2017-01-21 20:40:46 +00:00
|
|
|
|
2017-09-26 02:43:01 +00:00
|
|
|
{{-- This software is licensed under the terms of the MIT license. --}}
|
|
|
|
{{-- https://opensource.org/licenses/MIT --}}
|
2017-01-21 20:40:46 +00:00
|
|
|
@extends('layouts.master')
|
|
|
|
|
|
|
|
@section('title')
|
2017-09-14 02:46:43 +00:00
|
|
|
@lang('server.schedules.edit.header')
|
2017-01-21 20:40:46 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('scripts')
|
|
|
|
{{-- This has to be loaded before the AdminLTE theme to avoid dropdown issues. --}}
|
|
|
|
{!! Theme::css('vendor/select2/select2.min.css') !!}
|
|
|
|
@parent
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content-header')
|
2017-09-14 02:46:43 +00:00
|
|
|
<h1>@lang('server.schedule.manage.header')<small>{{ $schedule->name }}</small></h1>
|
2017-01-21 20:40:46 +00:00
|
|
|
<ol class="breadcrumb">
|
|
|
|
<li><a href="{{ route('index') }}">@lang('strings.home')</a></li>
|
|
|
|
<li><a href="{{ route('server.index', $server->uuidShort) }}">{{ $server->name }}</a></li>
|
2017-09-14 02:46:43 +00:00
|
|
|
<li><a href="{{ route('server.schedules', $server->uuidShort) }}">@lang('navigation.server.schedules')</a></li>
|
|
|
|
<li class="active">@lang('server.schedule.manage.header')</li>
|
2017-01-21 20:40:46 +00:00
|
|
|
</ol>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content')
|
2017-09-14 02:46:43 +00:00
|
|
|
<form action="{{ route('server.schedules.view', ['server' => $server->uuidShort, 'schedule' => $schedule->hashid]) }}" method="POST">
|
2017-09-10 04:55:21 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div class="box box-primary">
|
|
|
|
<div class="box-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="form-group col-xs-12">
|
2017-09-13 04:45:19 +00:00
|
|
|
<label class="control-label" for="scheduleName">@lang('strings.name') <span class="field-optional"></span></label>
|
2017-09-10 04:55:21 +00:00
|
|
|
<div>
|
2017-09-14 02:46:43 +00:00
|
|
|
<input type="text" name="name" class="form-control" id="scheduleName" value="{{ old('name', $schedule->name) }}" />
|
2017-09-10 04:55:21 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-01-21 20:40:46 +00:00
|
|
|
<div class="row">
|
2017-09-13 04:45:19 +00:00
|
|
|
<div class="col-xs-6 col-md-3">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="scheduleDayOfWeek" class="control-label">@lang('server.schedule.day_of_week')</label>
|
|
|
|
<div>
|
2017-09-14 02:46:43 +00:00
|
|
|
<select data-action="update-field" data-field="cron_day_of_week" class="form-control" multiple>
|
|
|
|
<option value="0">@lang('strings.days.sun')</option>
|
|
|
|
<option value="1">@lang('strings.days.mon')</option>
|
|
|
|
<option value="2">@lang('strings.days.tues')</option>
|
|
|
|
<option value="3">@lang('strings.days.wed')</option>
|
|
|
|
<option value="4">@lang('strings.days.thurs')</option>
|
|
|
|
<option value="5">@lang('strings.days.fri')</option>
|
|
|
|
<option value="6">@lang('strings.days.sat')</option>
|
2017-09-13 04:45:19 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
2017-01-21 20:40:46 +00:00
|
|
|
</div>
|
2017-09-13 04:45:19 +00:00
|
|
|
<div class="form-group">
|
2017-09-14 02:46:43 +00:00
|
|
|
<input type="text" id="scheduleDayOfWeek" class="form-control" name="cron_day_of_week" value="{{ old('cron_day_of_week', $schedule->cron_day_of_week) }}" />
|
2017-01-21 20:40:46 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-09-13 04:45:19 +00:00
|
|
|
<div class="col-xs-6 col-md-3">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="scheduleDayOfMonth" class="control-label">@lang('server.schedule.day_of_month')</label>
|
|
|
|
<div>
|
2017-09-14 02:46:43 +00:00
|
|
|
<select data-action="update-field" data-field="cron_day_of_month" class="form-control" multiple>
|
2017-09-13 04:45:19 +00:00
|
|
|
@foreach(range(1, 31) as $i)
|
|
|
|
<option value="{{ $i }}">{{ $i }}</option>
|
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
</div>
|
2017-01-21 20:40:46 +00:00
|
|
|
</div>
|
2017-09-13 04:45:19 +00:00
|
|
|
<div class="form-group">
|
2017-09-14 02:46:43 +00:00
|
|
|
<input type="text" id="scheduleDayOfMonth" class="form-control" name="cron_day_of_month" value="{{ old('cron_day_of_month', $schedule->cron_day_of_month) }}" />
|
2017-01-21 20:40:46 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-09-13 04:45:19 +00:00
|
|
|
<div class="col-xs-6 col-md-3">
|
|
|
|
<div class="form-group col-md-12">
|
|
|
|
<label for="scheduleHour" class="control-label">@lang('server.schedule.hour')</label>
|
|
|
|
<div>
|
2017-09-14 02:46:43 +00:00
|
|
|
<select data-action="update-field" data-field="cron_hour" class="form-control" multiple>
|
2017-09-13 04:45:19 +00:00
|
|
|
@foreach(range(0, 23) as $i)
|
|
|
|
<option value="{{ $i }}">{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}:00</option>
|
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
</div>
|
2017-01-21 20:40:46 +00:00
|
|
|
</div>
|
2017-09-13 04:45:19 +00:00
|
|
|
<div class="form-group col-md-12">
|
2017-09-14 02:46:43 +00:00
|
|
|
<input type="text" id="scheduleHour" class="form-control" name="cron_hour" value="{{ old('cron_hour', $schedule->cron_hour) }}" />
|
2017-01-21 20:40:46 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-09-13 04:45:19 +00:00
|
|
|
<div class="col-xs-6 col-md-3">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="scheduleMinute" class="control-label">@lang('server.schedule.minute')</label>
|
|
|
|
<div>
|
2017-09-14 02:46:43 +00:00
|
|
|
<select data-action="update-field" data-field="cron_minute" class="form-control" multiple>
|
2017-09-13 04:45:19 +00:00
|
|
|
@foreach(range(0, 55) as $i)
|
|
|
|
@if($i % 5 === 0)
|
|
|
|
<option value="{{ $i }}">_ _:{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}</option>
|
|
|
|
@endif
|
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
</div>
|
2017-01-21 20:40:46 +00:00
|
|
|
</div>
|
2017-09-13 04:45:19 +00:00
|
|
|
<div class="form-group">
|
2017-09-14 02:46:43 +00:00
|
|
|
<input type="text" id="scheduleMinute" class="form-control" name="cron_minute" value="{{ old('cron_minute', $schedule->cron_minute) }}" />
|
2017-01-21 20:40:46 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-09-13 04:45:19 +00:00
|
|
|
<div class="box-footer with-border">
|
|
|
|
<p class="small text-muted no-margin-bottom">@lang('server.schedule.time_help')</p>
|
|
|
|
</div>
|
2017-01-21 20:40:46 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12">
|
2017-09-13 04:45:19 +00:00
|
|
|
<div class="box box-primary" id="containsTaskList">
|
|
|
|
@include('partials.schedules.task-template')
|
|
|
|
<div class="box-footer with-border" id="taskAppendBefore">
|
2017-09-14 02:46:43 +00:00
|
|
|
<div>
|
2017-09-13 04:45:19 +00:00
|
|
|
<p class="text-muted small">@lang('server.schedule.task_help')</p>
|
2017-09-10 04:55:21 +00:00
|
|
|
</div>
|
2017-09-14 02:46:43 +00:00
|
|
|
<div class="pull-left">
|
|
|
|
<button type="submit" class="btn btn-sm btn-danger muted muted-hover" id="deleteButton" name="_method" value="DELETE"><i class="fa fa-trash-o"></i></button>
|
|
|
|
</div>
|
2017-09-10 04:55:21 +00:00
|
|
|
<div class="pull-right">
|
|
|
|
{!! csrf_field() !!}
|
2017-09-13 04:45:19 +00:00
|
|
|
<button type="button" class="btn btn-sm btn-default" data-action="add-new-task"><i class="fa fa-plus"></i> @lang('server.schedule.task.add_more')</button>
|
2017-09-14 02:46:43 +00:00
|
|
|
<button type="submit" class="btn btn-sm btn-success" name="_method" value="PATCH">@lang('server.schedule.manage.submit')</button>
|
2017-09-10 04:55:21 +00:00
|
|
|
</div>
|
2017-01-21 20:40:46 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-09-10 04:55:21 +00:00
|
|
|
</form>
|
2017-01-21 20:40:46 +00:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('footer-scripts')
|
|
|
|
@parent
|
|
|
|
{!! Theme::js('js/frontend/server.socket.js') !!}
|
|
|
|
{!! Theme::js('vendor/select2/select2.full.min.js') !!}
|
2017-09-13 04:45:19 +00:00
|
|
|
{!! Theme::js('js/frontend/tasks/view-actions.js') !!}
|
2017-09-14 02:46:43 +00:00
|
|
|
<script>
|
|
|
|
$(document).ready(function () {
|
|
|
|
$('#deleteButton').on('mouseenter', function () {
|
|
|
|
$(this).find('i').html(' @lang('server.schedule.manage.delete')');
|
|
|
|
}).on('mouseleave', function () {
|
|
|
|
$(this).find('i').html('');
|
|
|
|
});
|
|
|
|
$.each(Pterodactyl.tasks, function (index, value) {
|
|
|
|
var element = (index !== 0) ? $('button[data-action="add-new-task"]').trigger('click').data('element') : $('div[data-target="task-clone"]');
|
|
|
|
var timeValue = (value.time_offset > 59) ? value.time_offset / 60 : value.time_offset;
|
|
|
|
var timeInterval = (value.time_offset > 59) ? 'm' : 's';
|
|
|
|
element.find('select[name="tasks[time_value][]"]').val(timeValue).trigger('change');
|
|
|
|
element.find('select[name="tasks[time_interval][]"]').val(timeInterval).trigger('change');
|
|
|
|
element.find('select[name="tasks[action][]"]').val(value.action).trigger('change');
|
|
|
|
element.find('input[name="tasks[payload][]"]').val(value.payload);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
2017-01-21 20:40:46 +00:00
|
|
|
@endsection
|