mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
File Load Dialog Updates
This commit is contained in:
@@ -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'] ]
|
||||
|
||||
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user