mirror of
https://github.com/open-webui/open-webui
synced 2025-04-25 08:48:21 +00:00
Merge pull request #11413 from hurxxxx/fix/global-filter-cannot-disable
Some checks are pending
Deploy to HuggingFace Spaces / check-secret (push) Waiting to run
Deploy to HuggingFace Spaces / deploy (push) Blocked by required conditions
Create and publish Docker images with specific build args / build-main-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-main-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / merge-main-images (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge-cuda-images (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge-ollama-images (push) Blocked by required conditions
Python CI / Format Backend (3.11) (push) Waiting to run
Frontend Build / Format & Build Frontend (push) Waiting to run
Frontend Build / Frontend Unit Tests (push) Waiting to run
Some checks are pending
Deploy to HuggingFace Spaces / check-secret (push) Waiting to run
Deploy to HuggingFace Spaces / deploy (push) Blocked by required conditions
Create and publish Docker images with specific build args / build-main-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-main-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / merge-main-images (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge-cuda-images (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge-ollama-images (push) Blocked by required conditions
Python CI / Format Backend (3.11) (push) Waiting to run
Frontend Build / Format & Build Frontend (push) Waiting to run
Frontend Build / Frontend Unit Tests (push) Waiting to run
fix: Prevent modification of global filter settings in "Admin panel" - "Settings" - "Models"
This commit is contained in:
commit
6b806ae12f
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
export let state = 'unchecked';
|
export let state = 'unchecked';
|
||||||
export let indeterminate = false;
|
export let indeterminate = false;
|
||||||
|
export let disabled = false;
|
||||||
|
|
||||||
let _state = 'unchecked';
|
let _state = 'unchecked';
|
||||||
|
|
||||||
@ -14,8 +15,10 @@
|
|||||||
class=" outline -outline-offset-1 outline-[1.5px] outline-gray-200 dark:outline-gray-600 {state !==
|
class=" outline -outline-offset-1 outline-[1.5px] outline-gray-200 dark:outline-gray-600 {state !==
|
||||||
'unchecked'
|
'unchecked'
|
||||||
? 'bg-black outline-black '
|
? 'bg-black outline-black '
|
||||||
: 'hover:outline-gray-500 hover:bg-gray-50 dark:hover:bg-gray-800'} text-white transition-all rounded-sm inline-block w-3.5 h-3.5 relative"
|
: 'hover:outline-gray-500 hover:bg-gray-50 dark:hover:bg-gray-800'} text-white transition-all rounded-sm inline-block w-3.5 h-3.5 relative {disabled ? 'opacity-50 cursor-not-allowed' : ''}"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
|
if (disabled) return;
|
||||||
|
|
||||||
if (_state === 'unchecked') {
|
if (_state === 'unchecked') {
|
||||||
_state = 'checked';
|
_state = 'checked';
|
||||||
dispatch('change', _state);
|
dispatch('change', _state);
|
||||||
@ -30,6 +33,7 @@
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
|
{disabled}
|
||||||
>
|
>
|
||||||
<div class="top-0 left-0 absolute w-full flex justify-center">
|
<div class="top-0 left-0 absolute w-full flex justify-center">
|
||||||
{#if _state === 'checked'}
|
{#if _state === 'checked'}
|
||||||
|
@ -39,10 +39,13 @@
|
|||||||
<div class=" flex items-center gap-2 mr-3">
|
<div class=" flex items-center gap-2 mr-3">
|
||||||
<div class="self-center flex items-center">
|
<div class="self-center flex items-center">
|
||||||
<Checkbox
|
<Checkbox
|
||||||
state={_filters[filter].selected ? 'checked' : 'unchecked'}
|
state={_filters[filter].is_global ? 'checked' : (_filters[filter].selected ? 'checked' : 'unchecked')}
|
||||||
|
disabled={_filters[filter].is_global}
|
||||||
on:change={(e) => {
|
on:change={(e) => {
|
||||||
_filters[filter].selected = e.detail === 'checked';
|
if (!_filters[filter].is_global) {
|
||||||
selectedFilterIds = Object.keys(_filters).filter((t) => _filters[t].selected);
|
_filters[filter].selected = e.detail === 'checked';
|
||||||
|
selectedFilterIds = Object.keys(_filters).filter((t) => _filters[t].selected);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user