Updated with correct code
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
from flask import Blueprint
|
||||
routes = Blueprint('routes', __name__)
|
||||
|
||||
from .kube_helm_routes import *
|
||||
@@ -1,17 +0,0 @@
|
||||
from flask import render_template, request
|
||||
from forms import searchForm, playerRecordsForm, teamRecordsForm, clubPlayingRecordsForm
|
||||
from . import routes
|
||||
from tables import Results, playerResults, teamResults, clubPlayingRecord
|
||||
import datetime
|
||||
from datetime import date
|
||||
|
||||
@routes.route('/')
|
||||
def deploySelect():
|
||||
namespaces =
|
||||
sql2 = "SELECT nextClub, oppoLogo FROM hkfcDAdminSettings"
|
||||
clubs = sql_read_static(sql)
|
||||
settings = sql_read_static(sql2)
|
||||
form = teamRecordsForm()
|
||||
form.clubName.choices = [(name['hockeyClub'], name['hockeyClub']) for name in clubs]
|
||||
clubLogo = settings[0]['oppoLogo']
|
||||
return render_template('_teamRecords.html', data=clubs, selectedClubLogo=clubLogo, form=form)
|
||||
@@ -0,0 +1,36 @@
|
||||
from flask import render_template, request, jsonify
|
||||
from forms import deploySelectForm
|
||||
from main import get_namespaces, get_charts, get_chartdata
|
||||
from . import routes
|
||||
from tables import chartVersionTable
|
||||
import json
|
||||
|
||||
@routes.route('/', methods=['GET', 'POST'])
|
||||
def index():
|
||||
namespaces = get_namespaces()
|
||||
print(namespaces)
|
||||
form = deploySelectForm()
|
||||
form.namespace.choices = [(name['metadata']['name'], name['metadata']['name']) for name in namespaces['items']]
|
||||
return render_template('nameChartSelect.html', namespaces=namespaces, form=form)
|
||||
|
||||
@routes.route('/chartSelect', methods=['POST'])
|
||||
def chartVersions():
|
||||
namespace = request.form['namespace']
|
||||
chart = request.form['chart']
|
||||
chartVersions = get_chartdata(namespace, chart)
|
||||
print(chartVersions)
|
||||
table = chartVersionTable(chartVersions)
|
||||
table.border = True
|
||||
table.classes = ['table-striped', 'table-condensed', 'table-hover']
|
||||
return render_template('chartRevisionList.html', table=table, namespace=namespace, chart=chart)
|
||||
|
||||
|
||||
@routes.route('/nsLookup/<namespace>')
|
||||
def namespaceLookup(namespace):
|
||||
charts = get_charts(namespace)
|
||||
return jsonify(charts)
|
||||
|
||||
@routes.route('/deployChartRevision/<revision>')
|
||||
def deployChartRevision(revision):
|
||||
charts = get_charts(namespace)
|
||||
return jsonify(charts)
|
||||
Reference in New Issue
Block a user