| | |
| | | <template>
|
| | | <div class="all">
|
| | | <div class="cluster-content">
|
| | | <div class="update-set-content">
|
| | | <div class="cluster-center" ref="left">
|
| | | <div
|
| | | class="menu-item"
|
| | |
| | | </div>
|
| | | <div class="cluster-right">
|
| | | <div class="net-set" v-if="activePage == 0">
|
| | | <el-radio-group v-model="radio2" size="medium">
|
| | | <el-radio-group
|
| | | v-model="radio2"
|
| | | size="medium"
|
| | | fill="rgba(61, 104, 225, 1)"
|
| | | >
|
| | | <el-radio-button label="检查更新"></el-radio-button>
|
| | | <el-radio-button label="上传更新"></el-radio-button>
|
| | | </el-radio-group>
|
| | |
|
| | | <div
|
| | | class="update-center"
|
| | | v-if="radio2 == '检查更新'"
|
| | | v-loading="upgrading"
|
| | | element-loading-text="更新中,请稍后"
|
| | | element-loading-spinner="el-icon-loading"
|
| | | >
|
| | | <span class="icon iconfont spin-bg"></span>
|
| | | <div class="desc" v-if="hasNewVersion">
|
| | | 检查到最新版本:{{ newVersionName }}
|
| | | <div class="update-center" v-if="radio2 == '检查更新'">
|
| | | <span v-if="hasNewVersion||checking"
|
| | | class="icon iconfont spin-bg"
|
| | | :class="upgrading || checking ? 'spin-bg-rot' : ''"
|
| | | ></span
|
| | | >
|
| | | <span v-else
|
| | | class="icon iconfont spin-bg"
|
| | | ></span
|
| | | >
|
| | | <div class="desc" v-if="checking && !upgrading">
|
| | | 正在检测版本更新……
|
| | | </div>
|
| | | <div class="desc desc-suc" v-else>已是最新版本</div>
|
| | | <div class="desc" v-if="!checking && hasNewVersion">
|
| | | {{ upgrading ? "正在升级至" : "检查到" }}最新版本:{{
|
| | | newVersionName
|
| | | }}
|
| | | </div>
|
| | | <div class="desc desc-suc" v-if="!checking && !hasNewVersion">
|
| | | 当前已经是最新版本
|
| | | </div>
|
| | | <el-button
|
| | | v-if="hasNewVersion"
|
| | | v-if="hasNewVersion && !checking"
|
| | | :loading="upgrading"
|
| | | type="primary"
|
| | | style="width: 150px"
|
| | | size="small"
|
| | | @click="upgradeNewVersion"
|
| | | >更新</el-button
|
| | | >
|
| | |
|
| | | <div class="text-desc" v-if="hasNewVersion && !checking&& !upgrading">
|
| | | {{verText}}
|
| | | </div>
|
| | | </div>
|
| | | <div class="upload-center" v-if="radio2 == '上传更新'">
|
| | | <div class="upload-top">
|
| | | <!-- <div class="up-text">上传更新文件,只能上传文件</div> -->
|
| | | <el-upload
|
| | | class="upload-demo"
|
| | | drag
|
| | | action
|
| | | v-show="!shengjiing"
|
| | | :http-request="uploadPkg"
|
| | | :limit="1"
|
| | | >
|
| | |
| | | </div>
|
| | | <div class="el-upload__tip" slot="tip"></div>
|
| | | </el-upload>
|
| | | <!-- <fileUploader
|
| | | single
|
| | | url="/version/upload"
|
| | | @complete="onFileUpload"
|
| | | @file-added="onFileAdded"
|
| | | /> -->
|
| | |
|
| | | <span
|
| | | class="icon iconfont spin-bg"
|
| | | :class="shengjiing ? 'spin-bg-rot' : ''"
|
| | | v-if="shengjiing"
|
| | | ></span
|
| | | >
|
| | | <div class="desc" v-if="shengjiing">正在进行更新……</div>
|
| | | <el-button
|
| | | type="primary"
|
| | | style="width: 150px"
|
| | | style="width: 150px; font-size: 15px"
|
| | | @click="upgrade"
|
| | | size="small"
|
| | | class="uploader-btn"
|
| | | :loading="shengjiing"
|
| | | >{{ shengjiing ? "更新中" : "更新" }}</el-button
|
| | |
| | | <div class="name">{{ item.title }}</div>
|
| | | <el-switch
|
| | | v-model="item.val"
|
| | | active-value="1"
|
| | | inactive-value="0"
|
| | | active-color="rgba(61, 104, 225, 1)"
|
| | | @change="switchChange(item)"
|
| | | >
|
| | |
| | | <script>
|
| | | import {
|
| | | getDevInfo,
|
| | | fileUpload,
|
| | | doUpgrade,
|
| | | checkNewVersion,
|
| | | upgradeNewVersion,
|
| | |
| | | getSettings,
|
| | | updateSettings,
|
| | | } from "@/api/system";
|
| | | import { getUrlKey } from "@/api/utils";
|
| | | export default {
|
| | | filters: {
|
| | | nameFilter(v) {
|
| | | switch (v) {
|
| | | case value:
|
| | | break;
|
| | |
|
| | | default:
|
| | | break;
|
| | | }
|
| | | return;
|
| | | },
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | radio2: "检查更新",
|
| | | activePage: 0,
|
| | | patchUpdateStatus: "",
|
| | | probeSum: 0,
|
| | | timer: null,
|
| | | timer: null,verText:"",
|
| | | patchFile: {},
|
| | | fileAdded: false,
|
| | | curVersionName: "",
|
| | | shengjiing: false,
|
| | | upgrading: false,
|
| | | checking: true,
|
| | | newVersionName: "",
|
| | | hasNewVersion: true,
|
| | | sysSetList: [
|
| | |
| | | };
|
| | | },
|
| | | mounted() {
|
| | | this.fetchUpgradInfo();
|
| | | const isAutoUpdate = getUrlKey("autoUpdate");
|
| | | if (isAutoUpdate==1) {
|
| | | this.checking = false
|
| | | this.upgradeNewVersion()
|
| | | // this.showWelcome = false;
|
| | | // this.activeIndex = this.menuArr.findIndex((x) => x.name == menu);
|
| | | // this.$nextTick(() => {
|
| | | // this.$refs.netSettings.openRight(2);
|
| | | // });
|
| | | }else{
|
| | | this.fetchUpgradInfo();
|
| | | }
|
| | | this.fetchSettings();
|
| | | },
|
| | | methods: {
|
| | |
| | | });
|
| | | },
|
| | | fetchUpgradInfo() {
|
| | | this.checking = true;
|
| | | checkNewVersion().then((res) => {
|
| | | setTimeout(() => {
|
| | | this.checking = false;
|
| | | }, 800);
|
| | | this.newVersionName = res.data.newVersion;
|
| | | this.curVersionName = res.data.curVersion;
|
| | | this.hasNewVersion = res.data.hasNewVersion;
|
| | | this.verText=res.data.newVersionInfo
|
| | |
|
| | | if (!this.hasNewVersion) {
|
| | | this.upgrading = false;
|
| | | }
|
| | | });
|
| | | },
|
| | | upgradeNewVersion() {
|
| | | this.upgrading = true;
|
| | | upgradeNewVersion().then((res) => {
|
| | | this.upgrading = false;
|
| | | this.$message.success("更新版本成功");
|
| | | this.$notify.success("更新版本成功");
|
| | | this.fetchUpgradInfo();
|
| | | });
|
| | | },
|
| | |
| | | id: this.pkgID,
|
| | | }).then((res) => {
|
| | | this.shengjiing = false;
|
| | | this.$message.success("更新版本成功");
|
| | | this.$notify.success("更新版本成功");
|
| | | this.pkgID = "";
|
| | | });
|
| | | },
|
| | |
| | | this.activePage = typ;
|
| | | },
|
| | | switchChange(item) {
|
| | | let data = {
|
| | | updateSettings({
|
| | | name: item.name,
|
| | | value: item.val,
|
| | | };
|
| | | updateSettings(data).then((res) => {
|
| | | }).then((res) => {
|
| | | if (res.code == 200) {
|
| | | this.$message.success("更新成功");
|
| | | this.$notify.success("更新成功");
|
| | | }
|
| | | });
|
| | | },
|
| | |
| | | .all {
|
| | | width: 100%;
|
| | | }
|
| | |
|
| | | .cluster-content {
|
| | | .update-set-content {
|
| | | height: 100%;
|
| | | display: flex;
|
| | | flex-direction: row;
|
| | |
| | | flex-direction: column;
|
| | | justify-content: space-between;
|
| | | height: 95%;
|
| | | @keyframes spin {
|
| | | from {
|
| | | transform: rotate(0deg);
|
| | | }
|
| | | to {
|
| | | transform: rotate(360deg);
|
| | | }
|
| | | }
|
| | |
|
| | | .spin-bg {
|
| | | color: rgb(206, 205, 205);
|
| | | font-size: 100px;
|
| | | margin-bottom: 20px;
|
| | | }
|
| | | .spin-bg-rot {
|
| | | animation: spin 0.8s linear infinite;
|
| | | }
|
| | | .desc {
|
| | | height: 20px;
|
| | | line-height: 20px;
|
| | | font-size: 15px;
|
| | | color: rgb(231, 121, 58);
|
| | | margin-bottom: 20px;
|
| | | font-weight: 600;
|
| | | }
|
| | | .update-center {
|
| | | display: flex;
|
| | | flex-direction: column;
|
| | | align-items: center;
|
| | |
|
| | | .spin-bg {
|
| | | color: rgb(206, 205, 205);
|
| | | font-size: 110px;
|
| | | margin-bottom: 5px;
|
| | | }
|
| | |
|
| | | .desc {
|
| | | height: 20px;
|
| | | line-height: 20px;
|
| | | font-size: 15px;
|
| | | color: rgb(231, 121, 58);
|
| | | margin-bottom: 20px;
|
| | | font-weight: 600;
|
| | | }
|
| | | .desc-suc {
|
| | | color: rgb(58, 231, 58);
|
| | | color: #3a8120;
|
| | | }
|
| | | .el-button {
|
| | | width: 100px;
|
| | | font-size: 15px;
|
| | | }
|
| | | .text-desc{
|
| | | width: 260px;
|
| | | margin-top: 20px;
|
| | | background-color: rgba(250, 250, 250, 1);
|
| | | border: 1px dashed rgba(220, 220, 220, 1);
|
| | | height: 100px;
|
| | | padding: 10px 20px;
|
| | | color: rgba(94, 94, 94, 1);
|
| | | text-align: left;
|
| | | font-size: 14px;
|
| | | border-radius:5px ;
|
| | | }
|
| | | }
|
| | | .upload-center {
|
| | | .update-center {
|