Initial Commit

This commit is contained in:
jenkins-x-bot
2020-09-14 13:50:50 +08:00
parent 8943e695d1
commit 17443ee1ea
32 changed files with 10626 additions and 2 deletions
Binary file not shown.
Binary file not shown.
+4
View File
@@ -0,0 +1,4 @@
from flask import Blueprint
routes = Blueprint('routes', __name__)
from .kube_helm_routes import *
+40
View File
@@ -0,0 +1,40 @@
from flask import render_template, request, jsonify
from forms import deploySelectForm
from main import get_namespaces, get_charts, get_chartdata, get_tiller_namespaces
from . import routes
from tables import chartVersionTable
import json
@routes.route('/', methods=['GET', 'POST'])
def index():
tiller_ns = get_tiller_namespaces()
namespaces = get_namespaces()
form = deploySelectForm()
form.tiller_ns.choices = [(name['metadata']['namespace'], name['metadata']['namespace']) for name in tiller_ns['items']]
form.namespace.choices = [(name['metadata']['name'], name['metadata']['name']) for name in namespaces['items']]
return render_template('nameChartSelect.html', namespaces=namespaces, tiller_ns=tiller_ns, form=form)
@routes.route('/chartSelect', methods=['POST'])
def chartVersions():
namespace = request.form['namespace']
tiller_ns = request.form['tiller_ns']
chart = request.form['chart']
chartVersions = get_chartdata(tiller_ns, namespace, chart)
table = chartVersionTable(chartVersions)
table.border = True
table.classes = ['table-striped', 'table-condensed', 'table-hover']
return render_template('chartRevisionList.html', table=table, namespace=namespace)
@routes.route('/nsLookup/<tiller>/<namespace>')
def namespaceLookup(tiller, namespace):
charts = get_charts(tiller, namespace)
return jsonify(charts)
@routes.route('/deployChartRevision/<revision>/<chart>/<namespace>', methods=['POST'])
def deployChartRevision(revision, chart, namespace):
print(revision)
print(chart)
print(namespace)
charts = get_charts(namespace)
return jsonify(charts)