🎨完成基本构想的全部
This commit is contained in:
@@ -24,6 +24,9 @@ import changePwdForms, {
|
||||
} from "./component/change-password.vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import useGetGlobalProperties from "@/hooks/useGetGlobalProperties";
|
||||
import { Refresh } from "@element-plus/icons-vue";
|
||||
import { getServerRestartRule, restartServer } from "@/api/server";
|
||||
import { message } from "@/utils/message";
|
||||
|
||||
const {
|
||||
layout,
|
||||
@@ -121,6 +124,29 @@ const openChangePasswordDialog = () => {
|
||||
}
|
||||
});
|
||||
};
|
||||
let rule = ref(false);
|
||||
// 判断是否展示重载配置按钮
|
||||
const getRule = () => {
|
||||
getServerRestartRule().then(res => {
|
||||
if (res.code === 200) {
|
||||
rule.value = res.data.rule === "hand";
|
||||
}
|
||||
});
|
||||
return rule;
|
||||
};
|
||||
|
||||
// 重启服务端
|
||||
const restartServerCommand = () => {
|
||||
restartServer({
|
||||
status: "RESTART"
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
message("应用配置成功", { type: "success" });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
getRule();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -140,13 +166,21 @@ const openChangePasswordDialog = () => {
|
||||
<LayNavMix v-if="layout === 'mix'" />
|
||||
|
||||
<div v-if="layout === 'vertical'" class="vertical-header-right">
|
||||
<!-- 菜单搜索 -->
|
||||
<!-- <LaySearch id="header-search" />-->
|
||||
<!-- 全屏 -->
|
||||
<!-- <LaySidebarFullScreen id="full-screen" />-->
|
||||
<!-- 消息通知 -->
|
||||
<!-- <LayNotice id="header-notice" />-->
|
||||
<!-- 退出登录 -->
|
||||
<el-button
|
||||
v-if="rule"
|
||||
type="danger"
|
||||
:icon="Refresh"
|
||||
style="margin-right: 150px"
|
||||
@click="restartServerCommand()"
|
||||
>重载配置</el-button
|
||||
>
|
||||
<!-- 菜单搜索-->
|
||||
<!-- <LaySearch id="header-search" />-->
|
||||
<!-- 全屏-->
|
||||
<!-- <LaySidebarFullScreen id="full-screen" />-->
|
||||
<!-- 消息通知-->
|
||||
<!-- <LayNotice id="header-notice" />-->
|
||||
<!-- 退出登录-->
|
||||
<el-dropdown trigger="click">
|
||||
<span class="el-dropdown-link navbar-bg-hover select-none">
|
||||
<img :src="userAvatar" :style="avatarsStyle" />
|
||||
|
Reference in New Issue
Block a user