feat: auto update shell

feat: change client dist dir
feat: chat emoji
feat: custom websocket host
feat: update icon
feat: update layui.js
fix: socket id equel 0 error
This commit is contained in:
https://blog.iamtsm.cn
2023-09-09 15:02:18 +08:00
parent a5ae9d98e7
commit 9f5d912110
48 changed files with 700 additions and 56 deletions

View File

@@ -0,0 +1,102 @@
#!/bin/bash
#########################
# 提供一键部署http服务环境的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
# Function to install Node.js 16
install_node() {
echo "======>Node.js is not installed. Installing Node.js 16..."
curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash -
sudo yum install -y nodejs
echo "======>Node.js 16 installed"
}
# Function to install pm2 globally
install_pm2() {
echo "======>pm2 is not installed. Installing pm2 globally..."
sudo npm install -g pm2
echo "======>pm2 installed"
}
# Function to install lsof
install_lsof() {
echo "======>lsof is not installed. Installing lsof..."
sudo yum install -y lsof
echo "======>lsof installed"
}
# Wait for a command to become available
wait_for_command() {
command="$1"
while ! command -v $command &> /dev/null; do
sleep 1
done
}
# Step 1: Check if sudo is installed and install if not
if ! command -v sudo &> /dev/null; then
echo "======>sudo is not installed. Installing sudo..."
yum install -y sudo
fi
# Step 2: Check if curl is installed
if ! command -v curl &> /dev/null; then
echo "======>curl is not installed. Installing curl..."
sudo yum install -y curl
fi
# Step 3: Check if Node.js is installed and install Node.js 16 if not
if ! command -v node &> /dev/null; then
install_node
else
echo "======>Node.js is already installed"
fi
# Wait for Node.js to be installed
wait_for_command node
# Step 4: Output Node.js and npm versions
node_version=$(node -v)
npm_version=$(npm -v)
echo "======>Node.js version: $node_version"
echo "======>npm version: $npm_version"
# Step 5: Check if pm2 is installed and install it globally if not
if ! command -v pm2 &> /dev/null; then
install_pm2
else
echo "======>pm2 is already installed"
fi
# Wait for pm2 to be installed
wait_for_command pm2
# Step 6: Check if lsof is installed and install if not
if ! command -v lsof &> /dev/null; then
install_lsof
else
echo "======>lsof is already installed"
fi
# Step 7: Check if ports 9092 and 8444 are occupied
port_9092_in_use=$(sudo lsof -i :9092 | grep LISTEN | wc -l)
port_8444_in_use=$(sudo lsof -i :8444 | grep LISTEN | wc -l)
if [ "$port_9092_in_use" -gt 0 ] || [ "$port_8444_in_use" -gt 0 ]; then
echo "======>Port 9092 or 8444 is already in use."
exit 1
fi
# Step 8: install npm packages
echo "Ready to install npm packages"
cd ../../svr/
rm package-lock.json
npm install --registry=https://registry.npmmirror.com
# Step 9: Run start-http.sh script to start the service
echo "Ready to run auto-start-http.sh"
sleep 1
/bin/bash ./../bin/ubuntu16/auto-start-http.sh

View File

@@ -0,0 +1,102 @@
#!/bin/bash
#########################
# 提供一键部署https服务环境的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
# Function to install Node.js 16
install_node() {
echo "======>Node.js is not installed. Installing Node.js 16..."
curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash -
sudo yum install -y nodejs
echo "======>Node.js 16 installed"
}
# Function to install pm2 globally
install_pm2() {
echo "======>pm2 is not installed. Installing pm2 globally..."
sudo npm install -g pm2
echo "======>pm2 installed"
}
# Function to install lsof
install_lsof() {
echo "======>lsof is not installed. Installing lsof..."
sudo yum install -y lsof
echo "======>lsof installed"
}
# Wait for a command to become available
wait_for_command() {
command="$1"
while ! command -v $command &> /dev/null; do
sleep 1
done
}
# Step 1: Check if sudo is installed and install if not
if ! command -v sudo &> /dev/null; then
echo "======>sudo is not installed. Installing sudo..."
yum install -y sudo
fi
# Step 2: Check if curl is installed
if ! command -v curl &> /dev/null; then
echo "======>curl is not installed. Installing curl..."
sudo yum install -y curl
fi
# Step 3: Check if Node.js is installed and install Node.js 16 if not
if ! command -v node &> /dev/null; then
install_node
else
echo "======>Node.js is already installed"
fi
# Wait for Node.js to be installed
wait_for_command node
# Step 4: Output Node.js and npm versions
node_version=$(node -v)
npm_version=$(npm -v)
echo "======>Node.js version: $node_version"
echo "======>npm version: $npm_version"
# Step 5: Check if pm2 is installed and install it globally if not
if ! command -v pm2 &> /dev/null; then
install_pm2
else
echo "======>pm2 is already installed"
fi
# Wait for pm2 to be installed
wait_for_command pm2
# Step 6: Check if lsof is installed and install if not
if ! command -v lsof &> /dev/null; then
install_lsof
else
echo "======>lsof is already installed"
fi
# Step 7: Check if ports 9092 and 8444 are occupied
port_9092_in_use=$(sudo lsof -i :9092 | grep LISTEN | wc -l)
port_8444_in_use=$(sudo lsof -i :8444 | grep LISTEN | wc -l)
if [ "$port_9092_in_use" -gt 0 ] || [ "$port_8444_in_use" -gt 0 ]; then
echo "======>Port 9092 or 8444 is already in use."
exit 1
fi
# Step 8: install npm packages
echo "Ready to install npm packages"
cd ../../svr/
rm package-lock.json
npm install --registry=https://registry.npmmirror.com
# Step 9: Run start-https.sh script to start the service
echo "Ready to run auto-start-https.sh"
sleep 1
/bin/bash ./../bin/ubuntu16/auto-start-https.sh

17
bin/centeros/auto-start-http.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
#########################
# 提供pm2启动管理http服务的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
pm2 start npm --name=tl-rtc-file-api -- run http-api
sleep 1
pm2 start npm --name=tl-rtc-file-socket -- run http-socket
sleep 1
npm run build:pro

View File

@@ -0,0 +1,17 @@
#!/bin/bash
#########################
# 提供pm2启动管理https服务的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
pm2 start npm --name=tl-rtc-file-api -- run https-api
sleep 1
pm2 start npm --name=tl-rtc-file-socket -- run https-socket
sleep 1
npm run build:pro

13
bin/centeros/auto-stop.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
#########################
# 提供pm2删除停止服务的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
pm2 del tl-rtc-file-api
pm2 del tl-rtc-file-socket
echo "stop and [tl-rtc-file-api] / [tl-rtc-file-socket] pm2 processes ok"

View File

@@ -0,0 +1,36 @@
#!/bin/bash
#########################
# 提供一键更新项目代码版本的脚本
# @auther: iamtsm
# @version: v1.0.0
#########################
# Check if the current directory is a Git repository
if [ -d .git ]; then
# The current directory is a Git repository, so we can pull the latest changes
echo "Current directory is a Git repository. Pulling latest changes..."
git pull
else
# The current directory is not a Git repository
echo "Current directory is not a Git repository."
# Check if Git is installed
if ! command -v git &> /dev/null; then
# Git is not installed, so let's try to install it
echo "Git is not installed. Installing Git..."
sudo yum install -y git
fi
# Initialize a new Git repository and set the remote URL
echo "Initializing a new Git repository and setting remote URL..."
git init
git remote add origin https://github.com/tl-open-source/tl-rtc-file.git
# Pull the latest changes from the remote repository (use 'master' branch)
git pull origin master
# Optionally, you can set the default branch to 'master'
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master
fi
echo "Done."

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供一键部署http服务环境的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
# Function to install Node.js 16
install_node() {

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供一键部署https服务环境的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
# Function to install Node.js 16
install_node() {

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供pm2启动管理http服务的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
pm2 start npm --name=tl-rtc-file-api -- run http-api

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供pm2启动管理https服务的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
pm2 start npm --name=tl-rtc-file-api -- run https-api

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供pm2删除停止服务的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
pm2 del tl-rtc-file-api

View File

@@ -0,0 +1,37 @@
#!/bin/bash
#########################
# 提供一键更新项目代码版本的脚本
# @auther: iamtsm
# @version: v1.0.0
#########################
# Check if the current directory is a Git repository
if [ -d .git ]; then
# The current directory is a Git repository, so we can pull the latest changes
echo "Current directory is a Git repository. Pulling latest changes..."
git pull
else
# The current directory is not a Git repository
echo "Current directory is not a Git repository."
# Check if Git is installed
if ! command -v git &> /dev/null; then
# Git is not installed, so let's try to install it
echo "Git is not installed. Installing Git..."
sudo apt-get update
sudo apt-get install -y git # Adjust this for CentOS or other Linux distributions
fi
# Initialize a new Git repository and set the remote URL
echo "Initializing a new Git repository and setting remote URL..."
git init
git remote add origin https://github.com/tl-open-source/tl-rtc-file.git
# Pull the latest changes from the remote repository (use 'master' branch)
git pull origin master
# Optionally, you can set the default branch to 'master'
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master
fi
echo "Done."

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供一键部署http服务环境的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
# Function to install Node.js 16
install_node() {

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供一键部署https服务环境的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
# Function to install Node.js 16
install_node() {

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供pm2启动管理http服务的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
pm2 start npm --name=tl-rtc-file-api -- run http-api

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供pm2启动管理https服务的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
pm2 start npm --name=tl-rtc-file-api -- run https-api

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供pm2删除停止服务的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
pm2 del tl-rtc-file-api

View File

@@ -0,0 +1,37 @@
#!/bin/bash
#########################
# 提供一键更新项目代码版本的脚本
# @auther: iamtsm
# @version: v1.0.0
#########################
# Check if the current directory is a Git repository
if [ -d .git ]; then
# The current directory is a Git repository, so we can pull the latest changes
echo "Current directory is a Git repository. Pulling latest changes..."
git pull
else
# The current directory is not a Git repository
echo "Current directory is not a Git repository."
# Check if Git is installed
if ! command -v git &> /dev/null; then
# Git is not installed, so let's try to install it
echo "Git is not installed. Installing Git..."
sudo apt-get update
sudo apt-get install -y git # Adjust this for CentOS or other Linux distributions
fi
# Initialize a new Git repository and set the remote URL
echo "Initializing a new Git repository and setting remote URL..."
git init
git remote add origin https://github.com/tl-open-source/tl-rtc-file.git
# Pull the latest changes from the remote repository (use 'master' branch)
git pull origin master
# Optionally, you can set the default branch to 'master'
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master
fi
echo "Done."

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供一键部署http服务环境的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
# Function to install Node.js 16
install_node() {

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供一键部署https服务环境的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
# Function to install Node.js 16
install_node() {

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供pm2启动管理http服务的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
pm2 start npm --name=tl-rtc-file-api -- run http-api

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供pm2启动管理https服务的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
pm2 start npm --name=tl-rtc-file-api -- run https-api

View File

@@ -1,4 +1,10 @@
#!/bin/bash
#########################
# 提供pm2删除停止服务的脚本
# 包含api服务,socket服务
# @auther: iamtsm
# @version: v1.0.0
#########################
pm2 del tl-rtc-file-api

View File

@@ -0,0 +1,37 @@
#!/bin/bash
#########################
# 提供一键更新项目代码版本的脚本
# @auther: iamtsm
# @version: v1.0.0
#########################
# Check if the current directory is a Git repository
if [ -d .git ]; then
# The current directory is a Git repository, so we can pull the latest changes
echo "Current directory is a Git repository. Pulling latest changes..."
git pull
else
# The current directory is not a Git repository
echo "Current directory is not a Git repository."
# Check if Git is installed
if ! command -v git &> /dev/null; then
# Git is not installed, so let's try to install it
echo "Git is not installed. Installing Git..."
sudo apt-get update
sudo apt-get install -y git # Adjust this for CentOS or other Linux distributions
fi
# Initialize a new Git repository and set the remote URL
echo "Initializing a new Git repository and setting remote URL..."
git init
git remote add origin https://github.com/tl-open-source/tl-rtc-file.git
# Pull the latest changes from the remote repository (use 'master' branch)
git pull origin master
# Optionally, you can set the default branch to 'master'
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/master
fi
echo "Done."

View File

@@ -16,7 +16,7 @@ const pathResolve = (path: string) => resolve(__dirname, path);
// https://vitejs.dev/config/
export default defineConfig({
build: {
outDir: resolve(__dirname, '../../../client_dist/rtc-web'),
outDir: resolve(__dirname, '../../dist/rtc-web'),
minify: 'terser',
emptyOutDir: true,
terserOptions: {

View File

@@ -1,25 +0,0 @@
# 常见问题
##
```
```
##
```
```
##
```
```
##
```
```

View File

@@ -1,5 +1,5 @@
{
"version": "10.4.7",
"version": "10.4.8",
"socket": {
"port": "请到 tlrtcfile.env 中进行配置",
"host": "请到 tlrtcfile.env 中进行配置"
@@ -13,7 +13,7 @@
"router.js"
]
},
"res": {
"res" : {
"/": "res/dist/"
}
}

View File

@@ -1178,6 +1178,29 @@ body {
color: #79b0e8;
}
.layui-util-face ul li img{
width: 100%;
margin-top: -2px;
}
.layui-tl-img{
width: 100px;
}
body .layui-util-face .layui-layer-content{
border-radius: 8px;
}
.layui-util-face ul{
width: auto;
border-radius: 8px;
}
#chating_room_tpl_view img, #chating_room_single_tpl_view img, #chating_comm_tpl_view img{
width: 30px;
}
/* 500px以下 */
@media screen and (max-width: 500px) {
.tl-rtc-file-send-txt-tool-send{

View File

@@ -111,7 +111,7 @@
<a href="https://im.iamtsm.cn/document" target="_blank">
<svg class="icon" aria-hidden="true" style="width: 24px;height: 24px;margin-right: 10px;">
<use xlink:href="#icon-rtc-file-shu"></use>
<use xlink:href="#icon-rtc-file-shu1"></use>
</svg>
</a>
@@ -141,7 +141,7 @@
<i class="layui-icon layui-icon-about"></i>
</a>
<a :title="lang.setting" @click="setting()" v-show="switchDataGet">
<a :title="lang.setting" @click="setting()">
<i id="setting" class="layui-icon layui-icon-set"></i>
</a>

View File

@@ -10,6 +10,8 @@ var file = null;
// 是否禁用中继
let useTurn = (window.localStorage.getItem("tl-rtc-file-use-relay") || "") === 'true';
// 是否是自定义ws地址
let useCustomWsHost = window.localStorage.getItem("tl-rtc-file-custom-ws-host") || "";
axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
let resData = initData.data;
@@ -19,6 +21,9 @@ axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
data: function () {
let socket = null;
if (io) {
if(useCustomWsHost){
resData.wsHost = useCustomWsHost;
}
socket = io(resData.wsHost,{
transports : ['polling', 'websocket']
});
@@ -31,6 +36,8 @@ axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
socket: socket, // socket
config: resData.rtcConfig, // rtc配置
options: resData.options, // rtc配置
wsHost : resData.wsHost, // ws地址
useCustomWsHost : useCustomWsHost, // 自定义ws地址
showReceiveFile: false, // 展示底部接收文件列表
showSendFile: false, // 展示底部发送文件列表
@@ -677,7 +684,7 @@ axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
success: function (layero, index) {
if (window.layedit) {
that.txtEditId = layedit.build('chating_room_single_value', {
tool: ['strong', 'italic', 'underline', 'del', '|', 'left', 'center', 'right'],
tool: ['strong', 'italic', 'underline', 'del', '|', 'left', 'center', 'right', 'face'],
height: 120
});
}
@@ -1354,6 +1361,14 @@ axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
<cite>${this.lang.webrtc_check}</cite>
</a>
</li>
<li class="layui-col-xs4">
<a title="${this.lang.custom_ws_url}" onclick="customWsHost()" >
<svg class="icon" aria-hidden="true" style="width:42px;height:50px;" id="sendBugs">
<use xlink:href="#icon-rtc-file-WSshipinjiankong"></use>
</svg>
<cite>${this.lang.custom_ws_url}</cite>
</a>
</li>
<li class="layui-col-xs4" style="${this.switchData.openTurnServer ? '' : 'display:none;'}">
<a title="${this.lang.relay_setting}" onclick="relaySetting()">
<svg class="icon" aria-hidden="true" style="width:42px;height:50px;">
@@ -1389,6 +1404,36 @@ axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
})
this.addUserLogs(this.lang.open_setting)
},
// 自定义ws地址
customWsHost: function () {
let that = this;
if(window.localStorage.getItem("tl-rtc-file-custom-ws-host")){
window.localStorage.removeItem("tl-rtc-file-custom-ws-host")
layer.msg(that.lang.close_custom_ws_url)
setTimeout(() => {
window.location.reload()
}, 500);
}else{
layer.prompt({
formType: 0,
value: 'wss://',
title: that.lang.input_custom_ws_url,
}, function (value, index, elem) {
if(!/^wss?:\/\/[^\s/$.?#].[^\s]*$/.test(value)){
layer.msg(that.lang.ws_url_error)
return
}
layer.close(index);
window.localStorage.setItem("tl-rtc-file-custom-ws-host", value)
layer.msg(that.lang.open_custom_ws_url)
setTimeout(() => {
window.location.reload()
}, 500);
});
}
},
// 打开中继设置面板
relaySetting: function () {
let options = {
@@ -1894,11 +1939,25 @@ axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
let lIndex = layer.load(1);
setTimeout(() => {
layer.close(lIndex)
that.chatingCommTpl();
}, 300);
if (window.layer && window.layui && window.layedit) {
that.txtEditId = layedit.build('chating_comm_value', {
tool: ['strong', 'italic', 'underline', 'del', 'face'],
height: 120
});
}
that.chatingCommTpl();
if(window.tlrtcfile.chatKeydown){
tlrtcfile.chatKeydown(document.getElementById("chating_comm_value"), sendChatingComm)
let textareaIframe = document.getElementsByTagName("iframe");
if(textareaIframe && textareaIframe.length === 1){
tlrtcfile.chatKeydown(
document.getElementsByTagName("iframe")[0].contentDocument.body,
sendChatingComm
)
}
}
},
content: `
@@ -1911,7 +1970,7 @@ axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
<a > <img style="width: 32px; height: 32px;" src="/image/44826979.png" alt="img"> </a>
<div style="margin-left: 15px; margin-top: -5px;">
<div style="word-break: break-all;"> <small>${this.lang.room}: <b>{{info.room}}</b></small> - <small>${this.lang.user}: <b>{{info.socketId}}</b></small> - <small>${this.lang.time}: <b>{{info.timeAgo}}</b></small> </div>
<div style="margin-top: 5px;word-break: break-all;">说: <b style="font-weight: bold; font-size: large;"> {{info.msg}} </b></div>
<div style="margin-top: 5px;word-break: break-all;">说: <b style="font-weight: bold; font-size: large;"> {{- info.msg}} </b></div>
</div>
</div>
{{# }); }}
@@ -1950,9 +2009,9 @@ axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
let height = 0;
if (this.isMobile) {
height = document.documentElement.clientHeight - 235;
height = document.documentElement.clientHeight - 335;
} else {
height = 350
height = 300
}
if (chatDomHeight > height) {
@@ -1985,26 +2044,31 @@ axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
this.addUserLogs(this.lang.please_join_then_send)
return
}
let content = document.querySelector("#chating_comm_value").value;
if (content === '' || content === undefined) {
let realContent = layedit.getContent(this.txtEditId)
if (realContent.length <= 0) {
layer.msg(this.lang.please_fill_content)
this.addUserLogs(this.lang.please_fill_content)
return
}
if (content.length > 1000) {
if (realContent.length > 1000) {
layer.msg(this.lang.content_max_1000)
this.addUserLogs(this.lang.content_max_1000)
return
}
this.socket.emit('chatingComm', {
msg: tlrtcfile.escapeStr(content),
msg: tlrtcfile.escapeStr(realContent),
room: this.roomId,
socketId: this.socketId,
});
this.addUserLogs(this.lang.public_channel_send_done);
document.querySelector("#chating_comm_value").value = ''
this.chatingCommTpl();
layedit.setContent(this.txtEditId, "", false)
},
// 房间内群聊弹窗
openChatingRoom: function () {
@@ -2020,7 +2084,7 @@ axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
success: function (layero, index) {
if (window.layer && window.layui && window.layedit) {
that.txtEditId = layedit.build('chating_room_value', {
tool: ['strong', 'italic', 'underline', 'del', '|', 'left', 'center', 'right'],
tool: ['strong', 'italic', 'underline', 'del', '|', 'left', 'center', 'right', 'face'],
height: 120
});
}
@@ -3505,8 +3569,8 @@ axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
this.socket.on('connect_error', error => {
console.error('connect_error', error);
if(error){
layer.msg(that.lang.socketConnectFail + error.message);
that.addSysLogs(that.lang.socketConnectFail + error.message);
layer.msg(that.lang.socketConnectFail + "[" + that.wsHost + "], " + error.message );
that.addSysLogs(that.lang.socketConnectFail + "[" + that.wsHost + "], " + error.message);
}
that.socketHeartbeatFaild += 1;
that.addSysLogs(that.lang.websocketHeartBeatCheckFail + ": " + that.socketHeartbeatFaild);
@@ -4310,6 +4374,9 @@ axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
window.Bus.$on("relaySetting", (res) => {
this.relaySetting()
})
window.Bus.$on("customWsHost", (res) => {
this.customWsHost()
})
window.Bus.$on("addSysLogs", (res) => {
this.addSysLogs(res)
})
@@ -4545,6 +4612,11 @@ axios.get("/api/comm/initData?turn="+useTurn, {}).then((initData) => {
}
window.location.reload()
}
window.customWsHost = function () {
window.layer.closeAll(() => {
window.Bus.$emit("customWsHost", {})
});
}
})

View File

@@ -11,7 +11,7 @@ const local_lang = {
"wait_for_file" : "Waiting for the other party to prepare the file",
"send_to_all_user": "Send to all user",
"please_use_turn_server" : "Please use turn server in settings",
"socketConnectFail" : "Socket service connection failed, please check whether the socket service is started normally",
"socketConnectFail" : "Socket service connection failed, please check whether the socket service is started normally, socket host=",
"websocketHeartBeatCheckOk" : "websocket heartbeat check ok",
"websocketHeartBeatCheckFail" : "websocket heartbeat check fail",
"websocketDisConnected" : "disconnected",
@@ -103,7 +103,11 @@ const local_lang = {
"event_init_done": "Event initialization completed",
"expires_one_day" : "Expires after one day",
"exit_room": "Exit room",
"open_custom_ws_url": "Open custom websocket url",
"close_custom_ws_url": "Close custom websocket url",
"input_custom_ws_url": "Please enter a custom websocket address",
"expand_live": "Expand live panel",
"ws_url_error" : "The websocket address is incorrect, please check",
"expand_log": "Expand log panel",
"expand_receive_file": "Expand receive file panel",
"expand_screen_sharing": "Expand screen sharing panel",
@@ -114,6 +118,7 @@ const local_lang = {
"expand_wait_send_file": "Expand wait send file panel",
"failed_find_file": "Failed, file resource does not exist",
"feature_close": "The current function has been temporarily closed. If you have any questions, you can add a group to communicate",
"custom_ws_url": "Custom websocket url",
"feedback": "Feedback",
"file_box": "File box",
"file_from": "File from",
@@ -347,7 +352,7 @@ const local_lang = {
"zh": {
"wait_for_file": "对方准备文件中",
"please_use_turn_server" : "当前网络环境不稳定,建议在设置中打开中继服务开关",
"socketConnectFail" : "socket服务连接失败请检查socket服务是否正常启动",
"socketConnectFail" : "socket服务连接失败请检查socket服务是否正常启动socket地址=",
"websocketHeartBeatCheckOk" : "websocket心跳检测通过",
"websocketHeartBeatCheckFail" : "websocket心跳检测失败",
"websocketDisConnected" : "连接断开",
@@ -420,6 +425,8 @@ const local_lang = {
"common_event_init_done": "公共事件监听 初始化完成",
"communication_rational": "文明发言,理性交流",
"confirm": "确定",
"open_custom_ws_url": "打开自定义websocket地址",
"close_custom_ws_url": "关闭自定义websocket地址",
"connection_closed": "连接关闭",
"connection_disconnected": "连接断开",
"content_max_1000": "内容过长不能超过1000个字符",
@@ -460,6 +467,8 @@ const local_lang = {
"expand_wait_send_file": "展开待发送文件面板",
"failed_find_file": "失败,文件资源不存在",
"feature_close": "当前功能暂时关闭。如果您有任何问题,可以加入群组进行交流",
"input_custom_ws_url": "请输入自定义websocket地址",
"custom_ws_url" : "socket地址",
"feedback": "反馈问题",
"file_box": "文件箱",
"file_from": "文件来自",
@@ -592,6 +601,7 @@ const local_lang = {
"relay_setting": "中继设置",
"remote_draw": "远程画笔",
"room": "房间",
"ws_url_error" : "websocket地址错误",
"room_least_two_can_send_content": "房间内至少需要两人才能发送内容",
"room_least_two_can_send_file": "房间内至少需要两人才能发送文件",
"room_num_no_number": "房间号不允许包含数字",

View File

@@ -16,6 +16,13 @@ async function excute(tables, dbClient, io) {
}
io.sockets.on(rtcServerEvent.connection, function (socket) {
if(socket.id === undefined || socket.id === null || socket.id === 0 || socket.id === "0"){
socket.emit("tips", {
to: socket.id,
msg: "非法连接"
});
return
}
connect(io, socket, tables, dbClient)
});
}

View File

@@ -54,6 +54,18 @@
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe628;</span>
<div class="name"></div>
<div class="code-name">&amp;#xe628;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe82d;</span>
<div class="name">WS视频监控</div>
<div class="code-name">&amp;#xe82d;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe762;</span>
<div class="name"></div>
@@ -732,9 +744,9 @@
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.woff2?t=1692802578417') format('woff2'),
url('iconfont.woff?t=1692802578417') format('woff'),
url('iconfont.ttf?t=1692802578417') format('truetype');
src: url('iconfont.woff2?t=1694177446228') format('woff2'),
url('iconfont.woff?t=1694177446228') format('woff'),
url('iconfont.ttf?t=1694177446228') format('truetype');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -760,6 +772,24 @@
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-rtc-file-shu1"></span>
<div class="name">
</div>
<div class="code-name">.icon-rtc-file-shu1
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-rtc-file-WSshipinjiankong"></span>
<div class="name">
WS视频监控
</div>
<div class="code-name">.icon-rtc-file-WSshipinjiankong
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-rtc-file-shu"></span>
<div class="name">
@@ -1777,6 +1807,22 @@
<div class="content symbol">
<ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-rtc-file-shu1"></use>
</svg>
<div class="name"></div>
<div class="code-name">#icon-rtc-file-shu1</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-rtc-file-WSshipinjiankong"></use>
</svg>
<div class="name">WS视频监控</div>
<div class="code-name">#icon-rtc-file-WSshipinjiankong</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-rtc-file-shu"></use>

View File

@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 4147343 */
src: url('iconfont.woff2?t=1692802578417') format('woff2'),
url('iconfont.woff?t=1692802578417') format('woff'),
url('iconfont.ttf?t=1692802578417') format('truetype');
src: url('iconfont.woff2?t=1694177446228') format('woff2'),
url('iconfont.woff?t=1694177446228') format('woff'),
url('iconfont.ttf?t=1694177446228') format('truetype');
}
.iconfont {
@@ -13,6 +13,14 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-rtc-file-shu1:before {
content: "\e628";
}
.icon-rtc-file-WSshipinjiankong:before {
content: "\e82d";
}
.icon-rtc-file-shu:before {
content: "\e762";
}

File diff suppressed because one or more lines are too long

View File

@@ -5,6 +5,20 @@
"css_prefix_text": "icon-rtc-file-",
"description": "",
"glyphs": [
{
"icon_id": "15714218",
"name": "书",
"font_class": "shu1",
"unicode": "e628",
"unicode_decimal": 58920
},
{
"icon_id": "32981982",
"name": "WS视频监控",
"font_class": "WSshipinjiankong",
"unicode": "e82d",
"unicode_decimal": 59437
},
{
"icon_id": "4292650",
"name": "书",

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 KiB

File diff suppressed because one or more lines are too long

View File

@@ -38,11 +38,12 @@ async function start() {
utils.tlConsole("db init done ...")
}
//res
for (let key in resRouter) app.use(key, express.static(resRouter[key]));
//file api
for (let key in fileApiRouters) app.use(key, fileApiRouters[key])
//res api v1
for (let key in resRouter) app.use(key, express.static(resRouter[key]));
//start server
if(process.env.tl_rtc_file_env_mode === 'http'){
app.listen(conf.api.port);