HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux simsoft.ro 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC 2025 x86_64
User: www-data (33)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/local/src/cyberpanel/testPlugin/models.py
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User


class TestPluginSettings(models.Model):
    """Model to store plugin settings and enable/disable state"""
    user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True)
    plugin_enabled = models.BooleanField(default=True, help_text="Enable or disable the plugin")
    test_count = models.IntegerField(default=0, help_text="Number of times test button was clicked")
    last_test_time = models.DateTimeField(auto_now=True, help_text="Last time test button was clicked")
    custom_message = models.TextField(default="Test plugin is working!", help_text="Custom message for popup")
    
    class Meta:
        verbose_name = "Test Plugin Settings"
        verbose_name_plural = "Test Plugin Settings"
    
    def __str__(self):
        return f"Test Plugin Settings - Enabled: {self.plugin_enabled}"


class TestPluginLog(models.Model):
    """Model to store plugin activity logs"""
    timestamp = models.DateTimeField(auto_now_add=True)
    action = models.CharField(max_length=100)
    message = models.TextField()
    user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True)
    
    class Meta:
        verbose_name = "Test Plugin Log"
        verbose_name_plural = "Test Plugin Logs"
        ordering = ['-timestamp']
    
    def __str__(self):
        return f"{self.timestamp} - {self.action}: {self.message}"