diff --git a/UI2.0/src/assets/personal/star.png b/UI2.0/src/assets/personal/star.png new file mode 100644 index 0000000000000000000000000000000000000000..fa0c33fd74b0c80c83c00bf1e765cea90860c357 Binary files /dev/null and b/UI2.0/src/assets/personal/star.png differ diff --git a/UI2.0/src/css/personal.css b/UI2.0/src/css/personal.css index b100e6c30b4a99d739a654efe90d82e72c550397..bd64c6ec310008e7150371d911480bef39255a42 100644 --- a/UI2.0/src/css/personal.css +++ b/UI2.0/src/css/personal.css @@ -173,3 +173,9 @@ font-weight: bolder; padding: 14px 0px 8px 14px; } +.addipInfo-info > img { + margin-left: 31px; +} +.disabled_button { + pointer-events: none; +} \ No newline at end of file diff --git a/UI2.0/src/js/personal.js b/UI2.0/src/js/personal.js index a5ecbef5e75051276936b14f8f38fe0b6af69427..de0040e72c3afef6e5dc5ecc33bc612ef0a9af9c 100644 --- a/UI2.0/src/js/personal.js +++ b/UI2.0/src/js/personal.js @@ -10,6 +10,15 @@ export default defineComponent({ name: "", description: "" }, + ipInfo: { + hint: "", + ipAddrs: "", + ipPort: "", + serverUser: "", + serverPassword: "", + description: "", + isConnect: false + }, password: { hint: "", oldPassword: "", @@ -35,6 +44,51 @@ export default defineComponent({ document.getElementById("card-password").style.display = "none"; document.getElementById("fade").style.display = "none"; }, + popAddIpWin() { + document.getElementById("card-addIP").style.display = "block"; + document.getElementById("fade").style.display = "block"; + }, + closeAddIpWin() { + document.getElementById("card-addIP").style.display = "none"; + document.getElementById("fade").style.display = "none"; + this.ipInfo.isConnect = false; + this.ipInfo.hint = ""; + }, + deleteIp(index){ + this.$store.dispatch("deleteIp", index) + }, + testConnect(){ + if(this.ipInfo.ipAddrs == "" || this.ipInfo.ipPort == "" || + this.ipInfo.serverUser == "" || this.ipInfo.serverPassword == ""){ + this.ipInfo.hint = "服务器信息请填完整" + } else { + axios("/v1/UI/user/testConnect", { + ipAddrs: this.ipInfo.ipAddrs, + ipPort: this.ipInfo.ipPort, + serverUser: this.ipInfo.serverUser, + serverPassword: base64Encode(this.ipInfo.serverPassword), + }, "post").then(res => { + res = JSON.parse(res) + this.ipInfo.hint = res.msg + if(res.success) { + this.ipInfo.isConnect = true + } + }).catch(err => { + console.log(err) + }) + } + }, + addNewIp(){ + this.$store.dispatch("addNewip",{ + userId: this.$store.state.User.userInfo.userId, + ipAddrs: this.ipInfo.ipAddrs, + ipPort: this.ipInfo.ipPort, + serverUser: this.ipInfo.serverUser, + serverPassword: base64Encode(this.ipInfo.serverPassword), + description: this.ipInfo.description + }) + this.closeAddIpWin() + }, changeBasicInfo(){ if(this.basicInfo.name == this.$store.state.User.userInfo.name && this.basicInfo.description == this.$store.state.User.userInfo.description) { @@ -53,8 +107,6 @@ export default defineComponent({ res = JSON.parse(res) if(!res.success) { console.log("修改失败") - } else { - console.log("修改成功") } }).catch(err => { console.log(err) @@ -97,7 +149,9 @@ export default defineComponent({ }, mounted() { + this.$store.dispatch("getIpListFromBackend") this.basicInfo.name = this.$store.state.User.userInfo.name this.basicInfo.description = this.$store.state.User.userInfo.description + console.log(this.$store.state.User.ipList) }, }); \ No newline at end of file diff --git a/UI2.0/src/pages/Personal.vue b/UI2.0/src/pages/Personal.vue index 01ab33ed9a460fd8e906a7d9cbf4f314decadcdf..c74a4bc77aeb3848664dfac61f74dbf49fde4dc7 100644 --- a/UI2.0/src/pages/Personal.vue +++ b/UI2.0/src/pages/Personal.vue @@ -47,66 +47,38 @@ IP记录
| 序号 | -- |IP地址 - | -- |备注 - | -- |操作 - | -
|---|---|---|---|
| 1 | -9.10.33.13 | -- | - - | -
| 2 | -9.10.33.13 | -- | - - | -
| 3 | -9.10.33.13 | -- | - - | -
| 4 | -9.10.33.13 | -- | - - | -
| 5 | -9.10.33.13 | -- | - - | -
| 6 | -9.10.33.13 | -- | - - | -
| 序号 | ++ |IP地址 + | ++ |备注 + | ++ |操作 + | +
| {{index}} | +{{item.ipAddrs}} | +{{item.description}} | ++ + | +
| + | + | + | + + | +