@backstage-community/plugin-opencost 0.2.10
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/CHANGELOG.md +317 -0
- package/README.md +79 -0
- package/config.d.ts +30 -0
- package/dist/esm/index-BQC8_PDN.esm.js +1536 -0
- package/dist/esm/index-BQC8_PDN.esm.js.map +1 -0
- package/dist/images/pig.png +0 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.esm.js +22 -0
- package/dist/index.esm.js.map +1 -0
- package/package.json +66 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# @backstage-community/plugin-opencost
|
|
2
|
+
|
|
3
|
+
## 0.2.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 193a2a3: Migrated from the [backstage/backstage](https://github.com/backstage/backstage) monorepo.
|
|
8
|
+
|
|
9
|
+
## 0.2.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @backstage/core-components@0.14.4
|
|
15
|
+
- @backstage/core-plugin-api@1.9.2
|
|
16
|
+
|
|
17
|
+
## 0.2.9-next.0
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
- @backstage/core-components@0.14.4-next.0
|
|
23
|
+
- @backstage/core-plugin-api@1.9.1
|
|
24
|
+
|
|
25
|
+
## 0.2.8
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- f21ef8c: Added ESLint rule `no-top-level-material-ui-4-imports` in the `opencost` plugin to migrate the Material UI imports.
|
|
30
|
+
- Updated dependencies
|
|
31
|
+
- @backstage/core-components@0.14.3
|
|
32
|
+
- @backstage/core-plugin-api@1.9.1
|
|
33
|
+
|
|
34
|
+
## 0.2.7
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- f21ef8c: Added ESLint rule `no-top-level-material-ui-4-imports` in the `opencost` plugin to migrate the Material UI imports.
|
|
39
|
+
- Updated dependencies
|
|
40
|
+
- @backstage/core-components@0.14.2
|
|
41
|
+
- @backstage/core-plugin-api@1.9.1
|
|
42
|
+
|
|
43
|
+
## 0.2.6
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- Updated dependencies
|
|
48
|
+
- @backstage/core-components@0.14.1
|
|
49
|
+
- @backstage/core-plugin-api@1.9.1
|
|
50
|
+
|
|
51
|
+
## 0.2.6-next.2
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- Updated dependencies
|
|
56
|
+
- @backstage/core-components@0.14.1-next.2
|
|
57
|
+
- @backstage/core-plugin-api@1.9.1-next.1
|
|
58
|
+
|
|
59
|
+
## 0.2.6-next.1
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- Updated dependencies
|
|
64
|
+
- @backstage/core-components@0.14.1-next.1
|
|
65
|
+
- @backstage/core-plugin-api@1.9.1-next.1
|
|
66
|
+
|
|
67
|
+
## 0.2.6-next.0
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- Updated dependencies
|
|
72
|
+
- @backstage/core-components@0.14.1-next.0
|
|
73
|
+
- @backstage/core-plugin-api@1.9.1-next.0
|
|
74
|
+
|
|
75
|
+
## 0.2.5
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- 9aac2b0: Use `--cwd` as the first `yarn` argument
|
|
80
|
+
- 8fe56a8: Widen `@types/react` dependency range to include version 18.
|
|
81
|
+
- 8472188: Added or fixed the `repository` field in `package.json`.
|
|
82
|
+
- 03c5bbe: Updated dependency `date-fns` to `^3.0.0`.
|
|
83
|
+
- Updated dependencies
|
|
84
|
+
- @backstage/core-components@0.14.0
|
|
85
|
+
- @backstage/core-plugin-api@1.9.0
|
|
86
|
+
|
|
87
|
+
## 0.2.5-next.2
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- 8472188: Added or fixed the `repository` field in `package.json`.
|
|
92
|
+
- Updated dependencies
|
|
93
|
+
- @backstage/core-components@0.14.0-next.2
|
|
94
|
+
- @backstage/core-plugin-api@1.9.0-next.1
|
|
95
|
+
|
|
96
|
+
## 0.2.5-next.1
|
|
97
|
+
|
|
98
|
+
### Patch Changes
|
|
99
|
+
|
|
100
|
+
- 9aac2b0: Use `--cwd` as the first `yarn` argument
|
|
101
|
+
- 8fe56a8: Widen `@types/react` dependency range to include version 18.
|
|
102
|
+
- 03c5bbe: Updated dependency `date-fns` to `^3.0.0`.
|
|
103
|
+
- Updated dependencies
|
|
104
|
+
- @backstage/core-components@0.14.0-next.1
|
|
105
|
+
- @backstage/core-plugin-api@1.9.0-next.1
|
|
106
|
+
|
|
107
|
+
## 0.2.5-next.0
|
|
108
|
+
|
|
109
|
+
### Patch Changes
|
|
110
|
+
|
|
111
|
+
- Updated dependencies
|
|
112
|
+
- @backstage/core-components@0.14.0-next.0
|
|
113
|
+
- @backstage/core-plugin-api@1.8.3-next.0
|
|
114
|
+
|
|
115
|
+
## 0.2.4
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- 4016f21: Remove some unused dependencies
|
|
120
|
+
- Updated dependencies
|
|
121
|
+
- @backstage/core-components@0.13.10
|
|
122
|
+
- @backstage/core-plugin-api@1.8.2
|
|
123
|
+
|
|
124
|
+
## 0.2.4-next.1
|
|
125
|
+
|
|
126
|
+
### Patch Changes
|
|
127
|
+
|
|
128
|
+
- Updated dependencies
|
|
129
|
+
- @backstage/core-plugin-api@1.8.2-next.0
|
|
130
|
+
- @backstage/core-components@0.13.10-next.1
|
|
131
|
+
|
|
132
|
+
## 0.2.4-next.0
|
|
133
|
+
|
|
134
|
+
### Patch Changes
|
|
135
|
+
|
|
136
|
+
- 4016f21: Remove some unused dependencies
|
|
137
|
+
- Updated dependencies
|
|
138
|
+
- @backstage/core-components@0.13.10-next.0
|
|
139
|
+
- @backstage/core-plugin-api@1.8.1
|
|
140
|
+
|
|
141
|
+
## 0.2.3
|
|
142
|
+
|
|
143
|
+
### Patch Changes
|
|
144
|
+
|
|
145
|
+
- Updated dependencies
|
|
146
|
+
- @backstage/core-plugin-api@1.8.1
|
|
147
|
+
- @backstage/core-components@0.13.9
|
|
148
|
+
- @backstage/theme@0.5.0
|
|
149
|
+
|
|
150
|
+
## 0.2.3-next.3
|
|
151
|
+
|
|
152
|
+
### Patch Changes
|
|
153
|
+
|
|
154
|
+
- Updated dependencies
|
|
155
|
+
- @backstage/core-components@0.13.9-next.3
|
|
156
|
+
- @backstage/core-plugin-api@1.8.1-next.1
|
|
157
|
+
- @backstage/theme@0.5.0-next.1
|
|
158
|
+
|
|
159
|
+
## 0.2.3-next.2
|
|
160
|
+
|
|
161
|
+
### Patch Changes
|
|
162
|
+
|
|
163
|
+
- Updated dependencies
|
|
164
|
+
- @backstage/theme@0.5.0-next.1
|
|
165
|
+
- @backstage/core-components@0.13.9-next.2
|
|
166
|
+
- @backstage/core-plugin-api@1.8.1-next.1
|
|
167
|
+
|
|
168
|
+
## 0.2.3-next.1
|
|
169
|
+
|
|
170
|
+
### Patch Changes
|
|
171
|
+
|
|
172
|
+
- Updated dependencies
|
|
173
|
+
- @backstage/core-components@0.13.9-next.1
|
|
174
|
+
- @backstage/core-plugin-api@1.8.1-next.1
|
|
175
|
+
- @backstage/theme@0.5.0-next.0
|
|
176
|
+
|
|
177
|
+
## 0.2.3-next.0
|
|
178
|
+
|
|
179
|
+
### Patch Changes
|
|
180
|
+
|
|
181
|
+
- Updated dependencies
|
|
182
|
+
- @backstage/core-plugin-api@1.8.1-next.0
|
|
183
|
+
- @backstage/core-components@0.13.9-next.0
|
|
184
|
+
- @backstage/theme@0.5.0-next.0
|
|
185
|
+
|
|
186
|
+
## 0.2.2
|
|
187
|
+
|
|
188
|
+
### Patch Changes
|
|
189
|
+
|
|
190
|
+
- 6c2b872153: Add official support for React 18.
|
|
191
|
+
- 4aa43f62aa: Updated dependency `cross-fetch` to `^4.0.0`.
|
|
192
|
+
- Updated dependencies
|
|
193
|
+
- @backstage/core-components@0.13.8
|
|
194
|
+
- @backstage/core-plugin-api@1.8.0
|
|
195
|
+
- @backstage/theme@0.4.4
|
|
196
|
+
|
|
197
|
+
## 0.2.2-next.2
|
|
198
|
+
|
|
199
|
+
### Patch Changes
|
|
200
|
+
|
|
201
|
+
- Updated dependencies
|
|
202
|
+
- @backstage/core-components@0.13.8-next.2
|
|
203
|
+
|
|
204
|
+
## 0.2.2-next.1
|
|
205
|
+
|
|
206
|
+
### Patch Changes
|
|
207
|
+
|
|
208
|
+
- Updated dependencies
|
|
209
|
+
- @backstage/core-components@0.13.8-next.1
|
|
210
|
+
- @backstage/core-plugin-api@1.8.0-next.0
|
|
211
|
+
- @backstage/theme@0.4.4-next.0
|
|
212
|
+
|
|
213
|
+
## 0.2.2-next.0
|
|
214
|
+
|
|
215
|
+
### Patch Changes
|
|
216
|
+
|
|
217
|
+
- 6c2b872153: Add official support for React 18.
|
|
218
|
+
- Updated dependencies
|
|
219
|
+
- @backstage/core-components@0.13.7-next.0
|
|
220
|
+
- @backstage/core-plugin-api@1.8.0-next.0
|
|
221
|
+
- @backstage/theme@0.4.4-next.0
|
|
222
|
+
|
|
223
|
+
## 0.2.1
|
|
224
|
+
|
|
225
|
+
### Patch Changes
|
|
226
|
+
|
|
227
|
+
- 9a1fce352e: Updated dependency `@testing-library/jest-dom` to `^6.0.0`.
|
|
228
|
+
- 777b9a16a4: Fix for broken image reference.
|
|
229
|
+
- Updated dependencies
|
|
230
|
+
- @backstage/core-plugin-api@1.7.0
|
|
231
|
+
- @backstage/core-components@0.13.6
|
|
232
|
+
- @backstage/theme@0.4.3
|
|
233
|
+
|
|
234
|
+
## 0.2.1-next.2
|
|
235
|
+
|
|
236
|
+
### Patch Changes
|
|
237
|
+
|
|
238
|
+
- 777b9a16a4: Fix for broken image reference.
|
|
239
|
+
- Updated dependencies
|
|
240
|
+
- @backstage/core-components@0.13.6-next.2
|
|
241
|
+
- @backstage/core-plugin-api@1.7.0-next.1
|
|
242
|
+
- @backstage/theme@0.4.3-next.0
|
|
243
|
+
|
|
244
|
+
## 0.2.1-next.1
|
|
245
|
+
|
|
246
|
+
### Patch Changes
|
|
247
|
+
|
|
248
|
+
- Updated dependencies
|
|
249
|
+
- @backstage/core-components@0.13.6-next.1
|
|
250
|
+
- @backstage/core-plugin-api@1.7.0-next.0
|
|
251
|
+
- @backstage/theme@0.4.2
|
|
252
|
+
|
|
253
|
+
## 0.2.1-next.0
|
|
254
|
+
|
|
255
|
+
### Patch Changes
|
|
256
|
+
|
|
257
|
+
- Updated dependencies
|
|
258
|
+
- @backstage/core-plugin-api@1.7.0-next.0
|
|
259
|
+
- @backstage/core-components@0.13.6-next.0
|
|
260
|
+
- @backstage/theme@0.4.2
|
|
261
|
+
|
|
262
|
+
## 0.2.0
|
|
263
|
+
|
|
264
|
+
### Minor Changes
|
|
265
|
+
|
|
266
|
+
- 1380a689ab56: New OpenCost plugin provides an port of the latest OpenCost UI to Backstage with updated dependencies. The plugin's README covers installation and configuration
|
|
267
|
+
|
|
268
|
+
### Patch Changes
|
|
269
|
+
|
|
270
|
+
- 482bb5c0bbf8: Moved `@types/react` to be a regular dependency
|
|
271
|
+
- 406b786a2a2c: Mark package as being free of side effects, allowing more optimized Webpack builds.
|
|
272
|
+
- Updated dependencies
|
|
273
|
+
- @backstage/core-components@0.13.5
|
|
274
|
+
- @backstage/core-plugin-api@1.6.0
|
|
275
|
+
- @backstage/theme@0.4.2
|
|
276
|
+
|
|
277
|
+
## 0.2.0-next.3
|
|
278
|
+
|
|
279
|
+
### Patch Changes
|
|
280
|
+
|
|
281
|
+
- 406b786a2a2c: Mark package as being free of side effects, allowing more optimized Webpack builds.
|
|
282
|
+
- Updated dependencies
|
|
283
|
+
- @backstage/core-components@0.13.5-next.3
|
|
284
|
+
- @backstage/core-plugin-api@1.6.0-next.3
|
|
285
|
+
- @backstage/theme@0.4.2-next.0
|
|
286
|
+
|
|
287
|
+
## 0.2.0-next.2
|
|
288
|
+
|
|
289
|
+
### Patch Changes
|
|
290
|
+
|
|
291
|
+
- Updated dependencies
|
|
292
|
+
- @backstage/core-components@0.13.5-next.2
|
|
293
|
+
- @backstage/core-plugin-api@1.6.0-next.2
|
|
294
|
+
- @backstage/theme@0.4.1
|
|
295
|
+
|
|
296
|
+
## 0.2.0-next.1
|
|
297
|
+
|
|
298
|
+
### Patch Changes
|
|
299
|
+
|
|
300
|
+
- Updated dependencies
|
|
301
|
+
- @backstage/core-components@0.13.5-next.1
|
|
302
|
+
- @backstage/core-plugin-api@1.6.0-next.1
|
|
303
|
+
- @backstage/theme@0.4.1
|
|
304
|
+
|
|
305
|
+
## 0.2.0-next.0
|
|
306
|
+
|
|
307
|
+
### Minor Changes
|
|
308
|
+
|
|
309
|
+
- 1380a689ab56: New OpenCost plugin provides an port of the latest OpenCost UI to Backstage with updated dependencies. The plugin's README covers installation and configuration
|
|
310
|
+
|
|
311
|
+
### Patch Changes
|
|
312
|
+
|
|
313
|
+
- 482bb5c0bbf8: Moved `@types/react` to be a regular dependency
|
|
314
|
+
- Updated dependencies
|
|
315
|
+
- @backstage/core-plugin-api@1.6.0-next.0
|
|
316
|
+
- @backstage/core-components@0.13.5-next.0
|
|
317
|
+
- @backstage/theme@0.4.1
|
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# OpenCost
|
|
2
|
+
|
|
3
|
+
Welcome to the [OpenCost](https://opencost.io) plugin!
|
|
4
|
+
|
|
5
|
+
Currently this is a port of the [OpenCost UI](https://github.com/opencost/opencost/tree/develop/ui), but we will continue to expand it to expose any relevant data or pre-configured views that may be preferred.
|
|
6
|
+
|
|
7
|
+
All of the code was originally ported from https://github.com/opencost/opencost/blob/develop/ui/ which is under by the Apache v2 License and also managed by the CNCF.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
1. Add the OpenCost dependency to the `packages/app/package.json`:
|
|
12
|
+
```sh
|
|
13
|
+
# From your Backstage root directory
|
|
14
|
+
yarn --cwd packages/app add @backstage-community/plugin-opencost
|
|
15
|
+
```
|
|
16
|
+
2. Add the `OpenCostPage` to your `packages/app/src/App.tsx`:
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { OpenCostPage } from '@backstage-community/plugin-opencost';
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
and
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
<FlatRoutes>
|
|
26
|
+
…
|
|
27
|
+
<Route path="/opencost" element={<OpenCostPage />} />
|
|
28
|
+
</FlatRoutes>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
3. Import the `MoneyIcon` and add link to OpenCost to your sidebar
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// packages/app/src/components/Root/Root.tsx
|
|
35
|
+
import MoneyIcon from '@material-ui/icons/MonetizationOn';
|
|
36
|
+
|
|
37
|
+
...
|
|
38
|
+
|
|
39
|
+
export const Root = ({ children }: PropsWithChildren<{}>) => (
|
|
40
|
+
<SidebarPage>
|
|
41
|
+
<Sidebar>
|
|
42
|
+
...
|
|
43
|
+
<SidebarItem icon={MoneyIcon} to="opencost" text="OpenCost" />
|
|
44
|
+
...
|
|
45
|
+
</Sidebar>
|
|
46
|
+
</SidebarPage>
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Plugin Configuration
|
|
52
|
+
|
|
53
|
+
Since OpenCost doesn't have any authentication at this point, you just need to give API access to the plugin to access your data.
|
|
54
|
+
|
|
55
|
+
If you haven't set up an ingress rule, you can port-forward the API with
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
kubectl -n opencost port-forward deployment/opencost 9003
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Add the following to your `app-config.yaml`:
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
opencost:
|
|
65
|
+
baseUrl: http://localhost:9003
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Ideas/Next Steps
|
|
69
|
+
|
|
70
|
+
- More testing
|
|
71
|
+
- Use the OpenCost mascot for the sidebar logo
|
|
72
|
+
- Use the Backstage proxy to communicate with the OpenCost API if necessary for authentication
|
|
73
|
+
- Convert AllocationReport.js to use the [Backstage Table](https://backstage.io/storybook/?path=/story/data-display-table--default-table)
|
|
74
|
+
- Allow for user-provided default reports and/or disabling controls
|
|
75
|
+
- Support multiple hard-coded reports
|
|
76
|
+
- clean up deprecation warnings and upgrade to all the latest React components
|
|
77
|
+
- Fork(?) to support `Kubecost`, which could provide Alerts and Recommendations, similar to the Cost Explorer plugin
|
|
78
|
+
|
|
79
|
+

|
package/config.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 The Backstage Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export interface Config {
|
|
18
|
+
/**
|
|
19
|
+
* Configurations for the OpenCost plugin
|
|
20
|
+
*
|
|
21
|
+
* @visibility frontend
|
|
22
|
+
*/
|
|
23
|
+
opencost?: {
|
|
24
|
+
/**
|
|
25
|
+
* The base URL for the OpenCost API
|
|
26
|
+
* @visibility frontend
|
|
27
|
+
*/
|
|
28
|
+
baseUrl: string;
|
|
29
|
+
};
|
|
30
|
+
}
|