-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: Model resource #3773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Model resource #3773
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,7 +189,7 @@ const PermissionConst = { | |
| SHARED_KNOWLEDGE_DOCUMENT_GENERATE: new Permission('SYSTEM_KNOWLEDGE_DOCUMENT:READ+GENERATE'), | ||
| SHARED_KNOWLEDGE_DOCUMENT_MIGRATE: new Permission('SYSTEM_KNOWLEDGE_DOCUMENT:READ+MIGRATE'), | ||
| SHARED_KNOWLEDGE_DOCUMENT_EXPORT: new Permission('SYSTEM_KNOWLEDGE_DOCUMENT:READ+EXPORT'), | ||
| SHARED_KNOWLEDGE_DOCUMENT_DOWNLOAD_SOURCE_FILE: new Permission('SYSTEM_KNOWLEDGE_DOCUMENT:READ'), | ||
| SHARED_KNOWLEDGE_DOCUMENT_DOWNLOAD_SOURCE_FILE: new Permission('SYSTEM_KNOWLEDGE_DOCUMENT:READ+DOWNLOAD'), | ||
|
|
||
| SHARED_KNOWLEDGE_PROBLEM_READ: new Permission('SYSTEM_KNOWLEDGE_PROBLEM:READ'), | ||
| SHARED_KNOWLEDGE_PROBLEM_CREATE: new Permission('SYSTEM_KNOWLEDGE_PROBLEM:READ+CREATE'), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The provided code snippet appears correct and there are no apparent irregularities, potential issues, or optimizations to suggest based on the changes mentioned. The permission constants have been updated appropriately without introducing errors in their syntax or logic. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,7 +169,7 @@ | |
| type="primary" | ||
| text | ||
| :title="$t('common.modify')" | ||
| v-if="permissionPrecise.modify(row.id)" | ||
| v-if="permissionPrecise.modify()" | ||
| @click.stop="openEditModel(row)" | ||
| > | ||
| <el-icon><EditPen /></el-icon> | ||
|
|
@@ -191,7 +191,7 @@ | |
| row.model_type === 'LLM' || | ||
| row.model_type === 'IMAGE' || | ||
| row.model_type === 'TTI') && | ||
| permissionPrecise.paramSetting(row.id) | ||
| permissionPrecise.paramSetting() | ||
| " | ||
| @click.stop="openParamSetting(row)" | ||
| > | ||
|
|
@@ -205,7 +205,7 @@ | |
| type="primary" | ||
| text | ||
| :title="$t('common.delete')" | ||
| v-if="permissionPrecise.delete(row.id)" | ||
| v-if="permissionPrecise.delete()" | ||
| @click.stop="deleteModel(row)" | ||
| > | ||
| <el-icon><Delete /></el-icon> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code you've provided looks generally clean, but there's one area that can be optimized slightly. Here's an analysis with suggestions: Changes Suggested
By implementing these changes, you enhance readability and potentially decrease overhead by reducing repetitive code execution. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided JavaScript code snippet looks largely correct and functional. However, there are a couple of improvements you could make:
Type Checking: It's generally good practice to add type annotations to function parameters and return types. This can help catch errors at compile time if you're using modern TypeScript.
Remove Unnecessary Parameters: If the
modifymethod does not actually use anid, it might be more appropriate to remove this parameter altogether or document that it's intentionally unused.Here's how you might refactor the code with these considerations:
Key Points:
(): booleanafter each method signature to clearly indicate that they should return a boolean value.id: stringparameter from theparamSettinganddeletemethods unless they truly need it.These changes improve readability and maintainability while maintaining the functionality of the existing code.