Fork pd_web, remove everything we don't need
This commit is contained in:
@@ -15,34 +15,41 @@ export type FSPath = {
|
||||
}
|
||||
|
||||
export type FSNode = {
|
||||
type: string,
|
||||
path: string,
|
||||
name: string,
|
||||
created: string,
|
||||
modified: string,
|
||||
mode_string: string,
|
||||
mode_octal: string,
|
||||
created_by: string,
|
||||
type: string
|
||||
path: string
|
||||
name: string
|
||||
created: string
|
||||
modified: string
|
||||
mode_string: string
|
||||
mode_octal: string
|
||||
created_by: string
|
||||
|
||||
abuse_type?: string,
|
||||
abuse_report_time?: string,
|
||||
abuse_type?: string
|
||||
abuse_report_time?: string
|
||||
|
||||
custom_domain_name?: string,
|
||||
custom_domain_name?: string
|
||||
|
||||
file_size: number,
|
||||
file_type: string,
|
||||
sha256_sum: string,
|
||||
file_size: number
|
||||
file_type: string
|
||||
sha256_sum: string
|
||||
|
||||
id?: string,
|
||||
properties?: FSNodeProperties,
|
||||
link_permissions?: FSPermissions,
|
||||
user_permissions?: { [index: string]: FSPermissions },
|
||||
password_permissions?: { [index: string]: FSPermissions },
|
||||
id?: string
|
||||
properties?: FSNodeProperties
|
||||
link_permissions?: FSPermissions
|
||||
user_permissions?: { [index: string]: FSPermissions }
|
||||
password_permissions?: { [index: string]: FSPermissions }
|
||||
|
||||
// Added by us
|
||||
|
||||
// Indicates whether the file is selected in the file manager
|
||||
fm_selected?: boolean,
|
||||
fm_selected?: boolean
|
||||
}
|
||||
|
||||
export const node_is_shared = (node: FSNode): boolean => {
|
||||
if (node.link_permissions !== undefined && node.link_permissions.read) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
export type FSNodeProperties = {
|
||||
@@ -81,7 +88,6 @@ export type NodeOptions = {
|
||||
mode?: number,
|
||||
created?: string,
|
||||
modified?: string,
|
||||
shared?: boolean,
|
||||
|
||||
// Permissions
|
||||
link_permissions?: FSPermissions,
|
||||
@@ -316,7 +322,7 @@ export const fs_node_type = (node: FSNode) => {
|
||||
export const fs_node_icon = (node: FSNode, width = 64, height = 64) => {
|
||||
if (node.type === "dir") {
|
||||
// Folders with an ID are publically shared, use the shared folder icon
|
||||
if (node.id) {
|
||||
if (node_is_shared(node)) {
|
||||
return "/res/img/mime/folder-remote.png"
|
||||
} else {
|
||||
return "/res/img/mime/folder.png"
|
||||
|
||||
Reference in New Issue
Block a user