# ct-cockpit **Repository Path**: openeuler/ct-cockpit ## Basic Information - **Project Name**: ct-cockpit - **Description**: A web-based operations and maintenance tool designed to provide system administrators and users with an easy-to-use interface for managing and monitoring Linux servers. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-11-12 - **Last Updated**: 2025-12-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: sig-MCP-Tools-Ecosystem ## README
## 1. Basic Introduction ### 1.1 Project Introduction > CTyun Admin is a linux system management and observe platform. It base on Gin and Vue frameworks, which separates the front and rear of the full stack. It integrates jwt authentication, dynamic routing, dynamic menu, casbin authentication, form generator, code generator and other functions. username:admin password:123456 ### 1.2 source code - dev: https://work.ctyun.cn/git/ctyunos-sys/ct-platform/src/branch/dev ## 2. Getting started ``` - node version > v8.6.0 - golang version >= v1.14 - IDE recommendation: MS vscode ``` ### 2.1 server project ```bash # open server catalogue cd server # Run with debug mode (run quickly, but low performance) go run main.go # Alternatively, compile and run with binary go generate go build -o server main.go (windows the compile command is go build -o server.exe main.go ) ./server (windows The run command is server.exe) ``` ### 2.2 web project ```bash # enter the project directory cd web # install dependency npm install # develop npm run serve ``` ### 2.3 API docs auto-generation using swagger #### 2.3.1 install swagger ##### (1) Using VPN or outside mainland China ```` go get -u github.com/swaggo/swag/cmd/swag ```` ##### (2) In mainland China In mainland China, access to go.org/x is prohibited,we recommend [goproxy.io](https://goproxy.io/zh/) or [goproxy.cn](https://goproxy.cn) ````bash # If you are using a version of Go 1.13 - 1.15 Need to set up manually GO111MODULE=on, The opening mode is as follows, If your Go version is 1.16 ~ Latest edition You can ignore the following step one # Step one、Enable Go Modules Function go env -w GO111MODULE=on # Step two、Configuration GOPROXY Environment variable go env -w GOPROXY=https://goproxy.cn,https://goproxy.io,direct # If you dislike trouble,You can use the go generate Automatically execute code before compilation, But this can't be used command line terminal of `Goland` or `Vscode` cd server go generate -run "go env -w .*?" # download swag go get -u github.com/swaggo/swag/cmd/swag ```` #### 2.3.2 API docs generation ```` cd server swag init ```` > After executing the above command,server directory will appear in the docs folder `docs.go`, `swagger.json`, `swagger.yaml` Three file updates,After starting the go service, type in the browser [http://localhost:8888/swagger/index.html](http://localhost:8888/swagger/index.html) You can view swagger document ## 3. Technical selection - Frontend: using [Element](https://github.com/ElemeFE/element) based on [Vue](https://vuejs.org),to code the page. - Backend: using [Gin](https://gin-gonic.com/) to quickly build basic RESTful API. [Gin](https://gin-gonic.com/)is a web framework written in Go (Golang). - DB: `MySql`(5.6.44),using [gorm](http://gorm.io)` to implement data manipulation, added support for SQLite databases. - Cache: using `Redis` to implement the recording of the JWT token of the currently active user and implement the multi-login restriction. - API: using Swagger to auto generate APIs docs。 - Config: using [fsnotify](https://github.com/fsnotify/fsnotify) and [viper](https://github.com/spf13/viper) to implement `yaml` config file。 - Log: using [zap](https://github.com/uber-go/zap) record logs。 ## 4. Project Architecture ![Front-end Detailed Design Diagram](http://qmplusimg.henrongyi.top/naotu.png) ``` ├── server ├── api (api entrance) │ └── v1 (v1 version interface) ├── config (configuration package) ├── core (core document) ├── docs (swagger document directory) ├── global (global object) ├── initialize (initialization) │ └── internal (initialize internal function) ├── middleware (middleware layer) ├── model (model layer) │ ├── request (input parameter structure) │ └── response (out-of-parameter structure) ├── packfile (static file packaging) ├── resource (static resource folder) │ ├── excel (excel import and export default path) │ ├── page (form generator) │ └── template (template) ├── router (routing layer) ├── service (service layer) ├── source (source layer) └── utils (tool kit) ├── timer (timer interface encapsulation) └── upload (oss interface encapsulation) └─web (frontend) ├─public (deploy templates) └─src (source code) ├─api (frontend APIs) ├─assets (static files) ├─components(components) ├─router (frontend routers) ├─store (vuex state management) ├─style (common styles) ├─utils (frontend common utilitie) └─view (pages) ``` ## 5. Features - Authority management: Authority management based on `jwt` and `casbin`. - File upload and download: implement file upload operations based on `Qiniuyun', `Aliyun 'and `Tencent Cloud` (please develop your own application for each platform corresponding to `token` or `key` ). - Pagination Encapsulation:The frontend uses `mixins` to encapsulate paging, and the paging method can call `mixins` . - User management: The system administrator assigns user roles and role permissions. - Role management: Create the main object of permission control, and then assign different API permissions and menu permissions to the role. - Menu management: User dynamic menu configuration implementation, assigning different menus to different roles. - API management: Different users can call different API permissions. - Configuration management: the configuration file can be modified in the foreground (this feature is not available in the online experience site). - Conditional search: Add an example of conditional search. - Restful example: You can see sample APIs in user management module. - Front-end file reference: [web/src/view/superAdmin/api/api.vue] - Stage reference: [server/router/sys_api.go] - Multi-login restriction: Change `user-multipoint` to true in `system` in `config.yaml` (You need to configure redis and redis parameters yourself. During the test period, please report in time if there is a bug). - Upload file by chunk:Provides examples of file upload and large file upload by chunk. - Form Builder:With the help of [@form-generator](https://github.com/JakHuang/form-generator). - Code generator: Providing backend with basic logic and simple curd code generator.