fix: add sort for policies list

This commit is contained in:
cxymds
2025-04-02 09:09:46 +08:00
parent a26d4afda6
commit af4172a2fa
5 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ const emit = defineEmits<{
}>()
const getPoliciesList = async () => {
const res = await listPolicies()
polices.value = Object.keys(res).map((key) => {
polices.value = Object.keys(res).sort((a,b)=>a.localeCompare(b)).map((key) => {
return {
label: key,
value: key
@@ -95,7 +95,7 @@ function filterName(value: string) {
const listData = ref<any[]>([])
const getPoliciesList = async () => {
const res = await listPolicies()
listData.value = Object.keys(res).map((key) => {
listData.value = Object.keys(res).sort((a,b)=>a.localeCompare(b)).map((key) => {
return {
name: key,
content: res[key],
+1 -1
View File
@@ -140,7 +140,7 @@ const policiesList = ref<any[]>([])
const getPoliciesList = async () => {
const res = await listPolicies()
policiesList.value = Object.keys(res).map((key) => {
policiesList.value = Object.keys(res).sort((a,b)=>a.localeCompare(b)).map((key) => {
return {
label: key,
value: key,
+1 -1
View File
@@ -99,7 +99,7 @@ const emit = defineEmits<{
}>()
const getPoliciesList = async () => {
const res = await listPolicies()
policyList.value = Object.keys(res).map((key) => {
policyList.value = Object.keys(res).sort((a,b)=>a.localeCompare(b)).map((key) => {
return {
label: key,
value: key,
+1 -1
View File
@@ -136,7 +136,7 @@ function filterName(value: string) {
const fetchPolicies = async () => {
try {
const res = await $api.get("/list-canned-policies");
pilicies.value = Object.keys(res).map((key) => {
pilicies.value = Object.keys(res).sort((a,b)=>a.localeCompare(b)).map((key) => {
return {
name: key,
content: res[key],