-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
94 additions
and
7 deletions.
There are no files selected for viewing
Empty file.
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,68 @@ | ||
<template> | ||
<div> | ||
<!-- This is where html gets written --> | ||
<div class="title">This is a Vue Template File</div> | ||
|
||
<!-- | ||
Here we use the ListInput component written in | ||
another part of our code. We use v-bind to bind a value | ||
from the data section to the list prop in the the ListInput | ||
component. We then use v-on to tell the ListInput to bind | ||
to userInput whenever the input is changed. After, that we use | ||
v-bind twice more to pass data into the component. | ||
--> | ||
<ListInput | ||
v-bind:list='list' | ||
v-on:listChange='userInput = $event' | ||
v-bind:label="'Example List Input'" | ||
v-bind:tooltips='exampleTooltips' | ||
></ListInput> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import ListInput from './ListInput' | ||
export default { | ||
// props are objects that you can pass into a child element | ||
// Template.vue would be a child of whatever component it is imported into | ||
props: { | ||
model: { | ||
type: Object | ||
} | ||
}, | ||
// Components are other .vue files that can be added to your code so that you don't | ||
// have to write the same code twice. You import components at the time of the file | ||
// and register them here. | ||
components: { | ||
'ListInput': ListInput, | ||
}, | ||
// Methods are functions you want to be able to access from the template section | ||
// the allow us to execute commands with data. | ||
methods: { | ||
emit() { | ||
this.$emit('formChange', this.model) | ||
} | ||
}, | ||
// data is where declare the variables that you want your code to use | ||
// and interact with | ||
data() { | ||
return { | ||
list: ["example", "example", "example"], | ||
// update list will get stored in this variable | ||
userInput: [], | ||
exampleTooltips: ["this is 1", "this is 2", "this is 3"] | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
/* | ||
this is where css is written. However, try as much as possible not to write | ||
your own css because we are using Bulma as our primary style framework. If you don't | ||
known what that is google "Bulma css" - I'm not your mom. Hopefully mystyles.css | ||
still exists at this point. | ||
*/ | ||
</style> |
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 |
---|---|---|
|
@@ -11,15 +11,16 @@ | |
from flask import Flask, render_template, request, send_from_directory, jsonify, send_file | ||
from algorithm.tsp import tsp | ||
from algorithm.s_bfl import s_bfl | ||
# from email_credentials import credentials | ||
# from flask_mail import Mail | ||
# from flask_mail import Message | ||
from flask_cors import CORS, cross_origin | ||
# from simulation.sim import Simulation | ||
from algorithm.geo import Geo | ||
from simulation.sim import Simulation | ||
import json | ||
|
||
""" for email feature | ||
# from email_credentials import credentials | ||
# from flask_mail import Mail | ||
# from flask_mail import Message | ||
""" | ||
class CustomFlask(Flask): | ||
jinja_options = Flask.jinja_options.copy() | ||
jinja_options.update(dict( | ||
|
@@ -31,10 +32,10 @@ class CustomFlask(Flask): | |
app = CustomFlask(__name__) # This replaces your existing "app = Flask(__name__)" | ||
CORS(app, supports_credentials = True) | ||
|
||
""" for email feature | ||
# c = credentials() | ||
# c.setPassword() | ||
|
||
# app.config.update( | ||
# DEBUG = True, | ||
# MAIL_SERVER = 'smtp.gmail.com', | ||
|
@@ -45,7 +46,7 @@ class CustomFlask(Flask): | |
# ) | ||
# mail = Mail(app) | ||
|
||
""" | ||
my_sim = Simulation() | ||
|
||
@app.route('/s-bfls/', methods=['POST']) | ||
|
@@ -62,13 +63,16 @@ def Sbfl(): | |
my_sim.main() | ||
response_dict['sim_response'] = my_sim.sim_results | ||
response = jsonify(response_dict) | ||
|
||
""" for email feature | ||
# response.headers.add('Access-Control-Allow-Origin', '*') | ||
# msg = Message('S-BFLS', | ||
# sender="[email protected]", | ||
# recipients=["[email protected]"]) | ||
# msg.body = "Thanks for using SBFLS! Attached are our results." | ||
# mail.send(msg) | ||
""" | ||
return response | ||
|
||
@app.errorhandler(404) | ||
|