fix(fe): re-org dependencies and fix small issues
This commit is contained in:
parent
963f5b199a
commit
f3b65e1bb3
8 changed files with 38 additions and 42 deletions
|
@ -179,6 +179,7 @@
|
||||||
line-height: 2rem;
|
line-height: 2rem;
|
||||||
display: block;
|
display: block;
|
||||||
margin: 2rem 0;
|
margin: 2rem 0;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-default #item-rows .desc {
|
.theme-default #item-rows .desc {
|
||||||
|
|
|
@ -3,20 +3,21 @@ import { List, Set, Map } from "immutable";
|
||||||
import { UploadEntry } from "../worker/interface";
|
import { UploadEntry } from "../worker/interface";
|
||||||
import { MsgPackage } from "../i18n/msger";
|
import { MsgPackage } from "../i18n/msger";
|
||||||
import { User, MetadataResp } from "../client";
|
import { User, MetadataResp } from "../client";
|
||||||
import { settingsDialogCtrl } from "./layers";
|
|
||||||
import { filesViewCtrl } from "./panel_files";
|
|
||||||
import { FilesProps } from "./panel_files";
|
import { FilesProps } from "./panel_files";
|
||||||
import { UploadingsProps } from "./panel_uploadings";
|
import { UploadingsProps } from "./panel_uploadings";
|
||||||
import { SharingsProps } from "./panel_sharings";
|
import { SharingsProps } from "./panel_sharings";
|
||||||
import { controlName as panelTabs } from "./root_frame";
|
import { controlName as panelTabs } from "./root_frame";
|
||||||
import { settingsTabsCtrl } from "./dialog_settings";
|
import {
|
||||||
|
filesViewCtrl,
|
||||||
|
settingsTabsCtrl,
|
||||||
|
settingsDialogCtrl,
|
||||||
|
sharingCtrl,
|
||||||
|
ctrlOn,
|
||||||
|
ctrlOff,
|
||||||
|
} from "../common/controls";
|
||||||
import { LoginProps } from "./pane_login";
|
import { LoginProps } from "./pane_login";
|
||||||
import { AdminProps } from "./pane_admin";
|
import { AdminProps } from "./pane_admin";
|
||||||
|
|
||||||
export const ctrlHidden = "hidden";
|
|
||||||
export const ctrlOn = "on";
|
|
||||||
export const ctrlOff = "off";
|
|
||||||
export const sharingCtrl = "sharingCtrl";
|
|
||||||
export interface MsgProps {
|
export interface MsgProps {
|
||||||
lan: string;
|
lan: string;
|
||||||
pkg: Map<string, string>;
|
pkg: Map<string, string>;
|
||||||
|
@ -110,9 +111,9 @@ export function initState(): ICoreState {
|
||||||
control: {
|
control: {
|
||||||
controls: Map<string, string>({
|
controls: Map<string, string>({
|
||||||
[panelTabs]: "filesPanel",
|
[panelTabs]: "filesPanel",
|
||||||
[settingsDialogCtrl]: "off",
|
[settingsDialogCtrl]: ctrlOff,
|
||||||
[settingsTabsCtrl]: "preferencePane",
|
[settingsTabsCtrl]: "preferencePane",
|
||||||
[sharingCtrl]: "off",
|
[sharingCtrl]: ctrlOff,
|
||||||
[filesViewCtrl]: "rows",
|
[filesViewCtrl]: "rows",
|
||||||
}),
|
}),
|
||||||
options: Map<string, Set<string>>({
|
options: Map<string, Set<string>>({
|
||||||
|
@ -121,9 +122,9 @@ export function initState(): ICoreState {
|
||||||
"uploadingsPanel",
|
"uploadingsPanel",
|
||||||
"sharingsPanel",
|
"sharingsPanel",
|
||||||
]),
|
]),
|
||||||
[settingsDialogCtrl]: Set<string>(["on", "off"]),
|
[settingsDialogCtrl]: Set<string>([ctrlOn, ctrlOff]),
|
||||||
[settingsTabsCtrl]: Set<string>(["preferencePane", "managementPane"]),
|
[settingsTabsCtrl]: Set<string>(["preferencePane", "managementPane"]),
|
||||||
[sharingCtrl]: Set<string>(["on", "off"]),
|
[sharingCtrl]: Set<string>([ctrlOn, ctrlOff]),
|
||||||
[filesViewCtrl]: Set<string>(["rows", "table"]),
|
[filesViewCtrl]: Set<string>(["rows", "table"]),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,8 +11,7 @@ import { Tabs } from "./control/tabs";
|
||||||
import { Container } from "./layout/container";
|
import { Container } from "./layout/container";
|
||||||
import { LoginProps } from "./pane_login";
|
import { LoginProps } from "./pane_login";
|
||||||
import { roleAdmin } from "../client";
|
import { roleAdmin } from "../client";
|
||||||
|
import { settingsTabsCtrl } from "../common/controls";
|
||||||
export const settingsTabsCtrl = "settingsTabs";
|
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
admin: AdminProps;
|
admin: AdminProps;
|
||||||
|
|
|
@ -2,13 +2,7 @@ import * as React from "react";
|
||||||
import { List } from "immutable";
|
import { List } from "immutable";
|
||||||
|
|
||||||
import { updater } from "./state_updater";
|
import { updater } from "./state_updater";
|
||||||
import {
|
import { ICoreState, MsgProps, UIProps } from "./core_state";
|
||||||
ICoreState,
|
|
||||||
MsgProps,
|
|
||||||
UIProps,
|
|
||||||
sharingCtrl,
|
|
||||||
ctrlOn,
|
|
||||||
} from "./core_state";
|
|
||||||
import { AdminProps } from "./pane_admin";
|
import { AdminProps } from "./pane_admin";
|
||||||
import { SettingsDialog } from "./dialog_settings";
|
import { SettingsDialog } from "./dialog_settings";
|
||||||
|
|
||||||
|
@ -16,8 +10,7 @@ import { AuthPane, LoginProps } from "./pane_login";
|
||||||
import { FilesProps } from "./panel_files";
|
import { FilesProps } from "./panel_files";
|
||||||
import { Flexbox } from "./layout/flexbox";
|
import { Flexbox } from "./layout/flexbox";
|
||||||
import { Container } from "./layout/container";
|
import { Container } from "./layout/container";
|
||||||
|
import { sharingCtrl, ctrlOn } from "../common/controls";
|
||||||
export const settingsDialogCtrl = "settingsDialog";
|
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
filesInfo: FilesProps;
|
filesInfo: FilesProps;
|
||||||
|
|
|
@ -141,6 +141,10 @@ export class UserForm extends React.Component<
|
||||||
};
|
};
|
||||||
|
|
||||||
delUser = async () => {
|
delUser = async () => {
|
||||||
|
if (!confirmMsg(this.props.msg.pkg.get("op.confirm"))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return updater()
|
return updater()
|
||||||
.delUser(this.state.id)
|
.delUser(this.state.id)
|
||||||
.then((status: string) => {
|
.then((status: string) => {
|
||||||
|
|
|
@ -28,8 +28,7 @@ import { Rows, Row } from "./layout/rows";
|
||||||
import { Up } from "../worker/upload_mgr";
|
import { Up } from "../worker/upload_mgr";
|
||||||
import { UploadEntry, UploadState } from "../worker/interface";
|
import { UploadEntry, UploadState } from "../worker/interface";
|
||||||
import { getIcon } from "./visual/icons";
|
import { getIcon } from "./visual/icons";
|
||||||
|
import { filesViewCtrl } from "../common/controls";
|
||||||
export const filesViewCtrl = "filesView";
|
|
||||||
|
|
||||||
export interface Item {
|
export interface Item {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
import { List, Map, Set } from "immutable";
|
import { List, Map, Set } from "immutable";
|
||||||
|
|
||||||
import {
|
import { ICoreState } from "./core_state";
|
||||||
ICoreState,
|
|
||||||
sharingCtrl,
|
|
||||||
ctrlOn,
|
|
||||||
ctrlOff,
|
|
||||||
ctrlHidden,
|
|
||||||
} from "./core_state";
|
|
||||||
import { getItemPath } from "../common/utils";
|
import { getItemPath } from "../common/utils";
|
||||||
import {
|
import {
|
||||||
User,
|
User,
|
||||||
|
@ -32,10 +26,16 @@ import { UploadEntry, UploadState } from "../worker/interface";
|
||||||
import { Up } from "../worker/upload_mgr";
|
import { Up } from "../worker/upload_mgr";
|
||||||
import { alertMsg } from "../common/env";
|
import { alertMsg } from "../common/env";
|
||||||
import { controlName as panelTabs } from "./root_frame";
|
import { controlName as panelTabs } from "./root_frame";
|
||||||
import { settingsTabsCtrl } from "./dialog_settings";
|
|
||||||
import { settingsDialogCtrl } from "./layers";
|
|
||||||
import { errUpdater, errServer } from "../common/errors";
|
import { errUpdater, errServer } from "../common/errors";
|
||||||
import { ErrorLogger } from "../common/log_error";
|
import { ErrorLogger } from "../common/log_error";
|
||||||
|
import {
|
||||||
|
settingsTabsCtrl,
|
||||||
|
settingsDialogCtrl,
|
||||||
|
sharingCtrl,
|
||||||
|
ctrlOn,
|
||||||
|
ctrlOff,
|
||||||
|
ctrlHidden,
|
||||||
|
} from "../common/controls";
|
||||||
|
|
||||||
import { MsgPackage, isValidLanPack } from "../i18n/msger";
|
import { MsgPackage, isValidLanPack } from "../i18n/msger";
|
||||||
|
|
||||||
|
|
|
@ -2,17 +2,11 @@ import * as React from "react";
|
||||||
import { List } from "immutable";
|
import { List } from "immutable";
|
||||||
import { alertMsg, confirmMsg } from "../common/env";
|
import { alertMsg, confirmMsg } from "../common/env";
|
||||||
|
|
||||||
import {
|
import { ICoreState, MsgProps, UIProps } from "./core_state";
|
||||||
ICoreState,
|
|
||||||
MsgProps,
|
|
||||||
UIProps,
|
|
||||||
ctrlOn,
|
|
||||||
ctrlHidden,
|
|
||||||
} from "./core_state";
|
|
||||||
import { LoginProps } from "./pane_login";
|
import { LoginProps } from "./pane_login";
|
||||||
import { updater } from "./state_updater";
|
import { updater } from "./state_updater";
|
||||||
import { Flexbox } from "./layout/flexbox";
|
import { Flexbox } from "./layout/flexbox";
|
||||||
import { settingsDialogCtrl } from "./layers";
|
import { ctrlOn, ctrlHidden, settingsDialogCtrl } from "../common/controls";
|
||||||
import { QRCodeIcon } from "./visual/qrcode";
|
import { QRCodeIcon } from "./visual/qrcode";
|
||||||
|
|
||||||
export interface State {}
|
export interface State {}
|
||||||
|
@ -91,7 +85,12 @@ export class TopBar extends React.Component<Props, State, {}> {
|
||||||
>
|
>
|
||||||
Quickshare
|
Quickshare
|
||||||
</a>,
|
</a>,
|
||||||
<QRCodeIcon value={document.URL} size={128} pos={true} className="margin-l-m"/>,
|
<QRCodeIcon
|
||||||
|
value={document.URL}
|
||||||
|
size={128}
|
||||||
|
pos={true}
|
||||||
|
className="margin-l-m"
|
||||||
|
/>,
|
||||||
|
|
||||||
<Flexbox
|
<Flexbox
|
||||||
children={List([
|
children={List([
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue