Initial commit for v2.4.3

This commit is contained in:
usmannasir
2025-08-01 14:56:30 +05:00
commit 6dd7114f6d
4521 changed files with 1795978 additions and 0 deletions

View File

@@ -0,0 +1 @@
default_app_config = 'examplePlugin.apps.ExamplepluginConfig'

3
examplePlugin/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

8
examplePlugin/apps.py Normal file
View File

@@ -0,0 +1,8 @@
from django.apps import AppConfig
class ExamplepluginConfig(AppConfig):
name = 'examplePlugin'
def ready(self):
from . import signals

View File

7
examplePlugin/meta.xml Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<cyberpanelPluginConfig>
<name>examplePlugin</name>
<type>plugin</type>
<description>This is an example plugin</description>
<version>0</version>
</cyberpanelPluginConfig>

View File

9
examplePlugin/models.py Normal file
View File

@@ -0,0 +1,9 @@
from django.db import models
class ExamplePlugin(models.Model):
name = models.CharField(unique=True, max_length=255)
class Meta:
# db_table = "ExamplePlugin"
pass

View File

@@ -0,0 +1,4 @@
#!/usr/local/CyberCP/bin/python
RESET = '\033[0;0m'
BLUE = "\033[0;34m"
print(BLUE + "Running Post-Install Script..." + RESET)

View File

@@ -0,0 +1,4 @@
#!/usr/local/CyberCP/bin/python
RESET = '\033[0;0m'
GREEN = '\033[0;32m'
print(GREEN + "Running Pre-Install Script..." + RESET)

4
examplePlugin/pre_remove Normal file
View File

@@ -0,0 +1,4 @@
#!/usr/local/CyberCP/bin/python
RESET = '\033[0;0m'
GREEN = '\033[0;32m'
print(GREEN + "Running Pre-Remove Script..." + RESET)

17
examplePlugin/signals.py Normal file
View File

@@ -0,0 +1,17 @@
from django.dispatch import receiver
from django.http import HttpResponse
from websiteFunctions.signals import postWebsiteDeletion
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
# This plugin respond to an event after CyberPanel core finished deleting a website.
# Original request object is passed, body can be accessed with request.body.
# If any Event handler returns a response object, CyberPanel will stop further processing and returns your response to browser.
# To continue processing just return 200 from your events handlers.
@receiver(postWebsiteDeletion)
def rcvr(sender, **kwargs):
request = kwargs['request']
logging.writeToFile('Hello World from Example Plugin.')
return HttpResponse('Hello World from Example Plugin.')

View File

@@ -0,0 +1,3 @@
$(document).ready(function () {
console.log("using JS in static file...!");
});

View File

@@ -0,0 +1,52 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block styles %}
<style>
.exampleBody {
font-weight: bold;
}
</style>
{% endblock %}
{% block title %}Example plugin - CyberPanel{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div class="container" id="examplePluginApp">
<div id="page-title">
<h2 id="domainNamePage">{% trans "Example Plugin Page" %}</h2>
<p>{% trans "Example Plugin Info" %}</p>
</div>
<div class="panel">
<div class="panel-heading container-fluid">
<div class="col-xs-4"><h3 class="panel-title">{% trans "examplePlugin" %}</h3></div>
</div>
<div class="panel-body">
<div class="example-box-wrapper">
<p class="exampleBody">[[ pluginBody ]]</p>
</div>
</div>
</div>
</div>
{% endblock %}
{% block footer_scripts %}
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
{# <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>#}
<script src="{% static 'examplePlugin/examplePlugin.js' %}"></script>
<script>
let examplePluginApp = new Vue({
delimiters: ['[[', ']]'],
el: '#examplePluginApp',
data: function () {
return {
pluginBody: "Example Plugin Body leveraging templated imported Vue.js",
}
},
methods: {},
});
</script>
{% endblock %}

3
examplePlugin/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

7
examplePlugin/urls.py Normal file
View File

@@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.examplePlugin, name='examplePlugin'),
]

7
examplePlugin/views.py Normal file
View File

@@ -0,0 +1,7 @@
from django.shortcuts import render, HttpResponse
# Create your views here.
def examplePlugin(request):
return render(request, 'examplePlugin/examplePlugin.html')