diff --git a/src/apis/update.js b/src/apis/update.js index 45ca1b9..d283ea9 100644 --- a/src/apis/update.js +++ b/src/apis/update.js @@ -55,8 +55,18 @@ export const get_update_option = () => { } export const get_git_ver = () => { - return request( { + return request({ url: `/update/get_git_version/`, method: 'get', }) +} + + +export const handle_update = (params) => { + return request({ + url: '/update/update_cine/', + method: 'get', + params: params, + timeout: 3*60*1000, + }) } \ No newline at end of file diff --git a/src/components/update/CinemaUpdate.vue b/src/components/update/CinemaUpdate.vue index a28e2e6..e652425 100644 --- a/src/components/update/CinemaUpdate.vue +++ b/src/components/update/CinemaUpdate.vue @@ -1,12 +1,13 @@ - + 更新单机:{{ ip }}目标版本: - - + + - + - + 执行脚本 - + {{ cmd.desc }} + 数据库 - + {{ cmd.desc }} + 执行升级 - + {{ cmd.desc }} + 客户端 - + {{ cmd.desc }} + - 更新 - - - - - - - - {{ p.content }} - - - {{ p.checked }} - - - - - - + {{ updateBtn }} @@ -179,62 +243,13 @@ const progress = [ .el-divider--horizontal { line-height: 1; } + .update { padding-left: 0; } + .ip { margin-right: 100px; } - -.processBox { - background-color: #fff; - height: 210px; - - .title { - font-size: 16px; - font-weight: 600; - padding-left: 32px; - padding-top: 16px; - } - .timelineProcessBox { - .timeline { - display: flex; - width: 95%; - margin: 40px auto; - .lineitem { - transform: translateX(50%); - width: 25%; - } - } - } -} - -:deep(.el-timeline-item__tail) { - border-left: none; - border-top: 2px solid #e4e7ed; - width: 100%; - position: absolute; - top: 6px; -} -:deep(.el-timeline-item__wrapper) { - padding-left: 0; - position: absolute; - top: 20px; - transform: translateX(-50%); - text-align: center; -} -:deep(.el-timeline-item__timestamp) { - font-size: 14px; -} -.active { - :deep(.el-timeline-item__node) { - background-color: $login_word; - } - - :deep(.el-timeline-item__tail) { - border-color: $login_word; - } -} - \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js index 0f452f1..1fa7981 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -4,13 +4,32 @@ export default createStore({ modules: {}, state: { update_dialog_show: false, + update_config: {}, + update_status: {}, }, getters: { - dialog_change: (state) => { + dialog_change: state => { state.update_dialog_show = !state.update_dialog_show return state.update_dialog_show } }, - mutations: {}, + mutations: { + add_update_cine: (state, payload) => { + state.update_config[payload.ip] = payload.config + }, + add_update_status: (state, payload) => { + state.update_status[payload.ip] = payload.status + }, + change_update_status: (state, ip) => { + if (state.update_status[ip] !== undefined) { + state.update_status[ip] = !state.update_status[ip] + } + }, + clear_update_status: (state, ip) => { + if (state.update_status[ip]) { + delete state.update_status[ip] + } + } + }, actions: {}, }) \ No newline at end of file diff --git a/src/views/update/index.vue b/src/views/update/index.vue index ce9065e..9d97106 100644 --- a/src/views/update/index.vue +++ b/src/views/update/index.vue @@ -1,6 +1,6 @@ @@ -237,8 +213,6 @@ const changeDialogStatus = (val) => { - -