Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #174

Closed
wants to merge 50 commits into from
Closed

Dev #174

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
8f57d11
foi feita alteracao para o banco do sqlserver
hemanoelbritoF Jan 18, 2024
074d113
alteracoes1801
hemanoelbritoF Jan 18, 2024
906769f
alteracoes1801.01
hemanoelbritoF Jan 18, 2024
ce2d22a
falta estilo exec,exec2, preenchimento da dr,rb e ra
hemanoelbritoF Jan 22, 2024
96989fe
tabela receiteXdespesa, e execReceitaDesepesa
hemanoelbritoF Jan 24, 2024
20f6987
finalizado fub por enquanto
hemanoelbritoF Jan 26, 2024
42f245a
Delete
hemanoelbritoF Jan 29, 2024
c9b530d
finalizei pandas conciliação bancaria
hemanoelbritoF Jan 30, 2024
597672b
completa reestruturação da fub com o pandas
hemanoelbritoF Feb 1, 2024
bbded65
Merge pull request #166 from ResidenciaTICBrisa/estagioAutomatec
pedrobarbosaocb Feb 1, 2024
ce238bd
fix: removendo impedimento de acesso por cpf e adicao de historico su…
hemanoelbritoF Feb 1, 2024
ec85872
refact: removendocodigos comentados tem uso
pedrobarbosaocb Feb 2, 2024
356f65a
feature: adicionando tela inicial de historico
pedrobarbosaocb Feb 2, 2024
20cf926
style:atualizando estrutura da page de logs com bootstrap
pedrobarbosaocb Feb 2, 2024
89e7ed3
feature: adicionando filtros a tela de historico
pedrobarbosaocb Feb 2, 2024
8e7272b
feat: adicionando logica de recuperacao de senha
pedrobarbosaocb Feb 5, 2024
0a7243c
Merge pull request #167 from ResidenciaTICBrisa/refatorando-login
pedrobarbosaocb Feb 5, 2024
16dc4e2
style: refatorando html base para reset
pedrobarbosaocb Feb 5, 2024
87e2782
style: criacao da tela de Redefinicao de Senha de acordo com o estilo…
pedrobarbosaocb Feb 6, 2024
289652a
refact: refatoração da homepage utilizando novo html base
pedrobarbosaocb Feb 6, 2024
8363950
fix: remocao do link da navbar quando esta na propria pagina
pedrobarbosaocb Feb 6, 2024
1009633
refact: refatoracao da tela de login usando a base de layout
pedrobarbosaocb Feb 6, 2024
051ca65
feat: adicao da tela 404 e tela inicial de perfil
pedrobarbosaocb Feb 7, 2024
25cb64a
style: estilizacao seguindo layout automatec da tela de perfil
pedrobarbosaocb Feb 7, 2024
6384ae3
feat: adicionando logica de recuperacao de senha
pedrobarbosaocb Feb 5, 2024
ce08fa0
feat: adicionando logica de recuperacao de senha
pedrobarbosaocb Feb 5, 2024
0215bed
fix: corrigindo merge inadequado
pedrobarbosaocb Feb 8, 2024
83ccecd
style: adicao de mascaras para dados sensiveis
pedrobarbosaocb Feb 8, 2024
c032dcf
fix: logs aparecem agora ordenados do mais recente para o mais antigo…
pedrobarbosaocb Feb 8, 2024
1dda9ce
style: adicao do modal de alteracao de senha
pedrobarbosaocb Feb 8, 2024
697af5b
refact: atualizacao inicial da nova pagina de projeto
pedrobarbosaocb Feb 8, 2024
ea14891
fub alfa lançada
Feb 9, 2024
b1f2d97
Merge pull request #168 from ResidenciaTICBrisa/adicionarTabelapPatri…
pedrobarbosaocb Feb 9, 2024
9c06c1d
refact: atualizacao da pagina de consultas de projetos
pedrobarbosaocb Feb 9, 2024
904bcf0
fix: pagina de alteracao de senha com versao estavel
pedrobarbosaocb Feb 9, 2024
4757cb0
Merge branch 'dev' into recuperacao-de-senha
pedrobarbosaocb Feb 9, 2024
1767dc1
Merge pull request #169 from ResidenciaTICBrisa/recuperacao-de-senha
pedrobarbosaocb Feb 9, 2024
0db55b6
feat: alteracao de senha pela page de perfil funcional
pedrobarbosaocb Feb 15, 2024
0260014
style: correcao da imagem de fundo de todas as paginas
pedrobarbosaocb Feb 15, 2024
5464554
feat: page de projetos atualizada com bootstrap vs inicial
pedrobarbosaocb Feb 16, 2024
38eada5
fix: correcao de textos em page de redefinicao de senha
pedrobarbosaocb Feb 16, 2024
a1e8385
Merge pull request #170 from ResidenciaTICBrisa/recuperacao-de-senha
pedrobarbosaocb Feb 16, 2024
727c190
fubhotfix
Feb 20, 2024
fff7849
terminaldoido
Feb 20, 2024
03ca29d
Merge pull request #171 from ResidenciaTICBrisa/Finep
pedrobarbosaocb Feb 20, 2024
55c33ad
fix: adicionando novas conexoes com banco
pedrobarbosaocb Feb 20, 2024
ced6869
Merge pull request #172 from ResidenciaTICBrisa/refatorando-front
hemanoelbritoF Feb 20, 2024
f473bc7
fixed the annoying bug
Feb 22, 2024
7960026
Merge branch 'dev' into Finep
pedrobarbosaocb Feb 22, 2024
1a3415b
Merge pull request #173 from ResidenciaTICBrisa/Finep
pedrobarbosaocb Feb 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feature: adicionando tela inicial de historico
  • Loading branch information
pedrobarbosaocb committed Feb 2, 2024
commit 356f65a34a86b73137de13df28761b2d50c554e0
22 changes: 22 additions & 0 deletions project/app/migrations/0004_useractivity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.2.4 on 2024-02-02 17:26

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('app', '0003_alter_mapeamento_id_tipo'),
]

operations = [
migrations.CreateModel(
name='UserActivity',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('user_id', models.CharField(max_length=255)),
('activity', models.TextField()),
('timestamp', models.DateTimeField(auto_now_add=True)),
],
),
]
18 changes: 18 additions & 0 deletions project/app/migrations/0005_useractivity_tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.4 on 2024-02-02 18:06

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('app', '0004_useractivity'),
]

operations = [
migrations.AddField(
model_name='useractivity',
name='tag',
field=models.CharField(default=None, max_length=50),
),
]
18 changes: 18 additions & 0 deletions project/app/migrations/0006_alter_useractivity_tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.4 on 2024-02-02 18:12

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('app', '0005_useractivity_tag'),
]

operations = [
migrations.AlterField(
model_name='useractivity',
name='tag',
field=models.CharField(max_length=50),
),
]
9 changes: 9 additions & 0 deletions project/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,12 @@ class Export(models.Model):
nome_template = models.CharField(max_length=200)
nome_usuario = models.CharField(max_length=200)
id_projeto = models.CharField(max_length=50)

class UserActivity(models.Model):
user_id = models.CharField(max_length=255)
tag = models.CharField(max_length=50)
activity = models.TextField()
timestamp = models.DateTimeField(auto_now_add=True)

def __str__(self):
return f"{self.user_id} - {self.activity}"
31 changes: 31 additions & 0 deletions project/app/templates/user_activity_logs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!-- templates/user_activity_logs.html -->

<!DOCTYPE html>
<html>
<head>
<title>Activity Logs</title>
</head>
<body>
<h1>Activity Logs</h1>
<table>
<thead>
<tr>
<th>Timestamp</th>
<th>User</th>
<th>Tag</th>
<th>Activity</th>
</tr>
</thead>
<tbody>
{% for log in logs %}
<tr>
<td style="padding-inline: 10px;"> {{ log.timestamp }} </td>
<td style="padding-inline: 10px;"> {{ log.user_id }} </td>
<td style="padding-inline: 10px;"> {{ log.tag }} </td>
<td style="padding-inline: 10px;"> {{ log.activity }} </td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>
2 changes: 2 additions & 0 deletions project/app/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.urls import path
from . import views
from django.contrib.auth import views as auth_views
from .views import user_activity_logs

from .views import HomeView

Expand All @@ -13,4 +14,5 @@
# path('login_teste/', views.login_teste, name='login_teste'),
# path('cadastro_teste/', views.cadastro_teste, name='cadastro_teste'),
# path('projeto_teste/', views.projeto_teste, name='projeto_teste'),
path('user-activity-logs/', user_activity_logs, name='user_activity_logs'),
]
32 changes: 26 additions & 6 deletions project/app/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import os
import datetime
import re
from django.shortcuts import render
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
Expand All @@ -14,11 +17,12 @@
#from .preenche_fub import preencher_fub_teste,consultaID
from .preenche_fundep import preenche_fundep
from .preencheFub import consultaID,preencheFub
import os
import datetime
import re
from .capa import inserir_round_retangulo
from django.contrib.admin.models import LogEntry
from .models import UserActivity

def log_user_activity(user_id, tag, activity):
UserActivity.objects.create(user_id=user_id, tag=tag, activity=activity)

def convert_datetime_to_string(value):
if isinstance(value, datetime.datetime):
Expand Down Expand Up @@ -85,9 +89,16 @@ def login(request):

if user:
login_a(request, user)
log_message = f"Acessou o sistema"
log_user_activity(request.user, "Sistema", log_message)

return HttpResponseRedirect ('/projeto/')
else:
error_message = 'Usuário ou senha inválido.'

log_message = f"Tentativa de acesso"
log_user_activity(request.user, "Sistema", log_message)

return render(request, 'login.html', {'error_message': error_message})

@login_required(login_url="/login/")
Expand Down Expand Up @@ -200,9 +211,11 @@ def projeto(request):
response['Content-Disposition'] = f'attachment; filename="{os.path.basename(file_path)}"'

# adicionando log de consulta
consultaLog = f"{codigo} | {nome.nome_template} | {consultaInicio} | {consultaFim}"
LogEntry.objects.log_action(user_id=request.user.id,content_type_id=1, object_id=1, object_repr=consultaLog, action_flag=1, change_message="Consulta de prestação de contas")
consulta_log = f"Projeto: {codigo} | Modelo: {nome.nome_template} | Inicio da Prest.: {consultaInicio} | Fim da Prest.: {consultaFim}"
# LogEntry.objects.log_action(user_id=request.user.id, content_type_id=1, object_repr=consulta_log, action_flag=1, change_message="Consulta de prestação de contas")

log_user_activity(request.user, "Consulta",consulta_log)

return response
else:
print("Invalid aaaaaaaaaaa request")
Expand Down Expand Up @@ -258,4 +271,11 @@ def custom_logout(request):
# # if request.user.is_authenticated:
# # return HttpResponse('Projetos')
# # else:
# return render(request, 'projeto_teste.html')
# return render(request, 'projeto_teste.html').


from .models import UserActivity

def user_activity_logs(request):
logs = UserActivity.objects.all()
return render(request, 'user_activity_logs.html', {'logs': logs})