Commit 882dc03e by dqjdda

代码优化

parent fcc28fdd
...@@ -2,7 +2,7 @@ ENV = 'development' ...@@ -2,7 +2,7 @@ ENV = 'development'
# 接口地址 # 接口地址
VUE_APP_BASE_API = 'http://localhost:8000' VUE_APP_BASE_API = 'http://localhost:8000'
VUE_APP_WS_API: '"ws://localhost:8000"', VUE_APP_WS_API = 'ws://localhost:8000'
# 是否启用 babel-plugin-dynamic-import-node插件 # 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
...@@ -2,4 +2,4 @@ ENV = 'production' ...@@ -2,4 +2,4 @@ ENV = 'production'
# 接口地址 # 接口地址
VUE_APP_BASE_API = 'https://api.auauz.net' VUE_APP_BASE_API = 'https://api.auauz.net'
VUE_APP_WS_API: '"ws://api.auauz.net"', VUE_APP_WS_API = 'ws://api.auauz.net'
import request from '@/utils/request' import request from '@/utils/request'
export function queryApps(data) {
return request({
url: 'api/app',
method: 'get',
data
})
}
export function add(data) { export function add(data) {
return request({ return request({
url: 'api/app', url: 'api/app',
...@@ -30,3 +22,5 @@ export function edit(data) { ...@@ -30,3 +22,5 @@ export function edit(data) {
data data
}) })
} }
export default { add, edit, del }
...@@ -22,3 +22,5 @@ export function edit(data) { ...@@ -22,3 +22,5 @@ export function edit(data) {
data data
}) })
} }
export default { add, edit, del }
...@@ -72,3 +72,5 @@ export function serverStatus(data) { ...@@ -72,3 +72,5 @@ export function serverStatus(data) {
data data
}) })
} }
export default { add, edit, del, stopServer, serverStatus, startServer, getServers, getApps }
import request from '@/utils/request' import request from '@/utils/request'
/**
* 部署管理
* @param data
*/
export function add(data) {
return request({
url: 'api/deployHistory',
method: 'post',
data
})
}
export function del(id) { export function del(id) {
return request({ return request({
url: 'api/deployHistory/' + id, url: 'api/deployHistory/' + id,
...@@ -19,14 +7,6 @@ export function del(id) { ...@@ -19,14 +7,6 @@ export function del(id) {
}) })
} }
export function edit(data) {
return request({
url: 'api/deployHistory',
method: 'put',
data
})
}
/** /**
* 版本回退 * 版本回退
* @param data 选中行 * @param data 选中行
......
...@@ -22,3 +22,5 @@ export function edit(data) { ...@@ -22,3 +22,5 @@ export function edit(data) {
data data
}) })
} }
export default { add, edit, del }
...@@ -22,3 +22,5 @@ export function edit(data) { ...@@ -22,3 +22,5 @@ export function edit(data) {
data data
}) })
} }
export default { add, edit, del }
import request from '@/utils/request'
export function queryServerAccount(data) {
return request({
url: 'api/serverAccount',
method: 'get',
data
})
}
export function add(data) {
return request({
url: 'api/serverAccount',
method: 'post',
data
})
}
export function del(id) {
return request({
url: 'api/serverAccount/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
url: 'api/serverAccount',
method: 'put',
data
})
}
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M121.718 73.272v9.953c3.957-7.584 6.199-16.05 6.199-24.995C127.917 26.079 99.273 0 63.958 0 28.644 0 0 26.079 0 58.23c0 .403.028.806.028 1.21l22.97-25.953h13.34l-19.76 27.187h6.42V53.77l13.728-19.477v49.361H22.998V73.272H2.158c5.951 20.284 23.608 36.208 45.998 41.399-1.44 3.3-5.618 11.263-12.565 12.674-8.607 1.764 23.358.428 46.163-13.178 17.519-4.611 31.938-15.849 39.77-30.513h-13.506V73.272H85.02V59.464l22.998-25.977h13.008l-19.429 27.187h6.421v-7.433l13.727-19.402v39.433h-.027zm-78.24 2.822a10.516 10.516 0 0 1-.996-4.535V44.548c0-1.613.332-3.124.996-4.535a11.66 11.66 0 0 1 2.713-3.68c1.134-1.032 2.49-1.864 4.04-2.468 1.55-.605 3.21-.908 4.982-.908h11.292c1.77 0 3.431.303 4.981.908 1.522.604 2.85 1.41 3.986 2.418l-12.26 16.303v-2.898a1.96 1.96 0 0 0-.665-1.512c-.443-.403-.996-.604-1.66-.604-.665 0-1.218.201-1.661.604a1.96 1.96 0 0 0-.664 1.512v9.071L44.364 77.606a10.556 10.556 0 0 1-.886-1.512zm35.73-4.535c0 1.613-.332 3.124-.997 4.535a11.66 11.66 0 0 1-2.712 3.68c-1.134 1.032-2.49 1.864-4.04 2.469-1.55.604-3.21.907-4.982.907H55.185c-1.77 0-3.431-.303-4.981-.907-1.55-.605-2.906-1.437-4.041-2.47a12.49 12.49 0 0 1-1.384-1.512l13.727-18.217v6.375c0 .605.222 1.109.665 1.512.442.403.996.604 1.66.604.664 0 1.218-.201 1.66-.604a1.96 1.96 0 0 0 .665-1.512V53.87L75.97 36.838c.913.932 1.66 1.99 2.214 3.175.664 1.41.996 2.922.996 4.535v27.011h.028z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200" class="icon" p-id="1208" t="1543748455010" version="1.1" viewBox="0 0 1024 1024"><defs><style type="text/css">@font-face{font-family:rbicon;src:url(chrome-extension://dipiagiiohfljcicegpgffpbnjmgjcnf/fonts/rbicon.woff2) format(&quot;woff2&quot;);font-weight:400;font-style:normal}</style></defs><path d="M590.769231 571.076923h324.923077c15.753846 0 29.538462-13.784615 29.538461-29.538461v-59.076924c0-15.753846-13.784615-29.538462-29.538461-29.538461H590.769231c-11.815385 0-19.692308-7.876923-19.692308-19.692308V108.307692c0-15.753846-13.784615-29.538462-29.538461-29.538461h-59.076924c-15.753846 0-29.538462 13.784615-29.538461 29.538461V433.230769c0 11.815385-7.876923 19.692308-19.692308 19.692308H108.307692c-15.753846 0-29.538462 13.784615-29.538461 29.538461v59.076924c0 15.753846 13.784615 29.538462 29.538461 29.538461H433.230769c11.815385 0 19.692308 7.876923 19.692308 19.692308v324.923077c0 15.753846 13.784615 29.538462 29.538461 29.538461h59.076924c15.753846 0 29.538462-13.784615 29.538461-29.538461V590.769231c0-11.815385 7.876923-19.692308 19.692308-19.692308z" p-id="1209"/></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574649142168" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1910" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M468.693333 16.725333a85.333333 85.333333 0 0 1 82.56 0l381.952 211.072a85.333333 85.333333 0 0 1 44.074667 74.666667v419.029333a85.333333 85.333333 0 0 1-44.074667 74.666667l-381.952 211.114667a85.333333 85.333333 0 0 1-82.56 0l-381.952-211.072A85.333333 85.333333 0 0 1 42.666667 721.493333V302.506667a85.333333 85.333333 0 0 1 44.074666-74.666667L468.693333 16.682667z m423.253334 285.781334l-381.994667-211.072L128 302.506667v418.986666l381.952 211.072 381.994667-211.072V302.506667z m-684.714667 42.197333a42.666667 42.666667 0 0 1 57.984-16.725333l244.736 135.253333 244.778667-135.253333a42.666667 42.666667 0 0 1 41.258666 74.666666l-243.370666 134.528v268.16a42.666667 42.666667 0 0 1-85.333334 0V537.173333L223.914667 402.688a42.666667 42.666667 0 0 1-16.682667-58.026667z" fill="#bfbfbf" p-id="1911"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574649191790" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2774" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M646 1024H100A100 100 0 0 1 0 924V258a100 100 0 0 1 100-100h546a100 100 0 0 1 100 100v31a40 40 0 1 1-80 0v-31a20 20 0 0 0-20-20H100a20 20 0 0 0-20 20v666a20 20 0 0 0 20 20h546a20 20 0 0 0 20-20V713a40 40 0 0 1 80 0v211a100 100 0 0 1-100 100z" fill="#cdcdcd" p-id="2775"></path><path d="M924 866H806a40 40 0 0 1 0-80h118a20 20 0 0 0 20-20V100a20 20 0 0 0-20-20H378a20 20 0 0 0-20 20v8a40 40 0 0 1-80 0v-8A100 100 0 0 1 378 0h546a100 100 0 0 1 100 100v666a100 100 0 0 1-100 100z" fill="#cdcdcd" p-id="2776"></path><path d="M469 887a40 40 0 0 1-27-10L152 618a40 40 0 0 1 1-60l290-248a40 40 0 0 1 66 30v128a367 367 0 0 0 241-128l94-111a40 40 0 0 1 70 35l-26 109a430 430 0 0 1-379 332v142a40 40 0 0 1-40 40zM240 589l189 169v-91a40 40 0 0 1 40-40c144 0 269-85 323-214a447 447 0 0 1-323 137 40 40 0 0 1-40-40v-83z" fill="#cdcdcd" p-id="2777"></path></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M127.88 73.143c0 1.412-.506 2.635-1.518 3.669-1.011 1.033-2.209 1.55-3.592 1.55h-17.887c0 9.296-1.783 17.178-5.35 23.645l16.609 17.044c1.011 1.034 1.517 2.257 1.517 3.67 0 1.412-.506 2.635-1.517 3.668-.958 1.033-2.155 1.55-3.593 1.55-1.438 0-2.635-.517-3.593-1.55l-15.811-16.063a15.49 15.49 0 0 1-1.196 1.06c-.532.434-1.65 1.208-3.353 2.322a50.104 50.104 0 0 1-5.192 2.974c-1.758.87-3.94 1.658-6.546 2.364-2.607.706-5.189 1.06-7.748 1.06V47.044H58.89v73.062c-2.716 0-5.417-.367-8.106-1.102-2.688-.734-5.003-1.631-6.945-2.692a66.769 66.769 0 0 1-5.268-3.179c-1.571-1.057-2.73-1.94-3.476-2.65L33.9 109.34l-14.611 16.877c-1.066 1.14-2.344 1.711-3.833 1.711-1.277 0-2.422-.434-3.434-1.304-1.012-.978-1.557-2.187-1.635-3.627-.079-1.44.333-2.705 1.236-3.794l16.129-18.51c-3.087-6.197-4.63-13.644-4.63-22.342H5.235c-1.383 0-2.58-.517-3.592-1.55S.125 74.545.125 73.132c0-1.412.506-2.635 1.518-3.668 1.012-1.034 2.21-1.55 3.592-1.55h17.887V43.939L9.308 29.833c-1.012-1.033-1.517-2.256-1.517-3.669 0-1.412.505-2.635 1.517-3.668 1.012-1.034 2.21-1.55 3.593-1.55s2.58.516 3.593 1.55l13.813 14.106h67.396l13.814-14.106c1.012-1.034 2.21-1.55 3.592-1.55 1.384 0 2.581.516 3.593 1.55 1.012 1.033 1.518 2.256 1.518 3.668 0 1.413-.506 2.636-1.518 3.67l-13.814 14.105v23.975h17.887c1.383 0 2.58.516 3.593 1.55 1.011 1.033 1.517 2.256 1.517 3.668l-.005.01zM89.552 26.175H38.448c0-7.23 2.489-13.386 7.466-18.469C50.892 2.623 56.92.082 64 .082c7.08 0 13.108 2.541 18.086 7.624 4.977 5.083 7.466 11.24 7.466 18.469z"/></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M54.857 118.857h64V73.143H89.143c-1.902 0-3.52-.668-4.855-2.002-1.335-1.335-2.002-2.954-2.002-4.855V36.57H54.857v82.286zM73.143 16v-4.571a2.2 2.2 0 0 0-.677-1.61 2.198 2.198 0 0 0-1.609-.676H20.571c-.621 0-1.158.225-1.609.676a2.198 2.198 0 0 0-.676 1.61V16a2.2 2.2 0 0 0 .676 1.61c.451.45.988.676 1.61.676h50.285c.622 0 1.158-.226 1.61-.677.45-.45.676-.987.676-1.609zm18.286 48h21.357L91.43 42.642V64zM128 73.143v48c0 1.902-.667 3.52-2.002 4.855-1.335 1.335-2.953 2.002-4.855 2.002H52.57c-1.901 0-3.52-.667-4.854-2.002-1.335-1.335-2.003-2.953-2.003-4.855v-11.429H6.857c-1.902 0-3.52-.667-4.855-2.002C.667 106.377 0 104.759 0 102.857v-96c0-1.902.667-3.52 2.002-4.855C3.337.667 4.955 0 6.857 0h77.714c1.902 0 3.52.667 4.855 2.002 1.335 1.335 2.003 2.953 2.003 4.855V30.29c1 .622 1.856 1.29 2.569 2.003l29.147 29.147c1.335 1.335 2.478 3.145 3.429 5.43.95 2.287 1.426 4.383 1.426 6.291v-.018z"/></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h54.857v54.857H0V0zm0 73.143h54.857V128H0V73.143zm73.143 0H128V128H73.143V73.143zm27.428-18.286C115.72 54.857 128 42.577 128 27.43 128 12.28 115.72 0 100.571 0 85.423 0 73.143 12.28 73.143 27.429c0 15.148 12.28 27.428 27.428 27.428z"/></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574649229600" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3752" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M942 191.9C939.8 128.9 748.1 78 512 78S84.2 128.9 82 191.9V831c0 63.5 192.5 115 430 115s430-51.5 430-115V191.9z m-56.7 393.8c-4.6 3.3-11.6 7.4-21.9 12.2-21.3 9.8-50.5 19.1-84.4 26.8-74 16.8-168.8 26-267 26s-193-9.2-267-26c-33.9-7.7-63.1-16.9-84.4-26.8-10.3-4.8-17.3-8.9-21.9-12.2 0.1-0.1 0.2-0.1 0.3-0.2h-7v-123c72.2 36.4 215.3 61.1 380 61.1s307.8-24.8 380-61.1v122.9h-7l0.3 0.3z m0-177c-4.6 3.3-11.6 7.4-21.9 12.2-21.3 9.8-50.5 19.1-84.4 26.8-74 16.8-168.8 26-267 26s-193-9.2-267-26c-33.9-7.7-63.1-16.9-84.4-26.8-10.3-4.8-17.3-8.9-21.9-12.2 0.1-0.1 0.2-0.1 0.3-0.2h-7V246.9c72.2 36.4 215.3 61.1 380 61.1s307.8-24.8 380-61.1v161.6h-7c0.1 0 0.2 0.1 0.3 0.2zM160.7 180.8C182 171 211.2 161.7 245 154c74-16.8 168.8-26 267-26s193 9.2 267 26c33.9 7.7 63.1 16.9 84.4 26.8 10.3 4.8 17.3 8.9 21.9 12.2-4.6 3.3-11.6 7.4-21.9 12.2C842 215 812.8 224.3 779 232c-74 16.8-168.8 26-267 26s-193-9.2-267-26c-33.9-7.7-63.1-16.9-84.4-26.8-10.3-4.8-17.3-8.9-21.9-12.2 4.7-3.3 11.7-7.4 22-12.2zM885.3 831c-4.6 3.3-11.6 7.4-21.9 12.2C842 853 812.8 862.3 779 870c-74 16.8-168.8 26-267 26s-193-9.2-267-26c-33.9-7.7-63.1-16.9-84.4-26.8-10.3-4.8-17.3-8.9-21.9-12.2 0.1-0.1 0.2-0.1 0.3-0.2h-7V639.5c72.2 36.4 215.3 61.1 380 61.1s307.8-24.8 380-61.1v191.3h-7c0.1 0.1 0.2 0.1 0.3 0.2z" fill="#cdcdcd" p-id="3753"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574649300337" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4312" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M877.952 447.616v-0.256a272 272 0 0 0-479.68-175.68 166.144 166.144 0 0 0-226.016 155.296c0 4.768 0.32 9.6 0.704 14.144A196.896 196.896 0 0 0 206.592 832H448v-256H304l208-208 208 208H576v256h241.408a196.96 196.96 0 0 0 60.544-384.384z" fill="#cdcdcd" p-id="4313"></path></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M71.984 44.815H115.9L71.984 9.642v35.173zM16.094.05h63.875l47.906 38.37v76.74c0 3.392-1.682 6.645-4.677 9.044-2.995 2.399-7.056 3.746-11.292 3.746H16.094c-4.236 0-8.297-1.347-11.292-3.746-2.995-2.399-4.677-5.652-4.677-9.044V12.84C.125 5.742 7.23.05 16.094.05zm71.86 102.32V89.58h-71.86v12.79h71.86zm23.952-25.58V64H16.094v12.79h95.812z"/></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M73.137 29.08h-9.209 29.7L63.886.093 34.373 29.08h20.49v27.035H27.238v17.948h27.625v27.133h18.274V74.063h27.41V56.115h-27.41V29.08zm-9.245 98.827l27.518-26.711H36.59l27.302 26.71zM.042 64.982l27.196 27.029V38.167L.042 64.982zm100.505-26.815V92.01l27.41-27.029-27.41-26.815z"/></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M96.258 57.462h31.421C124.794 27.323 100.426 2.956 70.287.07v31.422a32.856 32.856 0 0 1 25.971 25.97zm-38.796-25.97V.07C27.323 2.956 2.956 27.323.07 57.462h31.422a32.856 32.856 0 0 1 25.97-25.97zm12.825 64.766v31.421c30.46-2.885 54.507-27.253 57.713-57.712H96.579c-2.886 13.466-13.146 23.726-26.292 26.291zM31.492 70.287H.07c2.886 30.46 27.253 54.507 57.713 57.713V96.579c-13.466-2.886-23.726-13.146-26.291-26.292z"/></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M78.208 16.576v8.384h38.72v5.376h-38.72v8.704h38.72v5.376h-38.72v8.576h38.72v5.376h-38.72v8.576h38.72v5.376h-38.72v8.576h38.72v5.376h-38.72v8.512h38.72v5.376h-38.72v11.136H128v-94.72H78.208zM0 114.368L72.128 128V0L0 13.632v100.736z"/><path d="M28.672 82.56h-11.2l14.784-23.488-14.08-22.592h11.52l8.192 14.976 8.448-14.976h11.136l-14.08 22.208L58.368 82.56H46.656l-8.768-15.68z"/></svg>
\ No newline at end of file
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><defs><style/></defs><path d="M512 128q69.675 0 135.51 21.163t115.498 54.997 93.483 74.837 73.685 82.006 51.67 74.837 32.17 54.827L1024 512q-2.347 4.992-6.315 13.483T998.87 560.17t-31.658 51.669-44.331 59.99-56.832 64.34-69.504 60.16-82.347 51.5-94.848 34.687T512 896q-69.675 0-135.51-21.163t-115.498-54.826-93.483-74.326-73.685-81.493-51.67-74.496-32.17-54.997L0 513.707q2.347-4.992 6.315-13.483t18.816-34.816 31.658-51.84 44.331-60.33 56.832-64.683 69.504-60.331 82.347-51.84 94.848-34.816T512 128.085zm0 85.333q-46.677 0-91.648 12.331t-81.152 31.83-70.656 47.146-59.648 54.485-48.853 57.686-37.675 52.821-26.325 43.99q12.33 21.674 26.325 43.52t37.675 52.351 48.853 57.003 59.648 53.845T339.2 767.02t81.152 31.488T512 810.667t91.648-12.331 81.152-31.659 70.656-46.848 59.648-54.186 48.853-57.344 37.675-52.651T927.957 512q-12.33-21.675-26.325-43.648t-37.675-52.65-48.853-57.345-59.648-54.186-70.656-46.848-81.152-31.659T512 213.334zm0 128q70.656 0 120.661 50.006T682.667 512 632.66 632.661 512 682.667 391.339 632.66 341.333 512t50.006-120.661T512 341.333zm0 85.334q-35.328 0-60.33 25.002T426.666 512t25.002 60.33T512 597.334t60.33-25.002T597.334 512t-25.002-60.33T512 426.666z"/></svg>
\ No newline at end of file
<svg width="128" height="64" xmlns="http://www.w3.org/2000/svg"><path d="M127.072 7.994c1.37-2.208.914-5.152-.914-6.87-2.056-1.717-4.797-1.226-6.396.982-.229.245-25.586 32.382-55.74 32.382-29.24 0-55.74-32.382-55.968-32.627-1.6-1.963-4.57-2.208-6.397-.49C-.17 3.086-.399 6.275 1.2 8.238c.457.736 5.94 7.36 14.62 14.72L4.17 35.96c-1.828 1.963-1.6 5.152.228 6.87.457.98 1.6 1.471 2.742 1.471s2.284-.49 3.198-1.472l12.564-13.983c5.94 4.416 13.021 8.587 20.788 11.53l-4.797 17.418c-.685 2.699.686 5.397 3.198 6.133h1.37c2.057 0 3.884-1.472 4.341-3.68L52.6 42.83c3.655.736 7.538 1.227 11.422 1.227 3.883 0 7.767-.49 11.422-1.227l4.797 17.173c.457 2.208 2.513 3.68 4.34 3.68.457 0 .914 0 1.143-.246 2.513-.736 3.883-3.434 3.198-6.133l-4.797-17.172c7.767-2.944 14.848-7.114 20.788-11.53l12.336 13.738c.913.981 2.056 1.472 3.198 1.472s2.284-.49 3.198-1.472c1.828-1.963 1.828-4.906.228-6.87l-11.65-13.001c9.366-7.36 14.849-14.474 14.849-14.474z"/></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M84.068 23.784c-1.02 0-1.877-.32-2.572-.96a8.588 8.588 0 0 1-1.738-2.237 11.524 11.524 0 0 1-1.042-2.621c-.232-.895-.348-1.641-.348-2.238V0h.278c.834 0 1.622.085 2.363.256.742.17 1.645.575 2.711 1.214 1.066.64 2.363 1.535 3.892 2.686 1.53 1.15 3.453 2.664 5.77 4.54 2.502 2.045 4.494 3.771 5.977 5.178 1.483 1.406 2.618 2.6 3.406 3.58.787.98 1.274 1.812 1.46 2.494.185.682.277 1.278.277 1.79v2.046H84.068zM127.3 84.01c.278.682.464 1.535.556 2.558.093 1.023-.37 2.003-1.39 2.94-.463.427-.88.832-1.25 1.215-.372.384-.696.704-.974.96a6.69 6.69 0 0 1-.973.767l-11.816-10.741a44.331 44.331 0 0 0 1.877-1.535 31.028 31.028 0 0 1 1.737-1.406c1.112-.938 2.317-1.343 3.615-1.215 1.297.128 2.363.405 3.197.83.927.427 1.923 1.173 2.989 2.239 1.065 1.065 1.876 2.195 2.432 3.388zM78.23 95.902c2.038 0 3.752-.511 5.143-1.534l-26.969 25.83H18.037c-1.761 0-3.684-.47-5.77-1.407a24.549 24.549 0 0 1-5.838-3.709 21.373 21.373 0 0 1-4.518-5.306c-1.204-2.003-1.807-4.07-1.807-6.202V16.495c0-1.79.44-3.665 1.32-5.626A18.41 18.41 0 0 1 5.04 5.562a21.798 21.798 0 0 1 5.213-3.964C12.198.533 14.237 0 16.37 0h53.24v15.984c0 1.62.278 3.367.834 5.242a16.704 16.704 0 0 0 2.572 5.179c1.159 1.577 2.665 2.898 4.518 3.964 1.853 1.066 4.078 1.598 6.673 1.598h20.295v42.325L85.458 92.45c1.02-1.364 1.529-2.856 1.529-4.476 0-2.216-.857-4.113-2.572-5.69-1.714-1.577-3.776-2.366-6.186-2.366H26.1c-2.409 0-4.448.789-6.116 2.366-1.668 1.577-2.502 3.474-2.502 5.69 0 2.217.834 4.092 2.502 5.626 1.668 1.535 3.707 2.302 6.117 2.302h52.13zM26.1 47.951c-2.41 0-4.449.789-6.117 2.366-1.668 1.577-2.502 3.473-2.502 5.69 0 2.216.834 4.092 2.502 5.626 1.668 1.534 3.707 2.302 6.117 2.302h52.13c2.409 0 4.47-.768 6.185-2.302 1.715-1.534 2.572-3.41 2.572-5.626 0-2.217-.857-4.113-2.572-5.69-1.714-1.577-3.776-2.366-6.186-2.366H26.1zm52.407 64.063l1.807-1.663 3.476-3.196a479.75 479.75 0 0 0 4.587-4.284 500.757 500.757 0 0 1 5.004-4.667c3.985-3.666 8.48-7.758 13.485-12.276l11.677 10.741-13.485 12.404-5.004 4.603-4.587 4.22a179.46 179.46 0 0 0-3.267 3.068c-.88.853-1.367 1.322-1.46 1.407-.463.341-.973.703-1.529 1.087-.556.383-1.112.703-1.668.959-.556.256-1.413.575-2.572.959a83.5 83.5 0 0 1-3.545 1.087 72.2 72.2 0 0 1-3.475.895c-1.112.256-1.946.426-2.502.511-1.112.17-1.854.043-2.224-.383-.371-.426-.464-1.151-.278-2.174.092-.511.278-1.279.556-2.302.278-1.023.602-2.067.973-3.132l1.042-3.005c.325-.938.58-1.577.765-1.918a10.157 10.157 0 0 1 2.224-2.941z"/></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M1.482 70.131l36.204 16.18 69.932-65.485-61.38 70.594 46.435 18.735c1.119.425 2.397-.17 2.797-1.363v-.085L127.998.047 1.322 65.874c-1.12.597-1.519 1.959-1.04 3.151.32.511.72.937 1.2 1.107zm44.676 57.821L64.22 107.26l-18.062-7.834v28.527z"/></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M84.742 36.8c2.398 7.2 5.595 12.8 11.19 18.4 4.795-4.8 7.992-11.2 10.39-18.4h-21.58zm-52.748 40h20.78l-10.39-28-10.39 28z"/><path d="M111.916 0H16.009C7.218 0 .025 7.2.025 16v96c0 8.8 7.193 16 15.984 16h95.907c8.791 0 15.984-7.2 15.984-16V16c0-8.8-6.394-16-15.984-16zM72.754 103.2c-1.598 1.6-3.197 1.6-4.795 1.6-.8 0-2.398 0-3.197-.8-.8-.8-1.599 0-1.599-.8s-.799-1.6-1.598-3.2c-.8-1.6-.8-2.4-1.599-4l-3.196-8.8H28.797L25.6 96c-1.598 3.2-2.398 5.6-3.197 7.2-.8 1.6-2.398 1.6-4.795 1.6-1.599 0-3.197-.8-4.796-1.6-1.598-1.6-2.397-2.4-2.397-4 0-.8 0-1.6.799-3.2.8-1.6.8-2.4 1.598-4l17.583-44.8c.8-1.6.8-3.2 1.599-4.8.799-1.6 1.598-3.2 2.397-4 .8-.8 1.599-2.4 3.197-3.2 1.599-.8 3.197-.8 4.796-.8 1.598 0 3.196 0 4.795.8 1.598.8 2.398 1.6 3.197 3.2.799.8 1.598 2.4 2.397 4 .8 1.6 1.599 3.2 2.398 5.6l17.583 44c1.598 3.2 2.398 5.6 2.398 7.2-.8.8-1.599 2.4-2.398 4zM116.711 72c-8.791-3.2-15.185-7.2-20.78-12-5.594 5.6-12.787 9.6-21.579 12l-2.397-4c8.791-2.4 15.984-5.6 21.579-11.2C87.939 51.2 83.144 44 81.545 36h-7.992v-3.2h21.58c-1.6-2.4-3.198-5.6-4.796-8l2.397-.8c1.599 2.4 3.997 5.6 5.595 8.8h19.98v4h-7.992c-2.397 8-6.393 15.2-11.189 20 5.595 4.8 11.988 8.8 20.78 11.2l-3.197 4z"/></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574572606408" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1870" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M870.4 793.6H153.6C68.9024 793.6 0 724.6976 0 640V153.6C0 68.9024 68.9024 0 153.6 0h716.8c84.6976 0 153.6 68.9024 153.6 153.6v486.4c0 84.6976-68.9024 153.6-153.6 153.6zM153.6 51.2c-56.4608 0-102.4 45.9392-102.4 102.4v486.4c0 56.4608 45.9392 102.4 102.4 102.4h716.8c56.4608 0 102.4-45.9392 102.4-102.4V153.6c0-56.4608-45.9392-102.4-102.4-102.4H153.6zM793.6 1024H230.4a25.6 25.6 0 0 1 0-51.2h563.2a25.6 25.6 0 0 1 0 51.2zM633.6 908.8h-243.2a25.6 25.6 0 0 1 0-51.2h243.2a25.6 25.6 0 0 1 0 51.2z" fill="#bfbfbf" p-id="1871"></path><path d="M349.0688 404.3008A25.664 25.664 0 0 1 330.9568 396.8l-54.2976-54.3104a25.6 25.6 0 0 1 36.2112-36.2112l44.2624 44.2752 88.2688-20.3648 20.3648-88.256-44.2752-44.2752a25.6 25.6 0 1 1 36.1984-36.1984L512 215.7824c6.2464 6.2336 8.8192 15.2576 6.848 23.8592l-27.1616 117.6704a25.6 25.6 0 0 1-19.1872 19.1872l-117.6832 27.1488a25.7792 25.7792 0 0 1-5.7472 0.6528zM584.4096 639.6288a25.4976 25.4976 0 0 1-18.0992-7.5008L512 577.8304a25.5616 25.5616 0 0 1-6.848-23.8464l27.1488-117.6832a25.6256 25.6256 0 0 1 19.2-19.1872l117.6704-27.1488a25.536 25.536 0 0 1 23.8464 6.848l54.2976 54.3104a25.6 25.6 0 0 1-36.1984 36.2112l-44.2752-44.2752-88.256 20.3648-20.3648 88.256 44.2752 44.2752a25.6 25.6 0 0 1-18.0864 43.6736z" fill="#bfbfbf" p-id="1872"></path><path d="M557.248 467.648a25.4976 25.4976 0 0 1-18.0992-7.5008l-90.496-90.496a25.6 25.6 0 1 1 36.1984-36.1984l90.496 90.496a25.6 25.6 0 0 1-18.0992 43.6992z" fill="#bfbfbf" p-id="1873"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574572606408" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1870" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M870.4 793.6H153.6C68.9024 793.6 0 724.6976 0 640V153.6C0 68.9024 68.9024 0 153.6 0h716.8c84.6976 0 153.6 68.9024 153.6 153.6v486.4c0 84.6976-68.9024 153.6-153.6 153.6zM153.6 51.2c-56.4608 0-102.4 45.9392-102.4 102.4v486.4c0 56.4608 45.9392 102.4 102.4 102.4h716.8c56.4608 0 102.4-45.9392 102.4-102.4V153.6c0-56.4608-45.9392-102.4-102.4-102.4H153.6zM793.6 1024H230.4a25.6 25.6 0 0 1 0-51.2h563.2a25.6 25.6 0 0 1 0 51.2zM633.6 908.8h-243.2a25.6 25.6 0 0 1 0-51.2h243.2a25.6 25.6 0 0 1 0 51.2z" fill="#707070" p-id="1871"></path><path d="M349.0688 404.3008A25.664 25.664 0 0 1 330.9568 396.8l-54.2976-54.3104a25.6 25.6 0 0 1 36.2112-36.2112l44.2624 44.2752 88.2688-20.3648 20.3648-88.256-44.2752-44.2752a25.6 25.6 0 1 1 36.1984-36.1984L512 215.7824c6.2464 6.2336 8.8192 15.2576 6.848 23.8592l-27.1616 117.6704a25.6 25.6 0 0 1-19.1872 19.1872l-117.6832 27.1488a25.7792 25.7792 0 0 1-5.7472 0.6528zM584.4096 639.6288a25.4976 25.4976 0 0 1-18.0992-7.5008L512 577.8304a25.5616 25.5616 0 0 1-6.848-23.8464l27.1488-117.6832a25.6256 25.6256 0 0 1 19.2-19.1872l117.6704-27.1488a25.536 25.536 0 0 1 23.8464 6.848l54.2976 54.3104a25.6 25.6 0 0 1-36.1984 36.2112l-44.2752-44.2752-88.256 20.3648-20.3648 88.256 44.2752 44.2752a25.6 25.6 0 0 1-18.0864 43.6736z" fill="#707070" p-id="1872"></path><path d="M557.248 467.648a25.4976 25.4976 0 0 1-18.0992-7.5008l-90.496-90.496a25.6 25.6 0 1 1 36.1984-36.1984l90.496 90.496a25.6 25.6 0 0 1-18.0992 43.6992z" fill="#707070" p-id="1873"></path></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M54.122 127.892v-28.68H7.513V87.274h46.609v-12.4H7.513v-12.86h38.003L.099 0h22.6l32.556 45.07c3.617 5.144 6.44 9.611 8.487 13.385 1.788-3.05 4.89-7.779 9.301-14.186L103.93 0h24.01L82.385 62.013h38.34v12.862h-46.41v12.4h46.41v11.937h-46.41v28.68H54.123z"/></svg>
\ No newline at end of file
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><path d="M869.073 277.307H657.111V65.344l211.962 211.963zm-238.232 26.27V65.344l-476.498-.054v416.957h714.73v-178.67H630.841zm-335.836 360.57c-5.07-3.064-10.944-5.133-17.61-6.201-6.67-1.064-13.603-1.6-20.81-1.6h-48.821v85.641h48.822c7.206 0 14.14-.532 20.81-1.6 6.665-1.065 12.54-3.133 17.609-6.202 5.064-3.063 9.134-7.406 12.208-13.007 3.065-5.602 4.6-12.937 4.6-22.011 0-9.07-1.535-16.408-4.6-22.01-3.074-5.603-7.144-9.94-12.208-13.01zM35.82 541.805v416.904h952.358V541.805H35.821zm331.421 191.179c-3.6 11.071-9.343 20.879-17.209 29.413-7.874 8.542-18.078 15.408-30.617 20.61-12.544 5.206-27.747 7.807-45.621 7.807h-66.036v102.45h-62.831V607.517h128.867c17.874 0 33.077 2.6 45.62 7.802 12.541 5.207 22.745 12.076 30.618 20.615 7.866 8.538 13.604 18.277 17.21 29.212 3.6 10.943 5.401 22.278 5.401 34.018 0 11.477-1.8 22.752-5.402 33.819zM644.9 806.417c-5.343 17.61-13.408 32.818-24.212 45.627-10.807 12.803-24.283 22.879-40.423 30.213-16.146 7.343-35.155 11.007-57.03 11.007h-123.26V607.518h123.26c18.41 0 35.552 2.941 51.428 8.808 15.873 5.869 29.618 14.671 41.22 26.412 11.608 11.744 20.674 26.411 27.217 44.02 6.535 17.61 9.803 38.288 9.803 62.035 0 20.81-2.67 40.02-8.003 57.624zm245.362-146.07h-138.07v66.03h119.66v48.829h-119.66v118.058h-62.83V607.518h200.9v52.829h-.001zm-318.2 25.611c-6.402-8.266-14.877-14.604-25.412-19.01-10.544-4.402-23.551-6.602-39.019-6.602h-44.825v180.088h56.029c9.07 0 17.872-1.463 26.415-4.401 8.535-2.932 16.14-7.802 22.812-14.609 6.665-6.8 12.007-15.667 16.007-26.61 4.003-10.94 6.003-24.275 6.003-40.021 0-14.408-1.4-27.416-4.202-39.019-2.8-11.607-7.406-21.542-13.808-29.816zm0 0"/></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M18.448 57.545l-.244-.744-.198-.968-.132-.53v-2.181l.236-.859.24-.908.317-.953.428-1.06.561-1.103.794-1.104v-.773l.077-.724.123-.984.34-1.106.313-1.194.25-.548.289-.511.371-.569.405-.423v-2.73l.234-1.407.236-1.633.42-1.955.577-2.035.43-1.118.426-1.217.468-1.135.559-1.216.57-1.332.655-1.247.737-1.331.929-1.33.43-.762.457-.624.995-1.406 1.025-1.403 1.163-1.444 1.246-1.405 1.352-1.384 1.41-1.423 1.708-1.536 1.083-.934 1.322-1.008 1.34-.89 1.448-.855 1.392-.76 1.57-.63 1.667-.775 1.657-.532 1.653-.552 1.787-.548 1.785-.417 1.876-.347L59.128.68l1.879-.245 1.876-.252 2.002-.106h5.912l1.97.243 1.981.231 2.019.207 1.874.441 1.979.413 1.857.475 2.035.53 1.862.646 1.782.738 1.904.78 1.736.853 1.689.95 1.655 1.044 1.425.971.662.548.693.401 1.323 1.1 1.115 1.064 1.112 1.1 1.083 1.214.894 1.178 1.064 1.217.74 1.306.752 1.162.798 1.352.661 1.175 1.113 2.489.546 1.286.428 1.192.428 1.294.384 1.217.267 1.047.347 1.231.607 2.198.388 1.924.253 1.861.217 1.497.342 2.28.077.362.274.41.737 1.18.473.8.42.832.534.892.472 1.07.307 1.093.334 1.2.252 1.232.115.605.106.746v.648l-.106.643v.8l-.192.774-.35 1.5-.403.76-.299.852v.213l.142.264.4.623 1.746 2.53 1.377 1.9.66 1.267.889 1.389.774 1.52.893 1.627.894 1.828 1.006 2.069.567 1.268.518 1.239.447 1.307.44 1.175.336 1.235.342 1.16.432 2.261.343 2.31.235 2.05v2.891l-.158 1.025-.226 1.768-.308 1.59-.48 1.44-.18.588-.336.707-.28.493-.375.607-.33.383-.42.494-.375.4-.401.34-.48.207-.432.207-.355.114h-.543l-.346-.114-.66-.32-.302-.212-.317-.223-.347-.304-.35-.342-.579-.63-.684-.89-.539-.917-.538-.734-.526-.855-.741-1.517-.833-1.579-.098-.055h-.138l-.338.247-.196.415-.326.516-.567 1.533-.856 2.182-1.096 2.626-.824 1.308-.864 1.366-1.027 1.536-1.09 1.503-.557.68-.676.743-1.555 1.497.136.135.21.214.777.446 3.235 1.524 1.41.779 1.347.756 1.332.953 1.187.982.574.443.432.511.445.593.367.643.198.533.242.64.105.554.115.647-.115.433v.44l-.105.454-.242.415-.092.325-.22.394-.587.784-.543.627-.42.47-.35.348-.893.638-1.01.556-1.077.532-1.155.511-1.287.495-.693.207-.608.167-1.496.342-1.545.325-1.552.323-1.689.27-1.74.072-1.785.21h-5.539l-1.998-.114-1.86-.168-2.005-.27-1.99-.209-2.095-.286-2.03-.495-1.981-.374-1.968-.552-2.019-.707-1.98-.585-1.044-.342-.927-.323-.586-.223-.582-.12h-1.647l-1.904-.131-.962-.096-1.24-.135-.795.705-1.085.665-1.471.701-1.628.875-.99.475-1.033.376-2.281.914-1.24.305-1.3.343-1.803.344-1.13.086-1.193.1-1.246.135-1.45.053h-5.926l-3.346-.053-3.25-.321-1.644-.23-1.589-.23-1.546-.227-1.547-.305-1.442-.456-1.434-.325-1.294-.51-1.223-.474-1.142-.533-.99-.583-.984-.71-.336-.343-.44-.415-.334-.362-.3-.417-.278-.415-.215-.42-.311-.89-.109-.46-.138-.51v-.473l.138-.533v-.53l.109-.53v-1.069l.052-.564.259-.647.215-.646.39-.779.286-.3.236-.348.615-.738.49-.38.464-.266.428-.338.676-.21.543-.324.676-.341.77-.227.775-.231.897-.192.85-.11 1.008-.13 1.093-.081.284-.092h.063l.137-.115v-.13l-.2-.266-.58-.27-1.45-1.231-.975-.761-1.127-.967-1.136-1.082-1.181-1.382-1.36-1.558-.508-.843-.672-.87-.58-1.007-.522-1.1-.704-1.047-.459-1.194-.547-1.192-.546-1.33-.397-1.273-.378-1.575-.112-.057h-.115l-.059-.113h-.14l-.23.113-.114.057-.158.264-.057.321-.119.286-.206.477-.664 1.157-.345.701-.546.612-.58.736-.641.816-.677.724-.795.701-.734.658-.814.524-.89.546-.855.325-1.008.247-.99.095h-.233l-.228-.095-.18-.384-.29-.188-.38-.912-.237-.493-.255-.707-.21-.734-.113-.724-.313-1.648-.12-.972v-3.185l.12-2.379.196-1.214.23-1.252.21-1.347.374-1.254.42-1.443.431-1.407.578-1.448.545-1.38.754-1.4.699-1.52.855-1.425 1.006-1.538 1.023-1.382 1.069-1.538.891-1.071 1.142-1.227 1.202-1.237.56-.59.678-.662.985-.836 1.012-.853 1.647-1.446 1.242-.889z"/></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574576420335" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9530" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M915.94 827.89h-91.42a12.5 12.5 0 0 1 0-25h78.92v-535h-78.92a12.5 12.5 0 1 1 0-25h91.42a12.5 12.5 0 0 1 12.5 12.5v560a12.5 12.5 0 0 1-12.5 12.5z" fill="#cdcdcd" p-id="9531"></path><path d="M915.94 547.91h-91.42a12.5 12.5 0 0 1 0-25h91.42a12.5 12.5 0 0 1 0 25z" fill="#cdcdcd" p-id="9532"></path><path d="M774.6 231.51a90.63 90.63 0 0 1-90.37 90.37H215.94a90.62 90.62 0 0 1-81.18-50.81 88.92 88.92 0 0 0 15.4 1.33h468.29a90.26 90.26 0 0 0 81.18-129.92c42.44 7.35 74.97 44.57 74.97 89.03z" fill="#cdcdcd" p-id="9533"></path><path d="M684.23 334.38H215.94a102.23 102.23 0 0 1-55.12-16.11 103.66 103.66 0 0 1-37.28-41.69 12.5 12.5 0 0 1 13.38-17.82 76.71 76.71 0 0 0 13.24 1.14h468.29a77.76 77.76 0 0 0 70-111.91 12.5 12.5 0 0 1 13.35-17.83 103.18 103.18 0 0 1 85.3 101.35 103.13 103.13 0 0 1-102.87 102.87zM159.46 284.9a78.31 78.31 0 0 0 56.48 24.48h468.29a77.75 77.75 0 0 0 59.28-128.2 78.73 78.73 0 0 0-24.14-19.08 103.06 103.06 0 0 1-100.92 122.8z" fill="#cdcdcd" p-id="9534"></path><path d="M618.45 284.91H150.16a102.86 102.86 0 1 1 0-205.73h468.29a102.86 102.86 0 0 1 0 205.73zM150.16 104.18a77.86 77.86 0 1 0 0 155.73h468.29a77.86 77.86 0 0 0 0-155.73z" fill="#cdcdcd" p-id="9535"></path><path d="M176.2 235.43A53.39 53.39 0 1 1 229.59 182a53.45 53.45 0 0 1-53.39 53.43z m0-81.78A28.39 28.39 0 1 0 204.59 182a28.43 28.43 0 0 0-28.39-28.35zM551.12 194.54H423a12.5 12.5 0 0 1 0-25h128.12a12.5 12.5 0 0 1 0 25z" fill="#cdcdcd" p-id="9536"></path><path d="M774.6 534.74a90.63 90.63 0 0 1-90.37 90.37H215.94a90.62 90.62 0 0 1-81.18-50.81 88.92 88.92 0 0 0 15.4 1.33h468.29a90.26 90.26 0 0 0 81.18-129.92c42.44 7.35 74.97 44.57 74.97 89.03z" fill="#cdcdcd" p-id="9537"></path><path d="M684.23 637.61H215.94a102.23 102.23 0 0 1-55.12-16.11 103.66 103.66 0 0 1-37.28-41.69A12.5 12.5 0 0 1 136.92 562a76.71 76.71 0 0 0 13.24 1.14h468.29a77.76 77.76 0 0 0 70-111.91 12.5 12.5 0 0 1 13.35-17.83 103.18 103.18 0 0 1 85.3 101.34 103.13 103.13 0 0 1-102.87 102.87z m-524.77-49.48a78.31 78.31 0 0 0 56.48 24.48h468.29a77.75 77.75 0 0 0 59.28-128.2 78.73 78.73 0 0 0-24.14-19.08 103.06 103.06 0 0 1-100.92 122.8z" fill="#cdcdcd" p-id="9538"></path><path d="M618.45 588.13H150.16a102.86 102.86 0 1 1 0-205.73h468.29a102.86 102.86 0 0 1 0 205.73zM150.16 407.4a77.86 77.86 0 1 0 0 155.73h468.29a77.86 77.86 0 0 0 0-155.73z" fill="#cdcdcd" p-id="9539"></path><path d="M176.2 538.66a53.39 53.39 0 1 1 53.39-53.39 53.45 53.45 0 0 1-53.39 53.39z m0-81.78a28.39 28.39 0 1 0 28.39 28.39 28.43 28.43 0 0 0-28.39-28.39zM551.12 497.77H423a12.5 12.5 0 0 1 0-25h128.12a12.5 12.5 0 0 1 0 25z" fill="#cdcdcd" p-id="9540"></path><path d="M774.6 869.33a90.63 90.63 0 0 1-90.37 90.37H215.94a90.62 90.62 0 0 1-81.18-50.81 88.92 88.92 0 0 0 15.4 1.33h468.29a90.26 90.26 0 0 0 81.18-129.92c42.44 7.35 74.97 44.57 74.97 89.03z" fill="#cdcdcd" p-id="9541"></path><path d="M684.23 972.2H215.94a102.23 102.23 0 0 1-55.12-16.11 103.66 103.66 0 0 1-37.28-41.69 12.5 12.5 0 0 1 13.38-17.82 76.71 76.71 0 0 0 13.24 1.14h468.29a77.76 77.76 0 0 0 70-111.91A12.5 12.5 0 0 1 701.76 768a102.73 102.73 0 0 1 55.14 174 102.16 102.16 0 0 1-72.67 30.2z m-524.77-49.48a78.31 78.31 0 0 0 56.48 24.48h468.29A77.75 77.75 0 0 0 743.51 819a78.71 78.71 0 0 0-24.14-19.08 103.06 103.06 0 0 1-100.92 122.8z" fill="#cdcdcd" p-id="9542"></path><path d="M618.45 922.72H150.16a102.86 102.86 0 1 1 0-205.73h468.29a102.86 102.86 0 0 1 0 205.73zM150.16 742a77.86 77.86 0 1 0 0 155.73h468.29a77.86 77.86 0 1 0 0-155.73z" fill="#cdcdcd" p-id="9543"></path><path d="M176.2 873.25a53.39 53.39 0 1 1 53.39-53.39 53.45 53.45 0 0 1-53.39 53.39z m0-81.78a28.39 28.39 0 1 0 28.39 28.39 28.42 28.42 0 0 0-28.39-28.4zM551.12 832.35H423a12.5 12.5 0 0 1 0-25h128.12a12.5 12.5 0 0 1 0 25z" fill="#cdcdcd" p-id="9544"></path></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M42.913 101.36c1.642 0 3.198.332 4.667.996a12.28 12.28 0 0 1 3.89 2.772c1.123 1.184 1.987 2.582 2.592 4.193.605 1.612.908 3.318.908 5.118 0 1.8-.303 3.507-.908 5.118-.605 1.611-1.469 3.01-2.593 4.194a13.3 13.3 0 0 1-3.889 2.843 10.582 10.582 0 0 1-4.667 1.066c-1.729 0-3.306-.355-4.732-1.066a13.604 13.604 0 0 1-3.825-2.843c-1.123-1.185-1.988-2.583-2.593-4.194a14.437 14.437 0 0 1-.907-5.118c0-1.8.302-3.506.907-5.118.605-1.61 1.47-3.009 2.593-4.193a12.515 12.515 0 0 1 3.825-2.772c1.426-.664 3.003-.996 4.732-.996zm53.932.285c1.643 0 3.22.331 4.733.995a11.386 11.386 0 0 1 3.889 2.772c1.08 1.185 1.945 2.583 2.593 4.194.648 1.61.972 3.317.972 5.118 0 1.8-.324 3.506-.972 5.117-.648 1.611-1.513 3.01-2.593 4.194a12.253 12.253 0 0 1-3.89 2.843 11 11 0 0 1-4.732 1.066 10.58 10.58 0 0 1-4.667-1.066 12.478 12.478 0 0 1-3.824-2.843c-1.08-1.185-1.945-2.583-2.593-4.194a13.581 13.581 0 0 1-.973-5.117c0-1.801.325-3.507.973-5.118.648-1.611 1.512-3.01 2.593-4.194a11.559 11.559 0 0 1 3.824-2.772 11.212 11.212 0 0 1 4.667-.995zm21.781-80.747c2.42 0 4.3.355 5.64 1.066 1.34.71 2.29 1.587 2.852 2.63a6.427 6.427 0 0 1 .778 3.34c-.044 1.185-.195 2.204-.454 3.057-.26.853-.8 2.606-1.62 5.26a589.268 589.268 0 0 1-2.788 8.743 1236.373 1236.373 0 0 0-3.047 9.453c-.994 3.128-1.75 5.592-2.269 7.393-1.123 3.79-2.55 6.42-4.278 7.89-1.728 1.469-3.846 2.203-6.352 2.203H39.023l1.945 12.795h65.342c4.148 0 6.223 1.943 6.223 5.828 0 1.896-.41 3.53-1.232 4.905-.821 1.374-2.442 2.061-4.862 2.061H38.505c-1.729 0-3.176-.426-4.343-1.28-1.167-.852-2.14-1.966-2.917-3.34a21.277 21.277 0 0 1-1.88-4.478 44.128 44.128 0 0 1-1.102-4.55c-.087-.568-.324-1.942-.713-4.122-.39-2.18-.865-4.904-1.426-8.174l-1.88-10.947c-.692-4.027-1.383-8.079-2.075-12.154-1.642-9.572-3.5-20.234-5.574-31.986H6.87c-1.296 0-2.377-.356-3.24-1.067a9.024 9.024 0 0 1-2.14-2.558 10.416 10.416 0 0 1-1.167-3.2C.108 8.53 0 7.488 0 6.54c0-1.896.583-3.46 1.75-4.69C2.917.615 4.494 0 6.482 0h13.095c1.728 0 3.111.284 4.148.853 1.037.569 1.858 1.28 2.463 2.132a8.548 8.548 0 0 1 1.297 2.701c.26.948.475 1.754.648 2.417.173.758.346 1.825.519 3.199.173 1.374.345 2.772.518 4.193.26 1.706.519 3.507.778 5.403h88.678z"/></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M70.66 4.328l14.01 29.693c1.088 2.29 3.177 3.882 5.603 4.25l31.347 4.76c6.087.926 8.528 8.756 4.117 13.247L103.05 79.395c-1.75 1.78-2.544 4.352-2.132 6.867l5.352 32.641c1.043 6.337-5.33 11.182-10.778 8.19l-28.039-15.409a7.13 7.13 0 0 0-6.91 0l-28.039 15.41c-5.448 2.99-11.821-1.854-10.777-8.19l5.352-32.642c.415-2.515-.387-5.088-2.136-6.867L2.264 56.278C-2.146 51.787.286 43.957 6.38 43.031l31.343-4.76c2.419-.368 4.51-1.96 5.595-4.25L57.334 4.328c2.728-5.77 10.605-5.77 13.325 0z"/></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1553828490559" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1684" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M898.831744 900.517641 103.816972 900.517641c-36.002982 0-65.363683-29.286-65.363683-65.313541l0-554.949184c0-36.041868 29.361725-65.326844 65.363683-65.326844l795.015795 0c36.002982 0 65.198931 29.284977 65.198931 65.326844l0 554.949184C964.030675 871.231641 934.834726 900.517641 898.831744 900.517641L898.831744 900.517641zM103.816972 255.593236c-13.576203 0-24.711821 11.085476-24.711821 24.662703l0 554.949184c0 13.576203 11.136641 24.662703 24.711821 24.662703l795.015795 0c13.577227 0 24.547069-11.086499 24.547069-24.662703l0-554.949184c0-13.577227-10.970866-24.662703-24.547069-24.662703L103.816972 255.593236 103.816972 255.593236zM664.346245 251.774257c-11.161201 0-20.332071-9.080819-20.332071-20.332071l0-101.278661c0-13.576203-11.047614-24.623817-24.699542-24.623817L383.181611 105.539708c-13.576203 0-24.712845 11.04659-24.712845 24.623817l0 101.278661c0 11.252275-9.041934 20.332071-20.332071 20.332071-11.20111 0-20.319791-9.080819-20.319791-20.332071l0-101.278661c0-35.989679 29.323862-65.275679 65.364707-65.275679l236.133022 0c36.06745 0 65.402569 29.284977 65.402569 65.275679l0 101.278661C684.717202 242.694461 675.636383 251.774257 664.346245 251.774257L664.346245 251.774257zM413.233044 521.725502 75.694471 521.725502c-11.163247 0-20.333094-9.117658-20.333094-20.35663 0-11.252275 9.169847-20.332071 20.333094-20.332071l337.538573 0c11.277858 0 20.319791 9.080819 20.319791 20.332071C433.552835 512.607844 424.510902 521.725502 413.233044 521.725502L413.233044 521.725502zM912.894018 521.725502 575.367725 521.725502c-11.213389 0-20.332071-9.117658-20.332071-20.35663 0-11.252275 9.118682-20.332071 20.332071-20.332071l337.526293 0c11.290137 0 20.332071 9.080819 20.332071 20.332071C933.226089 512.607844 924.184155 521.725502 912.894018 521.725502L912.894018 521.725502zM557.56322 634.217552 445.085496 634.217552c-11.213389 0-20.332071-9.079796-20.332071-20.331048l0-168.763658c0-11.251252 9.118682-20.332071 20.332071-20.332071l112.478747 0c11.290137 0 20.370956 9.080819 20.370956 20.332071l0 168.763658C577.934177 625.137757 568.853357 634.217552 557.56322 634.217552L557.56322 634.217552zM465.417567 593.514525l71.827909 0L537.245476 465.454918l-71.827909 0L465.417567 593.514525 465.417567 593.514525z" p-id="1685" fill="#bfbfbf"></path></svg> <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574576079728" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6611" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M981.917808 277.742466H813.589041V122.038356c0-19.638356-15.430137-35.068493-35.068493-35.068493H252.493151c-19.638356 0-35.068493 15.430137-35.068493 35.068493v155.70411H42.082192c-19.638356 0-35.068493 15.430137-35.068493 35.068493V911.780822c0 19.638356 15.430137 35.068493 35.068493 35.068493h939.835616c19.638356 0 35.068493-15.430137 35.068493-35.068493V312.810959c0-19.638356-15.430137-35.068493-35.068493-35.068493z m-694.356164-120.635617H743.452055v120.635617H287.561644v-120.635617zM252.493151 347.879452h694.356164v133.260274h-74.345205v-50.49863c0-19.638356-15.430137-35.068493-35.068494-35.068493h-117.830137c-19.638356 0-35.068493 15.430137-35.068493 35.068493v50.49863h-336.657534v-50.49863c0-19.638356-15.430137-35.068493-35.068493-35.068493h-117.830137c-19.638356 0-35.068493 15.430137-35.068493 35.068493v50.49863H77.150685v-133.260274H252.493151z m549.873972 119.232877v140.273972h-47.69315v-140.273972h47.69315z m-526.027397 0v140.273972h-47.693151v-140.273972h47.693151zM77.150685 876.712329V551.276712h81.358904v89.775343c0 19.638356 15.430137 35.068493 35.068493 35.068493h117.830137c19.638356 0 35.068493-15.430137 35.068493-35.068493v-89.775343h336.657535v89.775343c0 19.638356 15.430137 35.068493 35.068493 35.068493h117.830137c19.638356 0 35.068493-15.430137 35.068493-35.068493v-89.775343h74.345205v324.032877H77.150685z" p-id="6612" fill="#bfbfbf"></path></svg>
\ No newline at end of file \ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M.006.064h127.988v31.104H.006V.064zm0 38.016h38.396v41.472H.006V38.08zm0 48.384h38.396v41.472H.006V86.464zM44.802 38.08h38.396v41.472H44.802V38.08zm0 48.384h38.396v41.472H44.802V86.464zM89.598 38.08h38.396v41.472H89.598zm0 48.384h38.396v41.472H89.598z"/><path d="M.006.064h127.988v31.104H.006V.064zm0 38.016h38.396v41.472H.006V38.08zm0 48.384h38.396v41.472H.006V86.464zM44.802 38.08h38.396v41.472H44.802V38.08zm0 48.384h38.396v41.472H44.802V86.464zM89.598 38.08h38.396v41.472H89.598zm0 48.384h38.396v41.472H89.598z"/></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M78.527 116.793c.178.008.348.024.527.024h40.233c4.711-.005 8.53-3.677 8.534-8.21V18.895c-.004-4.532-3.823-8.204-8.534-8.209H79.054c-.179 0-.353.016-.527.024V0L0 10.082v107.406l78.527 10.342v-11.037zm0-101.362c.174-.024.348-.052.527-.052h40.233c2.018 0 3.659 1.578 3.659 3.52v89.713c-.003 1.942-1.64 3.517-3.659 3.519H79.054c-.179 0-.353-.028-.527-.052V15.431zM30.262 75.757l-18.721-.46V72.37l11.3-16.673v-.148l-10.266.164v-4.51l17.504-.44v3.264L18.696 70.76v.144l11.566.176v4.678zm9.419.231l-5.823-.144V50.671l5.823-.144v25.461zm22.255-11.632c-2.168 1.922-5.353 2.76-9.02 2.736-.702.004-1.402-.04-2.097-.131v9.303l-5.997-.148V50.743c1.852-.352 4.473-.647 8.218-.743 3.838-.096 6.608.539 8.48 1.913 1.807 1.306 3.032 3.5 3.032 6.112s-.926 4.833-2.612 6.331h-.004zM53.36 54.45c-.856-.01-1.71.083-2.541.275v7.682c.523.116 1.167.152 2.06.152 3.301-.004 5.36-1.614 5.36-4.314 0-2.425-1.772-3.843-4.875-3.791l-.004-.004zm39.847-37.066h9.564v3.795h-9.564v-3.795zm-9.568 5.68h9.564v3.8h-9.564v-3.8zm9.568 6.216h9.564v3.799h-9.564V29.28zm0 12h9.564v3.794h-9.564V41.28zm-9.568-6.096h9.564v3.795h-9.564v-3.795zm9.472 47.064c2.512 0 4.921-.96 6.697-2.67 1.776-1.708 2.773-4.026 2.772-6.442l-1.748-15.263c0-5.033-2.492-9.112-7.725-9.112-5.232 0-7.72 4.079-7.72 9.112l-1.752 15.263c-.001 2.417.996 4.735 2.773 6.444 1.777 1.71 4.187 2.669 6.7 2.668h.003zm-3.135-16.75h6.27v12.743h-6.27V65.5z"/></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1545183338053" class="icon" style="" viewBox="0 0 1031 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1503" xmlns:xlink="http://www.w3.org/1999/xlink" width="201.3671875" height="200"><defs><style type="text/css"></style></defs><path d="M422.495 226.407l-97.74-37.845-25.11 101.070-135.585-36.382v126.653h-96.435v520.222h833.332c0 0 0-91.035 0-180.923v-13.162h66.667v-129.352h-66.667v-11.318c0-100.935 0-185.468 0-185.468h-29.768v-61.965l-385.717-194.063M346.58 230.075l363.892 149.85h-74.407l-306.292-82.192 16.807-67.657zM196.19 294.2l319.343 85.702h-319.343v-85.702zM838.745 835.438h-706.838v-387.877h706.86c0 0 0 58.073 0 129.127h-224.685v129.352h224.685c-0.023 65.183-0.023 129.398-0.023 129.398zM839.060 673.73h-192.87v-64.687h192.87v64.687zM839.060 379.903h-96.435v-20.183l-281.408-118.35 40.118-60.57 337.725 160.043v39.060z" p-id="1504"></path></svg> <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574576020792" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5498" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M64 64h384v384H64V64z m0 512h384v384H64V576z m512 0h384v384H576V576z m192-128c106.039 0 192-85.961 192-192S874.039 64 768 64s-192 85.961-192 192 85.961 192 192 192z" p-id="5499" fill="#bfbfbf"></path></svg>
\ No newline at end of file \ No newline at end of file
...@@ -158,7 +158,6 @@ export default { ...@@ -158,7 +158,6 @@ export default {
this.delLoading = true this.delLoading = true
this.crudMethod.del(id).then(() => { this.crudMethod.del(id).then(() => {
this.delLoading = false this.delLoading = false
console.log(this.$refs[id])
this.$refs[id].doClose() this.$refs[id].doClose()
this.dleChangePage() this.dleChangePage()
this.delSuccessNotify() this.delSuccessNotify()
......
<template>
<el-dialog
:append-to-body="true"
:close-on-click-modal="false"
:visible.sync="dialog"
:title="isAdd ? '新增' : '编辑'"
width="500px"
>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="名称">
<el-input v-model="form.name" style="width: 370px" />
</el-form-item>
<el-form-item label="账号">
<el-input v-model="form.account" style="width: 370px" />
</el-form-item>
<el-form-item label="密码">
<el-input v-model="form.password" type="password" style="width: 370px" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/serverAccount'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false,
dialog: false,
form: {
id: '',
name: '',
account: '',
password: ''
},
rules: {}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form)
.then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
})
.catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form)
.then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
})
.catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
name: '',
account: '',
password: ''
}
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input
v-model="query.value"
clearable
placeholder="输入搜索内容"
style="width: 200px"
class="filter-item"
@keyup.enter.native="toQuery"
/>
<el-select
v-model="query.type"
clearable
placeholder="类型"
class="filter-item"
style="width: 130px"
>
<el-option
v-for="item in queryTypeOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-search"
@click="toQuery"
>搜索</el-button>
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px">
<el-button
v-permission="['admin','serverAccount:add']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%">
<el-table-column prop="name" label="名称" />
<el-table-column prop="account" label="账号" />
<el-table-column
v-if="checkPermission(['admin','serverAccount:edit','serverAccount:del'])"
label="操作"
width="150px"
align="center"
>
<template slot-scope="scope">
<el-button
v-permission="['admin','serverAccount:edit']"
size="mini"
type="primary"
icon="el-icon-edit"
@click="edit(scope.row)"
/>
<el-popover
:ref="scope.row.id"
v-permission="['admin','serverAccount:del']"
placement="top"
width="180"
>
<p>确定删除本条数据吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button
:loading="delLoading"
type="primary"
size="mini"
@click="subDelete(scope.row.id)"
>确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del } from '@/api/serverAccount'
import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
queryTypeOptions: [
{ key: 'name', display_name: '名称' },
{ key: 'account', display_name: '账号' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'api/serverAccount'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) {
this.params[type] = value
}
return true
},
subDelete(id) {
this.delLoading = true
del(id)
.then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
})
.catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
name: data.name,
account: data.account,
password: data.password
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
<template>
<el-dialog
:append-to-body="true"
:close-on-click-modal="false"
:visible.sync="dialog"
:title="isAdd ? '新增' : '编辑'"
width="800px"
>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="应用名称" prop="name">
<el-input v-model="form.name" style="width: 670px" placeholder="部署后的文件或者目录名称,用于备份" />
</el-form-item>
<el-form-item label="应用端口" prop="port">
<el-input-number v-model="form.port" placeholder="例如:8080" />
</el-form-item>
<el-form-item label="上传目录" prop="uploadPath">
<el-input
v-model="form.uploadPath"
style="width: 670px"
placeholder="例如: /opt/upload"
/>
</el-form-item>
<el-form-item label="部署目录" prop="deployPath">
<el-input
v-model="form.deployPath"
style="width: 670px"
placeholder="例如: /opt/app"
/>
</el-form-item>
<el-form-item label="备份目录" prop="backupPath">
<el-input
v-model="form.backupPath"
style="width: 670px"
placeholder="例如: /opt/backup"
/>
</el-form-item>
<el-form-item label="启动脚本" prop="startScript">
<el-input
v-model="form.startScript"
:rows="2"
type="textarea"
autosize
style="width: 670px"
placeholder=""
/>
</el-form-item>
<el-form-item label="部署脚本" prop="deployScript">
<el-input
v-model="form.deployScript"
:rows="2"
type="textarea"
autosize
style="width: 670px"
placeholder=""
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/app'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false,
dialog: false,
form: {
id: '',
name: '',
port: 8080,
uploadPath: '/opt/upload',
deployPath: '/opt/app',
backupPath: '/opt/backup',
startScript: '',
deployScript: ''
},
rules: {
name: [
{ required: true, message: '请输入应用名称', trigger: 'change' }
],
uploadPath: [
{ required: true, message: '请输入上传目录', trigger: 'change' }
],
deployPath: [
{ required: true, message: '请输入部署目录', trigger: 'change' }
],
backupPath: [
{ required: true, message: '请输入备份目录', trigger: 'change' }
],
startScript: [
{ required: true, message: '请输入启动脚本', trigger: 'change' }
],
deployScript: [
{ required: true, message: '请输入部署脚本', trigger: 'change' }
]
}
}
},
mounted() {},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.$refs['form'].validate(valid => {
if (valid) {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
} else {
this.$message.error('请将表单中的信息补充完整!')
}
})
},
doAdd() {
add(this.form)
.then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
})
.catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form)
.then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
})
.catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
name: '',
port: 8080,
uploadPath: '/opt/upload',
deployPath: '/opt/app',
backupPath: '/opt/backup',
startScript: '',
deployScript: ''
}
}
}
}
</script>
<style scoped>
</style>
<template>
<el-dialog
:append-to-body="true"
:close-on-click-modal="false"
:visible.sync="dialog"
:title="isAdd ? '新增' : '编辑'"
width="600px"
>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
<el-form-item label="数据库名称" prop="name">
<el-input v-model="form.name" style="width: 370px" />
</el-form-item>
<el-form-item label="jdbcUrl" prop="jdbcUrl">
<el-input v-model="form.jdbcUrl" style="width: 370px" />
</el-form-item>
<el-form-item label="用户名" prop="userName">
<el-input v-model="form.userName" style="width: 370px" />
</el-form-item>
<el-form-item label="数据库密码" prop="pwd">
<el-input v-model="form.pwd" type="password" style="width: 370px" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/database'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false,
dialog: false,
form: {
id: '',
name: '',
jdbcUrl: '',
userName: '',
pwd: ''
},
rules: {
name: [
{ required: true, message: '请输入数据库名称', trigger: 'change' }
],
jdbcUrl: [
{ required: true, message: '请输入数据库连接地址', trigger: 'change' }
],
userName: [
{ required: true, message: '请输入用户名', trigger: 'change' }
],
pwd: [
{ required: true, message: '请输入数据库密码', trigger: 'change' }
]
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.$refs['form'].validate(valid => {
if (valid) {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else {
this.doEdit()
}
} else {
this.$message.error('请将表单中的信息补充完整!')
}
})
},
doAdd() {
add(this.form)
.then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
})
.catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form)
.then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
})
.catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
name: '',
jdbcUrl: '',
userName: '',
pwd: ''
}
}
}
}
</script>
<style scoped>
</style>
...@@ -3,69 +3,47 @@ ...@@ -3,69 +3,47 @@
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <div class="head-container">
<!-- 搜索 --> <!-- 搜索 -->
<el-input <el-input v-model="query.blurry" clearable placeholder="模糊搜索" style="width: 200px" class="filter-item" @keyup.enter.native="toQuery" />
v-model="query.value" <el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
clearable <!-- 新增 -->
placeholder="输入搜索内容"
style="width: 200px"
class="filter-item"
@keyup.enter.native="toQuery"
/>
<el-select
v-model="query.type"
clearable
placeholder="类型"
class="filter-item"
style="width: 130px"
>
<el-option
v-for="item in queryTypeOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-button <el-button
v-permission="['admin','database:add']"
class="filter-item" class="filter-item"
size="mini" size="mini"
type="success" type="primary"
icon="el-icon-search" icon="el-icon-plus"
@click="toQuery" @click="showAddFormDialog"
>搜索</el-button> >新增</el-button>
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px">
<el-button
v-permission="['admin','database:add']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div> </div>
<!--表单组件--> <!--表单组件-->
<eForm ref="form" :is-add="isAdd" /> <el-dialog :append-to-body="true" :close-on-click-modal="false" :visible.sync="dialog" :title="getFormTitle()" width="530px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="数据库名称" prop="name">
<el-input v-model="form.name" style="width: 370px" />
</el-form-item>
<el-form-item label="连接地址" prop="jdbcUrl">
<el-input v-model="form.jdbcUrl" style="width: 370px" />
</el-form-item>
<el-form-item label="用户名" prop="userName">
<el-input v-model="form.userName" style="width: 370px" />
</el-form-item>
<el-form-item label="密码" prop="pwd">
<el-input v-model="form.pwd" type="password" style="width: 370px" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="submitMethod">确认</el-button>
</div>
</el-dialog>
<!--表格渲染--> <!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%"> <el-table v-loading="loading" :data="data" size="small" style="width: 100%">
<!--<el-table-column prop="id" label="id" />-->
<el-table-column prop="name" label="数据库名称" /> <el-table-column prop="name" label="数据库名称" />
<el-table-column prop="jdbcUrl" label="数据库连接地址" /> <el-table-column prop="jdbcUrl" label="连接地址" />
<el-table-column prop="userName" label="用户名" /> <el-table-column prop="userName" label="用户名" />
<el-table-column <el-table-column v-if="checkPermission(['admin','database:edit','database:del'])" label="操作" width="150px" align="center">
v-if="checkPermission(['admin','database:edit','database:del'])"
label="操作"
width="150px"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button v-permission="['admin','database:edit']" size="mini" type="primary" icon="el-icon-edit" @click="showEditFormDialog(scope.row)" />
v-permission="['admin','database:edit']"
size="mini"
type="primary"
icon="el-icon-edit"
@click="edit(scope.row)"
/>
<el-popover <el-popover
:ref="scope.row.id" :ref="scope.row.id"
v-permission="['admin','database:del']" v-permission="['admin','database:del']"
...@@ -75,12 +53,7 @@ ...@@ -75,12 +53,7 @@
<p>确定删除本条数据吗?</p> <p>确定删除本条数据吗?</p>
<div style="text-align: right; margin: 0"> <div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button> <el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button <el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.id)">确定</el-button>
:loading="delLoading"
type="primary"
size="mini"
@click="subDelete(scope.row.id)"
>确定</el-button>
</div> </div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" /> <el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover> </el-popover>
...@@ -100,20 +73,29 @@ ...@@ -100,20 +73,29 @@
</template> </template>
<script> <script>
import checkPermission from '@/utils/permission' import crud from '@/mixins/crud'
import initData from '@/mixins/initData' import crudDataBase from '@/api//mnt/database'
import { del } from '@/api/database'
import eForm from './form'
export default { export default {
components: { eForm }, mixins: [crud],
mixins: [initData],
data() { data() {
return { return {
delLoading: false, title: '数据库',
queryTypeOptions: [ crudMethod: { ...crudDataBase },
{ key: 'name', display_name: '数据库名称' }, form: { id: null, name: null, jdbcUrl: null, userName: null, pwd: null },
{ key: 'jdbcUrl', display_name: '数据库连接地址' } rules: {
] name: [
{ required: true, message: '请输入数据库名称', trigger: 'blur' }
],
jdbcUrl: [
{ required: true, message: '请输入数据库连接地址', trigger: 'blur' }
],
userName: [
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
pwd: [
{ required: true, message: '请输入数据库密码', trigger: 'blur' }
]
}
} }
}, },
created() { created() {
...@@ -122,54 +104,9 @@ export default { ...@@ -122,54 +104,9 @@ export default {
}) })
}, },
methods: { methods: {
checkPermission,
beforeInit() { beforeInit() {
this.url = 'api/database' this.url = 'api/database'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) {
this.params[type] = value
}
return true return true
},
subDelete(id) {
this.delLoading = true
del(id)
.then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
})
.catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
name: data.name,
jdbcUrl: data.jdbcUrl,
userName: data.userName,
pwd: data.pwd
}
_this.dialog = true
} }
} }
} }
......
<template> <template>
<el-dialog <el-dialog :append-to-body="true" :close-on-click-modal="false" :visible.sync="dialog" title="应用部署" width="400px">
:append-to-body="true"
:close-on-click-modal="false"
:visible.sync="dialog"
title="应用部署"
width="400px"
>
<el-form ref="form" :model="form" :rules="rules" size="small"> <el-form ref="form" :model="form" :rules="rules" size="small">
<el-upload <el-upload
:action="deployUploadApi" :action="deployUploadApi"
...@@ -31,7 +25,7 @@ ...@@ -31,7 +25,7 @@
</template> </template>
<script> <script>
import { add, edit, getApps, getServers } from '@/api/deploy' import { add, edit, getApps, getServers } from '@/api/mnt/deploy'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
...@@ -62,9 +56,6 @@ export default { ...@@ -62,9 +56,6 @@ export default {
created() { created() {
this.initWebSocket() this.initWebSocket()
}, },
destroyed: function() {
this.webSocketClose()
},
mounted() { mounted() {
this.initSelect() this.initSelect()
}, },
...@@ -144,9 +135,7 @@ export default { ...@@ -144,9 +135,7 @@ export default {
}) })
}, },
handleSuccess(response, file, fileList) { handleSuccess(response, file, fileList) {
const uid = file.uid this.cancel()
const id = response.id
console.log(uid, id)
}, },
// 监听上传失败 // 监听上传失败
handleError(e, file, fileList) { handleError(e, file, fileList) {
...@@ -160,17 +149,8 @@ export default { ...@@ -160,17 +149,8 @@ export default {
initWebSocket() { initWebSocket() {
const wsUri = process.env.VUE_APP_WS_API + '/webSocket/deploy' const wsUri = process.env.VUE_APP_WS_API + '/webSocket/deploy'
this.websock = new WebSocket(wsUri) this.websock = new WebSocket(wsUri)
this.websock.onopen = this.webSocketOnOpen
this.websock.onerror = this.webSocketOnError this.websock.onerror = this.webSocketOnError
this.websock.onmessage = this.webSocketOnMessage this.websock.onmessage = this.webSocketOnMessage
this.websock.onclose = this.webSocketClose
},
webSocketOnOpen() {
this.$notify({
title: 'WebSocket连接成功',
type: 'success',
duration: 2500
})
}, },
webSocketOnError(e) { webSocketOnError(e) {
this.$notify({ this.$notify({
...@@ -201,13 +181,6 @@ export default { ...@@ -201,13 +181,6 @@ export default {
}, },
webSocketSend(agentData) { webSocketSend(agentData) {
this.websock.send(agentData) this.websock.send(agentData)
},
webSocketClose(e) {
this.$notify({
title: 'WebSocket已经关闭',
type: 'info',
duration: 1000
})
} }
} }
} }
......
<template>
<el-dialog
:append-to-body="true"
:close-on-click-modal="false"
:visible.sync="dialog"
:title="isAdd ? '新增' : '编辑'"
width="500px"
>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="应用编号">
<el-select v-model="form.appId" placeholder="请选择" style="width: 370px">
<el-option v-for="item in apps" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="IP列表">
<el-select v-model="form.selectIp" multiple placeholder="请选择" style="width: 370px">
<el-option v-for="item in servers" :key="item.id" :label="item.id" :value="item.id" />
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit, getApps, getServers } from '@/api/deploy'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false,
dialog: false,
apps: [],
servers: [],
form: {
id: '',
appId: '',
ip: '',
selectIp: []
},
rules: {}
}
},
mounted() {
this.initSelect()
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
joinIp() {
this.form.ip = ''
this.form.selectIp.forEach(ip => {
if (this.form.ip !== '') {
this.form.ip += ','
}
this.form.ip += ip
})
},
doAdd() {
this.joinIp()
add(this.form)
.then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
})
.catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
this.joinIp()
edit(this.form)
.then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
})
.catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
appId: '',
ip: '',
selectIp: []
}
},
initSelect() {
getApps().then(res => {
this.apps = res.content
})
getServers().then(res => {
this.servers = res.content
})
}
}
}
</script>
<style scoped>
</style>
<template> <template>
<el-dialog <el-dialog :append-to-body="true" :close-on-click-modal="false" :visible.sync="dialog" title="系统还原" width="800px">
:append-to-body="true"
:close-on-click-modal="false"
:visible.sync="dialog"
title="系统还原"
width="800px"
>
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <div class="head-container">
<el-input <el-date-picker
v-model="query.value" v-model="query.createTime"
clearable :default-time="['00:00:00','23:59:59']"
placeholder="输入部署时间" type="daterange"
style="width: 200px" range-separator=":"
class="filter-item" class="el-range-editor--small date-item"
@keyup.enter.native="toQuery" style="width: 240px;height: 30.5px"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="部署开始日期"
end-placeholder="部署结束日期"
/> />
<el-button <el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
class="filter-item"
size="mini"
type="success"
icon="el-icon-search"
@click="toQuery"
>搜索
</el-button>
</div> </div>
<el-form size="small" label-width="80px"> <el-form size="small" label-width="80px">
<!--表格渲染--> <!--表格渲染-->
<el-table <el-table v-loading="loading" :data="data" size="small" style="width: 100%" @row-click="showRow">
v-loading="loading"
:data="data"
size="small"
style="width: 100%"
@row-click="showRow"
>
<el-table-column width="30px"> <el-table-column width="30px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-radio v-model="radio" :label="scope.$index" /> <el-radio v-model="radio" :label="scope.$index" />
...@@ -41,19 +25,17 @@ ...@@ -41,19 +25,17 @@
</el-table-column> </el-table-column>
<el-table-column prop="appName" label="应用名称" /> <el-table-column prop="appName" label="应用名称" />
<el-table-column prop="ip" label="部署IP" /> <el-table-column prop="ip" label="部署IP" />
<el-table-column prop="deployDate" label="部署时间" /> <el-table-column prop="deployDate" label="部署时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.deployDate) }}</span>
</template>
</el-table-column>
<el-table-column prop="deployUser" label="部署人员" /> <el-table-column prop="deployUser" label="部署人员" />
</el-table> </el-table>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button> <el-button type="text" @click="cancel">取消</el-button>
<el-button <el-button v-permission="['admin','deploy:add']" :loading="submitLoading" type="primary" @click="doSubmit">确认</el-button>
v-permission="['admin','deploy:add']"
:loading="loading"
type="primary"
@click="doSubmit"
>确认
</el-button>
</div> </div>
<!--分页组件--> <!--分页组件-->
<el-pagination <el-pagination
...@@ -68,11 +50,10 @@ ...@@ -68,11 +50,10 @@
</template> </template>
<script> <script>
import checkPermission from '@/utils/permission' import crud from '@/mixins/crud'
import initData from '@/mixins/initData' import { reducte } from '@/api/mnt/deployHistory'
import { reducte } from '@/api/deployHistory'
export default { export default {
mixins: [initData], mixins: [crud],
props: { props: {
appName: { appName: {
type: String, type: String,
...@@ -81,7 +62,7 @@ export default { ...@@ -81,7 +62,7 @@ export default {
}, },
data() { data() {
return { return {
loading: false, submitLoading: false,
dialog: false, dialog: false,
history: [], history: [],
radio: '', radio: '',
...@@ -95,51 +76,38 @@ export default { ...@@ -95,51 +76,38 @@ export default {
}) })
}, },
methods: { methods: {
checkPermission,
beforeInit() { beforeInit() {
this.url = 'api/deployHistory' this.url = 'api/deployHistory'
this.deployId = this.$parent.deployId this.deployId = this.$parent.deployId
debugger
if (this.deployId === '') { if (this.deployId === '') {
return false return false
} }
const sort = 'deployDate,desc' this.sort = 'deployDate,desc'
this.params = { this.params['deployId'] = this.deployId
page: this.page,
size: this.size,
sort: sort,
deployId: this.$parent.deployId
}
const query = this.query
const type = 'deployDate'
const value = query.value
this.params[type] = value
return true return true
}, },
formatterAppId(row, column) {
return this.appNames
},
showRow(row) { showRow(row) {
this.radio = this.data.indexOf(row) this.radio = this.data.indexOf(row)
this.selectIndex = row.id this.selectIndex = row.id
}, },
cancel() { cancel() {
this.dialog = false this.dialog = false
this.loading = false this.submitLoading = false
}, },
doSubmit() { doSubmit() {
if (this.selectIndex === '') { if (this.selectIndex === '') {
this.$message.error('请选择要还原的备份') this.$message.error('请选择要还原的备份')
} else { } else {
this.submitLoading = true
reducte(JSON.stringify(this.data[this.radio])) reducte(JSON.stringify(this.data[this.radio]))
.then(res => { .then(res => {
this.dialog = false this.dialog = false
this.loading = false this.submitLoading = false
this.appNames = '' this.appNames = ''
this.$parent.init() this.$parent.init()
}) })
.catch(err => { .catch(err => {
this.loading = false this.submitLoading = false
console.log('error:' + err.response.data.message) console.log('error:' + err.response.data.message)
}) })
} }
......
<template>
<el-dialog
:append-to-body="true"
:close-on-click-modal="false"
:visible.sync="dialog"
:title="isAdd ? '新增' : '编辑'"
width="500px"
>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="应用名称" prop="appName">
<el-input v-model="form.appName" style="width: 370px" />
</el-form-item>
<el-form-item label="部署IP" prop="ip">
<el-input v-model="form.ip" style="width: 370px" />
</el-form-item>
<el-form-item label="部署时间" prop="deployDate">
<el-input v-model="form.deployDate" style="width: 370px" />
</el-form-item>
<el-form-item label="部署人员" prop="deployUser">
<el-input v-model="form.deployUser" style="width: 370px" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/deployHistory'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false,
dialog: false,
form: {
id: '',
appName: '',
ip: '',
deployDate: '',
deployUser: ''
},
rules: {
id: [{ required: true, message: '请输入编号', trigger: 'change' }],
appName: [
{ required: true, message: '请输入应用名称', trigger: 'change' }
],
ip: [{ required: true, message: '请输入部署IP', trigger: 'change' }],
deployDate: [
{ required: true, message: '请输入部署时间', trigger: 'change' }
],
deployUser: [
{ required: true, message: '请输入部署人员', trigger: 'change' }
]
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.$refs['form'].validate(valid => {
if (valid) {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else {
this.doEdit()
}
} else {
this.$message.error('请将表单中的信息补充完整!')
}
})
},
doAdd() {
add(this.form)
.then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
})
.catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form)
.then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
})
.catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
appName: '',
ip: '',
deployDate: '',
deployUser: ''
}
}
}
}
</script>
<style scoped>
</style>
...@@ -3,50 +3,16 @@ ...@@ -3,50 +3,16 @@
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <div class="head-container">
<!-- 搜索 --> <!-- 搜索 -->
<el-input <el-input v-model="query.blurry" clearable placeholder="输入搜索内容" style="width: 200px" class="filter-item" @keyup.enter.native="toQuery" />
v-model="query.value" <el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
clearable
placeholder="输入搜索内容"
style="width: 200px"
class="filter-item"
@keyup.enter.native="toQuery"
/>
<el-select
v-model="query.type"
clearable
placeholder="类型"
class="filter-item"
style="width: 130px"
>
<el-option
v-for="item in queryTypeOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-search"
@click="toQuery"
>搜索</el-button>
</div> </div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染--> <!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%"> <el-table v-loading="loading" :data="data" size="small" style="width: 100%">
<el-table-column prop="appName" label="应用名称" /> <el-table-column prop="appName" label="应用名称" />
<el-table-column prop="ip" label="部署IP" /> <el-table-column prop="ip" label="部署IP" />
<el-table-column prop="deployDate" label="部署时间" /> <el-table-column prop="deployDate" label="部署时间" />
<el-table-column prop="deployUser" label="部署人员" /> <el-table-column prop="deployUser" label="部署人员" />
<el-table-column <el-table-column v-if="checkPermission(['admin','deployHistory:del'])" label="操作" width="100px" align="center">
v-if="checkPermission(['admin','deployHistory:del'])"
label="操作"
width="150px"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover <el-popover
:ref="scope.row.id" :ref="scope.row.id"
...@@ -57,12 +23,7 @@ ...@@ -57,12 +23,7 @@
<p>确定删除本条数据吗?</p> <p>确定删除本条数据吗?</p>
<div style="text-align: right; margin: 0"> <div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button> <el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button <el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.id)">确定</el-button>
:loading="delLoading"
type="primary"
size="mini"
@click="subDelete(scope.row.id)"
>确定</el-button>
</div> </div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" /> <el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover> </el-popover>
...@@ -82,22 +43,15 @@ ...@@ -82,22 +43,15 @@
</template> </template>
<script> <script>
import checkPermission from '@/utils/permission' import crud from '@/mixins/crud'
import initData from '@/mixins/initData' import { del } from '@/api/mnt/deployHistory'
import { del } from '@/api/deployHistory'
import eForm from './form'
export default { export default {
components: { eForm }, mixins: [crud],
mixins: [initData],
data() { data() {
return { return {
delLoading: false, title: '部署历史',
queryTypeOptions: [ crudMethod: { del }
{ key: 'appName', display_name: '应用名称' },
{ key: 'ip', display_name: '部署IP' },
{ key: 'deployUser', display_name: '部署人员' }
]
} }
}, },
created() { created() {
...@@ -106,54 +60,9 @@ export default { ...@@ -106,54 +60,9 @@ export default {
}) })
}, },
methods: { methods: {
checkPermission,
beforeInit() { beforeInit() {
this.url = 'api/deployHistory' this.url = 'api/deployHistory'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) {
this.params[type] = value
}
return true return true
},
subDelete(id) {
this.delLoading = true
del(id)
.then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
})
.catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
appName: data.appName,
ip: data.ip,
deployDate: data.deployDate,
deployUser: data.deployUser
}
_this.dialog = true
} }
} }
} }
......
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.id" clearable placeholder="输入名称或IP搜索" style="width: 200px" class="filter-item" @keyup.enter.native="toQuery" />
<el-date-picker
v-model="query.createTime"
:default-time="['00:00:00','23:59:59']"
type="daterange"
range-separator=":"
class="el-range-editor--small date-item"
style="width: 220px;height: 30.5px"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
v-permission="['admin','serverDeploy:add']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="showAddFormDialog"
>新增</el-button>
</div>
<!--表单组件-->
<el-dialog :append-to-body="true" :close-on-click-modal="false" :visible.sync="dialog" :title="getFormTitle()" width="470px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="55px">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" style="width: 370px" />
</el-form-item>
<el-form-item label="IP" prop="ip">
<el-input v-model="form.ip" style="width: 370px" />
</el-form-item>
<el-form-item label="端口" prop="port">
<el-input-number v-model.number="form.port" controls-position="right" style="width: 370px;" />
</el-form-item>
<el-form-item label="账号" prop="account">
<el-input v-model="form.account" style="width: 370px" />
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="form.password" type="password" style="width: 370px" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="submitMethod">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%">
<el-table-column prop="name" label="名称" />
<el-table-column prop="ip" label="IP" />
<el-table-column prop="port" label="端口" />
<el-table-column prop="account" label="账号" />
<el-table-column prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','serverDeploy:edit','serverDeploy:del'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','serverDeploy:edit']" size="mini" type="primary" icon="el-icon-edit" @click="showEditFormDialog(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','serverDeploy:del']"
placement="top"
width="180"
>
<p>确定删除本条数据吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import crud from '@/mixins/crud'
import crudServer from '@/api/mnt/serverDeploy'
import { validateIP } from '@/utils/validate'
export default {
mixins: [crud],
data() {
return {
title: '服务器',
crudMethod: { ...crudServer },
accountList: [],
accountMap: {},
form: { id: null, name: null, ip: null, port: 22, account: 'root', password: null },
rules: {
name: [
{ required: true, message: '请输入名称', trigger: 'blur' }
],
ip: [
{ required: true, message: '请输入IP', trigger: 'blur' },
{ validator: validateIP, trigger: 'change' }
],
port: [
{ required: true, message: '请输入端口', trigger: 'blur', type: 'number' }
],
account: [
{ required: true, message: '请输入账号', trigger: 'blur' }
],
password: [
{ required: true, message: '请输入密码', trigger: 'blur' }
]
}
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
async beforeInit() {
this.url = 'api/serverDeploy'
return true
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-input-number .el-input__inner {
text-align: left;
}
</style>
<template>
<el-dialog
:append-to-body="true"
:close-on-click-modal="false"
:visible.sync="dialog"
:title="isAdd ? '新增' : '编辑'"
width="500px"
>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="服务器IP" prop="id">
<el-input v-model="form.id" :disabled="!isAdd" style="width: 370px" />
</el-form-item>
<el-form-item label="服务器账号" prop="accountId">
<el-select
v-model="form.accountId"
clearable
placeholder="选择对应账号"
class="filter-item"
style="width: 370px"
>
<el-option
v-for="item in accountList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/serverDeploy'
import { validateIP } from '@/utils/validate'
export default {
props: {
isAdd: {
type: Boolean,
required: true
},
accountList: {
type: Array,
required: true
}
},
data() {
return {
loading: false,
dialog: false,
form: {
id: '',
accountId: ''
},
rules: {
id: [
{ required: true, message: '请输入IP', trigger: 'change' },
{ validator: validateIP, trigger: 'change' }
],
accountId: [
{ required: true, message: '请选择账号', trigger: 'change' }
]
}
}
},
mounted() {},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.$refs['form'].validate(valid => {
if (valid) {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else {
this.doEdit()
}
} else {
this.$message.error('请将表单中的信息补充完整!')
}
})
},
doAdd() {
add(this.form)
.then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
})
.catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form)
.then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
})
.catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
accountId: ''
}
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input
v-model="query.value"
clearable
placeholder="输入搜索内容"
style="width: 200px"
class="filter-item"
@keyup.enter.native="toQuery"
/>
<el-select
v-model="query.type"
clearable
placeholder="类型"
class="filter-item"
style="width: 130px"
>
<el-option
v-for="item in queryTypeOptions"
:key="item.key"
:label="item.display_name"
:value="item.key"
/>
</el-select>
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-search"
@click="toQuery"
>搜索</el-button>
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px">
<el-button
v-permission="['admin','serverDeploy:add']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" :account-list="accountList" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%">
<el-table-column prop="id" label="服务器IP" />
<el-table-column :formatter="accountTranslate" prop="accountId" label="服务器账号" />
<el-table-column
v-if="checkPermission(['admin','serverDeploy:edit','serverDeploy:del'])"
label="操作"
width="150px"
align="center"
>
<template slot-scope="scope">
<el-button
v-permission="['admin','serverDeploy:edit']"
size="mini"
type="primary"
icon="el-icon-edit"
@click="edit(scope.row)"
/>
<el-popover
:ref="scope.row.id"
v-permission="['admin','serverDeploy:del']"
placement="top"
width="180"
>
<p>确定删除本条数据吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button
:loading="delLoading"
type="primary"
size="mini"
@click="subDelete(scope.row.id)"
>确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del } from '@/api/serverDeploy'
import { queryServerAccount } from '@/api/serverAccount'
import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
queryTypeOptions: [{ key: 'id', display_name: '服务器IP' }],
accountList: [],
accountMap: {}
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
async beforeInit() {
this.url = 'api/serverDeploy'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
await queryServerAccount({}).then(res => {
this.accountList = res.content
this.accountList.forEach(({ id, name }) => {
this.accountMap[id] = name
})
})
if (type && value) {
this.params[type] = value
}
return true
},
accountTranslate(row, column) {
return this.accountMap[row.accountId]
},
subDelete(id) {
this.delLoading = true
del(id)
.then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
})
.catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
accountId: data.accountId
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="名称">
<el-input v-model="form.name" style="width: 370px;" />
</el-form-item>
<el-form-item label="IP地址">
<el-input v-model="form.ip" style="width: 370px;" />
</el-form-item>
<el-form-item label="访问端口">
<el-input-number v-model="form.port" />
</el-form-item>
<el-form-item label="排序">
<el-input-number v-model="form.sort" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/monitor/server'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
name: '',
ip: '',
port: '8777',
state: '',
cpuRate: '',
cpuCore: '',
memTotal: '',
memUsed: '',
diskTotal: '',
diskUsed: '',
swapTotal: '',
swapUsed: '',
sort: '999'
},
rules: {
name: [
{ required: true, message: '请输入名称', trigger: 'blur' }
],
ip: [
{ required: true, message: '请输入IP', trigger: 'blur' }
],
port: [
{ required: true, message: '请输入访问端口', trigger: 'blur' }
]
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
name: '',
ip: '',
port: '',
state: '',
cpuRate: '',
cpuCore: '',
memTotal: '',
memUsed: '',
diskTotal: '',
diskUsed: '',
swapTotal: '',
swapUsed: '',
sort: ''
}
}
}
}
</script>
<style scoped>
</style>
...@@ -3,37 +3,49 @@ ...@@ -3,37 +3,49 @@
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <div class="head-container">
<!-- 搜索 --> <!-- 搜索 -->
<el-input v-model="query.value" clearable size="small" placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" /> <el-input v-model="query.blurry" clearable size="small" placeholder="输入名称或者服务地址" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable size="small" placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button> <el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 --> <!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;"> <el-button
<el-button v-permission="['admin','server:add']"
v-permission="['admin','server:add']" class="filter-item"
class="filter-item" size="mini"
size="mini" type="primary"
type="primary" icon="el-icon-plus"
icon="el-icon-plus" @click="showAddFormDialog"
@click="add" >新增
>新增 </el-button>
</el-button>
</div>
<!-- 刷新 --> <!-- 刷新 -->
<div style="display: inline-block;"> <el-button
<el-button size="mini"
size="mini" class="filter-item"
class="filter-item" type="warning"
type="warning" icon="el-icon-refresh"
icon="el-icon-refresh" @click="toQuery"
@click="refresh" >刷新
>刷新 </el-button>
</el-button>
</div>
</div> </div>
<!--表单组件--> <!--表单组件-->
<eForm ref="form" :is-add="isAdd" /> <el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="getFormTitle()" width="500px">
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" style="width: 370px;" />
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input v-model="form.address" style="width: 370px;" />
</el-form-item>
<el-form-item label="端口" prop="port">
<el-input-number v-model.number="form.port" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number v-model.number="form.sort" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="submitMethod">确认</el-button>
</div>
</el-dialog>
<!--表格渲染--> <!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;"> <el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column label="状态" width="50px"> <el-table-column label="状态" width="50px">
...@@ -48,8 +60,8 @@ ...@@ -48,8 +60,8 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="名称" /> <el-table-column prop="name" label="名称" />
<el-table-column prop="ip" label="IP地址" /> <el-table-column prop="address" label="地址" />
<el-table-column prop="port" label="访问端口" width="80px" align="center" /> <el-table-column prop="port" label="端口" width="80px" align="center" />
<el-table-column :formatter="formatCpuRate" prop="cpuRate" label="CPU使用率" width="100px" align="center" /> <el-table-column :formatter="formatCpuRate" prop="cpuRate" label="CPU使用率" width="100px" align="center" />
<el-table-column prop="cpuCore" label="CPU内核数" width="100px" align="center" /> <el-table-column prop="cpuCore" label="CPU内核数" width="100px" align="center" />
<el-table-column label="物理内存" align="center"> <el-table-column label="物理内存" align="center">
...@@ -90,7 +102,7 @@ ...@@ -90,7 +102,7 @@
</el-table-column> </el-table-column>
<el-table-column v-if="checkPermission(['admin','server:edit','server:del'])" label="操作" width="150px" align="center"> <el-table-column v-if="checkPermission(['admin','server:edit','server:del'])" label="操作" width="150px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-permission="['admin','server:edit']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" /> <el-button v-permission="['admin','server:edit']" size="mini" type="primary" icon="el-icon-edit" @click="showEditFormDialog(scope.row)" />
<el-popover <el-popover
:ref="scope.row.id" :ref="scope.row.id"
v-permission="['admin','server:del']" v-permission="['admin','server:del']"
...@@ -100,7 +112,7 @@ ...@@ -100,7 +112,7 @@
<p>确定删除本条数据吗?</p> <p>确定删除本条数据吗?</p>
<div style="text-align: right; margin: 0"> <div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button> <el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button> <el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.id)">确定</el-button>
</div> </div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" /> <el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover> </el-popover>
...@@ -120,21 +132,42 @@ ...@@ -120,21 +132,42 @@
</template> </template>
<script> <script>
import checkPermission from '@/utils/permission' import crud from '@/mixins/crud'
import initData from '@/mixins/initData' import crudServer from '@/api/monitor/server'
import { del } from '@/api/monitor/server'
import eForm from './form'
export default { export default {
name: 'ServerMonitor', name: 'ServerMonitor',
components: { eForm }, mixins: [crud],
mixins: [initData],
data() { data() {
return { return {
delLoading: false, title: '监控',
queryTypeOptions: [ crudMethod: { ...crudServer },
{ key: 'name', display_name: '名称' }, form: {
{ key: 'ip', display_name: 'IP地址' } id: null,
] name: null,
ip: null,
port: 8777,
state: null,
cpuRate: null,
cpuCore: null,
memTotal: null,
memUsed: null,
diskTotal: null,
diskUsed: null,
swapTotal: null,
swapUsed: null,
sort: 999
},
rules: {
name: [
{ required: true, message: '请输入名称', trigger: 'blur' }
],
address: [
{ required: true, message: '请输入IP', trigger: 'blur' }
],
port: [
{ required: true, message: '请输入访问端口', trigger: 'blur', type: 'number' }
]
}
} }
}, },
created() { created() {
...@@ -143,65 +176,12 @@ export default { ...@@ -143,65 +176,12 @@ export default {
}) })
}, },
methods: { methods: {
checkPermission, // 获取数据前设置好接口地址
beforeInit() { beforeInit() {
this.url = 'api/server' this.url = 'api/server'
const sort = 'sort,asc' this.sort = 'sort,asc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) {
this.params[type] = value
}
return true return true
}, },
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
name: data.name,
ip: data.ip,
port: data.port,
state: data.state,
cpuRate: data.cpuRate,
cpuCore: data.cpuCore,
memTotal: data.memTotal,
memUsed: data.memUsed,
diskTotal: data.diskTotal,
diskUsed: data.diskUsed,
swapTotal: data.swapTotal,
swapUsed: data.swapUsed,
sort: data.sort
}
_this.dialog = true
},
refresh() {
this.init()
},
formatCpuRate(row, column) { formatCpuRate(row, column) {
const value = row.cpuRate const value = row.cpuRate
if (!value) { if (!value) {
......
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