mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-23 07:52:06 +01:00
520 lines
14 KiB
HTML
520 lines
14 KiB
HTML
{% extends "baseTemplate/index.html" %}
|
|
{% load i18n %}
|
|
{% block title %}{% trans "Change CyberPanel Access Port - CyberPanel" %}{% endblock %}
|
|
|
|
{% block header_scripts %}
|
|
<style>
|
|
/* CSS Variables for Dark Mode Support */
|
|
:root {
|
|
/* Text colors */
|
|
--text-primary: #2f3640;
|
|
--text-secondary: #64748b;
|
|
--text-muted: #8893a7;
|
|
|
|
/* Background colors */
|
|
--bg-primary: #ffffff;
|
|
--bg-secondary: #f8f9ff;
|
|
--bg-light: #f0f0ff;
|
|
--bg-card: #ffffff;
|
|
|
|
/* Border colors */
|
|
--border-color: #e8e9ff;
|
|
|
|
/* Accent colors */
|
|
--accent-color: #5b5fcf;
|
|
--accent-hover: #4b4fbf;
|
|
--accent-focus: rgba(91,95,207,0.1);
|
|
--accent-shadow: rgba(91,95,207,0.3);
|
|
|
|
/* Status colors */
|
|
--warning-bg: #fff3cd;
|
|
--warning-border: #ffeaa7;
|
|
--warning-color: #856404;
|
|
--warning-accent: #f39c12;
|
|
|
|
/* Shadow colors */
|
|
--shadow-light: rgba(0,0,0,0.08);
|
|
--shadow-medium: rgba(0,0,0,0.1);
|
|
|
|
/* Neutral colors */
|
|
--neutral-disabled: #94a3b8;
|
|
|
|
/* Info colors */
|
|
--info-bg: #e3f2fd;
|
|
--info-border: #90caf9;
|
|
--info-color: #1565c0;
|
|
--info-accent: #2196f3;
|
|
}
|
|
|
|
[data-theme="dark"] {
|
|
/* Dark mode overrides */
|
|
--text-primary: #e4e4e7;
|
|
--text-secondary: #9ca3af;
|
|
--text-muted: #6b7280;
|
|
|
|
--bg-primary: #0f0f23;
|
|
--bg-secondary: #1e1e42;
|
|
--bg-light: #252550;
|
|
--bg-card: #1a1a3e;
|
|
|
|
--border-color: #2a2a5e;
|
|
|
|
--accent-color: #7c7ff3;
|
|
--accent-hover: #6b6ee8;
|
|
--accent-focus: rgba(124,127,243,0.1);
|
|
--accent-shadow: rgba(124,127,243,0.3);
|
|
|
|
--warning-bg: #78350f;
|
|
--warning-border: #92400e;
|
|
--warning-color: #fbbf24;
|
|
--warning-accent: #f59e0b;
|
|
|
|
--shadow-light: rgba(0,0,0,0.3);
|
|
--shadow-medium: rgba(0,0,0,0.4);
|
|
|
|
--neutral-disabled: #4b5563;
|
|
|
|
--info-bg: #1e3a8a;
|
|
--info-border: #1e40af;
|
|
--info-color: #93c5fd;
|
|
--info-accent: #3b82f6;
|
|
}
|
|
|
|
/* Angular cloak to prevent flashing */
|
|
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
|
|
display: none !important;
|
|
}
|
|
|
|
/* Default state before Angular loads */
|
|
.btn-primary .loading-spinner,
|
|
.btn-primary span:nth-child(4) {
|
|
display: none !important;
|
|
}
|
|
|
|
/* Angular hide class */
|
|
.ng-hide {
|
|
display: none !important;
|
|
}
|
|
|
|
/* Show loading spinner when not hidden */
|
|
.ng-scope .loading-spinner:not(.ng-hide) {
|
|
display: inline-block !important;
|
|
}
|
|
|
|
/* Ensure default text is visible */
|
|
.btn-primary i.fas.fa-save,
|
|
.btn-primary span:nth-child(3) {
|
|
display: inline-block;
|
|
}
|
|
|
|
/* Page Specific Styles */
|
|
.page-wrapper {
|
|
background: transparent;
|
|
padding: 20px;
|
|
}
|
|
|
|
.page-container {
|
|
max-width: 800px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
/* Form Section */
|
|
.form-section {
|
|
background: var(--bg-card);
|
|
border-radius: 12px;
|
|
padding: 30px;
|
|
margin-bottom: 25px;
|
|
box-shadow: 0 2px 8px var(--shadow-light);
|
|
border: 1px solid var(--border-color);
|
|
}
|
|
|
|
.section-title {
|
|
font-size: 18px;
|
|
font-weight: 700;
|
|
color: var(--text-primary);
|
|
margin-bottom: 10px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.section-title::before {
|
|
content: '';
|
|
width: 4px;
|
|
height: 24px;
|
|
background: var(--accent-color);
|
|
border-radius: 2px;
|
|
}
|
|
|
|
.section-description {
|
|
font-size: 14px;
|
|
color: var(--text-secondary);
|
|
margin-bottom: 30px;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.form-content {
|
|
max-width: 600px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.form-label {
|
|
display: block;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: var(--text-primary);
|
|
margin-bottom: 10px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.form-control-wrapper {
|
|
position: relative;
|
|
}
|
|
|
|
.form-control {
|
|
width: 100%;
|
|
padding: 12px 16px;
|
|
font-size: 14px;
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 8px;
|
|
background: var(--bg-secondary);
|
|
color: var(--text-primary);
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.form-control:focus {
|
|
outline: none;
|
|
border-color: var(--accent-color);
|
|
background: var(--bg-card);
|
|
box-shadow: 0 0 0 3px var(--accent-focus);
|
|
}
|
|
|
|
.form-help {
|
|
font-size: 12px;
|
|
color: var(--text-muted);
|
|
margin-top: 8px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
.form-help i {
|
|
font-size: 13px;
|
|
color: var(--accent-color);
|
|
}
|
|
|
|
.form-actions {
|
|
display: flex;
|
|
gap: 15px;
|
|
justify-content: center;
|
|
margin-top: 35px;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: var(--accent-color);
|
|
color: white;
|
|
border: none;
|
|
padding: 12px 30px;
|
|
border-radius: 8px;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: var(--accent-hover);
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 5px 15px var(--accent-shadow);
|
|
}
|
|
|
|
.btn-primary:disabled {
|
|
background: var(--neutral-disabled);
|
|
cursor: not-allowed;
|
|
transform: none;
|
|
box-shadow: none;
|
|
}
|
|
|
|
/* Loading State */
|
|
.loading-spinner {
|
|
display: inline-block;
|
|
width: 14px;
|
|
height: 14px;
|
|
border: 2px solid var(--bg-primary);
|
|
border-radius: 50%;
|
|
border-top-color: transparent;
|
|
animation: spin 0.8s linear infinite;
|
|
}
|
|
|
|
@keyframes spin {
|
|
to { transform: rotate(360deg); }
|
|
}
|
|
|
|
/* Info Box */
|
|
.info-box {
|
|
background: var(--info-bg);
|
|
border: 1px solid var(--info-border);
|
|
border-radius: 8px;
|
|
padding: 16px;
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.info-box-title {
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: var(--info-color);
|
|
margin-bottom: 8px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.info-box-title i {
|
|
color: var(--info-accent);
|
|
font-size: 16px;
|
|
}
|
|
|
|
.info-box-content {
|
|
font-size: 13px;
|
|
color: var(--info-color);
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.info-box-content strong {
|
|
color: var(--info-color);
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* Warning Box */
|
|
.warning-box {
|
|
background: var(--warning-bg);
|
|
border: 1px solid var(--warning-border);
|
|
border-radius: 8px;
|
|
padding: 16px;
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.warning-box-title {
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: var(--warning-color);
|
|
margin-bottom: 8px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.warning-box-title i {
|
|
color: var(--warning-accent);
|
|
font-size: 16px;
|
|
}
|
|
|
|
.warning-box-content {
|
|
font-size: 13px;
|
|
color: var(--warning-color);
|
|
line-height: 1.6;
|
|
}
|
|
|
|
/* Bootstrap Toggle Styling Override */
|
|
.toggle {
|
|
position: relative;
|
|
overflow: hidden;
|
|
width: 70px !important;
|
|
height: 32px !important;
|
|
border-radius: 8px !important;
|
|
border: 1px solid var(--border-color) !important;
|
|
}
|
|
|
|
.toggle.off {
|
|
background: var(--bg-secondary) !important;
|
|
border-color: var(--border-color) !important;
|
|
}
|
|
|
|
.toggle.on {
|
|
background: var(--accent-color) !important;
|
|
border-color: var(--accent-color) !important;
|
|
}
|
|
|
|
.toggle .toggle-handle {
|
|
position: absolute;
|
|
top: 2px;
|
|
bottom: 2px;
|
|
width: 26px !important;
|
|
background: white !important;
|
|
border-radius: 6px !important;
|
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
|
|
transition: all 0.3s ease !important;
|
|
}
|
|
|
|
.toggle.off .toggle-handle {
|
|
left: 2px;
|
|
}
|
|
|
|
.toggle.on .toggle-handle {
|
|
right: 2px;
|
|
left: auto;
|
|
}
|
|
|
|
.toggle-group {
|
|
transition: all 0.3s ease !important;
|
|
}
|
|
|
|
.toggle-on, .toggle-off {
|
|
font-size: 12px !important;
|
|
font-weight: 600 !important;
|
|
letter-spacing: 0.5px !important;
|
|
text-transform: uppercase !important;
|
|
}
|
|
|
|
.toggle-on {
|
|
background: transparent !important;
|
|
color: white !important;
|
|
box-shadow: none !important;
|
|
}
|
|
|
|
.toggle-off {
|
|
background: transparent !important;
|
|
color: var(--text-secondary) !important;
|
|
box-shadow: none !important;
|
|
}
|
|
|
|
/* Toggle Container Styling */
|
|
.toggle-container {
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.toggle-label {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.toggle-label span {
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: var(--text-primary);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.toggle-help {
|
|
font-size: 12px;
|
|
color: var(--text-muted);
|
|
margin-top: 8px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
.toggle-help i {
|
|
font-size: 13px;
|
|
color: var(--accent-color);
|
|
}
|
|
|
|
/* Responsive */
|
|
@media (max-width: 768px) {
|
|
.form-section {
|
|
padding: 20px;
|
|
}
|
|
|
|
.section-title {
|
|
font-size: 16px;
|
|
}
|
|
|
|
.form-actions {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.btn-primary {
|
|
width: 100%;
|
|
justify-content: center;
|
|
}
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="page-wrapper">
|
|
<div class="page-container" ng-controller="changePort">
|
|
<!-- Form Section -->
|
|
<div class="form-section">
|
|
<h2 class="section-title">{% trans "Change CyberPanel Port" %}</h2>
|
|
<p class="section-description">
|
|
{% trans "Configure the port used to access your CyberPanel control panel. The default port is 8090." %}
|
|
</p>
|
|
|
|
<!-- Warning Box -->
|
|
<div class="warning-box">
|
|
<div class="warning-box-title">
|
|
<i class="fas fa-exclamation-triangle"></i>
|
|
{% trans "Important Notice" %}
|
|
</div>
|
|
<div class="warning-box-content">
|
|
{% trans "After changing the port, you will need to access CyberPanel using the new port number. Make sure to update your firewall rules to allow access through the new port." %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Info Box -->
|
|
<div class="info-box">
|
|
<div class="info-box-title">
|
|
<i class="fas fa-info-circle"></i>
|
|
{% trans "Current Configuration" %}
|
|
</div>
|
|
<div class="info-box-content">
|
|
{% trans "Your CyberPanel is currently accessible on port" %} <strong>{{ port }}</strong>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-content">
|
|
<form action="/" method="post">
|
|
<div class="form-group">
|
|
<label class="form-label">{% trans "New Port Number" %}</label>
|
|
<div class="form-control-wrapper">
|
|
<input type="text"
|
|
name="port"
|
|
class="form-control"
|
|
ng-model="port"
|
|
ng-init="port={{ port }}"
|
|
placeholder="{% trans 'Enter port number (e.g., 8090)' %}"
|
|
required
|
|
pattern="[0-9]+"
|
|
min="1"
|
|
max="65535">
|
|
</div>
|
|
<div class="form-help">
|
|
<i class="fas fa-lightbulb"></i>
|
|
{% trans "Valid port range: 1 - 65535. Common ports: 8090, 8443, 7080." %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-actions">
|
|
<button type="button"
|
|
class="btn-primary"
|
|
ng-click="changeCPPort()"
|
|
ng-disabled="cyberpanelLoading">
|
|
<i class="fas fa-save" ng-class="{'ng-hide': cyberpanelLoading}"></i>
|
|
<span class="loading-spinner" ng-class="{'ng-hide': !cyberpanelLoading}"></span>
|
|
<span ng-class="{'ng-hide': cyberpanelLoading}">{% trans "Change Port" %}</span>
|
|
<span ng-class="{'ng-hide': !cyberpanelLoading}">{% trans "Changing..." %}</span>
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|