Files
Pterodactyl-S3Manager/admin/view.blade.php
2025-04-26 11:18:20 +07:00

110 lines
4.3 KiB
PHP

<!--
Content on this page will be displayed on your extension's admin page.
-->
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">Information</h3>
</div>
<div class="box-body">
<p>
An Extension For Managing <code>S3 Storage</code> Credentials.
</p>
</div>
</div>
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title">Backup Driver</h3>
</div>
<div class="box-body">
<form method="POST" action="{{ $root }}">
@csrf
<div class="form-group">
<label for="backup_driver">Select Backup Driver</label>
<select name="APP_BACKUP_DRIVER" id="backup_driver" class="form-control">
<option value="s3" {{ env('APP_BACKUP_DRIVER') === 's3' ? 'selected' : '' }}>S3 (Remote)</option>
<option value="wings" {{ env('APP_BACKUP_DRIVER') === 'wings' ? 'selected' : '' }}>Wings (Local)</option>
</select>
</div>
<div class="form-group">
<button type="submit" name="save_driver" value="1" class="btn btn-warning">Save Driver</button>
</div>
</form>
</div>
</div>
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">Management</h3>
</div>
<div class="box-body">
<!-- Display success or error message if available -->
@if(isset($message) && $message)
<div class="alert alert-success">
{{ $message }}
</div>
@endif
<form method="POST" action="{{ $root }}">
@csrf
<div class="form-group">
<label for="region">AWS Region</label>
<input type="text" id="region" name="AWS_DEFAULT_REGION" class="form-control" value="{{ env('AWS_DEFAULT_REGION') }}">
</div>
<div class="form-group">
<label for="key">Access Key ID</label>
<input type="text" id="key" name="AWS_ACCESS_KEY_ID" class="form-control" value="{{ env('AWS_ACCESS_KEY_ID') }}">
</div>
<div class="form-group">
<label for="secret">Secret Access Key</label>
<input type="text" id="secret" name="AWS_SECRET_ACCESS_KEY" class="form-control" value="{{ env('AWS_SECRET_ACCESS_KEY') }}">
</div>
<div class="form-group">
<label for="bucket">Bucket Name</label>
<input type="text" id="bucket" name="AWS_BACKUPS_BUCKET" class="form-control" value="{{ env('AWS_BACKUPS_BUCKET') }}">
</div>
<div class="form-group">
<label for="endpoint">Endpoint</label>
<input type="url" id="endpoint" name="AWS_ENDPOINT" class="form-control" value="{{ rtrim(env('AWS_ENDPOINT'), '/') }}" placeholder="https://s3.example.com">
</div>
<div class="form-group">
<label for="path_style">Path Style Endpoint</label>
<select name="AWS_USE_PATH_STYLE_ENDPOINT" class="form-control">
<option value="true" {{ env('AWS_USE_PATH_STYLE_ENDPOINT') == 'true' ? 'selected' : '' }}>true</option>
<option value="false" {{ env('AWS_USE_PATH_STYLE_ENDPOINT') == 'false' ? 'selected' : '' }}>false</option>
</select>
</div>
<div class="form-group">
<label for="storage_class">Storage Class</label>
<select name="AWS_BACKUPS_STORAGE_CLASS" class="form-control">
<option value="STANDARD" {{ env('AWS_BACKUPS_STORAGE_CLASS') == 'STANDARD' ? 'selected' : '' }}>STANDARD</option>
<option value="STANDARD_IA" {{ env('AWS_BACKUPS_STORAGE_CLASS') == 'STANDARD_IA' ? 'selected' : '' }}>STANDARD_IA</option>
<option value="GLACIER" {{ env('AWS_BACKUPS_STORAGE_CLASS') == 'GLACIER' ? 'selected' : '' }}>GLACIER</option>
</select>
</div>
<div class="form-group">
<label for="part_size">Max Part Size (GB)</label>
<input type="number" min="1" max="5" step="1" id="part_size" name="BACKUP_MAX_PART_SIZE_GB" class="form-control" value="{{ intval(env('BACKUP_MAX_PART_SIZE')) / 1073741824 }}">
</div>
<div class="form-group">
<label for="lifespan">Presigned URL Lifespan (seconds)</label>
<input type="number" id="lifespan" name="BACKUP_PRESIGNED_URL_LIFESPAN" class="form-control" value="{{ env('BACKUP_PRESIGNED_URL_LIFESPAN') }}">
</div>
<div class="form-group">
<button type="submit" name="save_env" value="1" class="btn btn-primary">Save Settings</button>
</div>
</form>
</div>
</div>