Add home directory management features: Introduce models and views for managing user home directories, including dynamic home directory assignment during user creation. Update frontend to allow selection of home directories and display relevant information. Enhance backend logic for home directory migration and statistics retrieval, improving overall user management capabilities.

This commit is contained in:
Master3395
2025-09-20 21:50:22 +02:00
parent 25fa25d877
commit 53aea56136
19 changed files with 2593 additions and 10 deletions

View File

@@ -0,0 +1,48 @@
# Generated migration for home directories feature
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('loginSystem', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='HomeDirectory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text='Directory name (e.g., home, home2)', max_length=50, unique=True)),
('path', models.CharField(help_text='Full path to home directory', max_length=255, unique=True)),
('is_active', models.BooleanField(default=True, help_text='Whether this home directory is active')),
('is_default', models.BooleanField(default=False, help_text='Whether this is the default home directory')),
('max_users', models.IntegerField(default=0, help_text='Maximum number of users (0 = unlimited)')),
('description', models.TextField(blank=True, help_text='Description of this home directory')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
options={
'verbose_name': 'Home Directory',
'verbose_name_plural': 'Home Directories',
'db_table': 'home_directories',
},
),
migrations.CreateModel(
name='UserHomeMapping',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('home_directory', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='userManagment.homedirectory')),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='home_mapping', to='loginSystem.administrator')),
],
options={
'verbose_name': 'User Home Mapping',
'verbose_name_plural': 'User Home Mappings',
'db_table': 'user_home_mappings',
},
),
]