tibing / platform-terminal Goto Github PK
View Code? Open in Web Editor NEWAngular Dashboard rendered into system’s terminal! 🔥
Angular Dashboard rendered into system’s terminal! 🔥
I can run angular application on terminal. Can we run this in browser?
I have made below changes but did not get blessed component. I was not getting any error because schemas: [NO_ERRORS_SCHEMA] was added module.
Main.ts
// import { platformTerminalDynamic } from 'platform-terminal';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
// platformTerminalDynamic().bootstrapModule(AppModule)
// .catch(err => console.error(err));
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
AppModule:
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
// import { TerminalModule } from 'platform-terminal';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { TextExampleComponent } from './text/text-example.component';
import { BoxExampleComponent } from './box/box-example.component';
import { TableExampleComponent } from './table/table-example.component';
import { ProgressbarExampleComponent } from './progressbar/progressbar-example.component';
@NgModule({
declarations: [
AppComponent,
TextExampleComponent,
BoxExampleComponent,
TableExampleComponent,
ProgressbarExampleComponent,
],
imports: [
CommonModule,
BrowserModule, // added broswer module
// TerminalModule
],
bootstrap: [AppComponent],
schemas: [NO_ERRORS_SCHEMA],
})
export class AppModule {
}
Can you please guild me to render this in browser? We are trying to run our project on terminal as well as in browser.
`> [email protected] link:platform /Users/scottwalter/Library/Mobile Documents/comappleCloudDocs/Sandbox/platform-terminal
npm link dist/platform-terminal && npm link platform-terminal
npm ERR! code EINVALIDTYPE
npm ERR! typeerror Error: Argument #2: Expected array but got string
npm ERR! typeerror at EventEmitter.install (/Users/scottwalter/.nvm/versions/node/v10.16.0/lib/node_modules/npm/lib/install.js:190:3)
npm ERR! typeerror at Object.commandCache.(anonymous function) (/Users/scottwalter/.nvm/versions/node/v10.16.0/lib/node_modules/npm/lib/npm.js:156:13)
npm ERR! typeerror at /Users/scottwalter/.nvm/versions/node/v10.16.0/lib/node_modules/npm/lib/link.js:93:24
npm ERR! typeerror at /Users/scottwalter/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:282:31
npm ERR! typeerror at FSReqWrap.oncomplete (fs.js:153:21)
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror https://npm.community`
I changed app.component.ts
to:
import { ChangeDetectionStrategy, Component } from '@angular/core';
@Component({
selector: 'pl-root',
template: `<pl-3-dashboard></pl-3-dashboard>`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AppComponent {
}
But when I yarn start
, I get:
this.rows.forEach is not a function TypeError: this.rows.forEach is not a function
at Table._calculateMaxes (/Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/table.js:69:13)
at Table.render (/Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/table.js:175:8)
at /Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/element.js:2334:8
at Array.forEach (<anonymous>)
at Box.Element.render (/Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/element.js:2327:17)
at /Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/element.js:2334:8
at Array.forEach (<anonymous>)
at Box.Element.render (/Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/element.js:2327:17)
at /Users/maroun.bassam/personal/platform-terminal/node_modules/blessed/lib/widgets/screen.js:738:8
at Array.forEach (<anonymous>)
DOD:
TerminalPlatform provides all the required UI elements:
I have clone this repository and added input control but not able to set the focus:
I have added textbox to elementFactories using .set('textbox', blessed.textbox) and created a component to get user input
import { Component } from '@angular/core';
@component({
selector: 'pl-box-example',
template: <box #test top="center" left="center" height="10" width="21" [keyable]="'true'"> </box> <textbox left="center" [style]="style" top="5" keyable="true" value="first" height="2" width="10"></textbox>
,
})
export class TextBoxComponent {
style = {
underline: true,
fg: 'white',
bg: 'yellow',
border: {
fg: 'red',
},
};
}
can you please help me to set focus to an input component?
Congrats for the effort! There are a variety of use cases for such a project.
platform-terminal
? If you're planning to grow the project, we may sync to make sure everything will work in the future with Ivy.ng-add
schematics and a custom builder for serve
/build
?A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.