Git Product home page Git Product logo

xtermjs-spring-boot-starter's Introduction

xtermjs-spring-boot-starter

Build Status

Supply a web terminal to manage Spring Boot app. Why?

  • Access easy: not install, no env setup, just open the browser
  • Use commands to manage app
  • No need to us curl to call lots of REST API
  • Easy to write commands by Spring Shell

Xterm Console

Attention: You should care about security by yourself.

How to use?

  • Edit pom.xml and add following dependency:
<dependencies>
    <dependency>
        <groupId>org.mvnsearch</groupId>
        <artifactId>xtermjs-spring-boot-starter</artifactId>
        <version>1.3.1</version>
    </dependency> 
</dependencies> 
  • Open application.properties and add rsocket configuration.
# rsocket websocket
spring.rsocket.server.mapping-path=/rsocket
spring.rsocket.server.transport=websocket
# disable spring shell interactive mode 
spring.shell.interactive.enabled=false

Terminal Features

  • History: arrow up/down
  • Ctrl+U: clear input
  • clear: clear the screen
  • exit: close the window/tab

Application commands

System commands

  • cd, ls, tree etc. support by ZT Process Executor

System

  • date
  • curl: curl command for http operation

JVM commands

  • threads: display threads
  • classpath: display classpath

Spring Commands

  • Help: Spring Shell help
  • app: display app information
  • beans: display all spring beans
  • bean: display bean definition
  • profiles: display profile
  • metrics: display metrics
  • health: display health information
  • spel: execute SpEL expression 'spel userService.findById(1)'
  • actuator: display actuator information

Commands for Spring Bean

  • redis commands
use redis
set nick linux_china
get nick
exit
  • mysql commands
use db
select * from account;
exit db

How to development

  • Start Spring Boot App to supply xterm backend service
  • Start "npm run start" to start Webpack dev server for JavaScript development

References

xtermjs-spring-boot-starter's People

Contributors

dependabot[bot] avatar linux-china avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

xtermjs-spring-boot-starter's Issues

Improper handling of exceptions thrown in shell method

To recreate the issue, throw NullPointerException on any dummy ShellMethod.
Observed is XtermCommandHandler.executeCommand tries to format object which in that case is NullPointerException, so executed is:

if (object instanceof Exception) {
	return new AttributedString(((Exception) object).getMessage(),
			AttributedStyle.DEFAULT.foreground(AttributedStyle.RED)).toAnsi();
}

But ((Exception) object).getMessage() resolves into null, and AttributedString assumes an input to be not null, so another NullPointerException is raised.

Tested on 1.2.1

Using version 1.1.3 and have Rsocket Error

I start the version 1.1.3 (Tested with version 1.1.1 with the same result) of application and I added the properties as you mentioned here, it goes up but then I see the error message when I type help in the console:

  Xterm for null
  
  $help
  Failed to connect RSocket backend(ws://localhost:8080/rsocket), please check your service! 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.