constants.ts
3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
///
/// Copyright © 2016-2019 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export const Constants = {
serverErrorCode: {
general: 2,
authentication: 10,
jwtTokenExpired: 11,
tenantTrialExpired: 12,
permissionDenied: 20,
invalidArguments: 30,
badRequestParams: 31,
itemNotFound: 32,
tooManyRequests: 33,
tooManyUpdates: 34
},
entryPoints: {
login: '/api/auth/login',
tokenRefresh: '/api/auth/token',
nonTokenBased: '/api/noauth'
}
};
export const MediaBreakpoints = {
xs: 'screen and (max-width: 599px)',
sm: 'screen and (min-width: 600px) and (max-width: 959px)',
md: 'screen and (min-width: 960px) and (max-width: 1279px)',
lg: 'screen and (min-width: 1280px) and (max-width: 1919px)',
xl: 'screen and (min-width: 1920px) and (max-width: 5000px)',
'lt-sm': 'screen and (max-width: 599px)',
'lt-md': 'screen and (max-width: 959px)',
'lt-lg': 'screen and (max-width: 1279px)',
'lt-xl': 'screen and (max-width: 1919px)',
'gt-xs': 'screen and (min-width: 600px)',
'gt-sm': 'screen and (min-width: 960px)',
'gt-md': 'screen and (min-width: 1280px)',
'gt-lg': 'screen and (min-width: 1920px)',
'gt-xl': 'screen and (min-width: 5001px)'
};
const helpBaseUrl = 'https://thingsboard.io';
export const HelpLinks = {
linksMap: {
outgoingMailSettings: helpBaseUrl + '/docs/user-guide/ui/mail-settings',
securitySettings: helpBaseUrl + '/docs/user-guide/ui/security-settings',
tenants: helpBaseUrl + '/docs/user-guide/ui/tenants',
customers: helpBaseUrl + '/docs/user-guide/customers',
users: helpBaseUrl + '/docs/user-guide/ui/users',
devices: helpBaseUrl + '/docs/user-guide/ui/devices',
assets: helpBaseUrl + '/docs/user-guide/ui/assets',
entityViews: helpBaseUrl + '/docs/user-guide/ui/entity-views',
rulechains: helpBaseUrl + '/docs/user-guide/ui/rule-chains',
dashboards: helpBaseUrl + '/docs/user-guide/ui/dashboards',
widgetsBundles: helpBaseUrl + '/docs/user-guide/ui/widget-library#bundles'
}
};
export interface ValueTypeData {
name: string;
icon: string;
}
export enum ValueType {
STRING = 'STRING',
INTEGER = 'INTEGER',
DOUBLE = 'DOUBLE',
BOOLEAN = 'BOOLEAN'
}
export const valueTypesMap = new Map<ValueType, ValueTypeData>(
[
[
ValueType.STRING,
{
name: 'value.string',
icon: 'mdi:format-text'
}
],
[
ValueType.INTEGER,
{
name: 'value.integer',
icon: 'mdi:numeric'
}
],
[
ValueType.DOUBLE,
{
name: 'value.double',
icon: 'mdi:numeric'
}
],
[
ValueType.BOOLEAN,
{
name: 'value.boolean',
icon: 'mdi:checkbox-marked-outline'
}
]
]
);
export const customTranslationsPrefix = 'custom.';