upgraded ui

This commit is contained in:
saloui 2023-09-26 08:58:02 +02:00
parent a317238d86
commit 384c341a94
6 changed files with 76 additions and 33 deletions

View File

@ -0,0 +1,42 @@
import re
import os
# Define a list of file extensions to process
file_extensions = ['.js', '.vue', '.html']
# Regular expressions to match lines where semicolons can be added
javascript_pattern = r'\b(?:(?<!if|else|while|for|switch|catch|return|function)\s*[^;]*$|^\s*{)'
vue_pattern = r'\b(?:data|computed|methods|watch|beforeCreate|created|beforeMount|mounted|beforeUpdate|updated|beforeDestroy|destroyed)\s*:[^;]*$'
html_pattern = r'<[^>]*>$'
# Function to add semicolons to the end of lines in a file
def add_semicolons_to_file(file_path):
try:
with open(file_path, 'r') as file:
lines = file.readlines()
with open(file_path, 'w') as file:
for line in lines:
if file_path.endswith('.js') and re.search(javascript_pattern, line.strip()):
line = line.rstrip() + ';'
elif file_path.endswith('.vue') and re.search(vue_pattern, line.strip()):
line = line.rstrip() + ';'
elif file_path.endswith('.html') and re.search(html_pattern, line.strip()):
line = line.rstrip() + ';'
file.write(line)
except FileNotFoundError:
print(f"File not found: {file_path}")
except Exception as e:
print(f"An error occurred: {str(e)}")
# Specify the path to the directory containing your JavaScript, Vue.js, or HTML files
directory_path = '/path/to/your/files'
# Iterate through files in the directory and add semicolons
for root, _, files in os.walk(directory_path):
for file_name in files:
if any(file_name.endswith(ext) for ext in file_extensions):
file_path = os.path.join(root, file_name)
add_semicolons_to_file(file_path)
print("Semicolons added successfully.")

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
web/dist/index.html vendored
View File

@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoLLMS WebUI - Welcome</title>
<script type="module" crossorigin src="/assets/index-1b4fff03.js"></script>
<link rel="stylesheet" href="/assets/index-1c21f712.css">
<script type="module" crossorigin src="/assets/index-210a2834.js"></script>
<link rel="stylesheet" href="/assets/index-5acc5bc6.css">
</head>
<body>
<div id="app"></div>

View File

@ -31,7 +31,7 @@
</button>
Custom model
</div>
<input v-model="model.selected" @click.stop="toggleSelected" type="checkbox" class='cursor-pointer border-2 border-blue-300 rounded w-10 h-10'>
<input v-if="model.isInstalled" v-model="model.selected" @click.stop="toggleSelected" type="checkbox" class='cursor-pointer border-2 border-blue-300 rounded w-10 h-10'>
<div>
<button v-if="model.isInstalled" title="Delete file from disk" type="button" @click.stop="toggleInstall"
class="inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900">
@ -111,7 +111,7 @@
<div class="grow">
<!-- EMPTY SPACE FILLER -->
</div>
<input v-model="model.selected" @click.stop="toggleSelected" type="checkbox" class='cursor-pointer border-2 border-blue-300 rounded w-10 h-10'>
<input v-if="model.isInstalled" v-model="model.selected" @click.stop="toggleSelected" type="checkbox" class='cursor-pointer border-2 border-blue-300 rounded w-10 h-10'>
<InteractiveMenu :commands="commandsList" :force_position=2 title="Menu">
@ -324,6 +324,7 @@ export default {
//navigator.clipboard.writeText(this.path)
},
toggleCancelInstall() {
installing=false;
this.onCancelInstall(this)
},

View File

@ -2389,8 +2389,8 @@ export default {
// }
this.modelDownlaodInProgress = false
this.addModel = {}
this.$refs.toast.showToast("Model installation aborted", 4, false)
socket.emit('cancel_install', { model_name: modelEntry.model_name, binding_folder: modelEntry.binding_folder, model_url: modelEntry.model_url, patreon: model.patreon?model.patreon:"None"});
this.$refs.toast.showToast("Model installation aborted", 4, false)
},
// Model installation