refac
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
let headers = '';
|
||||
|
||||
let functionNameFilterList = '';
|
||||
let accessControl = {};
|
||||
let accessGrants = [];
|
||||
|
||||
let id = '';
|
||||
let name = '';
|
||||
@@ -149,7 +149,7 @@
|
||||
key,
|
||||
config: {
|
||||
enable: enable,
|
||||
access_control: accessControl
|
||||
access_grants: accessGrants
|
||||
},
|
||||
info: {
|
||||
id,
|
||||
@@ -206,7 +206,7 @@
|
||||
|
||||
if (data.config) {
|
||||
enable = data.config.enable ?? true;
|
||||
accessControl = data.config.access_control ?? {};
|
||||
accessGrants = data.config.access_grants ?? [];
|
||||
}
|
||||
|
||||
toast.success($i18n.t('Import successful'));
|
||||
@@ -305,7 +305,7 @@
|
||||
config: {
|
||||
enable: enable,
|
||||
function_name_filter_list: functionNameFilterList,
|
||||
access_control: accessControl
|
||||
access_grants: accessGrants
|
||||
},
|
||||
info: {
|
||||
id: id,
|
||||
@@ -339,7 +339,7 @@
|
||||
|
||||
enable = true;
|
||||
functionNameFilterList = '';
|
||||
accessControl = null;
|
||||
accessGrants = [];
|
||||
};
|
||||
|
||||
const init = () => {
|
||||
@@ -363,7 +363,7 @@
|
||||
|
||||
enable = connection.config?.enable ?? true;
|
||||
functionNameFilterList = connection.config?.function_name_filter_list ?? '';
|
||||
accessControl = connection.config?.access_control ?? null;
|
||||
accessGrants = connection.config?.access_grants ?? [];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -819,7 +819,7 @@
|
||||
<hr class=" border-gray-100 dark:border-gray-700/10 my-2.5 w-full" />
|
||||
|
||||
<div class="my-2">
|
||||
<AccessControl bind:accessControl />
|
||||
<AccessControl bind:accessGrants />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
let modelIds = [];
|
||||
let filterMode = 'include';
|
||||
|
||||
let accessControl = {};
|
||||
let accessGrants = [];
|
||||
|
||||
let imageInputElement;
|
||||
let loading = false;
|
||||
@@ -83,7 +83,7 @@
|
||||
description: description || null,
|
||||
model_ids: modelIds.length > 0 ? modelIds : null,
|
||||
filter_mode: modelIds.length > 0 ? (filterMode ? filterMode : null) : null,
|
||||
access_control: accessControl
|
||||
access_grants: accessGrants
|
||||
}
|
||||
};
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
description = model.meta.description;
|
||||
modelIds = model.meta.model_ids || [];
|
||||
filterMode = model.meta?.filter_mode ?? 'include';
|
||||
accessControl = 'access_control' in model.meta ? model.meta.access_control : {};
|
||||
accessGrants = model.meta.access_grants ?? [];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
<hr class=" border-gray-100 dark:border-gray-700/10 my-2.5 w-full" />
|
||||
|
||||
<div class="my-2">
|
||||
<AccessControl bind:accessControl />
|
||||
<AccessControl bind:accessGrants />
|
||||
</div>
|
||||
|
||||
<hr class=" border-gray-100 dark:border-gray-700/10 my-2.5 w-full" />
|
||||
|
||||
Reference in New Issue
Block a user