From 8c769a9f77cb49138097c1e191e4b07ebf9bb702 Mon Sep 17 00:00:00 2001 From: ebolam Date: Wed, 31 Aug 2022 13:06:56 -0400 Subject: [PATCH] File Load Dialog Updates --- aiserver.py | 7 ++++--- static/koboldai.js | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/aiserver.py b/aiserver.py index 2dc0ef48..5eeece13 100644 --- a/aiserver.py +++ b/aiserver.py @@ -7237,7 +7237,7 @@ def UI_2_load_story_list(data): file_popup("Select Story to Load", "./stories", "load_story", upload=True, jailed=True, folder_only=False, renameable=True, deleteable=True, show_breadcrumbs=True, item_check=valid_story, valid_only=True, hide_extention=True, extra_parameter_function=get_story_length, - column_names=['Story Name', 'Action Count'], + column_names=['Story Name', 'Action Count'], show_filename=False, column_widths=['auto', '100px'], sort="Modified", desc=True) @@ -7246,10 +7246,11 @@ def get_story_length(item_full_path, item, valid_selection): return [""] with open(item_full_path, "r") as f: js = json.load(f) + title = js['story_name'] if 'story_name' in js else ".".join(item.split(".")[:-1]) if 'file_version' not in js: - return [len(js['actions'])] + return [title, len(js['actions'])] if js['file_version'] == 1: - return [len(js['actions'])] + return [title, len(js['actions'])] return [0 if js['actions']['action_count'] == -1 else js['actions']['action_count'] ] diff --git a/static/koboldai.js b/static/koboldai.js index 4f2627f6..0aed68d5 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -634,7 +634,7 @@ function load_popup(data) { } function popup_items(data) { - //console.log(data); + console.log(data); var popup_list = document.getElementById('popup_list'); //first, let's clear out our existing data while (popup_list.firstChild) { @@ -647,6 +647,9 @@ function popup_items(data) { for (i=0; i < data.column_widths.length; i++) { style = style + " p"+i; } + if (data.show_filename) { + style = style + " p"+i; + } style = style + '"; grid-template-columns: 50px'; for (column_width of data.column_widths) { style = style + " "+column_width;