Skip to content

Commit 7642aeb

Browse files
author
CodeKevin
committedJan 24, 2015
Starting DO integration
1 parent fb5e525 commit 7642aeb

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed
 

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,5 @@ docs/_build/
5454
target/
5555

5656
*.db
57-
*.log
57+
*.log
58+
.idea/

‎CTFd/admin.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ def admin_pages(route):
111111
return render_template('admin/pages.html', routes=pages)
112112

113113

114+
@app.route('/admin/hosts', methods=['GET'])
115+
@admins_only
116+
def admin_hosts():
117+
return render_template('admin/hosts.html')
118+
114119
@app.route('/admin/chals', methods=['POST', 'GET'])
115120
@admins_only
116121
def admin_chals():
@@ -353,12 +358,12 @@ def admin_stats():
353358
db.session.close()
354359

355360
return render_template('admin/statistics.html', team_count=teams_registered,
356-
hit_count=site_hits,
357-
wrong_count=wrong_count,
358-
solve_count=solve_count,
361+
hit_count=site_hits,
362+
wrong_count=wrong_count,
363+
solve_count=solve_count,
359364
challenge_count=challenge_count,
360365
most_solved=most_solved_chal,
361-
least_solved = least_solved_chal
366+
least_solved=least_solved_chal
362367
)
363368

364369

‎requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ SQLAlchemy==0.9.8
77
passlib==1.6.2
88
py-bcrypt==0.4
99
six==1.8.0
10-
itsdangerous
10+
itsdangerous
11+
dop

‎static/admin/js/chalboard.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function loadchals(){
135135
};
136136

137137
for (var i = 0; i <= challenges['game'].length - 1; i++) {
138-
$('#' + challenges['game'][i].category.replace(/ /g,"-")).append($('<button value="' + challenges['game'][i].id + '">' + challenges['game'][i].value + '</button>'));
138+
$('#' + challenges['game'][i].category.replace(/ /g,"-")).append($('<button class="radius" value="' + challenges['game'][i].id + '">' + challenges['game'][i].value + '</button>'));
139139
};
140140

141141
$('#challenges button').click(function (e) {
@@ -145,7 +145,7 @@ function loadchals(){
145145
loadfiles(this.value);
146146
});
147147

148-
$('tr').append('<button class="create-challenge"><i class="fa fa-plus"></i></button>');
148+
$('tr').append('<button class="radius create-challenge"><i class="fa fa-plus"></i></button>');
149149

150150
$('.create-challenge').click(function (e) {
151151
$('#new-chal-category').val($($(this).siblings()[0]).text().trim())

‎templates/admin/chals.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ <h1>CTF</h1>
121121
<div>
122122
<table id='challenges'>
123123
</table>
124-
<button style="width:100%;" class="create-category">New Category</button>
124+
<button style="width:100%;" class="radius create-category">New Category</button>
125125
</div>
126126
</div>
127127
{% endblock %}

‎templates/admin/config.html

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ <h1>Config</h1>
77
<form method="POST">
88
<input name='nonce' type='hidden' value="{{ nonce }}">
99

10+
<div class="row">
11+
<label for="start">Digital Ocean API Key:</label>
12+
<input id='do_api_key' name='do_api_key' type='text' placeholder="Digital Ocean API Key" {% if do_api_key is defined and do_api_key != None %}value="{{ do_api_key }}"{% endif %}>
13+
</div>
14+
1015
<div class="row">
1116
<label for="start">Start Date:</label>
1217
<input id='start' name='start' type='text' placeholder="Start Date (UTC timestamp)" {% if start is defined and start != None %}value="{{ start }}"{% endif %}>

0 commit comments

Comments
 (0)
Please sign in to comment.