Merge branch 'master' of ssh://git.ervine.org/jonny/flask-python-helm

This commit is contained in:
Jonathan Ervine
2020-12-28 15:45:17 +08:00
7 changed files with 34 additions and 28 deletions
+9 -6
View File
@@ -1,6 +1,6 @@
from flask import render_template, request, jsonify
from forms import deploySelectForm
from main import get_namespaces, get_charts, get_chartdata, get_tiller_namespaces, chartRollback
from main import get_namespaces, get_charts, get_chartdata, chartRollback
from . import routes
from tables import chartVersionTable
import json
@@ -14,23 +14,26 @@ def index():
@routes.route('/chartSelect', methods=['POST'])
def chartVersions():
tiller_ns = request.form['tiller_ns']
chart = request.form['chart']
records = request.form['records']
namespace = 'default'
chartVersions = get_chartdata(tiller_ns, namespace, chart, records)
ns = request.form['ns']
chartVersions = get_chartdata(ns, chart, records)
table = chartVersionTable(chartVersions)
table.border = True
table.classes = ['table-striped', 'table-condensed', 'table-hover']
return render_template('chartRevisionList.html', table=table)
<<<<<<< HEAD
@routes.route('/nsLookup/<ns>/<namespace>')
=======
@routes.route('/nsLookup/<ns>')
>>>>>>> a7df40eb7710553f5d0185c3fa04ea6991c06f89
def namespaceLookup(ns):
charts = get_charts(ns)
return jsonify(charts)
@routes.route('/deployChartRevision/<revision>/<chart>/<tiller_ns>', methods=['POST'])
@routes.route('/deployChartRevision/<revision>/<chart>/<ns>', methods=['POST'])
def deployChartRevision(revision, chart, tiller_ns):
rollback = chartRollback(revision, chart, tiller_ns)
rollback = chartRollback(revision, chart, ns)
return rollback