-
+
+
+
+
{{ selectedLabels[0].name }}
{{ placeholder }}
@@ -30,7 +36,10 @@
-
![]()
+
+
+
+
{{ o.name }}
@@ -130,7 +139,23 @@ export default {
return selectedLabels.value.some(label => label.id === id)
}
- return { open, toggle, select, search, filteredOptions, wrapper, selectedLabels, isSelected, loading }
+ const isImageIcon = icon => {
+ if (!icon) return false
+ return /^https?:\/\//.test(icon) || icon.startsWith('/')
+ }
+
+ return {
+ open,
+ toggle,
+ select,
+ search,
+ filteredOptions,
+ wrapper,
+ selectedLabels,
+ isSelected,
+ loading,
+ isImageIcon
+ }
}
}
@@ -200,6 +225,9 @@ export default {
.option-icon {
width: 16px;
height: 16px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
}
.dropdown-loading {
diff --git a/open-isle-cli/src/views/SettingsPageView.vue b/open-isle-cli/src/views/SettingsPageView.vue
index c8f4aeb0b..fe6301aad 100644
--- a/open-isle-cli/src/views/SettingsPageView.vue
+++ b/open-isle-cli/src/views/SettingsPageView.vue
@@ -29,18 +29,11 @@
管理员设置
-
+
-
+
@@ -53,9 +46,10 @@
import { API_BASE_URL, toast } from '../main'
import { getToken, fetchCurrentUser } from '../utils/auth'
import BaseInput from '../components/BaseInput.vue'
+import Dropdown from '../components/Dropdown.vue'
export default {
name: 'SettingsPageView',
- components: { BaseInput },
+ components: { BaseInput, Dropdown },
data() {
return {
username: '',
@@ -83,6 +77,19 @@ export default {
onAvatarChange(e) {
this.avatarFile = e.target.files[0]
},
+ fetchPublishModes() {
+ return Promise.resolve([
+ { id: 'DIRECT', name: '直接发布', icon: 'fas fa-bolt' },
+ { id: 'REVIEW', name: '审核后发布', icon: 'fas fa-search' }
+ ])
+ },
+ fetchPasswordStrengths() {
+ return Promise.resolve([
+ { id: 'LOW', name: '低', icon: 'fas fa-lock-open' },
+ { id: 'MEDIUM', name: '中', icon: 'fas fa-lock' },
+ { id: 'HIGH', name: '高', icon: 'fas fa-user-shield' }
+ ])
+ },
async loadAdminConfig() {
try {
const token = getToken()