Commit 14984ae5 authored by 王曜嵚 Wang Yaoqin's avatar 王曜嵚 Wang Yaoqin

dev: 结构设计

parents
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist
# Node dependencies
node_modules
# Logs
logs
*.log
# Misc
.DS_Store
.fleet
.idea
# Local env files
.env
.env.*
!.env.example
# Nuxt 3 Minimal Starter
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
## Setup
Make sure to install the dependencies:
```bash
# npm
npm install
# pnpm
pnpm install
# yarn
yarn install
# bun
bun install
```
## Development Server
Start the development server on `http://localhost:3000`:
```bash
# npm
npm run dev
# pnpm
pnpm run dev
# yarn
yarn dev
# bun
bun run dev
```
## Production
Build the application for production:
```bash
# npm
npm run build
# pnpm
pnpm run build
# yarn
yarn build
# bun
bun run build
```
Locally preview production build:
```bash
# npm
npm run preview
# pnpm
pnpm run preview
# yarn
yarn preview
# bun
bun run preview
```
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
<template>
<div class='container'>
<NuxtPage />
</div>
</template>
<style scoped>
.container{
height: 100vh;
}
</style>
This diff is collapsed.
* {
margin: 0;
padding: 0;
}
.content{
background-color: #EFEFEF;
overflow: hidden;
height: 100%;
padding: 24px;
box-sizing: border-box;
}
.content .container{
/* border: 1px solid #BBBBBB; */
/* background-color: #ffffff; */
margin: 10px;
}
.content .container .form{
width: 100%;
}
.content .container .form .form-group {
width: 100%;
}
.content .container .form .form-group:nth-child(n+1) {
margin-top: 40px;
}
.content .container .form .form-group .form-group__label label{
font-size: 24px;
width: 100%;
border-bottom: 1px solid #ccc;
padding-bottom: 8px;
margin-bottom: 16px;
}
.content .container .form .form-group .form-group__label p{
font-size: 14px;
margin: 0 0 8px 0 ;
}
/* 表单组件 */
.form-group {}
.form-group .form-group__label > label {
display: flex;
justify-content: space-between;
}
.form-group .form-group__body {}
.form-group .form-group__body .form-group__item {
margin: 15px 0;
}
.form-group .form-group__body .form-group__item span:nth-of-type(1) {
display: block;
font-weight: bold;
margin-bottom: 6px;
}
.form-group .form-group__body .form-group__item span:nth-of-type(2) {}
/* Input 组件 */
input{
padding: 5px 12px;
font-size: 14px;
line-height: 20px;
color: #24292f;
vertical-align: middle;
border-radius: 6px;
background-color: #f6f8fa;
border: 1px solid #d0d7de;
}
input[disabled]{
color: var(--color-primer-fg-disabled);
background-color: var(--color-input-disabled-bg);
border-color: var(--color-border-default);
-webkit-text-fill-color: var(--color-primer-fg-disabled);
opacity: 1;
}
/* Button 组件 */
button{
position: relative;
display: inline-block;
padding: 5px 16px;
font-size: 14px;
font-weight: 500;
line-height: 20px;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
-webkit-user-select: none;
user-select: none;
border: 1px solid;
border-radius: 6px;
-webkit-appearance: none;
appearance: none;
}
button{
background-color: #f6f8fa;
color: #24292f;
border-color: rgba(27,31,36,.15);
}
button:hover{
background-color: #f3f4f6;
border-color: rgba(27,31,36,.15);
}
button.primary{
color: #fff;
background-color:#2c974b;
border-color: rgba(27,31,36,.15);
}
button[disabled] {
cursor:not-allowed;
background-color: #eee;
}
\ No newline at end of file
<template>
<span>
<slot />
</span>
</template>
\ No newline at end of file
<template>
<div id="app">
<div class='sidebar'>
<div class='logo'></div>
<div class='item'><NuxtLink to="/home">Home</NuxtLink></div>
<div class='item'><NuxtLink to="/git">Git</NuxtLink></div>
<div class='item'><NuxtLink to="/v2">V2</NuxtLink></div>
<div class='item'><NuxtLink to="/v1">V1</NuxtLink></div>
</div>
<div class='maintab'>
<slot></slot>
</div>
</div>
</template>
<style scoped>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
height: 100vh;
display: flex;
}
#app .sidebar{
width: 300px;
background-color: #333;
color: #fff;
}
#app .sidebar .logo{
height: 150px;
}
#app .sidebar .item {
height: 32px;
line-height: 32px;
font-size: 16px;
text-align: center;
cursor: pointer;
}
#app .sidebar a{
color: #fff;
text-decoration: none;
}
#app .sidebar .item:hover {
background-color: #6C6C6C;
}
#app .maintab{
flex: 1;
overflow: hidden;
}
</style>
import { useUserStore } from "~/store/user"
export default defineNuxtRouteMiddleware((to, from) => {
const user = useUserStore()
if (!user.username && to.path !== '/login') {
return navigateTo('/login')
}
})
\ No newline at end of file
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
modules: ['@pinia/nuxt'],
css: ['~/assets/css/main.css', '~/assets/css/color.css']
})
This diff is collapsed.
{
"name": "nuxt-app",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"@pinia/nuxt": "^0.5.1",
"lodash": "^4.17.21",
"nuxt": "^3.11.1",
"pinia": "^2.1.7",
"telnet-client": "^2.2.0",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
},
"devDependencies": {
"@types/lodash": "^4.17.0"
}
}
<template>
<section>
<p>此页面将显示在 /about 路由。</p>
</section>
</template>
\ No newline at end of file
This diff is collapsed.
<template>
<div>
<NuxtLayout />
</div>
</template>
\ No newline at end of file
<template>
<div class='login'>
<div class='logo'>
Welcome to Logwire Development
</div>
<div class='input'>
<input v-model='username' placeholder="请输入用户名"
@keydown.enter='handleLogin'
/>
</div>
<div class='button' @click='handleLogin'>
登录
</div>
</div>
</template>
<script lang="ts" setup>
import { useUserStore } from "@/store/user"
const username = ref('')
const userStore = useUserStore()
onMounted(() => {
username.value = localStorage.getItem('username') || ''
})
function handleLogin () {
if (/^[a-zA-Z]*$/.test(username.value) === false) {
alert('用户名只允许英文字母')
return
}
$fetch('/api/user/login', {
method: 'post',
body: { username: username.value }
}).then((value) => {
userStore.setUserName(username.value)
navigateTo('/home')
})
}
</script>
<style scoped>
.login{
height: 100%;
background-color: #101010;
text-align: center;
}
.logo{
color: #ccc;
font-size: 36px;
padding-top: 30vh;
margin-bottom: 50px;
}
.input{
width: 363px;
height: 32px;
margin: 0 auto;
margin-bottom: 68px;
}
.input input{
background-color: #333333;
border: 1xp solid #bbb;
color: #fff;
width: 100%;
outline: none;
box-sizing: border-box;
}
.button{
cursor: pointer;
width: 363px;
height: 32px;
line-height: 32px;
font-size: 16px;
color: #fff;
background-color: #6C6C6C;
border: 1px solid #BBBBBB;
margin: 0 auto;
}
</style>
\ No newline at end of file
<template>
<div>Post</div>
</template>
\ No newline at end of file
export default defineEventHandler((event) => {
let username = req.session.user as string || '1234'
let docker = createDockerFactory(username)
let container = await docker.checkContainer('logwire_backend_helper.' + username + '.node')
if (!container) {
// 不存在容器,则说明用户还没初始化
res.sendStatus(200)
return
}
let info = await container.inspect()
if (info.State.Running) {
// 正在运行,则认为正常
res.sendStatus(200)
} else {
LogUtil.print(username, `[progress] [[1;34mInfo[m] 服务器异常关闭,正在重启...... \n`)
await docker.startContainer({ container })
// 依次打开 nginx, 后端服务,vscode-web
try {
await docker.execContainerCommand({ container, cmd: 'lsof -i:80' })
} catch (err) {
try {
await docker.execContainerCommand({ container, cmd: 'nginx' })
LogUtil.print(username, `[progress] [[1;34mInfo[m] Nginx 重启成功...... \n`)
} catch (err) {
res.status(500).send(err)
}
}
try {
await docker.execContainerCommand({ container, cmd: 'lsof -i:8000' })
} catch (err) {
try {
docker.execContainerCommand({ container, cmd: 'code-server --bind-addr 127.0.0.1:8000 --auth none' })
LogUtil.print(username, `[progress] [[1;34mInfo[m] Vscode 重启成功...... \n`)
} catch (err) {
res.status(500).send(err)
}
}
try {
await docker.execContainerCommand({ container, cmd: 'pm2 delete backend' })
await docker.execContainerCommand({ container, cmd: 'pm2 delete gateway' })
} catch (err) {
}
await docker.execContainerCommand({ container, cmd: 'pm2 start --name gateway --no-autorestart java -- -Xms128m -Xmx128m -XX:+UseG1GC --add-opens java.base/sun.util.locale.provider=ALL-UNNAMED -jar logwire-gateway-starter.jar', dir: '/var/logwire-backend/build-output/gateway', quiet: true })
await docker.execContainerCommand({ container, cmd: `pm2 start --name backend --no-autorestart java -- -Xms128m -Xmx128m -XX:+UseG1GC -DVALIDATE_XML_ENABLED=false --add-opens java.base/sun.util.locale.provider=ALL-UNNAMED -jar logwire-backend-starter.jar`, dir: '/var/logwire-backend/build-output/backend', quiet: true })
LogUtil.print(username, `[progress] [[1;34mInfo[m] 服务重启成功...... \n`)
res.sendStatus(200)
}
})
\ No newline at end of file
export default defineEventHandler(async (event) => {
const session = await getSession(event, { password: '123456abcdefghijklmnopqrstuvwxyz'})
const username = 'wyq'
console.log('session', session)
let configs = getUserAllConfigs(username)
return configs
})
\ No newline at end of file
import { readJson, writeJson } from "../../utils"
import { getAvailableNodePort, getUserAllConfigs, getUserConfig } from "../../utils/server"
export default defineEventHandler(async (event) => {
try {
const body = await readBody(event)
const username = body.username
// 当用户数据文件没有 node-port 时,认为该用户还没有注册过
if (getUserConfig(username, 'node-port') === undefined) {
let host = process.env.NODE_ENV?.trim() === 'production' ? '192.168.0.4' : 'localhost'
const port = await getAvailableNodePort(host)
const userDefaultSetting = readJson('./server/files/default-user-setting.json')
const userSetting = Object.assign({}, userDefaultSetting, { "node-port": port })
userSetting['postgres']['database'] = username
userSetting['tenants']['id'] = username
userSetting['tenants']['host'] = `a.test.com:${23333+ (port - 30000)*2},a.test.com:${23334+(port-30000)*2}`
const userDataPath = `./server/data/${username}.json`
writeJson(userDataPath, userSetting)
}
return useSession(event, { name: username, password: '123456abcdefghijklmnopqrstuvwxyz' })
} catch (err) {
console.log(err)
throw createError({
statusCode: 500,
statusMessage: '登录失败'
})
}
})
\ No newline at end of file
{
"postgres": {
"visible": false,
"username": "postgres",
"password": "postgres",
"ip": "192.168.0.4",
"port": "25556",
"database": {
"username": "wyq"
},
"schema": "library"
},
"redis": {
"visible": false,
"ip": "192.168.0.4",
"port": "25557"
},
"zookeeper": {
"visible": false,
"ip": "192.168.0.4",
"port": "2182"
},
"rocketmq": {
"visible": false,
"ip": "192.168.0.4",
"port": "9876"
},
"tenants": {
"visible": false,
"id": {
"username": "wyq"
},
"host": "a.test.com:23333,a.test.com:23334",
"database-schema": "library",
"primary-namespace": "library"
},
"postgresV1": {
"visible": false,
"username": "postgres",
"password": "postgres",
"ip": "192.168.0.4",
"port": "25556",
"database": "logwirev2",
"schema": "library"
},
"redisV1": {
"visible": false,
"ip": "192.168.0.4",
"port": "25557"
},
"tenantsV1": {
"visible": false,
"id": "wongyaqi",
"port": 8080
},
"debug": {
"host": "192.168.1.94"
},
"node-port": 30000
}
\ No newline at end of file
{
"postgres": {
"visible": false,
"username": "postgres",
"password": "postgres",
"ip": "192.168.0.4",
"port": "25556",
"database": "wyq",
"schema": "library"
},
"redis": {
"visible": false,
"ip": "192.168.0.4",
"port": "25557"
},
"zookeeper": {
"visible": false,
"ip": "192.168.0.4",
"port": "2182"
},
"rocketmq": {
"visible": false,
"ip": "192.168.0.4",
"port": "9876"
},
"tenants": {
"visible": false,
"id": "wyq",
"host": "a.test.com:23335,a.test.com:23336,a.test.com:29000",
"database-schema": "library",
"primary-namespace": "library"
},
"node-port": 30001,
"status": "running",
"InstallSteps": [
"创建 node 容器",
"检查 SSH Key",
"创建 postgres 容器",
"创建 redis 容器",
"创建 zookeeper 容器",
"创建 rocketmq serv 容器",
"创建 rocketmq broker 容器",
"创建 node 容器",
"检查 SSH Key",
"创建 postgres 容器",
"创建 redis 容器",
"创建 zookeeper 容器",
"创建 rocketmq serv 容器",
"创建 rocketmq broker 容器",
"克隆仓库",
"更新源",
"安装 openjdk ",
"安装 maven ",
"修改 maven 源",
"安装 Wetty",
"安装 code-server ",
"安装 nginx ",
"安装 pm2 ",
"配置 nginx ",
"启动 wetty",
"启动 code-server ",
"启动 nginx ",
"初始化调试功能",
"初始化调试功能",
"初始化调试功能",
"初始化调试功能",
"初始化调试功能",
"初始化调试功能",
"初始化调试功能",
"v1-创建 postgres 容器",
"v1-克隆仓库",
"v1-创建 postgres 容器",
"v1-克隆仓库",
"v1-安装 openjdk ",
"v1-更换JDK"
],
"debug": {
"host": "192.168.1.94"
},
"serverProperties": [
{
"id": 0.9830334059659578,
"key": "logwire.security.encryption.key-management-system",
"value": "logwire-kms"
},
{
"id": 0.7282073911484346,
"key": "logwire.security.encryption.logwire-kms.master-key-passwords[0]",
"value": "logwire"
}
],
"v1-status": "created",
"postgresV1": {
"visible": false,
"username": "postgres",
"password": "postgres",
"ip": "192.168.0.4",
"port": "25556",
"database": "wyq_v1",
"schema": "library"
},
"serverPropertiesV1": [
{
"id": 0.7463455633624243,
"key": "logwire.tenants[0].designer.password",
"value": "c4ca4238a0b923820dcc509a6f75849b"
}
]
}
# 网关服务端口
server.port=9000
# 文件上传最大大小
spring.servlet.multipart.max-file-size=50MB
spring.servlet.multipart.max-request-size=100MB
# 默认错误处理 url
server.error.path=/error
#定制管理功能的 port, 如果端口为 -1 代表不暴露管理功能 over HTTP
management.server.port=-1
# 设定 /actuator 入口路径
management.endpoints.web.base-path=/actuator
management.endpoints.enabled-by-default=false
management.endpoints.web.exposure.include=health,prometheus,metrics,backend-prometheus
management.endpoint.health.enabled=true
management.endpoint.metrics.enabled=true
management.endpoint.prometheus.enabled=true
# 日志相关配置
logging.level.org.springframework=INFO
logging.level.io.netty=INFO
logging.level.com.zaxxer.hikari=INFO
logging.level.com.alibaba.excel=INFO
logging.level.io.lettuce=INFO
logging.level.org.hibernate=INFO
logging.level.org.eclipse=INFO
logging.level.org.apache.zookeeper=INFO
logging.level.org.springframework.boot.autoconfigure.logging=error
# MQ 相关配置
# MQ name service address; 默认值:localhost:9876
gateway.mq.name-srv-address=192.168.0.190:9876
# Gateway 请求 Backend 超时时间; 默认值:60000; 单位:毫秒
gateway.router-timeout=60000
# 环境类型; 默认值:dev; 可选值:dev; uat; prod;
gateway.environment-type=dev
# 是否开启 WebSocket 服务
gateway.web-socket-enabled=
# 注册中心地址; 默认值:127.0.0.1:2181
gateway.register-center-server-list=192.168.0.190:30003
# Coopwire 相关配置
# 是否连接到 Coopwire; 默认值:false
gateway.coopwire.connected=false
# 访问 Coopwire ClientId
gateway.coopwire.client-key=
# 访问 Coopwire security
gateway.coopwire.client-security=
# 异步请求回调 Coopwire 地址
gateway.coopwire.callback-url=
# 租户信息变更时通知 Coopwire 地址
gateway.coopwire.update-instances-url=
This diff is collapsed.
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = 192.168.0.190
\ No newline at end of file
{
"postgres": {
"visible": false,
"username": "postgres",
"password": "postgres",
"ip": "192.168.0.4",
"port": "25556",
"database": "logwirev2",
"schema": "library"
},
"redis": {
"visible": false,
"ip": "192.168.0.4",
"port": "25557"
},
"zookeeper": {
"visible": false,
"ip": "192.168.0.4",
"port": "2182"
},
"rocketmq": {
"visible": false,
"ip": "192.168.0.4",
"port": "9876"
},
"tenants": {
"visible": false,
"id": "wongyaqi",
"host": "a.test.com:23333,a.test.com:23334",
"database-schema": "library",
"primary-namespace": "library"
},
"postgresV1": {
"visible": false,
"username": "postgres",
"password": "postgres",
"ip": "192.168.0.4",
"port": "25556",
"database": "logwirev2",
"schema": "library"
},
"redisV1": {
"visible": false,
"ip": "192.168.0.4",
"port": "25557"
},
"tenantsV1": {
"visible": false,
"id": "wongyaqi",
"port": 8080
},
"debug": {
"host": "192.168.1.94"
}
}
\ No newline at end of file
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
stream {
upstream tcp {
server 127.0.0.1:8090;
}
upstream java {
server 127.0.0.1:6666;
}
map $remote_addr $upstream {
default tcp;
192.168.1.94 java;
}
server {
listen 8080;
proxy_pass $upstream;
ssl_preread on;
}
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
server {
listen 8090;
server_name localhost;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location /download {
alias /var/logwire-backend/build-output;
sendfile on;
autoindex on;
autoindex_exact_size on;
autoindex_localtime on;
charset utf-8;
}
location /wetty {
proxy_pass http://127.0.0.1:3001;
}
location /api/ {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $http_host;
client_max_body_size 0;
}
location /vscode {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
# v1
location /message {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $http_host;
client_max_body_size 0;
}
location /api {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $http_host;
client_max_body_size 0;
}
location /logout {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $http_host;
client_max_body_size 0;
}
location /assets {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $http_host;
client_max_body_size 0;
}
location /otm-dev {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $http_host;
client_max_body_size 0;
}
location /password {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $http_host;
client_max_body_size 0;
}
location /auth {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $http_host;
client_max_body_size 0;
}
location /t/t01 {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $http_host;
client_max_body_size 0;
}
location /sso {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $http_host;
client_max_body_size 0;
}
location /handler {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $http_host;
client_max_body_size 0;
}
location /checkServiceTicket {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $http_host;
client_max_body_size 0;
}
}
}
console
console
\ No newline at end of file
<settingsSecurity>
<master>{7CLISaeYZroH4Y3HBeEfUKAzjPE+gH9GS21IzKThGRw=}</master>
</settingsSecurity>
\ No newline at end of file
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>nexus.grea.member</id>
<mirrorOf>*</mirrorOf>
<url>https://nexus.logwire.cn/repository/member/</url>
</mirror>
</mirrors>
<servers>
<server>
<id>nexus.grea.member</id>
<username>wongyaqi</username>
<password>{Nlckr1Vtk3YHhlCpns97jtI6uuSzilAw/wpj7MGHuZQ=}</password>
</server>
<server>
<id>nexus.grea.releases</id>
<username>wongyaqi</username>
<password>{Nlckr1Vtk3YHhlCpns97jtI6uuSzilAw/wpj7MGHuZQ=}</password>
</server>
<server>
<id>nexus.grea.snapshots</id>
<username>wongyaqi</username>
<password>{Nlckr1Vtk3YHhlCpns97jtI6uuSzilAw/wpj7MGHuZQ=}</password>
</server>
<server>
<id>nexus.grea.thirdparty</id>
<username>wongyaqi</username>
<password>{Nlckr1Vtk3YHhlCpns97jtI6uuSzilAw/wpj7MGHuZQ=}</password>
</server>
</servers>
</settings>
\ No newline at end of file
# Spring DataSource
spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/tms
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jta.atomikos.datasource.test-query=select 1
#spring.datasource.url=jdbc:oracle:thin:@192.168.0.16:1521:orcl
#spring.datasource.username=cevademo
#spring.datasource.password=cevademo
#spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
#spring.jta.atomikos.datasource.test-query=select 1 from dual
#spring.datasource.url=jdbc:oracle:thin:@139.196.102.147:1521:otmppt
#spring.datasource.username=CMTOWNER
#spring.datasource.password=CMTOWNER
#spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
#spring.jta.atomikos.datasource.test-query=select 1 from dual
#logwire.otm-single-sign-on-urls[0]=http://139.196.136.1:7779/GC3/bridge.jsp
#logwire.otm-single-sign-on-urls[1]=http://139.196.136.2:7779/GC3/bridge.jsp
logwire.otm-vpd-aware=true
logwire.otm-vpd-call=LW_SET_USER
#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/world
#spring.datasource.username=root
#spring.datasource.password=password
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.jta.atomikos.datasource.test-query=select 1
# JTA connection pool
# Properties of com.atomikos.jdbc.AbstractDataSourceBean
spring.jta.atomikos.datasource.max-pool-size=20
spring.jta.atomikos.datasource.min-pool-size=2
# Spring Web
spring.mvc.staticPathPattern=/static/**
# Spring Resources for development
spring.resources.staticLocations=file:./src/main/resources/static/,classpath:/static/
# Spring Jackson
spring.jackson.deserialization.USE_BIG_DECIMAL_FOR_FLOATS=true
# Spring FreeMarker
spring.freemarker.cache=false
spring.freemarker.prefer-file-system-access=false
spring.freemarker.template-loader-path=file:./src/main/resources/templates/,classpath:/templates/
# Spring http upload
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
# Spring Logging
logging.file=./logs/logwire-web.log
logging.pattern.level=%5p/%5X{tenant}
logging.level.org.springframework=INFO
logging.level.com.atomikos=WARN
logging.level.com.atomikos.jdbc.AtomikosDataSourceBean=INFO
logging.level.logwire=DEBUG
# JTA
spring.jta.atomikos.properties.enable-logging=false
# default 30000 ms
spring.jta.atomikos.properties.default-jta-timeout=300000
spring.jta.atomikos.properties.max-timeout=300000
spring.jta.atomikos.properties.console-log-level=WARN
spring.jta.atomikos.properties.console-file-count=10
# 10 mb
spring.jta.atomikos.properties.console-file-limit=10485760
## SQLs to grant, log on sys as sysdba to grant
## grant select on sys.dba_pending_transactions to <user name>;
## grant select on sys.pending_trans$ to <user name>;
## grant select on sys.dba_2pc_pending to <user name>;
## grant execute on sys.dbms_system to <user name>;
# JWT
jwt.header=Authentication
jwt.secret=my-secret
jwt.expiration=3600
jwt.route.authentication.login=/api/auth/login
jwt.route.authentication.refresh=/api/auth/refresh
jwt.route.authentication.role=/api/auth/role
jwt.weixin.header=WeixinAuthentication
jwt.weixin.secret=my-secret-weixin
jwt.weixin.expiration=3600
# Web Server
# server.port = 8080
server.compression.enabled=true
server.compression.min-response-size=2048
server.compression.mime-types=application/json,application/javascript,text/css,text/csv
# LogWire Properties class
logwire.enable-vpd=false
logwire.task-schedule-mode=redisson
logwire.admin-user-gid=DEFAULT.ADMIN
logwire.weixin-oauth-access-token-uri=https://api.weixin.qq.com/sns/oauth2/access_token
logwire.weixin-cgi-bin-material-uri=https://api.weixin.qq.com/cgi-bin/media/get
# logwire.otm-single-sign-on-url=http://139.196.136.1:7779/GC3/bridge.jsp
logwire.default-tenant-id=t01
logwire.projects-base-dir=./projects
logwire.tenants[0].id=t01
logwire.tenants[0].dir=./projects/t01,./projects/core
#logwire.tenants[0].dir=/Users/gang/Git/grea/QFKD
#logwire.tenants[0].id=ac
#logwire.tenants[0].dir=C:/Users/jerry.deng/git/anjiceva
#logwire.tenants[0].id=cmt
#logwire.tenants[0].dir=D:/Projects/cmt/project
#logwire.tenants[0].id=ceva
#logwire.tenants[0].dir=C:/Users/jerry.deng/git/anjiceva
server.port=9000
# pg??
spring.datasource.url=jdbc:postgresql://192.168.0.4:25556/wongyaqi
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.datasource.driver-class-name=org.postgresql.Driver
spring.servlet.multipart.max-file-size=1024KB
# redis ???????db0
spring.redis.database=0
# redis ??
#spring.redis.password=
# redis ??
spring.redis.port=25557
# redis host
spring.redis.host=192.168.0.4
# ??????
logwire.jod-converter.enabled=false
logwire.jod-converter.host=192.168.0.25
logwire.jod-converter.port=2002
logwire.projects-base-dir=./projects
# ?????
logwire.multiple-tenants=false
# ??????
logwire.use-multi-db-schemas=true
#????
logwire.default-tenant-id=t01
logwire.tenants[0].id=t01
logwire.tenants[0].host=t01.com:8080
logwire.tenants[0].dir=./projects/demo
logwire.tenants[0].lib-dir=./product
logwire.tenants[0].designer.username=admin
logwire.tenants[0].designer.password=21232F297A57A5A743894A0E4A801FC3
# op-manager ???????
# admin/admin
logwire.tenants[0].op-manager.username=admin
logwire.tenants[0].op-manager.password=21232F297A57A5A743894A0E4A801FC3
# ????
logwire.production-mode=false
logwire.install-on-boot=true
logwire.enable-task-schedule=true
#??????????(????)
logwire.tenants[0].password-recover-enabled=true
#????
logwire.tenants[0].application-name=\u6d4b\u8bd5
logwire.tenants[0].mail.username=zhenglechao@logwirecloud.com
logwire.tenants[0].mail.host=smtp.mxhichina.com
logwire.tenants[0].mail.password=flzx.3qc
logwire.tenants[0].mail.protocol=smtp
logwire.tenants[0].mail.encoding=utf-8
#obs
logwire.document-storage-type=obs
logwire.obs.bucket-name=platform-dev
logwire.obs.end-point=obs.cn-east-3.myhuaweicloud.com
logwire.obs.access-key-id=BLVYTFIPDZDN57ZTCQ5K
logwire.obs.access-key-secret=kPaWoZdyaLQVGYQo0PPTIpwHQi0SaDIE1pmE0itZ
#azure-blob
#logwire.document-storage-type=blob
#logwire.blob.account-name=logwireblob
#logwire.blob.account-key=/5R7rO6JY8zCeXOnk212TB6CQsgLzBtXQLtb1MEg3DzKWuwzqAbUTWQgHjbpt97R5oQNoy2us6J+OnfwO5UO2g==
#logwire.blob.end-point=core.chinacloudapi.cn
#logwire.blob.protocol=https
# jwt???
#logwire.tenants[0].jwt-config.black-list-enabled=true
#logwire.max-content-size=1B
#logwire.tenants[0].max-content-size=1B
logwire.security.master-key.password=abc
jwt.secret=1234
# 6.x elasticsearch ??
#logwire.record-operation-log=true
#spring.data.elasticsearch.cluster-name=elasticsearch
#spring.data.elasticsearch.cluster-nodes=192.168.0.25:9300
# 7.x elasticsearch ??
#spring.elasticsearch.rest.uris=192.168.0.4:9200,192.168.0.4:9202,192.168.0.4:9203
#spring.elasticsearch.rest.username=elastic
#spring.elasticsearch.rest.password=Welc0me1
# logwire??????
# ????????????
logwire.memory-monitor.enabled=true
# dump???????????
logwire.memory-monitor.dump-path=./
# ?????????? 70%
logwire.memory-monitor.heap-percent-limit=70
# ??????????? 80%
logwire.memory-monitor.non-heap-percent-limit=80
# ?? gc ????????
logwire.gc-monitor.enabled=true
# dump???????????
logwire.gc-monitor.dump-path=./
logwire.tenants[0].coopwire.feedback-enabled=false
logwire.coopwire.auth-url=https://auth.local.logwire.cn:52006
logwire.coopwire.base-url=https://dev9302.local.logwire.cn:52006
logwire.tenants[0].coopwire.client-id=63f46933a4136d3a9d052b88
logwire.tenants[0].coopwire.client-secret=t9iaLzqOZdsenHUpmmeFpx6cOgnDSd80
logwire.tenants[0].weixin-config[wyq].appid=wxf9d16cb9cb3d28b4
logwire.tenants[0].weixin-config[wyq].secret=98cbc45201345f40182e4bd018d00487
logwire.tenants[0].weixin-config[default].appid=wxf9d16cb9cb3d28b4
logwire.tenants[0].weixin-config[default].secret=98cbc45201345f40182e4bd018d00487
logwire.tenants[0].weixin-config[gongzhonghao].appid=wxf9d16cb9cb3d28b4
logwire.tenants[0].weixin-config[gongzhonghao].secret=98cbc45201345f40182e4bd018d00487
\ No newline at end of file
zh_CN.UTF-8 UTF-8
\ No newline at end of file
export default defineEventHandler((event) => {
// console.log(event)
})
\ No newline at end of file
{
"extends": "../.nuxt/tsconfig.server.json"
}
import fs from 'fs'
import path from 'path'
export function readJson(path: string): Record<string, any> {
try {
const text = fs.readFileSync(path, { encoding: 'utf-8'})
const obj = JSON.parse(text)
return obj
} catch (err) {
return {}
}
}
export function writeJson(path: string, obj: Record<string, string>) {
fs.writeFileSync(
path,
JSON.stringify(obj, null, 2)
)
}
\ No newline at end of file
import path from 'path'
import fs from 'fs'
import lodash from 'lodash'
import { Telnet } from 'telnet-client'
export function getUserConfig (username: string, config: string) {
let jsonPath = path.resolve('./server/data/' + username + '.json')
try {
let jsonStr = fs.readFileSync(jsonPath, { encoding: 'utf-8' })
let json = JSON.parse(jsonStr) || {}
return lodash.get(json, config)
} catch (err: any) {
console.log(err)
}
}
// 在目标服务器上,获取 node 可用的端口
export async function getAvailableNodePort (ip: string, startPort = 30000) {
const tryPortAvailable = async function (port: number): Promise<number> {
let telnet = new Telnet()
const params = {
host: ip,
port: port,
negotiationMandatory: false,
timeout: 1500
}
try {
await telnet.connect(params)
telnet.end()
return tryPortAvailable(port + 1)
} catch (err) {
return port
}
}
return tryPortAvailable(startPort)
}
export function getUserAllConfigs (username: string): Record<string, string> {
let jsonPath = path.resolve('./server/data/' + username + '.json')
let jsonStr = fs.readFileSync(jsonPath, { encoding: 'utf-8' })
let json = JSON.parse(jsonStr) || {}
return json
}
\ No newline at end of file
import { defineStore } from 'pinia'
export const useUserStore = defineStore('user', () => {
const username = ref('')
const config = ref({})
function setUserName (name: string) {
username.value = name
}
function setUserConfig (name: string, obj: Object) {
config.value = obj
username.value = name
}
return { username, config, setUserName, setUserConfig }
})
\ No newline at end of file
{
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment