-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bcea35
commit 24d4dfb
Showing
26 changed files
with
338 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +0,0 @@ | ||
GOOGLE_API_KEY=AIzaSyAh5HbTtCHsO_ZWAtCtn_q5h2_Jw7tEfe8 | ||
HUGGING_FACE_API_KEY=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 | ||
|
||
SMS_ACCOUNT_SSID_API_KEY=AC954136eee66cc8ba187c7722f5840d13 | ||
SMS_ACCOUNT_AUTH_API_KEY=d1501d7b07f1625cce8b4c46c1d5a8f1 | ||
SMS_FROM_NUMBER=+12085516281 | ||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+56.7 KB
(200%)
db/058716e8-2d51-48ec-abb6-cf4d1b0bf163/index_metadata.pickle
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,21 @@ | ||
id,registration_number,type,available,condition,last_maintenance | ||
1,MP01AB1234,Standard,True,Good,2024-06-15 | ||
2,MP02CD5678,Advanced Life Support,True,Good,2024-07-01 | ||
3,MP03EF9101,Standard,False,Needs Repair,2024-06-20 | ||
4,MP04GH2345,Advanced Life Support,True,Good,2024-07-05 | ||
5,MP05IJ6789,Standard,True,Good,2024-06-25 | ||
6,MP06KL0123,Advanced Life Support,False,Needs Repair,2024-06-30 | ||
7,MP07MN4567,Standard,True,Good,2024-07-01 | ||
8,MP08OP8901,Advanced Life Support,True,Good,2024-07-10 | ||
9,MP09QR2345,Standard,True,Needs Repair,2024-06-22 | ||
10,MP10ST6789,Advanced Life Support,True,Good,2024-07-03 | ||
11,MP11UV0123,Standard,False,Needs Repair,2024-06-28 | ||
12,MP12WX4567,Advanced Life Support,True,Good,2024-07-12 | ||
13,MP13YZ8901,Standard,True,Good,2024-07-08 | ||
14,MP14AB2345,Advanced Life Support,True,Good,2024-07-04 | ||
15,MP15CD6789,Standard,True,Needs Repair,2024-06-26 | ||
16,MP16EF0123,Advanced Life Support,True,Good,2024-07-09 | ||
17,MP17GH4567,Standard,False,Needs Repair,2024-07-02 | ||
18,MP18IJ8901,Advanced Life Support,True,Good,2024-07-07 | ||
19,MP19KL2345,Standard,True,Good,2024-06-29 | ||
20,MP20MN6789,Advanced Life Support,True,Needs Repair,2024-07-11 | ||
21,MP21OP0123,Standard,True,Good,2024-06-24 | ||
22,MP22QR4567,Advanced Life Support,False,Needs Repair,2024-07-06 | ||
23,MP23ST8901,Standard,True,Good,2024-07-02 | ||
24,MP24UV2345,Advanced Life Support,True,Good,2024-07-08 | ||
25,MP25WX6789,Standard,False,Needs Repair,2024-07-10 | ||
26,MP26YZ0123,Advanced Life Support,True,Good,2024-07-12 | ||
27,MP27AB4567,Standard,True,Good,2024-06-23 | ||
28,MP28CD8901,Advanced Life Support,True,Needs Repair,2024-07-01 | ||
29,MP29EF2345,Standard,True,Good,2024-07-05 | ||
30,MP30GH6789,Advanced Life Support,True,Good,2024-07-07 | ||
31,MP31IJ0123,Standard,False,Needs Repair,2024-07-03 | ||
32,MP32KL4567,Advanced Life Support,True,Good,2024-07-09 | ||
33,MP33MN8901,Standard,True,Good,2024-06-27 | ||
34,MP34OP2345,Advanced Life Support,True,Needs Repair,2024-07-11 | ||
35,MP35QR6789,Standard,True,Good,2024-06-28 | ||
36,MP36ST0123,Advanced Life Support,False,Needs Repair,2024-07-12 | ||
37,MP37UV4567,Standard,True,Good,2024-07-01 | ||
38,MP38WX8901,Advanced Life Support,True,Good,2024-07-10 | ||
39,MP39YZ2345,Standard,False,Needs Repair,2024-06-30 | ||
40,MP40AB6789,Advanced Life Support,True,Good,2024-07-08 | ||
41,MP41CD0123,Standard,True,Good,2024-07-05 | ||
42,MP42EF4567,Advanced Life Support,False,Needs Repair,2024-07-01 | ||
43,MP43GH8901,Standard,True,Good,2024-06-29 | ||
44,MP44IJ2345,Advanced Life Support,True,Good,2024-07-11 | ||
45,MP45KL6789,Standard,True,Needs Repair,2024-06-27 | ||
46,MP46MN0123,Advanced Life Support,True,Good,2024-07-03 | ||
47,MP47OP4567,Standard,False,Needs Repair,2024-06-25 | ||
48,MP48QR8901,Advanced Life Support,True,Good,2024-07-12 | ||
49,MP49ST2345,Standard,True,Good,2024-07-07 | ||
50,MP50UV6789,Advanced Life Support,True,Needs Repair,2024-07-10 | ||
id,machinery,hours_of_operation,description,status,due_date | ||
1,Excavator,120,Routine maintenance check.,N,2024-07-28 01:37:17 | ||
2,Bulldozer,350,Oil change and filter replacement.,g,2024-07-29 10:15:00 | ||
3,Crane,5000,Complete overhaul.,N,2024-07-30 09:00:00 | ||
4,Loader,450,General maintenance.,g,2024-08-01 11:30:00 | ||
5,Dump Truck,1500,Brake inspection.,N,2024-08-03 14:20:00 | ||
6,Excavator,200,Hydraulic system check.,g,2024-08-05 13:25:00 | ||
7,Bulldozer,300,Engine tune-up.,N,2024-08-07 08:10:00 | ||
8,Crane,4200,Structural inspection.,g,2024-08-09 16:00:00 | ||
9,Loader,800,Transmission service.,N,2024-08-12 10:40:00 | ||
10,Dump Truck,2200,Exhaust system repair.,g,2024-08-15 12:00:00 | ||
11,Excavator,250,Undercarriage inspection.,N,2024-08-17 09:50:00 | ||
12,Bulldozer,350,Filter change.,g,2024-08-20 15:00:00 | ||
13,Crane,4800,Electrical system check.,N,2024-08-22 14:10:00 | ||
14,Loader,600,Coolant system service.,g,2024-08-25 11:30:00 | ||
15,Dump Truck,1800,Tire replacement.,N,2024-08-28 08:00:00 | ||
16,Excavator,300,Engine repair.,g,2024-08-30 10:15:00 | ||
17,Bulldozer,400,Hydraulic fluid change.,N,2024-09-02 13:00:00 | ||
18,Crane,4900,Maintenance and calibration.,g,2024-09-05 12:30:00 | ||
19,Loader,700,General inspection.,N,2024-09-08 15:00:00 | ||
20,Dump Truck,1600,Brake system check.,g,2024-09-10 09:45:00 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
from django.contrib import admin | ||
from .models import MaintenanceTask | ||
|
||
# Register your models here. | ||
from import_export.admin import ImportExportModelAdmin | ||
|
||
|
||
class MaintenanceTaskAdmin(ImportExportModelAdmin): | ||
list_display=['machinery','hours_of_operation','status'] | ||
admin.site.register(MaintenanceTask,MaintenanceTaskAdmin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 5.0.7 on 2024-07-28 01:25 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='MaintenanceTask', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('machinery', models.CharField(max_length=100)), | ||
('hours_of_operation', models.IntegerField()), | ||
('description', models.TextField()), | ||
('status', models.CharField(max_length=1)), | ||
('due_date', models.DateTimeField()), | ||
], | ||
), | ||
] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
from django.db import models | ||
from django.utils import timezone | ||
|
||
# Create your models here. | ||
class MaintenanceTask(models.Model): | ||
machinery = models.CharField(max_length=100) | ||
hours_of_operation = models.IntegerField() | ||
description = models.TextField() | ||
status = models.CharField(max_length=1) | ||
due_date = models.DateTimeField() | ||
|
||
def should_send_alert(self): | ||
return self.due_date.date() == timezone.now().date() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from twilio.rest import Client | ||
import os | ||
from dotenv import load_dotenv | ||
load_dotenv() | ||
def send_sms_alert(task): | ||
account_sid = os.getenv('SMS_ACCOUNT_SSID_API_KEY') | ||
auth_token = os.getenv('SMS_ACCOUNT_AUTH_API_KEY') | ||
client = Client(account_sid, auth_token) | ||
|
||
message_body = f"Maintenance Alert: {task.machinery} requires attention. Task: {task.description}. Hours of Operation: {task.hours_of_operation}." | ||
|
||
message = client.messages.create( | ||
body=message_body, | ||
from_='+1234567890', | ||
to='+0987654321' | ||
) | ||
|
||
return message.sid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{% extends 'maintain/partial/base.html' %} | ||
{% load static %} | ||
{% block index %} | ||
|
||
<div class="container-fluid"> | ||
<!-- Log Repair Activities Table Section --> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="vehicle_para"> | ||
<h3>Log Repair Activities</h3> | ||
<p>Track all repair activities including costs and downtime. Maintain records of repairs to monitor asset performance and costs.</p> | ||
|
||
<!-- Table Display --> | ||
<table class="table table-bordered"> | ||
<thead> | ||
<tr> | ||
<th>Machinery</th> | ||
<th>Date</th> | ||
<th>Hours of Operation</th> | ||
<th>Description</th> | ||
<th>Status</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for repair in repair_activities %} | ||
<tr> | ||
<td>{{ repair.machinery }}</td> | ||
<td>{{ repair.due_date }}</td> | ||
<td>{{ repair.hours_of_operation }}</td> | ||
<td>{{ repair.description }}</td> | ||
<td> | ||
{% if repair.status == 'Completed' %} | ||
<span class="text-success">Completed</span> | ||
{% elif repair.status == 'Pending' %} | ||
<span class="text-warning">Pending</span> | ||
{% else %} | ||
<span class="text-muted">Unknown</span> | ||
{% endif %} | ||
</td> | ||
</tr> | ||
{% empty %} | ||
<tr> | ||
<td colspan="5">No repair activities logged.</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{% endblock index %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{% extends 'maintain/partial/base.html' %} | ||
{% load static %} | ||
{% block index %} | ||
<!-- Reminders Section --> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="vehicle_para"> | ||
<h3>Today's Tasks</h3> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Machinery</th> | ||
<th>Hours of Operation</th> | ||
<th>Description</th> | ||
<th>Due Date</th> | ||
<th>Status</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for task in maintenance_tasks %} | ||
<tr> | ||
<td>{{ task.machinery }}</td> | ||
<td>{{ task.hours_of_operation }}</td> | ||
<td>{{ task.description }}</td> | ||
<td>{{ task.due_date }}</td> | ||
<td> | ||
{% if task.status == 'N' %} | ||
<span class="text-warning">Needs Attention</span> | ||
{% elif task.status == 'g' %} | ||
<span class="text-success">Good Condition</span> | ||
{% endif %} | ||
</td> | ||
</tr> | ||
{% empty %} | ||
<tr> | ||
<td colspan="4">No upcoming tasks.</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
<h3>Upcoming Maintenance Tasks</h3> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Machinery</th> | ||
<th>Hours of Operation</th> | ||
<th>Description</th> | ||
<th>Due Date</th> | ||
<th>Status</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for task in future_tasks %} | ||
<tr> | ||
<td>{{ task.machinery }}</td> | ||
<td>{{ task.hours_of_operation }}</td> | ||
<td>{{ task.description }}</td> | ||
<td>{{ task.due_date }}</td> | ||
<td> | ||
{% if task.status == 'N' %} | ||
<span class="text-warning">Needs Attention</span> | ||
{% elif task.status == 'g' %} | ||
<span class="text-success">Good Condition</span> | ||
{% endif %} | ||
</td> | ||
</tr> | ||
{% empty %} | ||
<tr> | ||
<td colspan="4">No upcoming tasks.</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{% endblock index %} |
Oops, something went wrong.