-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: initial web interface
- Loading branch information
Showing
8 changed files
with
129 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Generated files | ||
web/pertify/examples.js | ||
|
||
# Temporary files | ||
*~ | ||
*# | ||
|
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,25 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Transform: AWS::Serverless-2016-10-31 | ||
|
||
Globals: | ||
Function: | ||
Timeout: 5 | ||
|
||
Resources: | ||
PertifyFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: lambda-build/pertify | ||
Runtime: go1.x | ||
Tracing: Active | ||
Events: | ||
Request: | ||
Type: Api | ||
Properties: | ||
Path: /api/pertify | ||
Method: POST | ||
|
||
Outputs: | ||
GraphmanAPI: | ||
PertifyFunction: | ||
Value: !GetAtt PertifyFunction.Arn |
Empty file.
Binary file not shown.
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,71 @@ | ||
<html> | ||
<head> | ||
<title>Pertify</title> | ||
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" /> | ||
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1" /> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-133664781-4"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', 'UA-133664781-5'); | ||
</script> | ||
|
||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>Pertify</h1> | ||
<form class="form-inline"> | ||
<div class="form-group mb-2"> | ||
<select id="examples" class="form-control mr-sm-2"> | ||
<option value="custom">* custom *</option> | ||
</select> | ||
</div> | ||
<!-- checkbox with-details --> | ||
<!-- checkbox debug --> | ||
<!-- checkbox vertical --> | ||
<!-- checkbox no-simplify --> | ||
<input class="btn btn-primary mb-2 mx-sm-3" type="button" id="generate" value="generate" /> | ||
</form> | ||
<textarea class="form-control" rows="10" id="source">Loading...</textarea> | ||
<hr /> | ||
<textarea class="form-control" disabled="disabled" id="output" rows="10">Loading...</textarea> | ||
<hr /> | ||
<footer> | ||
<a href="https://github.com/moul/graphman">Graphman</a>, by <a href="https://manfred.life/">Manfred Touron</a>. | ||
</footer> | ||
</div> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> | ||
<script src="/pertify/examples.js"></script> | ||
<script> | ||
function generate() { | ||
var url = '/api/pertify?'; | ||
$('#generate').attr('disabled', 'disabled'); | ||
|
||
gtag('event', "generate", {}); | ||
$.post(url, $('#source').html(), function(res) { | ||
$('#output').html(res); | ||
}).always(function() {$('#generate').removeAttr('disabled');}); | ||
} | ||
|
||
function loadExample() { | ||
$('#source').html(atob(examples.files[$('#examples').val()].content)); | ||
generate(); | ||
} | ||
|
||
$('#examples').change(loadExample); | ||
$('#generate').click(generate); | ||
$('#source').change(function() { | ||
$('#examples').val('custom'); | ||
}); | ||
$(document).ready(function() { | ||
for (var i = 0; i < examples.files.length; i++) { | ||
$('#examples').append($("<option />").val(i).html(examples.files[i].name)); | ||
} | ||
$('#examples').val(0); | ||
loadExample(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |