更新容器获取
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package com.jeesite.modules.app;
|
||||
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.modules.app.Service.MyService;
|
||||
import com.jeesite.modules.app.dao.MyWorkInfo;
|
||||
import com.jeesite.modules.app.dao.info.DockerInfo;
|
||||
@@ -22,10 +20,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static com.jeesite.common.web.BaseController.text;
|
||||
import static com.jeesite.common.web.http.ServletUtils.renderResult;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/biz/myWork")
|
||||
public class appStart {
|
||||
@@ -116,48 +110,4 @@ public class appStart {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "restart")
|
||||
@ResponseBody
|
||||
public String restart(DockerInfo dockerInfo) {
|
||||
BizMonitorHost monitorHost = new BizMonitorHost();
|
||||
monitorHost.setHostId(dockerInfo.getHostId());
|
||||
List<BizMonitorHost> bizMonitorHostList = bizMonitorHostService.findList(monitorHost);
|
||||
BizMonitorHost bizMonitorHost = bizMonitorHostList.get(0);
|
||||
if (bizMonitorHost.getIsAuth().equals("1")) {
|
||||
DockerUtils dockerUtils = new DockerUtils(bizMonitorHost.getIpAddress(), bizMonitorHost.getCheckTargetPort());
|
||||
dockerUtils.stopContainer(dockerInfo.getId());
|
||||
dockerUtils.startContainer(dockerInfo.getId());
|
||||
}
|
||||
return renderResult(Global.TRUE, text("重启容器成功!"));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "start")
|
||||
@ResponseBody
|
||||
public String start(DockerInfo dockerInfo) {
|
||||
BizMonitorHost monitorHost = new BizMonitorHost();
|
||||
monitorHost.setHostId(dockerInfo.getHostId());
|
||||
List<BizMonitorHost> bizMonitorHostList = bizMonitorHostService.findList(monitorHost);
|
||||
BizMonitorHost bizMonitorHost = bizMonitorHostList.get(0);
|
||||
if (bizMonitorHost.getIsAuth().equals("1")) {
|
||||
DockerUtils dockerUtils = new DockerUtils(bizMonitorHost.getIpAddress(), bizMonitorHost.getCheckTargetPort());
|
||||
dockerUtils.startContainer(dockerInfo.getId());
|
||||
}
|
||||
return renderResult(Global.TRUE, text("启动容器成功!"));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "stop")
|
||||
@ResponseBody
|
||||
public String stop(DockerInfo dockerInfo) {
|
||||
BizMonitorHost monitorHost = new BizMonitorHost();
|
||||
monitorHost.setHostId(dockerInfo.getHostId());
|
||||
List<BizMonitorHost> bizMonitorHostList = bizMonitorHostService.findList(monitorHost);
|
||||
BizMonitorHost bizMonitorHost = bizMonitorHostList.get(0);
|
||||
if (bizMonitorHost.getIsAuth().equals("1")) {
|
||||
DockerUtils dockerUtils = new DockerUtils(bizMonitorHost.getIpAddress(), bizMonitorHost.getCheckTargetPort());
|
||||
dockerUtils.stopContainer(dockerInfo.getId());
|
||||
}
|
||||
return renderResult(Global.TRUE, text("停止容器成功!"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,12 +38,3 @@ export const bizMyWorkInfoList = () =>
|
||||
|
||||
export const bizDockerInfoList = (params?: DockerInfo | any) =>
|
||||
defHttp.get<DockerInfo[]>({ url: adminPath + '/biz/myWork/dockerList' , params });
|
||||
|
||||
export const bizDockerRestart = (params?: DockerInfo | any) =>
|
||||
defHttp.get<DockerInfo>({ url: adminPath + '/biz/myWork/restart', params });
|
||||
|
||||
export const bizDockerStart = (params?: DockerInfo | any) =>
|
||||
defHttp.get<DockerInfo>({ url: adminPath + '/biz/myWork/start', params });
|
||||
|
||||
export const bizDockerStop = (params?: DockerInfo | any) =>
|
||||
defHttp.get<DockerInfo>({ url: adminPath + '/biz/myWork/stop', params });
|
||||
@@ -77,14 +77,6 @@
|
||||
</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-divider"></div>
|
||||
<div class="action-button-section">
|
||||
<a-space size="middle">
|
||||
<a-button size="small" @click="handleRestart(item)">重启</a-button>
|
||||
<a-button type="error" size="small" @click="handleStop(item)" :disabled="item.state == '0'" > 停止</a-button>
|
||||
<a-button type="success" size="small" @click="handleStart(item)" :disabled="item.state == '1'" >启动</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
</div>
|
||||
@@ -154,87 +146,6 @@ export default defineComponent({
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleRestart = async (item: DockerInfo) => {
|
||||
Modal.confirm({
|
||||
title: '温馨提示',
|
||||
content: '您确定要重启当前容器吗?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
okType: 'danger',
|
||||
width: 420,
|
||||
onOk: async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
const res = await bizDockerRestart(item);
|
||||
createMessage.success(res.message || '重启成功');
|
||||
await getDockerList();
|
||||
filterContainerList();
|
||||
} catch (error: any) {
|
||||
console.error('重启容器失败:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
},
|
||||
onCancel: () => {
|
||||
createMessage.info('已取消重启操作');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleStop = async (item: DockerInfo) => {
|
||||
Modal.confirm({
|
||||
title: '温馨提示',
|
||||
content: '您确定要停止当前容器吗?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
okType: 'danger',
|
||||
width: 420,
|
||||
onOk: async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
const res = await bizDockerStop(item);
|
||||
createMessage.success(res.message || '停止成功');
|
||||
await getDockerList();
|
||||
filterContainerList();
|
||||
} catch (error: any) {
|
||||
console.error('停止容器失败:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
},
|
||||
onCancel: () => {
|
||||
createMessage.info('已取消停止操作');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleStart = async (item: DockerInfo) => {
|
||||
Modal.confirm({
|
||||
title: '温馨提示',
|
||||
content: '您确定要启动当前容器吗?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
okType: 'danger',
|
||||
width: 420,
|
||||
onOk: async () => {
|
||||
try {
|
||||
loading.value = true;
|
||||
const res = await bizDockerStart(item);
|
||||
createMessage.success(res.message || '启动成功');
|
||||
await getDockerList();
|
||||
filterContainerList();
|
||||
} catch (error: any) {
|
||||
console.error('启动容器失败:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
},
|
||||
onCancel: () => {
|
||||
createMessage.info('已取消启动操作');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const [register, { closeModal }] = useModalInner(async (data: any) => {
|
||||
if (!data?.hostId) {
|
||||
@@ -255,9 +166,6 @@ export default defineComponent({
|
||||
searchKey,
|
||||
containerList,
|
||||
filteredContainerList,
|
||||
handleRestart,
|
||||
handleStop,
|
||||
handleStart,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1091,7 +1091,7 @@ onMounted(() => {
|
||||
.file-manager-container {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: calc(100vh - 425px);
|
||||
height: calc(100vh - 445px);
|
||||
background: linear-gradient(135deg, #f0f8ff 0%, #e8f4f8 100%);
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
@@ -1140,6 +1140,7 @@ onMounted(() => {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* 核心修改:统一目录树背景色和搜索框一致 */
|
||||
.tree-scroll-container {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
@@ -1148,6 +1149,8 @@ onMounted(() => {
|
||||
scrollbar-color: #b3d9f2 #f8fcff;
|
||||
scroll-behavior: smooth;
|
||||
contain: layout paint;
|
||||
/* 关键修改:设置和搜索框一致的背景色 */
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.tree-scroll-container::-webkit-scrollbar {
|
||||
@@ -1167,9 +1170,11 @@ onMounted(() => {
|
||||
background-color: #91c8ee;
|
||||
}
|
||||
|
||||
/* 补充修改:确保tree-container背景透明,继承父元素的背景色 */
|
||||
.tree-container {
|
||||
width: 100%;
|
||||
padding: 0 8px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.tree-node-wrapper {
|
||||
|
||||
@@ -1,39 +1,77 @@
|
||||
<template>
|
||||
<div class="web-page-container">
|
||||
<MySchedule />
|
||||
<Tabs v-model:activeKey="activeKey">
|
||||
<TabPane key="1" tab="日程管理">
|
||||
<Calendar />
|
||||
</TabPane>
|
||||
<TabPane key="2" tab="我的待办">
|
||||
<ItemsInfo />
|
||||
</TabPane>
|
||||
<TabPane key="3" tab="文件管理">
|
||||
<MyfileInfo />
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
</div>
|
||||
<PageWrapper :sidebarWidth="220">
|
||||
<template #sidebar>
|
||||
<div class="config-sidebar">
|
||||
<div
|
||||
v-for="item in configItems"
|
||||
:key="item.key"
|
||||
class="sidebar-item"
|
||||
:class="{ active: activeKey === item.key }"
|
||||
@click="activeKey = item.key"
|
||||
>
|
||||
<Icon :icon="item.icon" size="14"/> {{ item.label }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 主内容区域 -->
|
||||
<div class="config-content">
|
||||
<div v-if="activeKey === '1'" class="config-panel">
|
||||
<Welcome />
|
||||
</div>
|
||||
</div>
|
||||
</PageWrapper>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="AboutPage">
|
||||
import { h, ref, onMounted } from 'vue';
|
||||
import { Tag, Tabs, TabPane } from 'ant-design-vue';
|
||||
import MySchedule from './components/MySchedule.vue';
|
||||
import Calendar from './components/calendar/list.vue';
|
||||
import ItemsInfo from './components/listItem/list.vue';
|
||||
import MyfileInfo from './components/myfiles/index.vue';
|
||||
|
||||
import { h, ref } from 'vue';
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { PageWrapper } from '@jeesite/core/components/Page';
|
||||
import { Tag, Tabs ,TabPane } from 'ant-design-vue';
|
||||
import Welcome from './components/Welcome.vue';
|
||||
|
||||
const activeKey = ref('1');
|
||||
const configItems = [
|
||||
{ key: '1', label: '工作台', icon: 'simple-line-icons:grid' },
|
||||
];
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
// 整体容器样式
|
||||
.web-page-container {
|
||||
width: 100%;
|
||||
background-color: #e8f4f8;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
padding: 0 8px;
|
||||
<style scoped>
|
||||
/* 侧边栏样式 */
|
||||
.config-sidebar {
|
||||
padding: 4px 0;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
.sidebar-item {
|
||||
padding: 12px 24px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
font-size: 14px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
|
||||
.sidebar-item:hover {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.sidebar-item.active {
|
||||
background-color: #e6f7ff;
|
||||
color: #1890ff;
|
||||
font-weight: 320;
|
||||
border-right: 3px solid #1890ff;
|
||||
}
|
||||
|
||||
/* 主内容区域样式 */
|
||||
.config-content {
|
||||
padding: 2px;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.config-panel {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user