Skip to content

Commit

Permalink
Added darkmode
Browse files Browse the repository at this point in the history
Fixed new_init db bug
  • Loading branch information
drakylar committed Jan 16, 2022
1 parent ff74878 commit 7893d70
Show file tree
Hide file tree
Showing 8 changed files with 534 additions and 11 deletions.
499 changes: 499 additions & 0 deletions static/css/darkmode.css

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions system/db_initiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,22 @@ def create_db():
print('Error with creating table IssueTemplates')
conn.commit()

# create table - NetworkPaths
try:
cursor.execute('''CREATE TABLE IF NOT EXISTS NetworkPaths
(
id text PRIMARY KEY,
host_out text default '',
network_out text default '',
host_in text default '',
network_in text default '',
description text default '',
project_id text default '',
type text default 'connection',
direction text default 'forward'
)''')
except psycopg2.errors.DuplicateTable:
print('Error with creating table NetworkPaths')
conn.commit()

return True
6 changes: 5 additions & 1 deletion templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<title>{% if tab_name %}{{ escape(tab_name) }}{% else %}PCF{% endif %}</title>
<link href="/static/images/favicon.ico" rel="shortcut icon" type="image/x-icon">


{% if external_css %}
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/se/dt-1.10.23/rg-1.1.2/datatables.min.css">
Expand Down Expand Up @@ -35,7 +36,10 @@
{% endif %}
{% endif %}


{% set darkmode=(request.cookies.get('darkmode')=='1') %}
{% if darkmode %}
<link rel="stylesheet" type="text/css" href="/static/css/darkmode.css">
{% endif %}
<style>
body {
padding: 1em;
Expand Down
6 changes: 4 additions & 2 deletions templates/menu.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

<div class="ui inverted menu orange" id="header_menu">
<div class="ui inverted menu header_menu orange" id="header_menu">
<a class="item" href="/">Pentest Collaboration Framework{% if current_project is defined %}:
{{ escape(current_project['name']) }}{% endif %}</a>
<div class="ui dropdown item">
Expand Down Expand Up @@ -28,6 +27,9 @@

</div>
</div>
{% set darkmode=(request.cookies.get('darkmode')=='1') %}
<a class="item" style="cursor: pointer" onclick="{% if darkmode %}document.cookie='darkmode=0; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/';{% else %}document.cookie='darkmode=1;expires=Fri, 31 Dec 9999 23:59:59 GMT;path=/';{% endif %}document.location.reload();"><i class="ui icon {% if darkmode %}yellow sun{% else %}blue moon{% endif %}"></i></a>

<div class="right menu">
{% if session.get('id') %}
<div class="ui dropdown item">
Expand Down
2 changes: 1 addition & 1 deletion templates/project/services/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h1 class="ui header" style="float: left">Services: {{ len(ports) }}</h1>
});
</script>
<div class="ui container" style="width: 100%;float:left;">
<table id="services_list" class="ui table"
<table id="services_list" class="ui table services_list"
style="width: 100%; text-align: left; vertical-align: baseline">
<thead>
<tr id="table_header">
Expand Down
4 changes: 2 additions & 2 deletions templates/project/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</style>
{% set project_counters = db.select_project_stats_divbar(current_project['id']) %}
<div class="ui sticky" id="sidebar" style="padding-right: 15px;">
<div class="ui vertical icon menu" style="margin-top: 0px;" id="sidebar_menu">
<div class="ui vertical icon menu sidebar_menu" style="margin-top: 0px;" id="sidebar_menu">
<div data-tooltip="Statistics" data-position="right center" data-inverted="">
<a href="/project/{{ current_project['id'] }}/" class="red item" id="menu_stats">
<i class="bar chart large icon"></i>
Expand Down Expand Up @@ -131,7 +131,7 @@
</div>
</div>

<div class="ui vertical icon menu" style="position:fixed; bottom:10px;left:17px;" id="scroll_menu">
<div class="ui vertical icon menu scroll_menu" style="position:fixed; bottom:10px;left:17px;" id="scroll_menu">
<a onclick="window.scrollTo(0,0);" class="red item">
<i class="arrow up icon"></i>
</a>
Expand Down
6 changes: 3 additions & 3 deletions templates/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<h2 class="ui header" style="float: left">Projects</h2>
<a href="/new_project" class="ui button purple" style="float: right"><i class="plus icon"></i>New project</a>
</div>
<div class="ui top attached tabular menu" style="margin-bottom: 10px">
<div class="ui top attached tabular menu projects_list_tabs" style="margin-bottom: 10px">
<a class="item active" data-tab="active">
Active
</a>
Expand All @@ -85,7 +85,7 @@ <h2 class="ui header" style="float: left">Projects</h2>
</a>
</div>

<div class="ui tab active" data-tab="active">
<div class="ui tab active" data-tab="active" style="padding-top:5px;">
<table id="online-projects" class="ui table" style="width:100%">
<thead>
<tr>
Expand Down Expand Up @@ -137,7 +137,7 @@ <h2 class="ui header" style="float: left">Projects</h2>
</table>
</div>

<div class="ui tab" data-tab="archived">
<div class="ui tab" data-tab="archived" style="padding-top:5px;">
<table id="archived-projects" class="ui table" style="width:100%">
<thead>
<tr>
Expand Down
4 changes: 2 additions & 2 deletions templates/team.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ <h2>Administrators</h2>
{% if curr_tester=='admin' %}
{% if count.append(count.pop() + 1) %} {% endif %}
{% set user_data = db.select_user_by_id(user_id)[0] %}
<div class="ui piled segment {% if count[0] % 2 %}blue{% else %}red{% endif %}">
<div class="ui piled segment {% if count[0] % 2 %}blue{% else %}red{% endif %} team_profile_segment">
<div class="ui dropdown item">
<h3>
<i class="id card icon"></i>{{ escape(user_data['fname'] + ' ' + user_data['lname'] + ' - ' + user_data['email']) }}<i
Expand Down Expand Up @@ -273,7 +273,7 @@ <h2>Testers</h2>
{% if curr_tester=='tester' %}
{% set user_data = db.select_user_by_id(user_id)[0] %}
{% if count.append(count.pop() + 1) %} {% endif %}
<div class="ui piled segment {% if count[0] % 2 %}blue{% else %}red{% endif %}">
<div class="ui piled segment {% if count[0] % 2 %}blue{% else %}red{% endif %} team_profile_segment">
<div class="ui dropdown item">
<h3>
<i class="id card icon"></i>{{ escape(user_data['fname'] + ' ' + user_data['lname'] + ' - ' + user_data['email']) }}<i
Expand Down

0 comments on commit 7893d70

Please sign in to comment.