mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-07 15:38:22 +08:00
Merge pull request #5838 from xuhaihan/fix/admin-user-role-select-styling
fix(frontend): align admin role selector styling
This commit is contained in:
@@ -31,10 +31,11 @@
|
||||
</div>
|
||||
<div>
|
||||
<label class="input-label">{{ t('admin.users.form.roleLabel') }}</label>
|
||||
<select v-model="form.role" class="input">
|
||||
<option value="user">{{ t('admin.users.roles.user') }}</option>
|
||||
<option value="admin">{{ t('admin.users.roles.admin') }}</option>
|
||||
</select>
|
||||
<Select
|
||||
v-model="form.role"
|
||||
:options="roleOptions"
|
||||
:searchable="false"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label class="input-label">{{ t('admin.users.notes') }}</label>
|
||||
@@ -73,13 +74,14 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from 'vue'
|
||||
import { computed, ref, reactive, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useAppStore } from '@/stores/app'
|
||||
import { useClipboard } from '@/composables/useClipboard'
|
||||
import { adminAPI } from '@/api/admin'
|
||||
import type { AdminUser, UserAttributeValuesMap } from '@/types'
|
||||
import BaseDialog from '@/components/common/BaseDialog.vue'
|
||||
import Select from '@/components/common/Select.vue'
|
||||
import UserAttributeForm from '@/components/user/UserAttributeForm.vue'
|
||||
import Icon from '@/components/icons/Icon.vue'
|
||||
import { useStepUp, isStepUpBlocked, isStepUpCancelled, stepUpBlockReason } from '@/composables/useStepUp'
|
||||
@@ -90,7 +92,20 @@ const emit = defineEmits(['close', 'success'])
|
||||
const { t } = useI18n(); const appStore = useAppStore(); const { copyToClipboard } = useClipboard()
|
||||
|
||||
const submitting = ref(false); const passwordCopied = ref(false)
|
||||
const form = reactive({ email: '', password: '', username: '', notes: '', role: 'user', concurrency: 1, rpm_limit: 0, customAttributes: {} as UserAttributeValuesMap })
|
||||
const roleOptions = computed(() => [
|
||||
{ value: 'user', label: t('admin.users.roles.user') },
|
||||
{ value: 'admin', label: t('admin.users.roles.admin') }
|
||||
])
|
||||
const form = reactive({
|
||||
email: '',
|
||||
password: '',
|
||||
username: '',
|
||||
notes: '',
|
||||
role: 'user' as AdminUser['role'],
|
||||
concurrency: 1,
|
||||
rpm_limit: 0,
|
||||
customAttributes: {} as UserAttributeValuesMap
|
||||
})
|
||||
|
||||
watch(() => props.user, (u) => {
|
||||
if (u) {
|
||||
|
||||
Reference in New Issue
Block a user