ui: optimize bundle

This commit is contained in:
undefined committed 2022-08-24 00:28:25 +08:00
1 parent 9c02ed4dd8
commit 5ae8258b8a
28 files changed
+57 -179

No files matched your search

-4
View File
@@ -1,5 +1,3 @@
import attachObjectMeta from './util/objectMeta';
export const JOIN_METHOD_NONE = 0;
export const JOIN_METHOD_ALL = 1;
export const JOIN_METHOD_CODE = 2;
@@ -8,7 +6,6 @@ export const JOIN_METHOD_RANGE = {
[JOIN_METHOD_ALL]: 'Any user is allowed to join this domain',
[JOIN_METHOD_CODE]: 'Any user is allowed to join this domain with an invitation code',
};
attachObjectMeta(JOIN_METHOD_RANGE, 'intKey', true);
export const JOIN_EXPIRATION_KEEP_CURRENT = 0;
export const JOIN_EXPIRATION_UNLIMITED = -1;
@@ -22,4 +19,3 @@ export const JOIN_EXPIRATION_RANGE = {
[24 * 30]: 'In 1 month',
[JOIN_EXPIRATION_UNLIMITED]: 'Never expire',
};
attachObjectMeta(JOIN_EXPIRATION_RANGE, 'intKey', true);
-18
View File
@@ -1,18 +0,0 @@
import attachObjectMeta from './util/objectMeta';
export const USER_GENDER_MALE = 0;
export const USER_GENDER_FEMALE = 1;
export const USER_GENDER_OTHER = 2;
export const USER_GENDERS = [USER_GENDER_MALE, USER_GENDER_FEMALE, USER_GENDER_OTHER];
export const USER_GENDER_RANGE = {
[USER_GENDER_MALE]: 'Boy ♂',
[USER_GENDER_FEMALE]: 'Girl ♀',
[USER_GENDER_OTHER]: 'Other',
};
attachObjectMeta(USER_GENDER_RANGE, 'intKey', true);
export const USER_GENDER_ICONS = {
[USER_GENDER_MALE]: '♂',
[USER_GENDER_FEMALE]: '♀',
[USER_GENDER_OTHER]: '?',
};
attachObjectMeta(USER_GENDER_ICONS, 'intKey', true);
-6
View File
@@ -1,5 +1,3 @@
import attachObjectMeta from './util/objectMeta';
// Please note that accepted < others, rp system uses this feature.
export const STATUS_WAITING = 0;
export const STATUS_ACCEPTED = 1;
@@ -34,7 +32,6 @@ export const STATUS_TEXTS = {
[STATUS_FETCHED]: 'Fetched',
[STATUS_IGNORED]: 'Ignored',
};
attachObjectMeta(STATUS_TEXTS, 'intKey', true);
export const STATUS_CODES = {
[STATUS_WAITING]: 'pending',
@@ -53,7 +50,6 @@ export const STATUS_CODES = {
[STATUS_FETCHED]: 'progress',
[STATUS_IGNORED]: 'ignored',
};
attachObjectMeta(STATUS_CODES, 'intKey', true);
/**
* Whether to show detail about each test case for a submission status
@@ -74,7 +70,6 @@ export const STATUS_SCRATCHPAD_SHOW_DETAIL_FLAGS = {
[STATUS_FETCHED]: false,
[STATUS_IGNORED]: false,
};
attachObjectMeta(STATUS_SCRATCHPAD_SHOW_DETAIL_FLAGS, 'exportToPython', false);
/**
* Short text to show in Scratchpad mode
@@ -86,4 +81,3 @@ export const STATUS_SCRATCHPAD_SHORT_TEXTS = {
[STATUS_MEMORY_LIMIT_EXCEEDED]: 'MLE',
[STATUS_RUNTIME_ERROR]: 'RTE',
};
attachObjectMeta(STATUS_SCRATCHPAD_SHORT_TEXTS, 'exportToPython', false);
-17
View File
@@ -1,17 +0,0 @@
import attachObjectMeta from './util/objectMeta';
export const PRIVACY_PUBLIC = 0;
export const PRIVACY_REGISTERED_ONLY = 1;
export const PRIVACY_SECRET = 2;
export const PRIVACY_RANGE = {
[PRIVACY_PUBLIC]: 'Public',
[PRIVACY_REGISTERED_ONLY]: 'Visible to registered users',
[PRIVACY_SECRET]: 'Secret',
};
attachObjectMeta(PRIVACY_RANGE, 'intKey', true);
export const FUNCTION_RANGE = {
0: 'Disabled',
1: 'Enabled',
};
attachObjectMeta(FUNCTION_RANGE, 'intKey', true);
@@ -1,8 +0,0 @@
export default function attachObjectMeta(obj, key, value) {
Object.defineProperty(obj, `__${key}`, {
value,
enumerable: false,
configurable: false,
writable: false,
});
}