@oneuptime/common 10.0.80 → 10.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/AnalyticsModels/Metric.ts +296 -2
- package/Server/Services/MetricService.ts +228 -3
- package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +43 -3
- package/Server/Utils/Express.ts +5 -0
- package/Types/AnalyticsDatabase/TableColumnType.ts +1 -0
- package/Types/BaseDatabase/AggregationType.ts +35 -0
- package/Types/Monitor/IncomingMonitor/IncomingMonitorRequest.ts +1 -0
- package/UI/Components/Banner/Banner.tsx +7 -2
- package/UI/Components/Breadcrumbs/Breadcrumbs.tsx +6 -2
- package/UI/Components/Button/Button.tsx +10 -4
- package/UI/Components/Card/Card.tsx +11 -4
- package/UI/Components/EmptyState/EmptyState.tsx +6 -2
- package/UI/Components/EventItem/EventItem.tsx +9 -5
- package/UI/Components/Modal/ConfirmModal.tsx +5 -1
- package/UI/Components/Modal/Modal.tsx +21 -5
- package/UI/Components/ModelTable/BaseModelTable.tsx +7 -1
- package/UI/Components/Navbar/NavBar.tsx +6 -3
- package/UI/Components/Page/Page.tsx +6 -2
- package/UI/Components/SideMenu/SideMenu.tsx +18 -6
- package/UI/Components/SideMenu/SideMenuItem.tsx +9 -2
- package/UI/Components/SideMenu/SideMenuSection.tsx +4 -1
- package/UI/Utils/Translation.tsx +53 -0
- package/UI/esbuild-config.js +8 -0
- package/build/dist/Models/AnalyticsModels/Metric.js +250 -2
- package/build/dist/Models/AnalyticsModels/Metric.js.map +1 -1
- package/build/dist/Server/Services/MetricService.js +183 -2
- package/build/dist/Server/Services/MetricService.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +36 -2
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
- package/build/dist/Server/Utils/Express.js +3 -0
- package/build/dist/Server/Utils/Express.js.map +1 -1
- package/build/dist/Types/AnalyticsDatabase/TableColumnType.js +1 -0
- package/build/dist/Types/AnalyticsDatabase/TableColumnType.js.map +1 -1
- package/build/dist/Types/BaseDatabase/AggregationType.js +30 -0
- package/build/dist/Types/BaseDatabase/AggregationType.js.map +1 -1
- package/build/dist/UI/Components/Banner/Banner.js +6 -2
- package/build/dist/UI/Components/Banner/Banner.js.map +1 -1
- package/build/dist/UI/Components/Breadcrumbs/Breadcrumbs.js +5 -2
- package/build/dist/UI/Components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/build/dist/UI/Components/Button/Button.js +10 -4
- package/build/dist/UI/Components/Button/Button.js.map +1 -1
- package/build/dist/UI/Components/Card/Card.js +6 -2
- package/build/dist/UI/Components/Card/Card.js.map +1 -1
- package/build/dist/UI/Components/EmptyState/EmptyState.js +4 -2
- package/build/dist/UI/Components/EmptyState/EmptyState.js.map +1 -1
- package/build/dist/UI/Components/EventItem/EventItem.js +9 -7
- package/build/dist/UI/Components/EventItem/EventItem.js.map +1 -1
- package/build/dist/UI/Components/Modal/ConfirmModal.js +4 -1
- package/build/dist/UI/Components/Modal/ConfirmModal.js.map +1 -1
- package/build/dist/UI/Components/Modal/Modal.js +13 -3
- package/build/dist/UI/Components/Modal/Modal.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +7 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBar.js +6 -3
- package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
- package/build/dist/UI/Components/Page/Page.js +5 -2
- package/build/dist/UI/Components/Page/Page.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenu.js +12 -6
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js +8 -2
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuSection.js +4 -1
- package/build/dist/UI/Components/SideMenu/SideMenuSection.js.map +1 -1
- package/build/dist/UI/Utils/Translation.js +36 -0
- package/build/dist/UI/Utils/Translation.js.map +1 -0
- package/package.json +3 -1
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import Icon from "../Icon/Icon";
|
|
2
|
+
import useTranslateValue from "../../Utils/Translation";
|
|
2
3
|
import IconProp from "../../../Types/Icon/IconProp";
|
|
3
4
|
import React, { useState } from "react";
|
|
4
5
|
const SideMenuSection = (props) => {
|
|
5
6
|
var _a;
|
|
7
|
+
const { translateString } = useTranslateValue();
|
|
6
8
|
const [isCollapsed, setIsCollapsed] = useState(props.defaultCollapsed || false);
|
|
9
|
+
const translatedTitle = translateString(props.title) || props.title;
|
|
7
10
|
const isCollapsible = (_a = props.collapsible) !== null && _a !== void 0 ? _a : true;
|
|
8
11
|
const handleToggle = () => {
|
|
9
12
|
if (isCollapsible) {
|
|
@@ -14,7 +17,7 @@ const SideMenuSection = (props) => {
|
|
|
14
17
|
React.createElement("button", { type: "button", onClick: handleToggle, className: `w-full flex items-center justify-between px-2 py-1.5 rounded-lg transition-colors duration-150 ${isCollapsible ? "hover:bg-gray-50 cursor-pointer" : "cursor-default"}`, "aria-expanded": !isCollapsed },
|
|
15
18
|
React.createElement("div", { className: "flex items-center gap-2" },
|
|
16
19
|
props.icon && (React.createElement(Icon, { icon: props.icon, className: "h-4 w-4 text-gray-400" })),
|
|
17
|
-
React.createElement("h6", { className: "text-xs font-semibold uppercase tracking-wider text-gray-500" },
|
|
20
|
+
React.createElement("h6", { className: "text-xs font-semibold uppercase tracking-wider text-gray-500" }, translatedTitle)),
|
|
18
21
|
isCollapsible && (React.createElement(Icon, { icon: IconProp.ChevronDown, className: `h-4 w-4 text-gray-400 transition-transform duration-200 ${isCollapsed ? "-rotate-90" : "rotate-0"}` }))),
|
|
19
22
|
React.createElement("div", { className: `overflow-hidden transition-all duration-200 ease-in-out ${isCollapsed ? "max-h-0 opacity-0" : "max-h-[2000px] opacity-100"}` },
|
|
20
23
|
React.createElement("div", { className: "mt-0.5 space-y-0" }, props.children))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideMenuSection.js","sourceRoot":"","sources":["../../../../../UI/Components/SideMenu/SideMenuSection.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AACpD,OAAO,KAAK,EAAE,EAAmC,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUzE,MAAM,eAAe,GAAsC,CACzD,KAAqB,EACrB,EAAE;;IACF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAC5C,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAChC,CAAC;
|
|
1
|
+
{"version":3,"file":"SideMenuSection.js","sourceRoot":"","sources":["../../../../../UI/Components/SideMenu/SideMenuSection.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,QAAQ,MAAM,8BAA8B,CAAC;AACpD,OAAO,KAAK,EAAE,EAAmC,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUzE,MAAM,eAAe,GAAsC,CACzD,KAAqB,EACrB,EAAE;;IACF,MAAM,EAAE,eAAe,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAChD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAC5C,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAChC,CAAC;IACF,MAAM,eAAe,GAAW,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC;IAE5E,MAAM,aAAa,GAAY,MAAA,KAAK,CAAC,WAAW,mCAAI,IAAI,CAAC;IAEzD,MAAM,YAAY,GAAe,GAAS,EAAE;QAC1C,IAAI,aAAa,EAAE,CAAC;YAClB,cAAc,CAAC,CAAC,WAAW,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,MAAM;QAEnB,gCACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,YAAY,EACrB,SAAS,EAAE,kGACT,aAAa,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,gBACtD,EAAE,mBACa,CAAC,WAAW;YAE3B,6BAAK,SAAS,EAAC,yBAAyB;gBACrC,KAAK,CAAC,IAAI,IAAI,CACb,oBAAC,IAAI,IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAC,uBAAuB,GAAG,CAC7D;gBACD,4BAAI,SAAS,EAAC,8DAA8D,IACzE,eAAe,CACb,CACD;YACL,aAAa,IAAI,CAChB,oBAAC,IAAI,IACH,IAAI,EAAE,QAAQ,CAAC,WAAW,EAC1B,SAAS,EAAE,2DACT,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAC/B,EAAE,GACF,CACH,CACM;QAGT,6BACE,SAAS,EAAE,2DACT,WAAW,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,4BACtC,EAAE;YAEF,6BAAK,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,QAAQ,CAAO,CACpD,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useTranslation } from "react-i18next";
|
|
2
|
+
/**
|
|
3
|
+
* Hook that returns helpers to translate arbitrary user-facing strings using
|
|
4
|
+
* the active i18next instance.
|
|
5
|
+
*
|
|
6
|
+
* The translation lookup uses the entire string as a flat key (keySeparator and
|
|
7
|
+
* nsSeparator are disabled per call) so titles like "v1.0" or "Active Incidents"
|
|
8
|
+
* work without nested-key confusion. If no translation entry exists, the original
|
|
9
|
+
* string is returned.
|
|
10
|
+
*/
|
|
11
|
+
const useTranslateValue = () => {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
const translateString = (value) => {
|
|
14
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
const translated = t(value, {
|
|
18
|
+
defaultValue: value,
|
|
19
|
+
keySeparator: false,
|
|
20
|
+
nsSeparator: false,
|
|
21
|
+
});
|
|
22
|
+
if (typeof translated !== "string") {
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
return translated;
|
|
26
|
+
};
|
|
27
|
+
const translateValue = (value) => {
|
|
28
|
+
if (typeof value === "string") {
|
|
29
|
+
return translateString(value);
|
|
30
|
+
}
|
|
31
|
+
return value;
|
|
32
|
+
};
|
|
33
|
+
return { translateValue, translateString };
|
|
34
|
+
};
|
|
35
|
+
export default useTranslateValue;
|
|
36
|
+
//# sourceMappingURL=Translation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Translation.js","sourceRoot":"","sources":["../../../../UI/Utils/Translation.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAS/C;;;;;;;;GAQG;AACH,MAAM,iBAAiB,GACrB,GAA4B,EAAE;IAC5B,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;IAE/B,MAAM,eAAe,GAAsD,CACzE,KAAyB,EACL,EAAE;QACtB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,UAAU,GAAY,CAAC,CAAC,KAAK,EAAE;YACnC,YAAY,EAAE,KAAK;YACnB,YAAY,EAAE,KAAK;YACnB,WAAW,EAAE,KAAK;SACnB,CAAC,CAAC;QACH,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YACnC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;IAEF,MAAM,cAAc,GAAoD,CACtE,KAAwB,EACL,EAAE;QACrB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAEF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC;AAC7C,CAAC,CAAC;AAEJ,eAAe,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneuptime/common",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.83",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
"express": "^4.21.1",
|
|
104
104
|
"formik": "^2.4.6",
|
|
105
105
|
"history": "^5.3.0",
|
|
106
|
+
"i18next": "^23.16.8",
|
|
106
107
|
"ioredis": "^5.3.2",
|
|
107
108
|
"isolated-vm": "^6.1.2",
|
|
108
109
|
"json2csv": "^5.0.7",
|
|
@@ -130,6 +131,7 @@
|
|
|
130
131
|
"react-dropzone": "^14.2.2",
|
|
131
132
|
"react-error-boundary": "^4.0.13",
|
|
132
133
|
"react-highlight": "^0.15.0",
|
|
134
|
+
"react-i18next": "^15.7.4",
|
|
133
135
|
"react-markdown": "^9.1.0",
|
|
134
136
|
"react-router-dom": "^6.30.1",
|
|
135
137
|
"react-select": "^5.4.0",
|