This repository has been archived by the owner on Feb 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from cds-snc/dev
Integration of dev branch work over time back into master.
- Loading branch information
Showing
16 changed files
with
198 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
WORKDIR=${1:-"/opt/apps/track-web-public"} | ||
mkdir -p $WORKDIR | ||
cd $WORKDIR | ||
python3 -m venv .venv | ||
. .venv/bin/activate | ||
pip install --upgrade pip | ||
pip install -r requirements.txt | ||
tar -czvf track-web-public.tar.gz .venv track | ||
rm -rf .venv |
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 |
---|---|---|
|
@@ -20,6 +20,8 @@ class Config: | |
def init_app(app): | ||
pass | ||
|
||
|
||
|
||
class ProductionConfig(Config): | ||
|
||
CACHE_TYPE = "filesystem" | ||
|
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
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,75 @@ | ||
function generate_chart() { | ||
var chart = d3.select('.compliant'); | ||
var width = chart.attr("data-width"); | ||
if (width == null) | ||
width = calculate_width(); | ||
width = parseInt(width); | ||
var height = width * 1.2; | ||
var radius = Math.min(width, height) / 2; | ||
var color = d3.scale.ordinal() | ||
.range(["#0071e1", "#888888"]); | ||
var arc = d3.svg.arc() | ||
.outerRadius(radius) | ||
.innerRadius(radius - 40); | ||
var pie = d3.layout.pie() | ||
.value(function (d) { | ||
return d.value; | ||
}) | ||
.sort(null); | ||
chart = chart | ||
.append('svg') | ||
.attr("width", width) | ||
.attr("height", height) | ||
.append("g") | ||
.attr("transform", "translate(" + (width / 2) + "," + (height / 2) + ")"); | ||
d3.json("/data/reports/https.json", function (error, data) { | ||
// calculate % client-side | ||
var compliant = Math.round((data.enforces / data.eligible) * 100); | ||
// just abort and leave it blank if something's wrong | ||
// (instead of showing "NaN%" visually) | ||
if (isNaN(compliant)) | ||
return; | ||
var pie_data = [ | ||
{status: 'active', value: compliant}, | ||
{status: 'inactive', value: (100-compliant)}, | ||
] | ||
var g = chart.selectAll(".arc") | ||
.data(pie(pie_data)) | ||
.enter().append("g") | ||
.attr("class", "arc"); | ||
g.append("path") | ||
.style("fill", function(d) { | ||
return color(d.data.status); | ||
}) | ||
.transition().delay(function(d, i) { | ||
return i *400; | ||
}).duration(400) | ||
.attrTween('d', function(d) { | ||
var i = d3.interpolate(d.startAngle+ 0.1, d.endAngle); | ||
return function(t) { | ||
d.endAngle = i(t); | ||
return arc(d); | ||
} | ||
}); | ||
g.append("text") | ||
.attr("text-anchor", "middle") | ||
.attr("class", "text-5xl font-bold") | ||
.attr("dy", "0.4em") | ||
.attr("fill", "black") | ||
.text(function(d){ | ||
return "" + pie_data[0].value + "%"; | ||
}); | ||
}); | ||
}; | ||
|
||
function calculate_width() { | ||
var window_width = $(window).width(); | ||
|
||
if(window_width < 769) | ||
return 250; | ||
else | ||
return 287; | ||
} | ||
|
||
generate_chart(); | ||
|
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
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 |
---|---|---|
@@ -1 +1,8 @@ | ||
<div class="bg-grey-darkest py-1 text-xs sm:block md:block lg:block xl:block"></div> | ||
<section class="bg-grey-darkest py-4 text-xs sm:block md:block lg:block xl:block"> | ||
<div class="container mx-auto text-white flex items-center"> | ||
<span class="flex-initial"> | ||
<span class="beta-badge py-2 px-2 font-bold rounded uppercase mr-4">Beta</span> | ||
</span> | ||
<span class="flex-1">This is a new service, we are constantly improving.</span> | ||
</div> | ||
</section> |
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 |
---|---|---|
@@ -1 +1,8 @@ | ||
<div class="bg-grey-darkest py-1 text-xs sm:block md:block lg:block xl:block"></div> | ||
<section class="bg-grey-darkest py-4 text-xs sm:block md:block lg:block xl:block"> | ||
<div class="container mx-auto text-white flex items-center"> | ||
<span class="flex-initial"> | ||
<span class="beta-badge py-2 px-2 font-bold rounded uppercase mr-4">Bêta</span> | ||
</span> | ||
<span class="flex-1">Ceci est un nouveau service, nous l’améliorons constamment.</span> | ||
</div> | ||
</section> |
Oops, something went wrong.