fix(fe/cron): use proper name for cron jobs

This commit is contained in:
hexxa 2022-04-16 10:52:26 +08:00 committed by Hexxa
parent fb219c90b7
commit 191146ac7c
5 changed files with 16 additions and 16 deletions

View file

@ -34,7 +34,7 @@ export class Cron {
}; };
} }
const cronTable = new Cron(); const cronJobs = new Cron();
export const CronTable = (): Cron => { export const CronJobs = (): Cron => {
return cronTable; return cronJobs;
}; };

View file

@ -32,7 +32,7 @@ import {
loadingCtrl, loadingCtrl,
} from "../common/controls"; } from "../common/controls";
import { HotkeyHandler } from "../common/hotkeys"; import { HotkeyHandler } from "../common/hotkeys";
import { CronTable } from "../common/cron"; import { CronJobs } from "../common/cron";
import { Title } from "./visual/title"; import { Title } from "./visual/title";
import { NotFoundBanner } from "./visual/banner_notfound"; import { NotFoundBanner } from "./visual/banner_notfound";
@ -107,7 +107,7 @@ export class FilesPanel extends React.Component<Props, State, {}> {
} }
componentDidMount(): void { componentDidMount(): void {
CronTable().setInterval("refreshFileList", { CronJobs().setInterval("refreshFileList", {
func: updater().refreshFiles, func: updater().refreshFiles,
args: [], args: [],
delay: 5000, delay: 5000,
@ -123,7 +123,7 @@ export class FilesPanel extends React.Component<Props, State, {}> {
} }
componentWillUnmount() { componentWillUnmount() {
CronTable().clearInterval("refreshFileList"); CronJobs().clearInterval("refreshFileList");
document.removeEventListener("keyup", this.hotkeyHandler.handle); document.removeEventListener("keyup", this.hotkeyHandler.handle);
} }

View file

@ -15,7 +15,7 @@ import { NotFoundBanner } from "./visual/banner_notfound";
import { Title } from "./visual/title"; import { Title } from "./visual/title";
import { shareIDQuery } from "../client/files"; import { shareIDQuery } from "../client/files";
import { loadingCtrl, ctrlOn, ctrlOff } from "../common/controls"; import { loadingCtrl, ctrlOn, ctrlOff } from "../common/controls";
import { CronTable } from "../common/cron"; import { CronJobs } from "../common/cron";
export interface SharingsProps { export interface SharingsProps {
sharings: Map<string, string>; sharings: Map<string, string>;
@ -40,7 +40,7 @@ export class SharingsPanel extends React.Component<Props, State, {}> {
} }
componentDidMount(): void { componentDidMount(): void {
CronTable().setInterval("listSharings", { CronJobs().setInterval("listSharings", {
func: updater().listSharings, func: updater().listSharings,
args: [], args: [],
delay: 5000, delay: 5000,
@ -48,7 +48,7 @@ export class SharingsPanel extends React.Component<Props, State, {}> {
} }
componentWillUnmount() { componentWillUnmount() {
CronTable().clearInterval("listSharings"); CronJobs().clearInterval("listSharings");
} }
setLoading = (state: boolean) => { setLoading = (state: boolean) => {

View file

@ -11,7 +11,7 @@ import { LoginProps } from "./pane_login";
import { Layers } from "./layers"; import { Layers } from "./layers";
import { AdminProps } from "./pane_admin"; import { AdminProps } from "./pane_admin";
import { TopBar } from "./topbar"; import { TopBar } from "./topbar";
import { CronTable } from "../common/cron"; import { CronJobs } from "../common/cron";
import { updater } from "./state_updater"; import { updater } from "./state_updater";
export const controlName = "panelTabs"; export const controlName = "panelTabs";
@ -33,7 +33,7 @@ export class RootFrame extends React.Component<Props, State, {}> {
} }
componentDidMount(): void { componentDidMount(): void {
CronTable().setInterval("autoSwitchTheme", { CronJobs().setInterval("autoSwitchTheme", {
func: updater().autoSwitchTheme, func: updater().autoSwitchTheme,
args: [], args: [],
delay: 60 * 1000, delay: 60 * 1000,
@ -41,7 +41,7 @@ export class RootFrame extends React.Component<Props, State, {}> {
} }
componentWillUnmount() { componentWillUnmount() {
CronTable().clearInterval("autoSwitchTheme"); CronJobs().clearInterval("autoSwitchTheme");
} }
makeBgStyle = (): Object => { makeBgStyle = (): Object => {
@ -171,7 +171,7 @@ export class RootFrame extends React.Component<Props, State, {}> {
</span> </span>
</div> </div>
<div id="tail" className="container-center"> <div id="footer" className="container-center">
<a href="https://github.com/ihexxa/quickshare">Quickshare</a> - <a href="https://github.com/ihexxa/quickshare">Quickshare</a> -
Quick and simple file sharing. Quick and simple file sharing.
</div> </div>

View file

@ -14,7 +14,7 @@ import { UsersClient } from "../client/users";
import { SettingsClient } from "../client/settings"; import { SettingsClient } from "../client/settings";
import { IUsersClient, IFilesClient, ISettingsClient } from "../client"; import { IUsersClient, IFilesClient, ISettingsClient } from "../client";
import { loadingCtrl, ctrlOn, ctrlOff } from "../common/controls"; import { loadingCtrl, ctrlOn, ctrlOff } from "../common/controls";
import { CronTable } from "../common/cron"; import { CronJobs } from "../common/cron";
export interface Props {} export interface Props {}
export interface State extends ICoreState {} export interface State extends ICoreState {}
@ -35,7 +35,7 @@ export class StateMgr extends React.Component<Props, State, {}> {
} }
componentDidMount(): void { componentDidMount(): void {
CronTable().setInterval("refreshState", { CronJobs().setInterval("refreshState", {
func: this.update, func: this.update,
args: [updater().updateAll], args: [updater().updateAll],
delay: 1000, delay: 1000,
@ -43,7 +43,7 @@ export class StateMgr extends React.Component<Props, State, {}> {
} }
componentWillUnmount() { componentWillUnmount() {
CronTable().clearInterval("refreshState"); CronJobs().clearInterval("refreshState");
} }
setUsersClient = (client: IUsersClient) => { setUsersClient = (client: IUsersClient) => {