mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-08-05 17:19:27 +02:00
567 lines
30 KiB
HTML
Executable File
567 lines
30 KiB
HTML
Executable File
{% extends "baseTemplate/index.html" %}
|
|
{% load i18n %}
|
|
{% block title %}{% trans "Websites Hosted - CyberPanel" %}{% endblock %}
|
|
{% block content %}
|
|
|
|
{% load static %}
|
|
{% get_current_language as LANGUAGE_CODE %}
|
|
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
|
|
|
<!-- Add Font Awesome -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
$('[data-toggle="tooltip"]').tooltip();
|
|
});
|
|
</script>
|
|
|
|
<div ng-controller="listWebsites" class="container">
|
|
<!-- Loading State -->
|
|
<div ng-show="loading" class="text-center" style="padding: 50px;">
|
|
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
|
|
<span class="sr-only">Loading...</span>
|
|
</div>
|
|
<h4 class="mt-3">{% trans "Loading websites..." %}</h4>
|
|
</div>
|
|
|
|
<!-- Main Content (hidden while loading) -->
|
|
<div ng-hide="loading">
|
|
<!-- Password Protection Modal -->
|
|
<div class="modal fade" id="passwordProtectionModal" tabindex="-1" role="dialog">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Password Protection</h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form>
|
|
<div class="form-group">
|
|
<label>Username</label>
|
|
<input type="text" class="form-control" ng-model="currentWP.PPUsername" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Password</label>
|
|
<input type="password" class="form-control" ng-model="currentWP.PPPassword" required>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
|
<button type="button" class="btn btn-primary" ng-click="submitPasswordProtection()">Enable Protection</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="page-title">
|
|
<h2 id="domainNamePage">{% trans "List Websites" %}
|
|
<a class="pull-right btn btn-primary" href="{% url "createWebsite" %}">{% trans "Create Website" %}</a>
|
|
</h2>
|
|
<img ng-hide="cyberPanelLoading" src="{% static 'images/loading.gif' %}">
|
|
<p>{% trans "On this page you can launch, list, modify and delete websites from your server." %}</p>
|
|
</div>
|
|
|
|
<div class="col-sm-10" style="padding: 0px; box-shadow: 0px 0px 1px 0px #888888; margin-bottom: 2%">
|
|
<input ng-keypress="$event.keyCode === 13 && searchWebsites()" placeholder="Search... (Press Enter to search)" ng-model="patternAdded" name="dom" type="text"
|
|
class="form-control" required>
|
|
</div>
|
|
|
|
<div class="col-sm-2">
|
|
<div class="form-group">
|
|
<select ng-model="recordsToShow" ng-change="getFurtherWebsitesFromDB()"
|
|
class="form-control" id="example-select">
|
|
<option>10</option>
|
|
<option>50</option>
|
|
<option>100</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Websites List with New Collapsed Design -->
|
|
<div ng-repeat="web in WebSitesList track by $index" class="website-item">
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<!-- Website Header (Always Visible) -->
|
|
<div class="website-header">
|
|
<div class="row">
|
|
<div class="col-sm-8">
|
|
<h4>
|
|
<i class="fas"
|
|
ng-class="{'fa-chevron-down': isExpanded(web.domain), 'fa-chevron-right': !isExpanded(web.domain)}"
|
|
ng-click="toggleSite(web)"
|
|
style="cursor: pointer; margin-right: 10px; color: #666;"></i>
|
|
<a href="http://{$ web.domain $}" target="_blank" title="Visit Site" style="text-decoration: none; color: #414C59;">
|
|
{$ web.domain $}
|
|
</a>
|
|
<span ng-if="web.loading" class="loading-indicator">
|
|
<i class="fa fa-spinner fa-spin" style="color: #00749C; font-size: 14px;"></i>
|
|
</span>
|
|
</h4>
|
|
</div>
|
|
<div class="col-sm-4 text-right">
|
|
<a href="/websites/{$ web.domain $}" target="_self" title="Manage Website" class="btn btn-primary btn-sm">
|
|
<i class="fa fa-external-link"></i> {% trans "Manage" %}
|
|
</a>
|
|
<a target="_self" href="/filemanager/{$ web.domain $}" title="Open File Manager" class="btn btn-outline-secondary btn-sm">
|
|
<i class="fa fa-folder"></i> {% trans "File Manager" %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Website Content (Expandable) -->
|
|
<div class="website-content" ng-if="isExpanded(web.domain)">
|
|
<div class="row">
|
|
<!-- Website Screenshot -->
|
|
<div class="col-sm-3">
|
|
<img ng-src="https://api.microlink.io/?url=https://{$ web.domain $}&screenshot=true&meta=false&embed=screenshot.url"
|
|
alt="{$ web.domain $}"
|
|
class="img-responsive website-screenshot"
|
|
style="max-width: 100%; margin-bottom: 10px; min-height: 150px; background: #f5f5f5; border-radius: 6px;"
|
|
onerror="this.onerror=null; this.src='{% static 'baseTemplate/assets/image-resources/webPanel.png' %}';">
|
|
<div class="text-center website-action-buttons">
|
|
<a href="http://{$ web.domain $}" target="_blank" class="btn btn-outline-secondary btn-sm">
|
|
<i class="fa fa-external-link"></i> Visit Site
|
|
</a>
|
|
<a ng-click="issueSSL(web.domain)" href="javascript:void(0);" class="btn btn-outline-primary btn-sm">
|
|
<i class="fa fa-lock"></i> {% trans "Issue SSL" %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Website Details -->
|
|
<div class="col-sm-9">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<div class="info-box">
|
|
<label><i class="fa fa-sticky-note" style="margin-right: 5px;"></i>State</label>
|
|
<span>{$ web.state $}</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<div class="info-box">
|
|
<label><i class="fa fa-map-marker" style="margin-right: 5px;"></i>IP Address</label>
|
|
<span>{$ web.ipAddress $}</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<div class="info-box">
|
|
<label><i class="fa fa-code" style="margin-right: 5px;"></i>PHP Version</label>
|
|
<span>{$ web.phpVersion $}</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<div class="info-box">
|
|
<label><i class="fa fa-hard-drive" style="margin-right: 5px;"></i>Disk Usage</label>
|
|
<span>{$ web.diskUsed $}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<div class="info-box">
|
|
<label><i class="fa fa-cubes" style="margin-right: 5px;"></i>Package</label>
|
|
<span>{$ web.package $}</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<div class="info-box">
|
|
<label><i class="fa fa-user" style="margin-right: 5px;"></i>Owner</label>
|
|
<span>{$ web.admin $}</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="info-box">
|
|
<label><i class="fa-brands fa-wordpress" style="margin-right: 5px;"></i>WordPress Sites</label>
|
|
<div style="display: flex; align-items: center; gap: 10px;">
|
|
<span>{$ (web.wp_sites && web.wp_sites.length) || 0 $} sites</span>
|
|
<button ng-click="showWPSites(web.domain)" class="btn btn-outline-info btn-xs">
|
|
<span ng-if="!web.loadingWPSites">
|
|
<i class="fa" ng-class="{'fa-eye': !web.showWPSites, 'fa-eye-slash': web.showWPSites}"></i>
|
|
{$ web.showWPSites ? 'Hide' : 'Show' $}
|
|
</span>
|
|
<span ng-if="web.loadingWPSites">
|
|
Loading <i class="fa fa-spinner fa-spin"></i>
|
|
</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- WordPress Sites Section -->
|
|
<div ng-if="web.showWPSites && web.wp_sites && web.wp_sites.length > 0" style="margin-top: 20px;">
|
|
<h5 style="margin-bottom: 15px; color: #00749C;">
|
|
<i class="fa-brands fa-wordpress"></i> WordPress Sites ({$ web.wp_sites.length $})
|
|
</h5>
|
|
<div ng-repeat="wp in web.wp_sites" class="wp-site-item">
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<div class="wp-site-header">
|
|
<div class="row">
|
|
<div class="col-sm-8">
|
|
<h4>
|
|
<i class="fa-brands fa-wordpress" style="color: #00749C; margin-right: 8px;"></i>
|
|
{$ wp.title $}
|
|
<span ng-if="wp.loading || wp.loadingPlugins || wp.loadingTheme" class="loading-indicator">
|
|
<i class="fa fa-spinner fa-spin" style="color: #00749C; font-size: 14px;"></i>
|
|
</span>
|
|
</h4>
|
|
</div>
|
|
<div class="col-sm-4 text-right">
|
|
<button class="btn btn-outline-primary btn-sm wp-action-btn" ng-click="manageWP(wp.id)">
|
|
<i class="fa-solid fa-cog"></i> Manage
|
|
</button>
|
|
<button class="btn btn-outline-danger btn-sm wp-action-btn" ng-click="deleteWPSite(wp)">
|
|
<i class="fa-solid fa-trash"></i> Delete
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="wp-site-content">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<img ng-src="{$ wp.screenshot $}"
|
|
alt="{$ wp.title $}"
|
|
class="img-responsive"
|
|
style="max-width: 100%; margin-bottom: 10px; min-height: 150px; background: #f5f5f5;"
|
|
onerror="this.onerror=null; this.src='https://s.wordpress.org/style/images/about/WordPress-logotype-standard.png';">
|
|
<div class="text-center wp-action-buttons">
|
|
<a href="javascript:void(0);" ng-click="visitSite(wp)" class="btn btn-outline-secondary btn-sm wp-action-btn">
|
|
<i class="fa-solid fa-external-link"></i> Visit Site
|
|
</a>
|
|
<a href="{% url 'AutoLogin' %}?id={$ wp.id $}" target="_blank" class="btn btn-outline-primary btn-sm wp-action-btn">
|
|
<i class="fa-brands fa-wordpress"></i> WP Login
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<div class="info-box">
|
|
<label>WordPress</label>
|
|
<span>{$ wp.version || 'Loading...' $}</span>
|
|
<i ng-if="wp.loading" class="fa fa-spinner fa-spin" style="margin-left: 5px; font-size: 12px;"></i>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<div class="info-box">
|
|
<label>PHP Version</label>
|
|
<span>{$ wp.phpVersion || 'Loading...' $}</span>
|
|
<i ng-if="wp.loading" class="fa fa-spinner fa-spin" style="margin-left: 5px; font-size: 12px;"></i>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<div class="info-box">
|
|
<label>Theme</label>
|
|
<span>{$ wp.theme || 'Loading...' $}</span>
|
|
<i ng-if="wp.loadingTheme" class="fa fa-spinner fa-spin" style="margin-left: 5px; font-size: 12px;"></i>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<div class="info-box">
|
|
<label>Plugins</label>
|
|
<span>{$ wp.activePlugins || '0' $} active</span>
|
|
<i ng-if="wp.loadingPlugins" class="fa fa-spinner fa-spin" style="margin-left: 5px; font-size: 12px;"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row mt-3">
|
|
<div class="col-sm-6">
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox"
|
|
ng-click="updateSetting(wp, 'search-indexing')"
|
|
ng-checked="wp.searchIndex == 1">
|
|
Search engine indexing
|
|
</label>
|
|
</div>
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox"
|
|
ng-click="updateSetting(wp, 'debugging')"
|
|
ng-checked="wp.debugging == 1">
|
|
Debugging
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox"
|
|
ng-model="wp.passwordProtection"
|
|
ng-init="wp.passwordProtection = wp.passwordProtection || false"
|
|
ng-change="togglePasswordProtection(wp)">
|
|
Password protection
|
|
</label>
|
|
</div>
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox"
|
|
ng-click="updateSetting(wp, 'maintenance-mode')"
|
|
ng-checked="wp.maintenanceMode == 1">
|
|
Maintenance mode
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Error Display -->
|
|
<div id="listFail" class="alert alert-danger" style="display: none;">
|
|
<p>{% trans "Cannot list websites. Error message:" %} {$ errorMessage $}</p>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
<div style="margin-top: 2%" class="row">
|
|
<div class="col-md-12">
|
|
<div class="row">
|
|
<div class="col-md-9">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<select ng-model="currentPage" class="form-control"
|
|
ng-change="getFurtherWebsitesFromDB()">
|
|
<option ng-repeat="page in pagination">{$ $index + 1 $}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Enhanced Styles -->
|
|
<style>
|
|
/* Website Item Styles */
|
|
.website-item {
|
|
border: 1px solid #ddd;
|
|
margin-bottom: 20px;
|
|
border-radius: 8px;
|
|
background: white;
|
|
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
|
|
}
|
|
|
|
.website-header {
|
|
padding: 15px 20px;
|
|
border-bottom: 1px solid #ddd;
|
|
background: #f8f9fa;
|
|
border-radius: 8px 8px 0 0;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.website-header h4 {
|
|
margin: 0;
|
|
font-size: 18px;
|
|
line-height: 34px;
|
|
color: #2c3338;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.website-content {
|
|
padding: 20px;
|
|
background: #fff;
|
|
border-radius: 0 0 8px 8px;
|
|
}
|
|
|
|
.website-screenshot {
|
|
border: 1px solid #e0e0e0;
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.website-action-buttons {
|
|
margin-top: 15px;
|
|
display: flex;
|
|
gap: 8px;
|
|
justify-content: center;
|
|
}
|
|
|
|
/* Info Box Styles */
|
|
.info-box {
|
|
margin-bottom: 15px;
|
|
background: #f8f9fa;
|
|
padding: 12px;
|
|
border-radius: 6px;
|
|
border-left: 3px solid #007cba;
|
|
}
|
|
|
|
.info-box label {
|
|
display: block;
|
|
font-size: 12px;
|
|
color: #646970;
|
|
margin-bottom: 6px;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.info-box span {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: #2c3338;
|
|
}
|
|
|
|
/* WordPress Site Styles */
|
|
.wp-site-item {
|
|
border: 1px solid #e0e0e0;
|
|
margin-bottom: 15px;
|
|
border-radius: 6px;
|
|
background: white;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
|
|
}
|
|
|
|
.wp-site-header {
|
|
padding: 12px 15px;
|
|
border-bottom: 1px solid #e0e0e0;
|
|
background: #f8f9fa;
|
|
border-radius: 6px 6px 0 0;
|
|
}
|
|
|
|
.wp-site-header h4 {
|
|
margin: 0;
|
|
font-size: 16px;
|
|
line-height: 28px;
|
|
color: #2c3338;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.wp-site-content {
|
|
padding: 15px;
|
|
}
|
|
|
|
/* Button Styles */
|
|
.wp-action-btn {
|
|
margin: 0 4px;
|
|
padding: 6px 12px;
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
transition: all 0.2s ease;
|
|
border-width: 1.5px;
|
|
line-height: 1.5;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
vertical-align: middle;
|
|
height: 32px;
|
|
}
|
|
|
|
.wp-action-btn i {
|
|
margin-right: 6px;
|
|
font-size: 14px;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.wp-action-buttons {
|
|
margin-top: 12px;
|
|
display: flex;
|
|
gap: 8px;
|
|
justify-content: center;
|
|
}
|
|
|
|
.wp-action-buttons .wp-action-btn {
|
|
min-width: 110px;
|
|
flex: 0 1 auto;
|
|
}
|
|
|
|
/* Checkbox Styles */
|
|
.checkbox {
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.mt-3 {
|
|
margin-top: 1rem;
|
|
}
|
|
|
|
/* Loading Indicator */
|
|
.loading-indicator {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
color: #00749C;
|
|
font-size: 14px;
|
|
padding: 0 8px;
|
|
}
|
|
|
|
.loading-indicator i {
|
|
font-size: 14px;
|
|
margin-left: 4px;
|
|
}
|
|
|
|
/* Button Color Overrides */
|
|
.btn-outline-primary {
|
|
color: #0073aa;
|
|
border-color: #0073aa;
|
|
}
|
|
|
|
.btn-outline-primary:hover {
|
|
background-color: #0073aa;
|
|
color: white;
|
|
}
|
|
|
|
.btn-outline-secondary {
|
|
color: #50575e;
|
|
border-color: #50575e;
|
|
}
|
|
|
|
.btn-outline-secondary:hover {
|
|
background-color: #50575e;
|
|
color: white;
|
|
}
|
|
|
|
.btn-outline-danger {
|
|
color: #dc3545;
|
|
border-color: #dc3545;
|
|
}
|
|
|
|
.btn-outline-danger:hover {
|
|
background-color: #dc3545;
|
|
color: white;
|
|
}
|
|
|
|
.btn-outline-info {
|
|
color: #17a2b8;
|
|
border-color: #17a2b8;
|
|
}
|
|
|
|
.btn-outline-info:hover {
|
|
background-color: #17a2b8;
|
|
color: white;
|
|
}
|
|
|
|
/* Responsive adjustments */
|
|
@media (max-width: 768px) {
|
|
.website-header .col-sm-4 {
|
|
text-align: left !important;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.website-action-buttons {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.info-box {
|
|
margin-bottom: 10px;
|
|
}
|
|
}
|
|
</style>
|
|
|
|
{% endblock %}
|