mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 05:45:19 +00:00
refac: styling
This commit is contained in:
parent
9a55547827
commit
384a53b339
6 changed files with 18 additions and 33 deletions
|
|
@ -233,14 +233,4 @@
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div class="flex justify-end pt-3 text-sm font-medium">
|
|
||||||
<button
|
|
||||||
class=" px-4 py-2 bg-emerald-700 hover:bg-emerald-800 text-gray-100 transition rounded-lg"
|
|
||||||
type="submit"
|
|
||||||
>
|
|
||||||
{$i18n.t('Save')}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</div> -->
|
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -260,39 +260,34 @@
|
||||||
|
|
||||||
const model = atSelectedModel ?? $models.find((m) => m.id === selectedModels[0]);
|
const model = atSelectedModel ?? $models.find((m) => m.id === selectedModels[0]);
|
||||||
if (model) {
|
if (model) {
|
||||||
|
// Set Default Tools
|
||||||
if (model?.info?.meta?.toolIds) {
|
if (model?.info?.meta?.toolIds) {
|
||||||
selectedToolIds = [
|
selectedToolIds = [
|
||||||
...new Set(
|
...new Set(
|
||||||
[...(model?.info?.meta?.toolIds ?? [])].filter((id) => $tools.find((t) => t.id === id))
|
[...(model?.info?.meta?.toolIds ?? [])].filter((id) => $tools.find((t) => t.id === id))
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
} else {
|
|
||||||
selectedToolIds = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set Default Filters
|
||||||
if (model?.info?.meta?.defaultFilterIds) {
|
if (model?.info?.meta?.defaultFilterIds) {
|
||||||
console.log('model.info.meta.defaultFilterIds', model.info.meta.defaultFilterIds);
|
console.log(model);
|
||||||
selectedFilterIds = model.info.meta.defaultFilterIds;
|
selectedFilterIds = model.info.meta.defaultFilterIds;
|
||||||
console.log('selectedFilterIds', selectedFilterIds);
|
|
||||||
} else {
|
|
||||||
selectedFilterIds = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set Default Features
|
||||||
if (model?.info?.meta?.defaultFeatureIds) {
|
if (model?.info?.meta?.defaultFeatureIds) {
|
||||||
console.log('model.info.meta.defaultFeatureIds', model.info.meta.defaultFeatureIds);
|
if (model.info?.meta?.capabilities?.['image_generation']) {
|
||||||
imageGenerationEnabled = model.info.meta.defaultFeatureIds.includes('image_generation');
|
imageGenerationEnabled = model.info.meta.defaultFeatureIds.includes('image_generation');
|
||||||
webSearchEnabled = model.info.meta.defaultFeatureIds.includes('web_search');
|
}
|
||||||
codeInterpreterEnabled = model.info.meta.defaultFeatureIds.includes('code_interpreter');
|
|
||||||
|
|
||||||
console.log({
|
if (model.info?.meta?.capabilities?.['web_search']) {
|
||||||
imageGenerationEnabled,
|
webSearchEnabled = model.info.meta.defaultFeatureIds.includes('web_search');
|
||||||
webSearchEnabled,
|
}
|
||||||
codeInterpreterEnabled
|
|
||||||
});
|
if (model.info?.meta?.capabilities?.['code_interpreter']) {
|
||||||
} else {
|
codeInterpreterEnabled = model.info.meta.defaultFeatureIds.includes('code_interpreter');
|
||||||
imageGenerationEnabled = false;
|
}
|
||||||
webSearchEnabled = false;
|
|
||||||
codeInterpreterEnabled = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@
|
||||||
|
|
||||||
<div class="flex justify-end pt-1 text-sm font-medium">
|
<div class="flex justify-end pt-1 text-sm font-medium">
|
||||||
<button
|
<button
|
||||||
class=" px-4 py-2 bg-emerald-700 hover:bg-emerald-800 text-gray-100 transition rounded-3xl flex flex-row space-x-1 items-center {loading
|
class="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full {loading
|
||||||
? ' cursor-not-allowed'
|
? ' cursor-not-allowed'
|
||||||
: ''}"
|
: ''}"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
|
|
||||||
<div class="flex justify-end pt-1 text-sm font-medium">
|
<div class="flex justify-end pt-1 text-sm font-medium">
|
||||||
<button
|
<button
|
||||||
class=" px-4 py-2 bg-emerald-700 hover:bg-emerald-800 text-gray-100 transition rounded-3xl flex flex-row space-x-1 items-center {loading
|
class="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full {loading
|
||||||
? ' cursor-not-allowed'
|
? ' cursor-not-allowed'
|
||||||
: ''}"
|
: ''}"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
false)
|
false)
|
||||||
? 'focus:outline focus:outline-2 focus:outline-gray-800 focus:dark:outline-gray-200'
|
? 'focus:outline focus:outline-2 focus:outline-gray-800 focus:dark:outline-gray-200'
|
||||||
: 'outline outline-1 outline-gray-100 dark:outline-gray-800'} {state
|
: 'outline outline-1 outline-gray-100 dark:outline-gray-800'} {state
|
||||||
? ' bg-emerald-600'
|
? ' bg-emerald-500 dark:bg-emerald-700'
|
||||||
: 'bg-gray-200 dark:bg-transparent'}"
|
: 'bg-gray-200 dark:bg-transparent'}"
|
||||||
>
|
>
|
||||||
<Switch.Thumb
|
<Switch.Thumb
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
|
|
||||||
<div class="flex justify-end pt-3 text-sm font-medium">
|
<div class="flex justify-end pt-3 text-sm font-medium">
|
||||||
<button
|
<button
|
||||||
class=" px-4 py-2 bg-emerald-700 hover:bg-emerald-800 text-gray-100 transition rounded-lg flex flex-row space-x-1 items-center"
|
class="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"
|
||||||
type="submit"
|
type="submit"
|
||||||
>
|
>
|
||||||
{$i18n.t('Done')}
|
{$i18n.t('Done')}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue