openc3 5.8.1 → 5.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/openc3/ext/crc/crc.c +1 -1
- data/lib/openc3/api/cmd_api.rb +1 -1
- data/lib/openc3/microservices/decom_microservice.rb +10 -2
- data/lib/openc3/microservices/reaction_microservice.rb +152 -81
- data/lib/openc3/microservices/timeline_microservice.rb +1 -1
- data/lib/openc3/microservices/trigger_group_microservice.rb +188 -118
- data/lib/openc3/migrations/20230615000000_autonomic.rb +86 -0
- data/lib/openc3/models/activity_model.rb +2 -4
- data/lib/openc3/models/microservice_model.rb +6 -2
- data/lib/openc3/models/model.rb +1 -3
- data/lib/openc3/models/reaction_model.rb +124 -119
- data/lib/openc3/models/scope_model.rb +15 -3
- data/lib/openc3/models/timeline_model.rb +1 -3
- data/lib/openc3/models/trigger_group_model.rb +16 -50
- data/lib/openc3/models/trigger_model.rb +86 -123
- data/lib/openc3/packets/json_packet.rb +2 -3
- data/lib/openc3/script/commands.rb +10 -0
- data/lib/openc3/script/script.rb +1 -0
- data/lib/openc3/top_level.rb +0 -12
- data/lib/openc3/utilities/authorization.rb +1 -1
- data/lib/openc3/utilities/bucket_require.rb +5 -1
- data/lib/openc3/utilities/bucket_utilities.rb +4 -1
- data/lib/openc3/utilities/cli_generator.rb +56 -4
- data/lib/openc3/utilities/ruby_lex_utils.rb +4 -0
- data/lib/openc3/version.rb +6 -6
- data/templates/plugin/README.md +54 -4
- data/templates/plugin/Rakefile +31 -3
- data/templates/tool_angular/.editorconfig +16 -0
- data/templates/tool_angular/.gitignore +44 -0
- data/templates/tool_angular/.vscode/extensions.json +4 -0
- data/templates/tool_angular/.vscode/launch.json +20 -0
- data/templates/tool_angular/.vscode/tasks.json +42 -0
- data/templates/tool_angular/angular.json +111 -0
- data/templates/tool_angular/extra-webpack.config.js +8 -0
- data/templates/tool_angular/package.json +47 -0
- data/templates/tool_angular/src/app/app-routing.module.ts +15 -0
- data/templates/tool_angular/src/app/app.component.html +31 -0
- data/templates/tool_angular/src/app/app.component.scss +26 -0
- data/templates/tool_angular/src/app/app.component.spec.ts +29 -0
- data/templates/tool_angular/src/app/app.component.ts +51 -0
- data/templates/tool_angular/src/app/app.module.ts +30 -0
- data/templates/tool_angular/src/app/custom-overlay-container.ts +17 -0
- data/templates/tool_angular/src/app/empty-route/empty-route.component.ts +7 -0
- data/templates/tool_angular/src/app/openc3-api.d.ts +1 -0
- data/templates/tool_angular/src/assets/.gitkeep +0 -0
- data/templates/tool_angular/src/environments/environment.prod.ts +3 -0
- data/templates/tool_angular/src/environments/environment.ts +16 -0
- data/templates/tool_angular/src/favicon.ico +0 -0
- data/templates/tool_angular/src/index.html +13 -0
- data/templates/tool_angular/src/main.single-spa.ts +40 -0
- data/templates/tool_angular/src/single-spa/asset-url.ts +12 -0
- data/templates/tool_angular/src/single-spa/single-spa-props.ts +8 -0
- data/templates/tool_angular/src/styles.scss +1 -0
- data/templates/tool_angular/tsconfig.app.json +13 -0
- data/templates/tool_angular/tsconfig.json +33 -0
- data/templates/tool_angular/tsconfig.spec.json +14 -0
- data/templates/tool_angular/yarn.lock +8080 -0
- data/templates/tool_react/.eslintrc +7 -0
- data/templates/tool_react/.gitignore +72 -0
- data/templates/tool_react/.prettierignore +8 -0
- data/templates/tool_react/babel.config.json +29 -0
- data/templates/tool_react/jest.config.js +12 -0
- data/templates/tool_react/package.json +53 -0
- data/templates/tool_react/src/openc3-tool_name.js +24 -0
- data/templates/tool_react/src/root.component.js +88 -0
- data/templates/tool_react/src/root.component.test.js +9 -0
- data/templates/tool_react/webpack.config.js +27 -0
- data/templates/tool_react/yarn.lock +6854 -0
- data/templates/tool_svelte/.gitignore +72 -0
- data/templates/tool_svelte/.prettierignore +8 -0
- data/templates/tool_svelte/babel.config.js +12 -0
- data/templates/tool_svelte/build/smui.css +5 -0
- data/templates/tool_svelte/jest.config.js +9 -0
- data/templates/tool_svelte/package.json +46 -0
- data/templates/tool_svelte/rollup.config.js +72 -0
- data/templates/tool_svelte/src/App.svelte +42 -0
- data/templates/tool_svelte/src/App.test.js +9 -0
- data/templates/tool_svelte/src/services/api.js +92 -0
- data/templates/tool_svelte/src/services/axios.js +85 -0
- data/templates/tool_svelte/src/services/cable.js +65 -0
- data/templates/tool_svelte/src/services/config-parser.js +199 -0
- data/templates/tool_svelte/src/services/openc3-api.js +647 -0
- data/templates/tool_svelte/src/theme/_smui-theme.scss +25 -0
- data/templates/tool_svelte/src/tool_name.js +17 -0
- data/templates/tool_svelte/yarn.lock +5052 -0
- data/templates/tool_vue/.browserslistrc +16 -0
- data/templates/tool_vue/.env.standalone +1 -0
- data/templates/tool_vue/.eslintrc.js +43 -0
- data/templates/tool_vue/.gitignore +2 -0
- data/templates/tool_vue/.nycrc +3 -0
- data/templates/tool_vue/.prettierrc.js +5 -0
- data/templates/tool_vue/babel.config.json +11 -0
- data/templates/tool_vue/jsconfig.json +6 -0
- data/templates/tool_vue/package.json +52 -0
- data/templates/tool_vue/src/App.vue +15 -0
- data/templates/tool_vue/src/main.js +38 -0
- data/templates/tool_vue/src/router.js +29 -0
- data/templates/tool_vue/src/tools/tool_name/tool_name.vue +63 -0
- data/templates/tool_vue/vue.config.js +30 -0
- data/templates/tool_vue/yarn.lock +9145 -0
- data/templates/widget/package.json +9 -9
- data/templates/widget/yarn.lock +77 -73
- metadata +76 -2
@@ -0,0 +1,51 @@
|
|
1
|
+
import { Component, ViewChild, AfterViewInit, OnDestroy } from '@angular/core';
|
2
|
+
import {CdkPortal, DomPortalOutlet} from '@angular/cdk/portal';
|
3
|
+
import { OpenC3Api } from "@openc3/tool-common/src/services/openc3-api";
|
4
|
+
|
5
|
+
@Component({
|
6
|
+
selector: 'openc3-tool-<%= tool_name %>-root',
|
7
|
+
templateUrl: './app.component.html',
|
8
|
+
styleUrls: ['./app.component.scss'],
|
9
|
+
})
|
10
|
+
export class AppComponent implements AfterViewInit, OnDestroy {
|
11
|
+
@ViewChild(CdkPortal)
|
12
|
+
private portal: CdkPortal | undefined;
|
13
|
+
private host: DomPortalOutlet | undefined;
|
14
|
+
|
15
|
+
clickHandler = function() {
|
16
|
+
let api = new OpenC3Api();
|
17
|
+
api.cmd("INST", "COLLECT", { TYPE: "NORMAL" }).then((response: any) => {
|
18
|
+
alert("Command Sent!");
|
19
|
+
});
|
20
|
+
}
|
21
|
+
getMenuElement() {
|
22
|
+
let elem = document.getElementById("openc3-menu")
|
23
|
+
if (elem) {
|
24
|
+
return elem
|
25
|
+
} else {
|
26
|
+
return new HTMLElement()
|
27
|
+
}
|
28
|
+
}
|
29
|
+
ngAfterViewInit(): void {
|
30
|
+
this.host = new DomPortalOutlet(
|
31
|
+
this.getMenuElement()
|
32
|
+
);
|
33
|
+
this.host.attach(this.portal);
|
34
|
+
document.title = "<%= tool_name_display %>";
|
35
|
+
let tool = document.querySelector('#openc3-tool');
|
36
|
+
if (tool == null) {
|
37
|
+
tool = new HTMLElement()
|
38
|
+
}
|
39
|
+
let overlay = document.querySelector('.cdk-overlay-container');
|
40
|
+
if (overlay == null) {
|
41
|
+
overlay = new HTMLElement()
|
42
|
+
}
|
43
|
+
// Move stuff
|
44
|
+
tool.append(overlay);
|
45
|
+
}
|
46
|
+
ngOnDestroy(): void {
|
47
|
+
if (this.host) {
|
48
|
+
this.host.detach();
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { NgModule } from '@angular/core';
|
2
|
+
import { BrowserModule } from '@angular/platform-browser';
|
3
|
+
import { PortalModule } from '@angular/cdk/portal';
|
4
|
+
|
5
|
+
import { AppRoutingModule } from './app-routing.module';
|
6
|
+
import { AppComponent } from './app.component';
|
7
|
+
import {MatCardModule} from '@angular/material/card';
|
8
|
+
import {MatButtonModule} from '@angular/material/button';
|
9
|
+
import {MatMenuModule} from '@angular/material/menu';
|
10
|
+
import {OverlayContainer} from '@angular/cdk/overlay';
|
11
|
+
import {AppOverlayContainer} from './custom-overlay-container';
|
12
|
+
|
13
|
+
@NgModule({
|
14
|
+
declarations: [
|
15
|
+
AppComponent
|
16
|
+
],
|
17
|
+
imports: [
|
18
|
+
BrowserModule,
|
19
|
+
AppRoutingModule,
|
20
|
+
PortalModule,
|
21
|
+
MatCardModule,
|
22
|
+
MatButtonModule,
|
23
|
+
MatMenuModule
|
24
|
+
],
|
25
|
+
providers: [
|
26
|
+
{ provide: OverlayContainer, useClass: AppOverlayContainer },
|
27
|
+
],
|
28
|
+
bootstrap: [AppComponent]
|
29
|
+
})
|
30
|
+
export class AppModule { }
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Injectable, OnDestroy } from '@angular/core';
|
2
|
+
import { OverlayContainer } from '@angular/cdk/overlay';
|
3
|
+
|
4
|
+
export class AppOverlayContainer extends OverlayContainer {
|
5
|
+
|
6
|
+
override _createContainer(): void {
|
7
|
+
let container = document.createElement('div');
|
8
|
+
container.classList.add('cdk-overlay-container');
|
9
|
+
|
10
|
+
let elem = document.querySelector('#openc3-tool');
|
11
|
+
if (!elem) {
|
12
|
+
elem = new HTMLElement();
|
13
|
+
}
|
14
|
+
elem.appendChild(container);
|
15
|
+
this._containerElement = container;
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
declare module '@openc3/tool-common/src/services/openc3-api';
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// This file can be replaced during build by using the `fileReplacements` array.
|
2
|
+
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
|
3
|
+
// The list of file replacements can be found in `angular.json`.
|
4
|
+
|
5
|
+
export const environment = {
|
6
|
+
production: false
|
7
|
+
};
|
8
|
+
|
9
|
+
/*
|
10
|
+
* For easier debugging in development mode, you can import the following file
|
11
|
+
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
12
|
+
*
|
13
|
+
* This import should be commented out in production mode because it will have a negative impact
|
14
|
+
* on performance if an error is thrown.
|
15
|
+
*/
|
16
|
+
import 'zone.js/dist/zone-error'; // Included with Angular CLI.
|
Binary file
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Openc3ToolTemplateAngular</title>
|
6
|
+
<base href="/">
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<openc3-tool-template-angular-root></openc3-tool-template-angular-root>
|
12
|
+
</body>
|
13
|
+
</html>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import 'zone.js/dist/zone'
|
2
|
+
|
3
|
+
import { enableProdMode, NgZone } from '@angular/core';
|
4
|
+
|
5
|
+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
6
|
+
import { Router, NavigationStart } from '@angular/router';
|
7
|
+
|
8
|
+
import { singleSpaAngular, getSingleSpaExtraProviders } from 'single-spa-angular';
|
9
|
+
|
10
|
+
|
11
|
+
import { AppModule } from './app/app.module';
|
12
|
+
import { environment } from './environments/environment';
|
13
|
+
import { singleSpaPropsSubject } from './single-spa/single-spa-props';
|
14
|
+
|
15
|
+
if (environment.production) {
|
16
|
+
enableProdMode();
|
17
|
+
}
|
18
|
+
|
19
|
+
const lifecycles = singleSpaAngular({
|
20
|
+
bootstrapFunction: singleSpaProps => {
|
21
|
+
singleSpaPropsSubject.next(singleSpaProps);
|
22
|
+
return platformBrowserDynamic(getSingleSpaExtraProviders()).bootstrapModule(AppModule);
|
23
|
+
},
|
24
|
+
template: '<openc3-tool-<%= tool_name %>-root />',
|
25
|
+
Router,
|
26
|
+
NavigationStart,
|
27
|
+
NgZone,
|
28
|
+
domElementGetter: function() {
|
29
|
+
let elem = document.getElementById("openc3-tool")
|
30
|
+
if (elem) {
|
31
|
+
return elem
|
32
|
+
} else {
|
33
|
+
return new HTMLElement()
|
34
|
+
}
|
35
|
+
},
|
36
|
+
});
|
37
|
+
|
38
|
+
export const bootstrap = lifecycles.bootstrap;
|
39
|
+
export const mount = lifecycles.mount;
|
40
|
+
export const unmount = lifecycles.unmount;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
// In single-spa, the assets need to be loaded from a dynamic location,
|
2
|
+
// instead of hard coded to `/assets`. We use webpack public path for this.
|
3
|
+
// See https://webpack.js.org/guides/public-path/#root
|
4
|
+
|
5
|
+
export function assetUrl(url: string): string {
|
6
|
+
// @ts-ignore
|
7
|
+
const publicPath = __webpack_public_path__;
|
8
|
+
const publicPathSuffix = publicPath.endsWith('/') ? '' : '/';
|
9
|
+
const urlPrefix = url.startsWith('/') ? '' : '/';
|
10
|
+
|
11
|
+
return `${publicPath}${publicPathSuffix}assets${urlPrefix}${url}`;
|
12
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ReplaySubject } from 'rxjs';
|
2
|
+
import { AppProps } from 'single-spa';
|
3
|
+
|
4
|
+
export const singleSpaPropsSubject = new ReplaySubject<SingleSpaProps>(1);
|
5
|
+
|
6
|
+
// Add any custom single-spa props you have to this type def
|
7
|
+
// https://single-spa.js.org/docs/building-applications.html#custom-props
|
8
|
+
export type SingleSpaProps = AppProps & {};
|
@@ -0,0 +1 @@
|
|
1
|
+
/* You can add global styles to this file, and also import other style files */
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
2
|
+
{
|
3
|
+
"compileOnSave": false,
|
4
|
+
"compilerOptions": {
|
5
|
+
"baseUrl": "./",
|
6
|
+
"outDir": "./dist/out-tsc",
|
7
|
+
"forceConsistentCasingInFileNames": true,
|
8
|
+
"strict": true,
|
9
|
+
"noImplicitOverride": true,
|
10
|
+
"noPropertyAccessFromIndexSignature": true,
|
11
|
+
"noImplicitReturns": true,
|
12
|
+
"noFallthroughCasesInSwitch": true,
|
13
|
+
"sourceMap": true,
|
14
|
+
"declaration": false,
|
15
|
+
"downlevelIteration": true,
|
16
|
+
"experimentalDecorators": true,
|
17
|
+
"moduleResolution": "node",
|
18
|
+
"importHelpers": true,
|
19
|
+
"target": "ES2022",
|
20
|
+
"module": "ES2022",
|
21
|
+
"useDefineForClassFields": false,
|
22
|
+
"lib": [
|
23
|
+
"ES2022",
|
24
|
+
"dom"
|
25
|
+
]
|
26
|
+
},
|
27
|
+
"angularCompilerOptions": {
|
28
|
+
"enableI18nLegacyMessageIdFormat": false,
|
29
|
+
"strictInjectionParameters": true,
|
30
|
+
"strictInputAccessModifiers": true,
|
31
|
+
"strictTemplates": true
|
32
|
+
}
|
33
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
2
|
+
{
|
3
|
+
"extends": "./tsconfig.json",
|
4
|
+
"compilerOptions": {
|
5
|
+
"outDir": "./out-tsc/spec",
|
6
|
+
"types": [
|
7
|
+
"jasmine"
|
8
|
+
]
|
9
|
+
},
|
10
|
+
"include": [
|
11
|
+
"src/**/*.spec.ts",
|
12
|
+
"src/**/*.d.ts"
|
13
|
+
]
|
14
|
+
}
|