@meshxdata/fops 0.1.55 → 0.1.58

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +191 -4
  2. package/package.json +1 -2
  3. package/src/commands/index.js +2 -0
  4. package/src/commands/k3s-cmd.js +124 -0
  5. package/src/commands/lifecycle.js +7 -0
  6. package/src/plugins/builtins/docker-compose.js +17 -35
  7. package/src/plugins/bundled/fops-plugin-azure/lib/azure-openai.js +0 -3
  8. package/src/plugins/bundled/fops-plugin-azure/lib/commands/vm-cmds.js +5 -2
  9. package/src/plugins/bundled/fops-plugin-cloud/api.js +14 -0
  10. package/src/project.js +12 -7
  11. package/src/plugins/bundled/fops-plugin-cloud/ui/postcss.config.cjs +0 -5
  12. package/src/plugins/bundled/fops-plugin-cloud/ui/src/App.jsx +0 -32
  13. package/src/plugins/bundled/fops-plugin-cloud/ui/src/api/client.js +0 -114
  14. package/src/plugins/bundled/fops-plugin-cloud/ui/src/api/queries.js +0 -111
  15. package/src/plugins/bundled/fops-plugin-cloud/ui/src/components/LogPanel.jsx +0 -162
  16. package/src/plugins/bundled/fops-plugin-cloud/ui/src/components/ThemeToggle.jsx +0 -46
  17. package/src/plugins/bundled/fops-plugin-cloud/ui/src/css/additional-styles/utility-patterns.css +0 -147
  18. package/src/plugins/bundled/fops-plugin-cloud/ui/src/css/style.css +0 -138
  19. package/src/plugins/bundled/fops-plugin-cloud/ui/src/favicon.svg +0 -15
  20. package/src/plugins/bundled/fops-plugin-cloud/ui/src/lib/utils.ts +0 -19
  21. package/src/plugins/bundled/fops-plugin-cloud/ui/src/main.jsx +0 -25
  22. package/src/plugins/bundled/fops-plugin-cloud/ui/src/pages/Audit.jsx +0 -164
  23. package/src/plugins/bundled/fops-plugin-cloud/ui/src/pages/Costs.jsx +0 -305
  24. package/src/plugins/bundled/fops-plugin-cloud/ui/src/pages/CreateResource.jsx +0 -285
  25. package/src/plugins/bundled/fops-plugin-cloud/ui/src/pages/Fleet.jsx +0 -307
  26. package/src/plugins/bundled/fops-plugin-cloud/ui/src/pages/Resources.jsx +0 -229
  27. package/src/plugins/bundled/fops-plugin-cloud/ui/src/partials/Header.jsx +0 -132
  28. package/src/plugins/bundled/fops-plugin-cloud/ui/src/partials/Sidebar.jsx +0 -174
  29. package/src/plugins/bundled/fops-plugin-cloud/ui/src/partials/SidebarLinkGroup.jsx +0 -21
  30. package/src/plugins/bundled/fops-plugin-cloud/ui/src/utils/AuthContext.jsx +0 -170
  31. package/src/plugins/bundled/fops-plugin-cloud/ui/src/utils/Info.jsx +0 -49
  32. package/src/plugins/bundled/fops-plugin-cloud/ui/src/utils/ThemeContext.jsx +0 -37
  33. package/src/plugins/bundled/fops-plugin-cloud/ui/src/utils/Transition.jsx +0 -116
  34. package/src/plugins/bundled/fops-plugin-cloud/ui/src/utils/Utils.js +0 -63
@@ -1,116 +0,0 @@
1
- import React, { useRef, useEffect, useContext } from 'react';
2
- import { CSSTransition as ReactCSSTransition } from 'react-transition-group';
3
-
4
- const TransitionContext = React.createContext({
5
- parent: {},
6
- })
7
-
8
- function useIsInitialRender() {
9
- const isInitialRender = useRef(true);
10
- useEffect(() => {
11
- isInitialRender.current = false;
12
- }, [])
13
- return isInitialRender.current;
14
- }
15
-
16
- function CSSTransition({
17
- show,
18
- enter = '',
19
- enterStart = '',
20
- enterEnd = '',
21
- leave = '',
22
- leaveStart = '',
23
- leaveEnd = '',
24
- appear,
25
- unmountOnExit,
26
- tag = 'div',
27
- children,
28
- ...rest
29
- }) {
30
- const enterClasses = enter.split(' ').filter((s) => s.length);
31
- const enterStartClasses = enterStart.split(' ').filter((s) => s.length);
32
- const enterEndClasses = enterEnd.split(' ').filter((s) => s.length);
33
- const leaveClasses = leave.split(' ').filter((s) => s.length);
34
- const leaveStartClasses = leaveStart.split(' ').filter((s) => s.length);
35
- const leaveEndClasses = leaveEnd.split(' ').filter((s) => s.length);
36
- const removeFromDom = unmountOnExit;
37
-
38
- function addClasses(node, classes) {
39
- classes.length && node.classList.add(...classes);
40
- }
41
-
42
- function removeClasses(node, classes) {
43
- classes.length && node.classList.remove(...classes);
44
- }
45
-
46
- const nodeRef = React.useRef(null);
47
- const Component = tag;
48
-
49
- return (
50
- <ReactCSSTransition
51
- appear={appear}
52
- nodeRef={nodeRef}
53
- unmountOnExit={removeFromDom}
54
- in={show}
55
- addEndListener={(done) => {
56
- nodeRef.current.addEventListener('transitionend', done, false)
57
- }}
58
- onEnter={() => {
59
- if (!removeFromDom) nodeRef.current.style.display = null;
60
- addClasses(nodeRef.current, [...enterClasses, ...enterStartClasses])
61
- }}
62
- onEntering={() => {
63
- removeClasses(nodeRef.current, enterStartClasses)
64
- addClasses(nodeRef.current, enterEndClasses)
65
- }}
66
- onEntered={() => {
67
- removeClasses(nodeRef.current, [...enterEndClasses, ...enterClasses])
68
- }}
69
- onExit={() => {
70
- addClasses(nodeRef.current, [...leaveClasses, ...leaveStartClasses])
71
- }}
72
- onExiting={() => {
73
- removeClasses(nodeRef.current, leaveStartClasses)
74
- addClasses(nodeRef.current, leaveEndClasses)
75
- }}
76
- onExited={() => {
77
- removeClasses(nodeRef.current, [...leaveEndClasses, ...leaveClasses])
78
- if (!removeFromDom) nodeRef.current.style.display = 'none';
79
- }}
80
- >
81
- <Component ref={nodeRef} {...rest} style={{ display: !removeFromDom ? 'none': null }}>{children}</Component>
82
- </ReactCSSTransition>
83
- )
84
- }
85
-
86
- function Transition({ show, appear, ...rest }) {
87
- const { parent } = useContext(TransitionContext);
88
- const isInitialRender = useIsInitialRender();
89
- const isChild = show === undefined;
90
-
91
- if (isChild) {
92
- return (
93
- <CSSTransition
94
- appear={parent.appear || !parent.isInitialRender}
95
- show={parent.show}
96
- {...rest}
97
- />
98
- )
99
- }
100
-
101
- return (
102
- <TransitionContext.Provider
103
- value={{
104
- parent: {
105
- show,
106
- isInitialRender,
107
- appear,
108
- },
109
- }}
110
- >
111
- <CSSTransition appear={appear} show={show} {...rest} />
112
- </TransitionContext.Provider>
113
- )
114
- }
115
-
116
- export default Transition;
@@ -1,63 +0,0 @@
1
- export const formatValue = (value) => Intl.NumberFormat('en-US', {
2
- style: 'currency',
3
- currency: 'USD',
4
- maximumSignificantDigits: 3,
5
- notation: 'compact',
6
- }).format(value);
7
-
8
- export const formatThousands = (value) => Intl.NumberFormat('en-US', {
9
- maximumSignificantDigits: 3,
10
- notation: 'compact',
11
- }).format(value);
12
-
13
- export const getCssVariable = (variable) => {
14
- return getComputedStyle(document.documentElement).getPropertyValue(variable).trim();
15
- };
16
-
17
- const adjustHexOpacity = (hexColor, opacity) => {
18
- // Remove the '#' if it exists
19
- hexColor = hexColor.replace('#', '');
20
-
21
- // Convert hex to RGB
22
- const r = parseInt(hexColor.substring(0, 2), 16);
23
- const g = parseInt(hexColor.substring(2, 4), 16);
24
- const b = parseInt(hexColor.substring(4, 6), 16);
25
-
26
- // Return RGBA string
27
- return `rgba(${r}, ${g}, ${b}, ${opacity})`;
28
- };
29
-
30
- const adjustHSLOpacity = (hslColor, opacity) => {
31
- // Convert HSL to HSLA
32
- return hslColor.replace('hsl(', 'hsla(').replace(')', `, ${opacity})`);
33
- };
34
-
35
- const adjustOKLCHOpacity = (oklchColor, opacity) => {
36
- // Add alpha value to OKLCH color
37
- return oklchColor.replace(/oklch\((.*?)\)/, (match, p1) => `oklch(${p1} / ${opacity})`);
38
- };
39
-
40
- export const adjustColorOpacity = (color, opacity) => {
41
- if (color.startsWith('#')) {
42
- return adjustHexOpacity(color, opacity);
43
- } else if (color.startsWith('hsl')) {
44
- return adjustHSLOpacity(color, opacity);
45
- } else if (color.startsWith('oklch')) {
46
- return adjustOKLCHOpacity(color, opacity);
47
- } else {
48
- throw new Error('Unsupported color format');
49
- }
50
- };
51
-
52
- export const oklchToRGBA = (oklchColor) => {
53
- // Create a temporary div to use for color conversion
54
- const tempDiv = document.createElement('div');
55
- tempDiv.style.color = oklchColor;
56
- document.body.appendChild(tempDiv);
57
-
58
- // Get the computed style and convert to RGB
59
- const computedColor = window.getComputedStyle(tempDiv).color;
60
- document.body.removeChild(tempDiv);
61
-
62
- return computedColor;
63
- };