From 868871a93c7d5be88ab9bfaf73d26e5b57aa293e Mon Sep 17 00:00:00 2001 From: AndzejsP Date: Wed, 21 Jun 2023 17:56:03 +0300 Subject: [PATCH] somehow ready --- web/src/components/UniversalForm.vue | 148 ++++++++++++++++++++++++--- web/src/views/SettingsView.vue | 8 +- 2 files changed, 137 insertions(+), 19 deletions(-) diff --git a/web/src/components/UniversalForm.vue b/web/src/components/UniversalForm.vue index 718d452e..8912c354 100644 --- a/web/src/components/UniversalForm.vue +++ b/web/src/components/UniversalForm.vue @@ -31,13 +31,16 @@
-
-
+ +
+
+ +
+
+ + +

+ {{ item.help }} +

+ + + +
-
+
+ + - -
+ + + + +
+ +

+ {{ item.help }} +

+ +
+
+ + + + +

+ {{ item.help }} +

+ +

@@ -80,7 +192,7 @@
- @@ -134,9 +246,13 @@ export default { methods: { hide(response) { this.show = false; + if (this.resolve) { - this.resolve(response); + if(response){ + this.resolve(this.controls_array); this.resolve = null; + } + } }, showForm(controls_array, title, ConfirmButtonText, DenyButtonText) { diff --git a/web/src/views/SettingsView.vue b/web/src/views/SettingsView.vue index 0dda61b8..1e02b26b 100644 --- a/web/src/views/SettingsView.vue +++ b/web/src/views/SettingsView.vue @@ -1195,9 +1195,11 @@ export default { const arr = '[{"name":"model_name","type":"str","value":"DreamShaper_5_beta2_noVae_half_pruned.ckpt", "help":"Name of the model to be loaded for stable diffusion generation"},{"name":"ddim_steps","type":"int","value":50, "min":10, "max":1024},{"name":"scale","type":"float","value":7.5, "min":0.1, "max":100.0},{"name":"W","type":"int","value":512, "min":10, "max":2048},{"name":"H","type":"int","value":512, "min":10, "max":2048},{"name":"skip_grid","type":"bool","value":true,"help":"Skip building a grid of generated images"},{"name":"batch_size","type":"int","value":1, "min":1, "max":100,"help":"Number of images per batch (requires more memory)"},{"name":"num_images","type":"int","value":1, "min":1, "max":100,"help":"Number of batch of images to generate (to speed up put a batch of n and a single num images, to save vram, put a batch of 1 and num_img of n)"},{"name":"seed","type":"int","value":-1}, {"name":"servers_addresses","type":"list","value":[], "help":"A list of server addresses for example [\'http://localhost:9601\', \'http://localhost:9602\']"},{"name":"keep_only_active_servers","type":"bool","value":true, "help":"If true, then only active servers will be kept in the loop"},{"name":"sampler_name","type":"str","value":"ddim","help":"Supported sampler names: ddim, dpms, plms", "options":["ddim","dpms","plms"]}]' const arr2 = JSON.parse(arr) - - - this.$refs.universalForm.showForm(arr2, "Baba booey form", "Go for torps", "go home") // disabled to not break UI just add endpoint or anything + const newItem = { name: "babagaga", value: ['lol', 'asdasd', 'hhhhhh'], type: 'list', help: 'smelly ' } + arr2.push(newItem) + // this.$refs.universalForm.showForm(arr2, "Baba booey form", "Go for torps", "go home").then(res => { + // console.log('finished', res) + // }) // disabled to not break UI just add endpoint or anything }, // messagebox ok stuff onMessageBoxOk() {