some progress
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Add TCP Port - ' . $site->name)
|
||||
|
||||
@section('content')
|
||||
<div class="mb-3">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ route('sites.index') }}">Sites</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('dashboard.show', $site) }}">{{ $site->name }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('tcp-ports.index', $site) }}">TCP Ports</a></li>
|
||||
<li class="breadcrumb-item active">Add Port</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h1 class="mb-4"><i class="bi bi-plus-circle"></i> Add TCP Port</h1>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('tcp-ports.store', $site) }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="port" class="form-label">Port Number</label>
|
||||
<input type="number"
|
||||
class="form-control @error('port') is-invalid @enderror"
|
||||
id="port"
|
||||
name="port"
|
||||
min="1"
|
||||
max="65535"
|
||||
value="{{ old('port') }}"
|
||||
required>
|
||||
@error('port')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">Enter a port number between 1 and 65535.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Port Name (Optional)</label>
|
||||
<input type="text"
|
||||
class="form-control @error('name') is-invalid @enderror"
|
||||
id="name"
|
||||
name="name"
|
||||
value="{{ old('name') }}"
|
||||
maxlength="255"
|
||||
placeholder="e.g., Web Server, Database">
|
||||
@error('name')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">Optional custom name for this port.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
class="form-check-input"
|
||||
id="is_active"
|
||||
name="is_active"
|
||||
value="1"
|
||||
{{ old('is_active', true) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_active">
|
||||
Enable monitoring for this port
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-circle"></i> Add Port
|
||||
</button>
|
||||
<a href="{{ route('tcp-ports.index', $site) }}" class="btn btn-secondary">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Common Ports</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<small class="text-muted">Click to use:</small>
|
||||
<div class="list-group list-group-flush mt-2">
|
||||
@foreach($commonPorts as $portNumber => $portName)
|
||||
<a href="#" class="list-group-item list-group-item-action py-2 px-3 common-port"
|
||||
data-port="{{ $portNumber }}"
|
||||
data-name="{{ $portName }}">
|
||||
<strong>{{ $portNumber }}</strong> - {{ $portName }}
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.querySelectorAll('.common-port').forEach(function(element) {
|
||||
element.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
document.getElementById('port').value = this.dataset.port;
|
||||
document.getElementById('name').value = this.dataset.name;
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@endsection
|
||||
Reference in New Issue
Block a user