This repository has been archived by the owner on Feb 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
15 changed files
with
3,832 additions
and
7 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
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 @@ | ||
"""Init file for module implementation.""" |
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 "base.html" %} {% block content %} {# | ||
<div class="container"> | ||
#} {# | ||
<img#} | ||
{# | ||
src="{{ url_for('static', filename='CISAImage.png') }}" | ||
#} | ||
{# | ||
alt="Cinque Terre" | ||
#} | ||
{# | ||
width="200" | ||
#} | ||
{# | ||
height="200" | ||
#} | ||
{# | ||
/>#} {#{% if current_user.is_authenticated %}#} {# | ||
<p>Welcome {{ current_user.username }}</p> | ||
#} {# {% else %}#} {# | ||
<p>Please Login</p> | ||
#} {##} {#{% endif %}#} {# | ||
</div> | ||
#} | ||
<!--End of container--> | ||
<script> | ||
function showDiv() { | ||
let T = document.getElementById("TestsDiv"), | ||
displayValue = ""; | ||
if (T.style.display == "") displayValue = "none"; | ||
T.style.display = displayValue; | ||
} | ||
|
||
function loading() { | ||
$("#loading").show(); | ||
$("#content").hide(); | ||
} | ||
|
||
$(document).ready(function () { | ||
console.log("Im ready "); | ||
|
||
showDiv(); | ||
|
||
setTimeout(function () { | ||
$("#messageDiv").fadeOut("fast"); | ||
}, 5000); | ||
$(window).load(function () { | ||
$("#loading").hide(); | ||
}); | ||
}); | ||
</script> | ||
|
||
{% endblock %} |
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 @@ | ||
"""Flask application will add new stakeholder information to the PE Database. | ||
Automate the process to add stakeholder information to Cyber Sixgill portal. | ||
""" | ||
|
||
# Third-Party Libraries | ||
from flask import Blueprint, render_template | ||
|
||
home_blueprint = Blueprint("home", __name__, template_folder="templates/home") | ||
|
||
|
||
@home_blueprint.route("/") | ||
def index(): | ||
"""Create "add customer" HTML form. | ||
Gather data from form and insert into database. | ||
""" | ||
return render_template("home.html") |
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 @@ | ||
"""Init file for module implementation.""" |
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,31 @@ | ||
"""Create the stakeholder data input form.""" | ||
|
||
# Third-Party Libraries | ||
from flask_wtf import FlaskForm | ||
from wtforms import StringField, SubmitField | ||
from wtforms.validators import DataRequired | ||
|
||
|
||
class InfoFormExternal(FlaskForm): | ||
"""Create web form to take user input on organization information/details.""" | ||
|
||
cust = StringField("What is the stakeholder name?", validators=[DataRequired()]) | ||
# TODO: The following form field may be used in a future update. Issue #208 | ||
# custIP = StringField( | ||
# "What is the stakeholder ip/cidr? *comma separate entries", | ||
# validators=[DataRequired()], | ||
# ) | ||
custRootDomain = StringField( | ||
"What is the root domain for this stakeholder? " "*comma separate entries" | ||
) | ||
custDomainAliases = StringField( | ||
"What are the organization aliases? " "*comma separate entries" | ||
) | ||
# TODO: The following form field may be used in a future update. Issue #208 | ||
# custSubDomain = StringField( | ||
# "What is the sub-domain for this stakeholder?" " *comma separate entries" | ||
# ) | ||
custExecutives = StringField( | ||
"Who are the executives for this stakeholder? " "*comma separate entries" | ||
) | ||
submit = SubmitField("Submit", render_kw={"onclick": "loading()"}) |
78 changes: 78 additions & 0 deletions
78
src/pe_reports/stakeholder/templates/stakeholder_UI/home_stakeholder.html
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 "base.html" %} {% block content %} | ||
|
||
<div class="container"> | ||
<img | ||
src="{{ url_for('static', filename='CISAImage.png') }}" | ||
alt="CISA seal image" | ||
width="200" | ||
height="200" | ||
/> | ||
<div id="loading" class="justify-content-lg-center"></div> | ||
<div class="row justify-content-lg-center"> | ||
<div class="row col-lg-6 offset-lg-3"> | ||
<input | ||
type="hidden" | ||
value="{% block title %} Stakeholder {% endblock%}" | ||
/> | ||
|
||
<button type="button" class="btn btn-primary" onclick="showDiv()"> | ||
Add External Stakeholder | ||
</button> | ||
</div> | ||
<br /> | ||
|
||
<div id="TestsDiv" class="row justify-content-lg-center"> | ||
<div class="d-flex justify-content-center"> | ||
<div class="card" id="content"> | ||
<div class="card-header text-white bg-primary mb-3"> | ||
Add external agency | ||
</div> | ||
<div class="card-body"> | ||
<form method="post"> | ||
{{ formExternal.hidden_tag() }} {{ | ||
formExternal.cust.label(style='font-size: 24px') }} {{ | ||
formExternal.cust(class='form-control') }} {{ | ||
formExternal.custDomainAliases.label(style='font-size: 24px') }} | ||
{{ formExternal.custDomainAliases(class='form-control') }} {{ | ||
formExternal.custRootDomain.label(style='font-size: 24px') }} {{ | ||
formExternal.custRootDomain(class='form-control') }} {{ | ||
formExternal.custExecutives.label(style='font-size: 24px') }} {{ | ||
formExternal.custExecutives(class='form-control') }} | ||
<br /> | ||
{{ formExternal.submit(class='btn btn-primary') }} | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<!--End of container--> | ||
<script> | ||
function showDiv() { | ||
let T = document.getElementById("TestsDiv"), | ||
displayValue = ""; | ||
if (T.style.display == "") displayValue = "none"; | ||
T.style.display = displayValue; | ||
} | ||
|
||
function loading() { | ||
$("#loading").show(); | ||
$("#content").hide(); | ||
} | ||
|
||
$(document).ready(function () { | ||
console.log("Im ready "); | ||
|
||
showDiv(); | ||
|
||
setTimeout(function () { | ||
$("#messageDiv").fadeOut("fast"); | ||
}, 5000); | ||
$(window).load(function () { | ||
$("#loading").hide(); | ||
}); | ||
}); | ||
</script> | ||
|
||
{% endblock %} | ||
</div> |
Oops, something went wrong.