tuning ui and adding adaptive themeing to extension
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
import { credentialsApi } from '../services/api'
|
||||
|
||||
export const useCredentialsStore = defineStore('credentials', () => {
|
||||
const credentials = ref([])
|
||||
const platforms = ref({})
|
||||
const loading = ref(false)
|
||||
|
||||
async function fetchCredentials() {
|
||||
loading.value = true
|
||||
try {
|
||||
const response = await credentialsApi.list()
|
||||
credentials.value = response.data.items
|
||||
platforms.value = response.data.platforms || {}
|
||||
return response.data
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function hasPlatformCredentials(platform) {
|
||||
return !!platforms.value[platform]
|
||||
}
|
||||
|
||||
return {
|
||||
credentials,
|
||||
platforms,
|
||||
loading,
|
||||
fetchCredentials,
|
||||
hasPlatformCredentials,
|
||||
}
|
||||
})
|
||||
@@ -4,6 +4,7 @@ import { downloadsApi } from '../services/api'
|
||||
|
||||
export const useDownloadsStore = defineStore('downloads', () => {
|
||||
const downloads = ref([])
|
||||
const recentActivity = ref([])
|
||||
const stats = ref(null)
|
||||
const loading = ref(false)
|
||||
const total = ref(0)
|
||||
@@ -13,9 +14,9 @@ export const useDownloadsStore = defineStore('downloads', () => {
|
||||
async function fetchDownloads(params = {}) {
|
||||
loading.value = true
|
||||
try {
|
||||
// Use provided per_page or default to 1000 for client-side pagination
|
||||
const response = await downloadsApi.list({
|
||||
page: currentPage.value,
|
||||
per_page: perPage.value,
|
||||
per_page: params.per_page || 1000,
|
||||
...params,
|
||||
})
|
||||
downloads.value = response.data.items
|
||||
@@ -26,6 +27,12 @@ export const useDownloadsStore = defineStore('downloads', () => {
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchRecentActivity(params = {}) {
|
||||
const response = await downloadsApi.recentActivity(params)
|
||||
recentActivity.value = response.data.items
|
||||
return response.data
|
||||
}
|
||||
|
||||
async function fetchStats(params = {}) {
|
||||
const response = await downloadsApi.stats(params)
|
||||
stats.value = response.data
|
||||
@@ -38,12 +45,14 @@ export const useDownloadsStore = defineStore('downloads', () => {
|
||||
|
||||
return {
|
||||
downloads,
|
||||
recentActivity,
|
||||
stats,
|
||||
loading,
|
||||
total,
|
||||
currentPage,
|
||||
perPage,
|
||||
fetchDownloads,
|
||||
fetchRecentActivity,
|
||||
fetchStats,
|
||||
retryDownload,
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ export const useSubscriptionsStore = defineStore('subscriptions', () => {
|
||||
async function fetchSubscriptions(params = {}) {
|
||||
loading.value = true
|
||||
try {
|
||||
// Fetch all items for client-side pagination in v-data-table
|
||||
const response = await subscriptionsApi.list({
|
||||
page: currentPage.value,
|
||||
per_page: perPage.value,
|
||||
per_page: 1000,
|
||||
...params,
|
||||
})
|
||||
subscriptions.value = response.data.items
|
||||
|
||||
Reference in New Issue
Block a user