fix: improve log rendering by removing unnecessary replacements and ensure safe HTML output
This commit is contained in:
@@ -123,7 +123,7 @@ def view_logs():
|
|||||||
if log_name == 'beat' and os.path.exists('/var/log/jellyplist_beat.log'):
|
if log_name == 'beat' and os.path.exists('/var/log/jellyplist_beat.log'):
|
||||||
with open('/var/log/jellyplist_beat.log', 'r',encoding='utf-8') as f:
|
with open('/var/log/jellyplist_beat.log', 'r',encoding='utf-8') as f:
|
||||||
logs = f.readlines()
|
logs = f.readlines()
|
||||||
return render_template('admin/logview.html', logs=str.join('',logs).replace('<',"_").replace('>',"_"),name=log_name)
|
return render_template('admin/logview.html', logs=str.join('',logs),name=log_name)
|
||||||
|
|
||||||
@app.route('/admin/setloglevel', methods=['POST'])
|
@app.route('/admin/setloglevel', methods=['POST'])
|
||||||
@functions.jellyfin_admin_required
|
@functions.jellyfin_admin_required
|
||||||
|
|||||||
@@ -116,8 +116,9 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let editor = monaco.editor.create(document.getElementById('editor'), {
|
let editor = monaco.editor.create(document.getElementById('editor'), {
|
||||||
value: `{{ logs }}`,
|
value: `{{logs | safe }}`,
|
||||||
language: 'jellyplistLog',
|
language: 'jellyplistLog',
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
minimap: { enabled: false },
|
minimap: { enabled: false },
|
||||||
|
|||||||
Reference in New Issue
Block a user