-
-
Notifications
You must be signed in to change notification settings - Fork 313
Step 1: Create the Django model Define a Django model named 'Monitor' with fields such as 'url', 'keyword', 'last_checked_time', 'status', and 'user'. #1897 #1981
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9f7c09b
Step 1: Create the Django model Define a Django model named 'Monitor'…
Sarthak5598 34e93ab
Merge branch 'main' into ISSUE_1897
Sarthak5598 0f3146b
made migration
Sarthak5598 992814b
Merge branch 'ISSUE_1897' of https://github.com/Sarthak5598/BLT into …
Sarthak5598 e3348ab
formating issue
Sarthak5598 254c04f
added the form
Sarthak5598 204e29e
Merge branch 'main' into ISSUE_1897
Sarthak5598 56b943a
html issues
Sarthak5598 a0cfd7b
Merge branch 'ISSUE_1897' of https://github.com/Sarthak5598/BLT into …
Sarthak5598 ad3f540
Merge branch 'main' into ISSUE_1897
Sarthak5598 0433ae1
Update website/views.py
Sarthak5598 b31af3a
added new feilds
Sarthak5598 08b962c
Merge branch 'main' into ISSUE_1897
Sarthak5598 7ddbc5a
adding this
Sarthak5598 04713d9
removed unnecasry lines
Sarthak5598 a71266e
Merge branch 'ISSUE_1897' of https://github.com/Sarthak5598/BLT into …
Sarthak5598 304b539
identation issue
Sarthak5598 3f3825a
added merge
Sarthak5598 e040312
indentation
Sarthak5598 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,43 @@ | ||
| # Generated by Django 5.0.2 on 2024-03-09 06:06 | ||
|
|
||
| import django.db.models.deletion | ||
| from django.conf import settings | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("website", "0086_merge_20240308_1030"), | ||
| migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name="Monitor", | ||
| fields=[ | ||
| ( | ||
| "id", | ||
| models.AutoField( | ||
| auto_created=True, | ||
| primary_key=True, | ||
| serialize=False, | ||
| verbose_name="ID", | ||
| ), | ||
| ), | ||
| ("url", models.URLField()), | ||
| ("keyword", models.CharField(max_length=255)), | ||
| ("last_checked_time", models.DateTimeField(auto_now=True)), | ||
| ( | ||
| "status", | ||
| models.CharField(choices=[("UP", "Up"), ("DOWN", "Down")], max_length=20), | ||
| ), | ||
| ( | ||
| "user", | ||
| models.ForeignKey( | ||
| on_delete=django.db.models.deletion.CASCADE, | ||
| to=settings.AUTH_USER_MODEL, | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| ] |
24 changes: 24 additions & 0 deletions
24
website/migrations/0088_monitor_created_monitor_modified.py
This file contains hidden or 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,24 @@ | ||
| # Generated by Django 5.0.2 on 2024-03-21 04:29 | ||
|
|
||
| import django.utils.timezone | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("website", "0087_monitor"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="monitor", | ||
| name="created", | ||
| field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now), | ||
| preserve_default=False, | ||
| ), | ||
| migrations.AddField( | ||
| model_name="monitor", | ||
| name="modified", | ||
| field=models.DateTimeField(auto_now=True), | ||
| ), | ||
| ] |
This file contains hidden or 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,12 @@ | ||
| # Generated by Django 5.0.2 on 2024-03-21 18:23 | ||
|
|
||
| from django.db import migrations | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("website", "0087_issue_cve_score"), | ||
| ("website", "0088_monitor_created_monitor_modified"), | ||
| ] | ||
|
|
||
| operations = [] |
This file contains hidden or 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 hidden or 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,68 @@ | ||
| <style> | ||
| body { | ||
| font-family: Arial, sans-serif; | ||
| margin: 0; | ||
| padding: 0; | ||
| background-color: #f8f9fa; | ||
| } | ||
| .container { | ||
| max-width: 600px; | ||
| margin: 50px auto; | ||
| padding: 20px; | ||
| background-color: #fff; | ||
| border-radius: 5px; | ||
| box-shadow: 0 2px 4px rgba(0,0,0,0.1); | ||
| } | ||
| h1 { | ||
| text-align: center; | ||
| color: #333; | ||
| } | ||
| form { | ||
| margin-top: 20px; | ||
| } | ||
| form label { | ||
| display: block; | ||
| margin-bottom: 5px; | ||
| color: #333; | ||
| } | ||
| form input[type="text"], | ||
| form textarea{ | ||
| width: 100%; | ||
| padding: 8px; | ||
| margin-bottom: 10px; | ||
| border: 1px solid #ccc; | ||
| border-radius: 4px; | ||
| box-sizing: border-box; | ||
| } | ||
| form button { | ||
| padding: 8px 20px; | ||
| background-color: #dc3545; | ||
| color: #fff; | ||
| border: none; | ||
| border-radius: 4px; | ||
| cursor: pointer; | ||
| } | ||
| form button:hover { | ||
| background-color: #c82333; | ||
| } | ||
| .created-field, | ||
| .modified-field{ | ||
| width: 100%; | ||
| padding: 8px; | ||
| margin-bottom: 10px; | ||
| border: 1px solid #ccc; | ||
| border-radius: 4px; | ||
| box-sizing: border-box; | ||
| text-align:center; | ||
| } | ||
| </style> | ||
| <div class="container"> | ||
| <h1>Create Monitor</h1> | ||
| <form method="post"> | ||
| {% csrf_token %} | ||
| {{ form.as_p }} | ||
| <button type="submit" class="btn btn-danger">Submit</button> | ||
| </form> | ||
| <p class="created-field">Created: {{ form.created.value }}</p> | ||
| <p class="modified-field">Modified: {{ form.modified.value }}</p> | ||
| </div> |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.