commit
1add20ecb6
5 changed files with 82 additions and 15 deletions
|
@ -117,9 +117,7 @@ class TicketsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
public function blacklist() {
|
public function blacklist() {
|
||||||
$users = User::paginate();
|
return view("moderator.ticket.blacklist");
|
||||||
$ticketcategories = TicketCategory::all();
|
|
||||||
return view("moderator.ticket.blacklist", compact("users", "ticketcategories"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function blacklistAdd(Request $request) {
|
public function blacklistAdd(Request $request) {
|
||||||
|
|
|
@ -227,6 +227,7 @@ class ServerController extends Controller
|
||||||
/** Show Server Settings */
|
/** Show Server Settings */
|
||||||
public function show(Server $server)
|
public function show(Server $server)
|
||||||
{
|
{
|
||||||
|
if($server->user_id != Auth::user()->id) return redirect()->route('servers.index');
|
||||||
$serverAttributes = Pterodactyl::getServerAttributes($server->pterodactyl_id);
|
$serverAttributes = Pterodactyl::getServerAttributes($server->pterodactyl_id);
|
||||||
$serverRelationships = $serverAttributes['relationships'];
|
$serverRelationships = $serverAttributes['relationships'];
|
||||||
$serverLocationAttributes = $serverRelationships['location']['attributes'];
|
$serverLocationAttributes = $serverRelationships['location']['attributes'];
|
||||||
|
@ -254,6 +255,7 @@ class ServerController extends Controller
|
||||||
|
|
||||||
public function upgrade(Server $server, Request $request)
|
public function upgrade(Server $server, Request $request)
|
||||||
{
|
{
|
||||||
|
if($server->user_id != Auth::user()->id) return redirect()->route('servers.index');
|
||||||
if(!isset($request->product_upgrade))
|
if(!isset($request->product_upgrade))
|
||||||
{
|
{
|
||||||
return redirect()->route('servers.show', ['server' => $server->id])->with('error', __('this product is the only one'));
|
return redirect()->route('servers.show', ['server' => $server->id])->with('error', __('this product is the only one'));
|
||||||
|
|
|
@ -31,7 +31,7 @@ class TicketsController extends Controller
|
||||||
public function create() {
|
public function create() {
|
||||||
#check in blacklist
|
#check in blacklist
|
||||||
$check = TicketBlacklist::where('user_id', Auth::user()->id)->first();
|
$check = TicketBlacklist::where('user_id', Auth::user()->id)->first();
|
||||||
if($check->status == "True"){
|
if($check && $check->status == "True"){
|
||||||
return redirect()->route('ticket.index')->with('error', __("You can't make a ticket because you're on the blacklist for a reason: '" . $check->reason . "', please contact the administrator"));
|
return redirect()->route('ticket.index')->with('error', __("You can't make a ticket because you're on the blacklist for a reason: '" . $check->reason . "', please contact the administrator"));
|
||||||
}
|
}
|
||||||
$ticketcategories = TicketCategory::all();
|
$ticketcategories = TicketCategory::all();
|
||||||
|
@ -73,7 +73,7 @@ class TicketsController extends Controller
|
||||||
public function reply(Request $request) {
|
public function reply(Request $request) {
|
||||||
#check in blacklist
|
#check in blacklist
|
||||||
$check = TicketBlacklist::where('user_id', Auth::user()->id)->first();
|
$check = TicketBlacklist::where('user_id', Auth::user()->id)->first();
|
||||||
if($check->status == "True"){
|
if($check && $check->status == "True"){
|
||||||
return redirect()->route('ticket.index')->with('error', __("You can't reply a ticket because you're on the blacklist for a reason: '" . $check->reason . "', please contact the administrator"));
|
return redirect()->route('ticket.index')->with('error', __("You can't reply a ticket because you're on the blacklist for a reason: '" . $check->reason . "', please contact the administrator"));
|
||||||
}
|
}
|
||||||
$this->validate($request, array("ticketcomment" => "required"));
|
$this->validate($request, array("ticketcomment" => "required"));
|
||||||
|
|
|
@ -69,9 +69,6 @@
|
||||||
</label>
|
</label>
|
||||||
<select id="user_id" style="width:100%" class="custom-select" name="user_id" required
|
<select id="user_id" style="width:100%" class="custom-select" name="user_id" required
|
||||||
autocomplete="off" @error('user_id') is-invalid @enderror>
|
autocomplete="off" @error('user_id') is-invalid @enderror>
|
||||||
@foreach ($users as $user)
|
|
||||||
<option value="{{$user->id}}" >{{ $user->name }}</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group ">
|
<div class="form-group ">
|
||||||
|
@ -112,10 +109,73 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script type="application/javascript">
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
function initUserIdSelect(data) {
|
||||||
$('[data-toggle="popover"]').popover();
|
function escapeHtml(str) {
|
||||||
$('.custom-select').select2();
|
var div = document.createElement('div');
|
||||||
|
div.appendChild(document.createTextNode(str));
|
||||||
|
return div.innerHTML;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#user_id').select2({
|
||||||
|
ajax: {
|
||||||
|
url: '/admin/users.json',
|
||||||
|
dataType: 'json',
|
||||||
|
delay: 250,
|
||||||
|
|
||||||
|
data: function (params) {
|
||||||
|
return {
|
||||||
|
filter: { email: params.term },
|
||||||
|
page: params.page,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
processResults: function (data, params) {
|
||||||
|
return { results: data };
|
||||||
|
},
|
||||||
|
|
||||||
|
cache: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
data: data,
|
||||||
|
escapeMarkup: function (markup) { return markup; },
|
||||||
|
minimumInputLength: 2,
|
||||||
|
templateResult: function (data) {
|
||||||
|
if (data.loading) return escapeHtml(data.text);
|
||||||
|
|
||||||
|
return '<div class="user-block"> \
|
||||||
|
<img class="img-circle img-bordered-xs" src="' + escapeHtml(data.avatarUrl) + '?s=120" alt="User Image"> \
|
||||||
|
<span class="username"> \
|
||||||
|
<a href="#">' + escapeHtml(data.name) +'</a> \
|
||||||
|
</span> \
|
||||||
|
<span class="description"><strong>' + escapeHtml(data.email) + '</strong>' + '</span> \
|
||||||
|
</div>';
|
||||||
|
},
|
||||||
|
templateSelection: function (data) {
|
||||||
|
return '<div> \
|
||||||
|
<span> \
|
||||||
|
<img class="img-rounded img-bordered-xs" src="' + escapeHtml(data.avatarUrl) + '?s=120" style="height:28px;margin-top:-4px;" alt="User Image"> \
|
||||||
|
</span> \
|
||||||
|
<span style="padding-left:5px;"> \
|
||||||
|
' + escapeHtml(data.name) + ' (<strong>' + escapeHtml(data.email) + '</strong>) \
|
||||||
|
</span> \
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
@if (old('user_id'))
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/users.json?user_id={{ old('user_id') }}',
|
||||||
|
dataType: 'json',
|
||||||
|
}).then(function (data) {
|
||||||
|
initUserIdSelect([ data ]);
|
||||||
|
});
|
||||||
|
@else
|
||||||
|
initUserIdSelect();
|
||||||
|
@endif
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
@ -251,7 +251,7 @@
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<form action="{{ route('servers.upgrade', ['server' => $server->id]) }}" method="POST">
|
<form action="{{ route('servers.upgrade', ['server' => $server->id]) }}" method="POST" class="upgrade-form">
|
||||||
@csrf
|
@csrf
|
||||||
<select name="product_upgrade" id="product_upgrade" class="form-input2 form-control">
|
<select name="product_upgrade" id="product_upgrade" class="form-input2 form-control">
|
||||||
<option value="">{{__("Select the product")}}</option>
|
<option value="">{{__("Select the product")}}</option>
|
||||||
|
@ -265,7 +265,7 @@
|
||||||
<br> {{_("Server will be automatically restarted once upgraded")}}
|
<br> {{_("Server will be automatically restarted once upgraded")}}
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer card-body">
|
<div class="modal-footer card-body">
|
||||||
<button onclick="this.disabled='true';" type="submit" class="btn btn-primary" style="width: 100%"><strong>{{__("Change Product")}}</strong></button>
|
<button type="submit" class="btn btn-primary upgrade-once" style="width: 100%"><strong>{{__("Change Product")}}</strong></button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -312,6 +312,13 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<!-- END CONTENT -->
|
<!-- END CONTENT -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(".upgrade-form").submit(function (e) {
|
||||||
|
|
||||||
|
$(".upgrade-once").attr("disabled", true);
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|
Loading…
Add table
Reference in a new issue