Skip to content

Commit eaaea2b

Browse files
authored
update:智控台添加版本号 (#793)
1 parent 58d0aef commit eaaea2b

File tree

13 files changed

+126
-102
lines changed

13 files changed

+126
-102
lines changed

main/manager-api/src/main/java/xiaozhi/modules/security/config/ShiroConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public ShiroFilterFactoryBean shirFilter(SecurityManager securityManager) {
7676
filterMap.put("/favicon.ico", "anon");
7777
filterMap.put("/user/captcha", "anon");
7878
filterMap.put("/user/login", "anon");
79+
filterMap.put("/user/pub-config", "anon");
7980
filterMap.put("/user/register", "anon");
8081
filterMap.put("/config/server-base", "anon");
8182
filterMap.put("/config/agent-models", "anon");

main/manager-api/src/main/java/xiaozhi/modules/security/controller/LoginController.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package xiaozhi.modules.security.controller;
22

33
import java.io.IOException;
4+
import java.util.HashMap;
5+
import java.util.Map;
46

57
import org.springframework.web.bind.annotation.GetMapping;
68
import org.springframework.web.bind.annotation.PostMapping;
@@ -111,4 +113,12 @@ public Result<?> changePassword(@RequestBody PasswordDTO passwordDTO) {
111113
sysUserTokenService.changePassword(userId, passwordDTO);
112114
return new Result<>();
113115
}
116+
117+
@GetMapping("/pub-config")
118+
@Operation(summary = "公共配置")
119+
public Result<Map<String, Object>> pubConfig() {
120+
Map<String, Object> config = new HashMap<>();
121+
config.put("version", "0.3.3");
122+
return new Result<Map<String, Object>>().ok(config);
123+
}
114124
}

main/manager-web/src/apis/module/user.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default {
106106
},
107107
// 修改用户状态
108108
changeUserStatus(status, userIds, successCallback) {
109-
console.log(555,userIds)
109+
console.log(555, userIds)
110110
RequestService.sendRequest()
111111
.url(`${getServiceUrl()}/admin/users/changeStatus/${status}`)
112112
.method('put')
@@ -122,4 +122,20 @@ export default {
122122
})
123123
}).send()
124124
},
125+
// 获取公共配置
126+
getPubConfig(callback) {
127+
RequestService.sendRequest()
128+
.url(`${getServiceUrl()}/user/pub-config`)
129+
.method('GET')
130+
.success((res) => {
131+
RequestService.clearRequestTime();
132+
callback(res);
133+
})
134+
.fail((err) => {
135+
console.error('获取公共配置失败:', err);
136+
RequestService.reAjaxFun(() => {
137+
this.getPubConfig(callback);
138+
});
139+
}).send();
140+
},
125141
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<template>
2+
<div class="copyright">
3+
©2025 xiaozhi-esp32-server v{{ version }}
4+
</div>
5+
</template>
6+
7+
<script>
8+
import Api from '@/apis/api';
9+
10+
export default {
11+
name: 'VersionFooter',
12+
data() {
13+
return {
14+
version: ''
15+
}
16+
},
17+
mounted() {
18+
this.getSystemVersion();
19+
},
20+
methods: {
21+
getSystemVersion() {
22+
const storedVersion = sessionStorage.getItem('systemVersion');
23+
if (storedVersion) {
24+
this.version = storedVersion;
25+
return;
26+
}
27+
28+
Api.user.getPubConfig(({ data }) => {
29+
if (data.code === 0 && data.data.version) {
30+
this.version = data.data.version;
31+
sessionStorage.setItem('systemVersion', data.data.version);
32+
}
33+
});
34+
}
35+
}
36+
}
37+
</script>
38+
39+
<style scoped></style>

main/manager-web/src/views/DeviceManagement.vue

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<el-main style="padding: 20px; display: flex; flex-direction: column;">
55
<div class="table-container">
66
<h3 class="device-list-title">设备列表</h3>
7-
<el-table ref="deviceTable" :data="paginatedDeviceList" @selection-change="handleSelectionChange" style="width: 100%; margin-top: 20px" border stripe>
7+
<el-table ref="deviceTable" :data="paginatedDeviceList" @selection-change="handleSelectionChange"
8+
style="width: 100%; margin-top: 20px" border stripe>
89
<el-table-column type="selection" align="center" width="60"></el-table-column>
910
<el-table-column label="设备型号" prop="model" flex></el-table-column>
1011
<el-table-column label="固件版本" prop="firmwareVersion" width="120"></el-table-column>
@@ -40,32 +41,24 @@
4041
<div class="table_bottom">
4142
<div class="ctrl_btn">
4243
<el-button size="mini" type="primary" class="select-all-btn" @click="toggleAllSelection">
43-
{{ isAllSelected ? '取消全选' : '全选' }}
44+
{{ isAllSelected ? '取消全选' : '全选' }}
4445
</el-button>
4546
<el-button type="primary" size="mini" class="add-device-btn" @click="handleAddDevice">
46-
新增
47+
新增
4748
</el-button>
4849
</div>
4950
<div class="custom-pagination">
5051
<button class="pagination-btn" :disabled="currentPage === 1" @click="goFirst">首页</button>
5152
<button class="pagination-btn" :disabled="currentPage === 1" @click="goPrev">上一页</button>
52-
<button
53-
v-for="page in visiblePages"
54-
:key="page"
55-
class="pagination-btn"
56-
:class="{ active: page === currentPage }"
57-
@click="goToPage(page)"
58-
>
53+
<button v-for="page in visiblePages" :key="page" class="pagination-btn"
54+
:class="{ active: page === currentPage }" @click="goToPage(page)">
5955
{{ page }}
6056
</button>
6157
<button class="pagination-btn" :disabled="currentPage === pageCount" @click="goNext">下一页</button>
6258
<span class="total-text">共{{ deviceList.length }}条记录</span>
6359
</div>
6460
</div>
6561
</div>
66-
<div class="copyright">
67-
©2025 xiaozhi-esp32-server
68-
</div>
6962
<AddDeviceDialog :visible.sync="addDeviceDialogVisible" :agent-id="currentAgentId"
7063
@refresh="fetchBindDevices(currentAgentId)" />
7164
</el-main>
@@ -82,7 +75,7 @@ export default {
8275
data() {
8376
return {
8477
addDeviceDialogVisible: false,
85-
selectedDevices: [],
78+
selectedDevices: [],
8679
isAllSelected: false,
8780
currentAgentId: this.$route.query.agentId || '',
8881
currentPage: 1,
@@ -99,7 +92,7 @@ export default {
9992
return this.deviceList.slice(start, end);
10093
},
10194
pageCount() {
102-
return Math.ceil(this.deviceList.length / this.pageSize);
95+
return Math.ceil(this.deviceList.length / this.pageSize);
10396
},
10497
visiblePages() {
10598
const pages = [];
@@ -346,6 +339,4 @@ export default {
346339
color: white;
347340
}
348341
}
349-
350-
351342
</style>

main/manager-web/src/views/ModelConfig.vue

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,15 @@
33
<HeaderBar />
44

55
<div class="operation-bar">
6-
<h2 class="page-title">{{ modelTypeText }}</h2>
6+
<h2 class="page-title">{{ modelTypeText }}</h2>
77
<div class="action-group">
8-
<div class="search-group">
9-
<el-input
10-
placeholder="请输入模型名称查询"
11-
v-model="search"
12-
class="search-input"
13-
clearable
14-
@keyup.enter.native="handleSearch"
15-
style="width: 240px"
16-
/>
17-
<el-button class="btn-search" @click="handleSearch">
18-
搜索
19-
</el-button>
20-
</div>
8+
<div class="search-group">
9+
<el-input placeholder="请输入模型名称查询" v-model="search" class="search-input" clearable
10+
@keyup.enter.native="handleSearch" style="width: 240px" />
11+
<el-button class="btn-search" @click="handleSearch">
12+
搜索
13+
</el-button>
14+
</div>
2115
</div>
2216
</div>
2317

@@ -93,9 +87,9 @@
9387

9488
<div class="table-footer">
9589
<div class="batch-actions">
96-
<el-button size="mini" type="primary" @click="selectAll" >
90+
<el-button size="mini" type="primary" @click="selectAll">
9791
{{ isAllSelected ?
98-
'取消全选' : '全选' }}
92+
'取消全选' : '全选' }}
9993
</el-button>
10094
<el-button type="success" size="mini" @click="addModel" class="add-btn">
10195
新增
@@ -125,10 +119,6 @@
125119
<TtsModel :visible.sync="ttsDialogVisible" :ttsModelId="selectedTtsModelId" />
126120
<AddModelDialog :modelType="activeTab" :visible.sync="addDialogVisible" @confirm="handleAddConfirm" />
127121
</div>
128-
129-
<div class="copyright">
130-
©2025 xiaozhi-esp32-server
131-
</div>
132122
</div>
133123
</template>
134124

@@ -639,20 +629,6 @@ export default {
639629
gap: 8px;
640630
}
641631
642-
.copyright {
643-
text-align: center;
644-
color: #979db1;
645-
font-size: 12px;
646-
font-weight: 400;
647-
margin-top: auto;
648-
padding: 30px 0 20px;
649-
position: absolute;
650-
bottom: 0;
651-
left: 50%;
652-
transform: translateX(-50%);
653-
width: 100%;
654-
}
655-
656632
.title-wrapper {
657633
display: flex;
658634
align-items: center;

main/manager-web/src/views/ParamsManagement.vue

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@
6464
<!-- 新增/编辑参数对话框 -->
6565
<param-dialog :title="dialogTitle" :visible.sync="dialogVisible" :form="paramForm" @submit="handleSubmit"
6666
@cancel="dialogVisible = false" />
67-
68-
<div class="copyright">©2025 xiaozhi-esp32-server</div>
6967
</div>
7068
</template>
7169

@@ -382,20 +380,6 @@ export default {
382380
}
383381
}
384382
385-
.copyright {
386-
text-align: center;
387-
color: #979db1;
388-
font-size: 12px;
389-
font-weight: 400;
390-
margin-top: auto;
391-
padding: 30px 0 20px;
392-
position: absolute;
393-
bottom: 0;
394-
left: 50%;
395-
transform: translateX(-50%);
396-
width: 100%;
397-
}
398-
399383
.custom-pagination {
400384
display: flex;
401385
align-items: center;

main/manager-web/src/views/UserManagement.vue

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<div class="table_bottom">
4343
<div class="ctrl_btn">
4444
<el-button size="mini" type="primary" class="select-all-btn" @click="handleSelectAll">
45-
{{ isAllSelected ? '取消全选' : '全选' }}
45+
{{ isAllSelected ? '取消全选' : '全选' }}
4646
</el-button>
4747
<el-button size="mini" type="success" icon="el-icon-circle-check" @click="batchEnable">启用</el-button>
4848
<el-button size="mini" type="warning" @click="batchDisable"><i
@@ -69,8 +69,6 @@
6969
</div>
7070
</div>
7171
</div>
72-
73-
<div class="copyright">©2025 xiaozhi-esp32-server</div>
7472
<view-password-dialog :visible.sync="showViewPassword" :password="currentPassword" />
7573
</div>
7674
</template>
@@ -465,20 +463,6 @@ export default {
465463
color: black;
466464
}
467465
468-
.copyright {
469-
text-align: center;
470-
color: #979db1;
471-
font-size: 12px;
472-
font-weight: 400;
473-
margin-top: auto;
474-
padding: 30px 0 20px;
475-
position: absolute;
476-
bottom: 0;
477-
left: 50%;
478-
transform: translateX(-50%);
479-
width: 100%;
480-
}
481-
482466
.custom-pagination {
483467
display: flex;
484468
align-items: center;

main/manager-web/src/views/home.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
@deviceManage="handleDeviceManage" @delete="handleDeleteAgent" />
3636
</div>
3737
</div>
38-
<div class="copyright">
39-
©2025 xiaozhi-esp32-server
40-
</div>
4138
<AddWisdomBodyDialog :visible.sync="addDeviceDialogVisible" @confirm="handleWisdomBodyAdded" />
4239
</el-main>
40+
<el-footer>
41+
<version-footer />
42+
</el-footer>
4343
</div>
4444

4545
</template>
@@ -49,10 +49,11 @@ import Api from '@/apis/api';
4949
import AddWisdomBodyDialog from '@/components/AddWisdomBodyDialog.vue';
5050
import DeviceItem from '@/components/DeviceItem.vue';
5151
import HeaderBar from '@/components/HeaderBar.vue';
52+
import VersionFooter from '@/components/VersionFooter.vue';
5253
5354
export default {
5455
name: 'HomePage',
55-
components: { DeviceItem, AddWisdomBodyDialog, HeaderBar },
56+
components: { DeviceItem, AddWisdomBodyDialog, HeaderBar, VersionFooter },
5657
data() {
5758
return {
5859
addDeviceDialogVisible: false,

0 commit comments

Comments
 (0)