mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-31 22:59:37 +08:00
✨ Feature(custom): rewrite setting page, WIP
This commit is contained in:
@@ -1589,11 +1589,11 @@ import {
|
||||
import { getConfig, saveConfig } from '@/manage/utils/dataSender'
|
||||
import { textFileExt } from '@/manage/utils/textfile'
|
||||
import { videoExt } from '@/manage/utils/videofile'
|
||||
import { IRPCActionType } from '#/types/enum'
|
||||
import { IDownloadTask, IUploadTask } from '#/types/manage'
|
||||
import { IStringKeyMap } from '#/types/types'
|
||||
import { trimPath } from '#/utils/common'
|
||||
import { cancelDownloadLoadingFileList, refreshDownloadFileTransferList } from '#/utils/static'
|
||||
import { trimPath } from '@/utils/common'
|
||||
import { IRPCActionType } from '@/utils/enum'
|
||||
import { cancelDownloadLoadingFileList, refreshDownloadFileTransferList } from '@/utils/static'
|
||||
import type { IDownloadTask, IUploadTask } from '#/types/manage'
|
||||
import type { IStringKeyMap } from '#/types/types'
|
||||
|
||||
const { t } = useI18n()
|
||||
/*
|
||||
|
||||
@@ -273,10 +273,10 @@ import { useManageStore } from '@/manage/store/manageStore'
|
||||
import { formObjToTableData } from '@/manage/utils/common'
|
||||
import { supportedPicBedList } from '@/manage/utils/constants'
|
||||
import { getConfig, removeConfig, saveConfig } from '@/manage/utils/dataSender'
|
||||
import { formatEndpoint, isNeedToShorten, safeSliceF } from '@/utils/common'
|
||||
import { getConfig as getPicBedsConfig } from '@/utils/dataSender'
|
||||
import { IRPCActionType } from '#/types/enum'
|
||||
import { IStringKeyMap, IUploaderConfigListItem } from '#/types/types'
|
||||
import { formatEndpoint, isNeedToShorten, safeSliceF } from '#/utils/common'
|
||||
import { IRPCActionType } from '@/utils/enum'
|
||||
import type { IStringKeyMap, IUploaderConfigListItem } from '#/types/types'
|
||||
|
||||
const { t } = useI18n()
|
||||
const manageStore = useManageStore()
|
||||
|
||||
@@ -279,7 +279,6 @@ import {
|
||||
Tools
|
||||
} from '@element-plus/icons-vue'
|
||||
import { ElNotification } from 'element-plus'
|
||||
import { IRPCActionType } from 'root/src/universal/types/enum'
|
||||
import { computed, onBeforeMount, reactive, ref, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
@@ -287,7 +286,8 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
import { useManageStore } from '@/manage/store/manageStore'
|
||||
import { supportedPicBedList } from '@/manage/utils/constants'
|
||||
import { newBucketConfig } from '@/manage/utils/newBucketConfig'
|
||||
import { IStringKeyMap } from '#/types/types'
|
||||
import { IRPCActionType } from '@/utils/enum'
|
||||
import type { IStringKeyMap } from '#/types/types'
|
||||
|
||||
const { t } = useI18n()
|
||||
const manageStore = useManageStore() as any
|
||||
|
||||
@@ -225,7 +225,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { Folder, InfoFilled } from '@element-plus/icons-vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { IRPCActionType } from 'root/src/universal/types/enum'
|
||||
import { onBeforeMount, ref, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
@@ -233,7 +232,8 @@ import DynamicSwitch from '@/manage/components/DynamicSwitch.vue'
|
||||
import { fileCacheDbInstance } from '@/manage/store/bucketFileDb'
|
||||
import { customRenameFormatTable, formatFileSize } from '@/manage/utils/common'
|
||||
import { getConfig, saveConfig } from '@/manage/utils/dataSender'
|
||||
import { IStringKeyMap } from '#/types/types'
|
||||
import { IRPCActionType } from '@/utils/enum'
|
||||
import type { IStringKeyMap } from '#/types/types'
|
||||
|
||||
const { t } = useI18n()
|
||||
const form = ref<IStringKeyMap>({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Dexie, { Table } from 'dexie'
|
||||
|
||||
import { IStringKeyMap } from '#/types/types'
|
||||
import type { IStringKeyMap } from '#/types/types'
|
||||
|
||||
/*
|
||||
* create a database for bucket file cache
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import { getConfig } from '@/manage/utils/dataSender'
|
||||
import { IStringKeyMap } from '#/types/types'
|
||||
import type { IStringKeyMap } from '#/types/types'
|
||||
|
||||
export const useManageStore = defineStore('manageConfig', {
|
||||
state: () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IStringKeyMap } from '#/types/types'
|
||||
import type { IStringKeyMap } from '#/types/types'
|
||||
|
||||
const AliyunAreaCodeName: IStringKeyMap = {
|
||||
'oss-cn-hangzhou': '华东1(杭州)',
|
||||
|
||||
@@ -2,8 +2,19 @@ import { v4 as uuidv4 } from 'uuid'
|
||||
|
||||
import { getConfig } from '@/manage/utils/dataSender'
|
||||
import { availableIconList } from '@/manage/utils/icon'
|
||||
import { IStringKeyMap } from '#/types/types'
|
||||
import { handleUrlEncode, isNeedToShorten, safeSliceF } from '#/utils/common'
|
||||
import { isNeedToShorten, safeSliceF } from '@/utils/common'
|
||||
import type { IStringKeyMap } from '#/types/types'
|
||||
|
||||
export const isUrlEncode = (url: string): boolean => {
|
||||
url = url || ''
|
||||
try {
|
||||
return url !== decodeURI(url)
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
export const handleUrlEncode = (url: string): string => (isUrlEncode(url) ? url : encodeURI(url))
|
||||
|
||||
export function randomStringGenerator (length: number): string {
|
||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createI18n } from 'vue-i18n'
|
||||
import en from '@/i18n/locales/en.json'
|
||||
import zhCN from '@/i18n/locales/zh-CN.json'
|
||||
import zhTW from '@/i18n/locales/zh-TW.json'
|
||||
import { IStringKeyMap } from '#/types/types'
|
||||
import type { IStringKeyMap } from '#/types/types'
|
||||
type MessageSchema = typeof en
|
||||
|
||||
const i18n = createI18n<MessageSchema, 'en' | 'zh-CN' | 'zh-TW'>({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { IRPCActionType } from '#/types/enum'
|
||||
import { IObj } from '#/types/types'
|
||||
import { IRPCActionType } from '@/utils/enum'
|
||||
import type { IObj } from '#/types/types'
|
||||
|
||||
export function saveConfig (config: IObj | string, value?: any) {
|
||||
const configObj = typeof config === 'string' ? { [config]: value } : config
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IStringKeyMap } from '#/types/types'
|
||||
import type { IStringKeyMap } from '#/types/types'
|
||||
|
||||
const AUTH_KEY_VALUE_RE = /(\w+)=["']?([^'"]{1,10000})["']?/
|
||||
let NC = 0
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createI18n } from 'vue-i18n'
|
||||
import en from '@/i18n/locales/en.json'
|
||||
import zhCN from '@/i18n/locales/zh-CN.json'
|
||||
import zhTW from '@/i18n/locales/zh-TW.json'
|
||||
import { IStringKeyMap } from '#/types/types'
|
||||
import type { IStringKeyMap } from '#/types/types'
|
||||
|
||||
import { AliyunAreaCodeName, QiniuAreaCodeName, TencentAreaCodeName } from './bucketConfigCons'
|
||||
type MessageSchema = typeof en
|
||||
|
||||
Reference in New Issue
Block a user