1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-15 06:44:16 +00:00

add file ledger apis (#5507)

* add file ledger apis

* remove apis about export ledgers

* opt code struct

* feat: update api

* feat: update code

* rename init-ledger script -> init-extended-props

* remove useless code

* POST/PUT extended-props return row

* return default some fields when extended-row not exists

* feat: update seafile-js version

---------

Co-authored-by: er-pai-r <18335219360@163.com>
This commit is contained in:
Alex Happy
2023-07-27 15:11:35 +08:00
committed by GitHub
parent e97b0c264c
commit 0a7aeec2e2
32 changed files with 2330 additions and 36 deletions

View File

@@ -0,0 +1,112 @@
import * as zIndexes from './zIndexes';
import KeyCodes from './keyCodes';
export const DIALOG_MAX_HEIGHT = window.innerHeight - 56; // Dialog margin is 3.5rem (56px)
export const EXTRA_ATTRIBUTES_COLUMN_TYPE = {
TEXT: 'text',
NUMBER: 'number',
DATE: 'date',
FORMULA: 'formula',
SINGLE_SELECT: 'single-select',
CTIME: 'ctime',
MTIME: 'mtime'
};
export const EXTRA_ATTRIBUTES_NOT_DISPLAY_COLUMN_KEY = [
'_id',
'_locked',
'_locked_by',
'_archived',
'_creator',
'_last_modifier',
'_ctime',
'_mtime',
];
export const EXTRA_ATTRIBUTES_NOT_DISPLAY_COLUMN_NAME = [
'Repo ID',
'UUID',
];
export const FORMULA_RESULT_TYPE = {
NUMBER: 'number',
STRING: 'string',
DATE: 'date',
BOOL: 'bool',
ARRAY: 'array',
};
export const DELETED_OPTION_BACKGROUND_COLOR = '#eaeaea';
export const DELETED_OPTION_TIPS = 'Deleted option';
export const DEFAULT_NUMBER_FORMAT = 'number';
export const ERROR = 'ERROR';
export const ERROR_DIV_ZERO = 'DIV/0';
export const ERROR_NAME = 'NAME';
export const ERROR_NOT_AVAILABLE = 'N/A';
export const ERROR_NULL = 'NULL';
export const ERROR_NUM = 'NUM';
export const ERROR_REF = 'REF';
export const ERROR_VALUE = 'VALUE';
export const GETTING_DATA = 'GETTING_DATA';
const errors = {
[ERROR]: '#ERROR!',
[ERROR_DIV_ZERO]: '#DIV/0!',
[ERROR_NAME]: '#NAME?',
[ERROR_NOT_AVAILABLE]: '#N/A',
[ERROR_NULL]: '#NULL!',
[ERROR_NUM]: '#NUM!',
[ERROR_REF]: '#REF!',
[ERROR_VALUE]: '#VALUE!',
[GETTING_DATA]: '#GETTING_DATA',
};
export const DISPLAY_INTERNAL_ERRORS = [
errors[ERROR],
errors[ERROR_DIV_ZERO],
errors[ERROR_NAME],
errors[ERROR_NOT_AVAILABLE],
errors[ERROR_NULL],
errors[ERROR_NUM],
errors[ERROR_REF],
errors[ERROR_VALUE],
errors[GETTING_DATA],
];
export const DURATION_FORMATS_MAP = {
H_MM: 'h:mm',
H_MM_SS: 'h:mm:ss',
H_MM_SS_S: 'h:mm:ss.s',
H_MM_SS_SS: 'h:mm:ss.ss',
H_MM_SS_SSS: 'h:mm:ss.sss'
};
export const DURATION_FORMATS = [
{ name: DURATION_FORMATS_MAP.H_MM, type: DURATION_FORMATS_MAP.H_MM },
{ name: DURATION_FORMATS_MAP.H_MM_SS, type: DURATION_FORMATS_MAP.H_MM_SS }
];
export const DURATION_ZERO_DISPLAY = {
[DURATION_FORMATS_MAP.H_MM]: '0:00',
[DURATION_FORMATS_MAP.H_MM_SS]: '0:00',
[DURATION_FORMATS_MAP.H_MM_SS_S]: '0:00.0',
[DURATION_FORMATS_MAP.H_MM_SS_SS]: '0:00.00',
[DURATION_FORMATS_MAP.H_MM_SS_SSS]: '0:00.000',
};
export const DURATION_DECIMAL_DIGITS = {
[DURATION_FORMATS_MAP.H_MM]: 0,
[DURATION_FORMATS_MAP.H_MM_SS]: 0,
[DURATION_FORMATS_MAP.H_MM_SS_S]: 1,
[DURATION_FORMATS_MAP.H_MM_SS_SS]: 2,
[DURATION_FORMATS_MAP.H_MM_SS_SSS]: 3,
};
export {
KeyCodes,
zIndexes,
};

View File

@@ -0,0 +1,104 @@
const KeyCodes = {
Backspace: 8,
Tab: 9,
Enter: 13,
Shift: 16,
Ctrl: 17,
Alt: 18,
PauseBreak: 19,
CapsLock: 20,
Escape: 27,
Esc: 27,
Space: 32,
PageUp: 33,
PageDown: 34,
End: 35,
Home: 36,
LeftArrow: 37,
UpArrow: 38,
RightArrow: 39,
DownArrow: 40,
Insert: 45,
Delete: 46,
0: 48,
1: 49,
2: 50,
3: 51,
4: 52,
5: 53,
6: 54,
7: 55,
8: 56,
9: 57,
a: 65,
b: 66,
c: 67,
d: 68,
e: 69,
f: 70,
g: 71,
h: 72,
i: 73,
j: 74,
k: 75,
l: 76,
m: 77,
n: 78,
o: 79,
p: 80,
q: 81,
r: 82,
s: 83,
t: 84,
u: 85,
v: 86,
w: 87,
x: 88,
y: 89,
z: 90,
LeftWindowKey: 91,
RightWindowKey: 92,
SelectKey: 93,
NumPad0: 96,
NumPad1: 97,
NumPad2: 98,
NumPad3: 99,
NumPad4: 100,
NumPad5: 101,
NumPad6: 102,
NumPad7: 103,
NumPad8: 104,
NumPad9: 105,
Multiply: 106,
Add: 107,
Subtract: 109,
DecimalPoint: 110,
Divide: 111,
F1: 112,
F2: 113,
F3: 114,
F4: 115,
F5: 116,
F6: 117,
F7: 118,
F8: 119,
F9: 120,
F10: 121,
F12: 123,
NumLock: 144,
ScrollLock: 145,
SemiColon: 186,
EqualSign: 187,
Comma: 188,
Dash: 189,
Period: 190,
ForwardSlash: 191,
GraveAccent: 192,
OpenBracket: 219,
BackSlash: 220,
CloseBracket: 221,
SingleQuote: 222,
ChineseInputMethod: 229,
};
export default KeyCodes;

View File

@@ -0,0 +1 @@
export const EXTRA_ATTRIBUTES_DIALOG_MODAL = 1048;