Skip to content

Commit

Permalink
Merge pull request #117 from NSWC-Crane/CHRIS_DEV
Browse files Browse the repository at this point in the history
Add docs, minor bug fixes.
  • Loading branch information
crodriguez6497 authored Nov 21, 2024
2 parents 4796cd6 + e8e7e33 commit 36f4dc8
Show file tree
Hide file tree
Showing 50 changed files with 3,244 additions and 163 deletions.
157 changes: 156 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,161 @@ node_modules/
/.vs
client/.angular
client/.nx
/docs
/client/src/development.html
/api/.env


### JupyterNotebooks ###
# gitignore template for Jupyter Notebooks
# website: http://jupyter.org/

.ipynb_checkpoints
*/.ipynb_checkpoints/*

# IPython
profile_default/
ipython_config.py

# Remove previous ipynb_checkpoints
# git rm -r .ipynb_checkpoints/

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook

# IPython

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks
/.vs
*/.vs
13 changes: 13 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "2"

build:
os: "ubuntu-22.04"
tools:
python: "3.12"

sphinx:
configuration: docs/conf.py

python:
install:
- requirements: docs/requirements.txt
6 changes: 3 additions & 3 deletions client/src/app/common/utils/poam-export.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export class PoamExportService {
U: '',
V: 'likelihood',
W: '',
X: '',
X: 'impactDescription',
Y: 'residualRisk',
Z: '',
AA: 'adjSeverity',
Expand Down Expand Up @@ -247,8 +247,8 @@ export class PoamExportService {
vulnerabilitySource: (value: any, poam: Poam, _columnKey: string): any => {
if (value === 'STIG') {
return poam.vulnerabilityTitle;
} else if (value === 'Task Order') {
return `Task Order #: ${poam.taskOrderNumber}`;
} else if (value === 'Assured Compliance Assessment Solution (ACAS) Nessus Scanner') {
return poam.vulnerabilityTitle;
} else {
return poam.vulnerabilitySource;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
[(ngModel)]="asset.assetId"
placeholder="Select Asset to Modify..."
(onChange)="setAsset($event.value.assetId)"
appendTo="body"
styleClass="mt-2 w-full"
required
[disabled]="accessLevel < 2">
Expand All @@ -137,7 +136,11 @@
</div>
</div>

<p-dialog *ngIf="accessLevel >= 2" header="Manage Assets" [(visible)]="assetDialogVisible" [modal]="true" [style]="{width: '50vw'}">
<p-dialog *ngIf="accessLevel >= 2"
[(visible)]="assetDialogVisible"
[modal]="true"
[style]="{width: '50vw'}"
[baseZIndex]="1000">
<ng-template pTemplate="content">
<cpat-asset [asset]="asset" [assets]="assets" [payload]="payload" (assetchange)="resetData(); closeAssetDialog();"></cpat-asset>
</ng-template>
Expand Down
162 changes: 79 additions & 83 deletions client/src/app/pages/asset-processing/asset/asset.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,96 +9,92 @@
-->

<form (ngSubmit)="onSubmit()" #form="ngForm">
<div class="p-fluid">
<div class="p-field p-grid">
<label for="collectionId" class="p-col-fixed" style="width: 10rem;">Collection:</label>
<div class="p-col">
<p-dropdown [options]="collectionOptions" [(ngModel)]="asset.collectionId" name="collectionId" placeholder="{{ tcollectionName }}" required></p-dropdown>
</div>
<div class="p-fluid">
<div class="p-field p-grid">
<label for="assetName" class="p-col-fixed" style="width: 10rem;">*Asset Name:</label>
<div class="p-col">
<input pInputText type="text" id="assetName" name="assetName" [(ngModel)]="asset.assetName" placeholder="Asset Name" required>
</div>
<br />
<div class="p-field p-grid">
<label for="assetName" class="p-col-fixed" style="width: 10rem;">*Asset Name:</label>
<div class="p-col">
<input pInputText type="text" id="assetName" name="assetName" [(ngModel)]="asset.assetName" placeholder="Asset Name" required>
</div>
</div>
<br />
<div class="p-field p-grid">
<label for="description" class="p-col-fixed" style="width: 10rem;">Description:</label>
<div class="p-col">
<input pInputText type="text" id="description" name="description" [(ngModel)]="asset.description" placeholder="Description">
</div>
</div>
<br />
<div class="p-field p-grid">
<label for="fullyQualifiedDomainName" class="p-col-fixed" style="width: 10rem;">Fully Qualified Domain Name:</label>
<div class="p-col">
<input pInputText type="text" id="fullyQualifiedDomainName" name="fullyQualifiedDomainName" [(ngModel)]="asset.fullyQualifiedDomainName" placeholder="Fully Qualified Domain Name">
</div>
</div>
<br />
<div class="p-field p-grid">
<label for="ipAddress" class="p-col-fixed" style="width: 10rem;">*IP Address:</label>
<div class="p-col">
<input pInputText type="text" id="ipAddress" name="ipAddress" [(ngModel)]="asset.ipAddress" placeholder="IP Address">
</div>
</div>
<br />
<div class="p-field p-grid">
<label for="macAddress" class="p-col-fixed" style="width: 10rem;">*MAC Address:</label>
<div class="p-col">
<input pInputText type="text" id="macAddress" name="macAddress" [(ngModel)]="asset.macAddress" placeholder="Mac Address">
</div>
</div>
<br />
<div class="p-field p-grid">
<label for="description" class="p-col-fixed" style="width: 10rem;">Description:</label>
<div class="p-col">
<input pInputText type="text" id="description" name="description" [(ngModel)]="asset.description" placeholder="Description">
</div>
<br />
<div class="col">
<p-table [value]="assetLabels" dataKey="labelId">
<ng-template pTemplate="header">
<tr>
<th scope="col" style="width:8rem">
<button pButton pRipple type="button" icon="pi pi-plus" (click)="addNewRow()" class="p-button-rounded p-button-text"></button>
</th>
<th scope="col">Label</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-label let-ri="rowIndex">
<tr>
<td>
<button pButton pRipple type="button" icon="pi pi-trash"
(click)="deleteAssetLabel(label, ri)" class="p-button-rounded p-button-text p-button-danger"></button>
</td>
<td>
<span *ngIf="!label.isNew">{{label.labelName}}</span>
<p-dropdown *ngIf="label.isNew"
[options]="labelOptions"
name="labelOptions"
appendTo="body"
[(ngModel)]="label.labelId"
[optionLabel]="'labelName'"
[optionValue]="'labelId'"
[style]="{'width':'100%'}"
(onChange)="onLabelChange(label, ri)">
</p-dropdown>
</td>
</tr>
</ng-template>
<ng-template pTemplate="emptymessage">
<tr>
<td colspan="2" style="text-align:center">No Data to Display</td>
</tr>
</ng-template>
</p-table>
</div>
<br />
<div class="p-field p-grid">
<label for="fullyQualifiedDomainName" class="p-col-fixed" style="width: 10rem;">Fully Qualified Domain Name:</label>
<div class="p-col">
<input pInputText type="text" id="fullyQualifiedDomainName" name="fullyQualifiedDomainName" [(ngModel)]="asset.fullyQualifiedDomainName" placeholder="Fully Qualified Domain Name">
</div>
</div>
<div class="formgroup-inline" style="margin-top: 20px;">
<div class="field">
<button pButton type="submit" [outlined]="true" label="Submit" class="p-mr-2" [disabled]="!form.valid"></button>
<br />
<div class="p-field p-grid">
<label for="ipAddress" class="p-col-fixed" style="width: 10rem;">*IP Address:</label>
<div class="p-col">
<input pInputText type="text" id="ipAddress" name="ipAddress" [(ngModel)]="asset.ipAddress" placeholder="IP Address">
</div>
<div class="field">
<button pButton type="button" [outlined]="true" label="Cancel" class="p-button-secondary p-mr-2" (click)="resetData()"></button>
</div>
<br />
<div class="p-field p-grid">
<label for="macAddress" class="p-col-fixed" style="width: 10rem;">*MAC Address:</label>
<div class="p-col">
<input pInputText type="text" id="macAddress" name="macAddress" [(ngModel)]="asset.macAddress" placeholder="Mac Address">
</div>
</div>
<br />
<div class="col">
<p-table [value]="assetLabels" dataKey="labelId" [style]="{'overflow': 'visible'}">
<ng-template pTemplate="header">
<tr>
<th scope="col" style="width:8rem">
<button pButton pRipple type="button" icon="pi pi-plus" (click)="addNewRow()" class="p-button-rounded p-button-text"></button>
</th>
<th scope="col">Label</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-label let-ri="rowIndex">
<tr>
<td>
<button pButton pRipple type="button" icon="pi pi-trash"
(click)="deleteAssetLabel(label, ri)" class="p-button-rounded p-button-text p-button-danger"></button>
</td>
<td style="overflow: visible; position: relative;">
<span *ngIf="!label.isNew">{{label.labelName}}</span>
<p-dropdown *ngIf="label.isNew"
[options]="labelList"
name="labelList"
appendTo="body"
[(ngModel)]="label.labelId"
optionLabel="labelName"
optionValue="labelId"
[style]="{'width':'100%'}"
[baseZIndex]="99999"
[panelStyle]="{'z-index': '999999'}"
(onChange)="onLabelChange(label, ri)"
placeholder="Select a label">
</p-dropdown>
</td>
</tr>
</ng-template>
<ng-template pTemplate="emptymessage">
<tr>
<td colspan="2" style="text-align:center">No Data to Display</td>
</tr>
</ng-template>
</p-table>
</div>
</div>
<div class="formgroup-inline" style="margin-top: 6rem;">
<div class="field">
<button pButton type="submit" [outlined]="true" label="Submit" class="p-mr-2" [disabled]="!form.valid"></button>
</div>
<div class="field">
<button pButton type="button" [outlined]="true" label="Cancel" class="p-button-secondary p-mr-2" (click)="resetData()"></button>
</div>
</div>
</form>
<p-toast></p-toast>
<p-confirmDialog header="Confirmation" icon="pi pi-exclamation-triangle"></p-confirmDialog>
Expand Down
Loading

0 comments on commit 36f4dc8

Please sign in to comment.