mirror of
https://github.com/CzBiX/qb-web.git
synced 2026-05-12 11:36:22 +08:00
Add remote QB support
This commit is contained in:
@@ -5,7 +5,22 @@ import { ConfigState, ConfigPayload } from './types';
|
||||
|
||||
const configKey = 'qb-config';
|
||||
|
||||
export interface Config {
|
||||
baseUrl: string | null;
|
||||
updateInterval: number;
|
||||
pageOptions: any;
|
||||
filter: {
|
||||
state: string | null;
|
||||
category: string | null;
|
||||
site: string | null;
|
||||
query: string | null;
|
||||
};
|
||||
locale: string | null;
|
||||
darkMode: string | null;
|
||||
}
|
||||
|
||||
const defaultConfig = {
|
||||
baseUrl: null,
|
||||
updateInterval: 2000,
|
||||
pageOptions: {
|
||||
itemsPerPage: 50,
|
||||
@@ -20,8 +35,6 @@ const defaultConfig = {
|
||||
darkMode: null,
|
||||
};
|
||||
|
||||
export type Config = typeof defaultConfig
|
||||
|
||||
function saveConfig(obj: any) {
|
||||
localStorage.setItem(configKey, JSON.stringify(obj));
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ const store = new Vuex.Store<RootState>({
|
||||
mainData: undefined,
|
||||
preferences: null,
|
||||
pasteUrl: null,
|
||||
needAuth: false,
|
||||
},
|
||||
mutations: {
|
||||
/* eslint-disable no-param-reassign */
|
||||
@@ -60,6 +61,9 @@ const store = new Vuex.Store<RootState>({
|
||||
const { url } = payload;
|
||||
state.pasteUrl = url;
|
||||
},
|
||||
updateNeedAuth(state, payload) {
|
||||
state.needAuth = payload;
|
||||
},
|
||||
/* eslint-enable no-param-reassign */
|
||||
},
|
||||
getters: {
|
||||
|
||||
@@ -6,6 +6,7 @@ export interface RootState {
|
||||
mainData?: MainData;
|
||||
preferences: any;
|
||||
pasteUrl: string | null;
|
||||
needAuth: boolean;
|
||||
}
|
||||
|
||||
export interface SearchEnginePage {
|
||||
|
||||
Reference in New Issue
Block a user