fix(ui): add sharing url and fix several issues
This commit is contained in:
parent
b89ad2765e
commit
0a8c3e77a2
2 changed files with 27 additions and 5 deletions
|
@ -493,6 +493,13 @@ export class Browser extends React.Component<Props, State, {}> {
|
||||||
<span className="bold">{dirPath}</span>
|
<span className="bold">{dirPath}</span>
|
||||||
</span>
|
</span>
|
||||||
<span className="flex-list-item-r padding-r-m">
|
<span className="flex-list-item-r padding-r-m">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
className="margin-r-m"
|
||||||
|
value={`${
|
||||||
|
document.location.href.split("?")[0]
|
||||||
|
}?dir=${encodeURIComponent(dirPath)}`}
|
||||||
|
/>
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
this.deleteSharing(dirPath);
|
this.deleteSharing(dirPath);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
import { List } from "immutable";
|
||||||
|
|
||||||
import { updater as BrowserUpdater } from "./browser.updater";
|
import { updater as BrowserUpdater } from "./browser.updater";
|
||||||
import { Updater as PanesUpdater } from "./panes";
|
import { Updater as PanesUpdater } from "./panes";
|
||||||
|
@ -22,6 +23,8 @@ export class StateMgr extends React.Component<Props, State, {}> {
|
||||||
BrowserUpdater().init(state.panel.browser);
|
BrowserUpdater().init(state.panel.browser);
|
||||||
BrowserUpdater().setClients(new UsersClient(""), new FilesClient(""));
|
BrowserUpdater().setClients(new UsersClient(""), new FilesClient(""));
|
||||||
|
|
||||||
|
const params = new URLSearchParams(document.location.search.substring(1));
|
||||||
|
|
||||||
LoginPaneUpdater.init(state.panel.authPane);
|
LoginPaneUpdater.init(state.panel.authPane);
|
||||||
LoginPaneUpdater.setClient(new UsersClient(""));
|
LoginPaneUpdater.setClient(new UsersClient(""));
|
||||||
LoginPaneUpdater.getCaptchaID().then((ok: boolean) => {
|
LoginPaneUpdater.getCaptchaID().then((ok: boolean) => {
|
||||||
|
@ -33,11 +36,17 @@ export class StateMgr extends React.Component<Props, State, {}> {
|
||||||
});
|
});
|
||||||
|
|
||||||
BrowserUpdater()
|
BrowserUpdater()
|
||||||
.setHomeItems()
|
.refreshUploadings()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
return BrowserUpdater().refreshUploadings();
|
const dir = params.get("dir");
|
||||||
|
if (dir != null && dir !== "") {
|
||||||
|
const dirPath = List(dir.split("/"));
|
||||||
|
return BrowserUpdater().setItems(dirPath);
|
||||||
|
} else {
|
||||||
|
return BrowserUpdater().setHomeItems();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.then((_: boolean) => {
|
.then(() => {
|
||||||
return BrowserUpdater().initUploads();
|
return BrowserUpdater().initUploads();
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
@ -55,10 +64,16 @@ export class StateMgr extends React.Component<Props, State, {}> {
|
||||||
return PanesUpdater.self();
|
return PanesUpdater.self();
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
return PanesUpdater.listRoles();
|
if (PanesUpdater.props.userRole === "admin") {
|
||||||
|
// TODO: remove hardcode
|
||||||
|
return PanesUpdater.listRoles();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
return PanesUpdater.listUsers();
|
if (PanesUpdater.props.userRole === "admin") {
|
||||||
|
// TODO: remove hardcode
|
||||||
|
return PanesUpdater.listUsers();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.update(PanesUpdater.updateState);
|
this.update(PanesUpdater.updateState);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue