mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-22 19:01:51 +08:00
Merge pull request #90 from bui/uncache-views
add query string to view requests
This commit is contained in:
commit
f726ecdd7b
13
app.py
13
app.py
@ -44,6 +44,7 @@ def get_config():
|
||||
if not config.get('assets_baseurl'):
|
||||
config['assets_baseurl'] = ''.join([request.host_url, 'assets']) + '/'
|
||||
|
||||
config['_version'] = get_version()
|
||||
return config
|
||||
|
||||
|
||||
@ -118,6 +119,14 @@ def get_tja_preview(tja):
|
||||
return 0
|
||||
|
||||
|
||||
def get_version():
|
||||
version = None
|
||||
if os.path.isfile('version.json'):
|
||||
version = json.load(open('version.json', 'r'))
|
||||
|
||||
return version
|
||||
|
||||
|
||||
@app.teardown_appcontext
|
||||
def close_connection(exception):
|
||||
db = getattr(g, '_database', None)
|
||||
@ -127,9 +136,7 @@ def close_connection(exception):
|
||||
|
||||
@app.route('/')
|
||||
def route_index():
|
||||
version = None
|
||||
if os.path.isfile('version.json'):
|
||||
version = json.load(open('version.json', 'r'))
|
||||
version = get_version()
|
||||
return render_template('index.html', version=version, config=get_config())
|
||||
|
||||
|
||||
|
@ -84,7 +84,8 @@ class Loader{
|
||||
|
||||
assets.views.forEach(name => {
|
||||
var id = this.getFilename(name)
|
||||
this.promises.push(this.ajax("src/views/" + name).then(page => {
|
||||
var qs = gameConfig._version ? '?' + gameConfig._version.commit_short : '?'
|
||||
this.promises.push(this.ajax("src/views/" + name + qs).then(page => {
|
||||
assets.pages[id] = page
|
||||
}))
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user