Skip to content

linux-china/xtermjs-spring-boot-starter

Repository files navigation

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