chore: 集成vben

This commit is contained in:
xiaojunnuo
2025-03-07 18:01:51 +08:00
parent 8fcabc5e9f
commit 9557fc799e
26 changed files with 232 additions and 169 deletions
@@ -18,7 +18,7 @@
<div class="layout">
<div class="layout-left">
<div class="pipeline-container">
<div class="pipeline-container bg-neutral-100 dark:bg-black">
<div class="pipeline">
<v-draggable v-model="pipeline.stages" class="stages" item-key="id" handle=".stage-move-handle" :disabled="!settingStore.isPlus">
<template #header>
@@ -95,19 +95,10 @@
<!-- :open="true"-->
<template #content>
<div v-for="(item, index) of task.steps" :key="item.id" class="flex-o w-100">
<span class="ellipsis flex-1 step-title" :class="{ disabled: item.disabled, deleted: item.disabled }">
{{ index + 1 }}. {{ item.title }}
</span>
<span class="ellipsis flex-1 step-title" :class="{ disabled: item.disabled, deleted: item.disabled }"> {{ index + 1 }}. {{ item.title }} </span>
<pi-status-show v-if="!editMode" :status="item.status?.result"></pi-status-show>
<a-tooltip title="强制重新执行此步骤">
<fs-icon
v-if="!editMode"
class="pointer color-blue ml-2"
style="font-size: 16px"
title="强制重新执行此步骤"
icon="icon-park-outline:replay-music"
@click="run(item.id)"
></fs-icon>
<fs-icon v-if="!editMode" class="pointer color-blue ml-2" style="font-size: 16px" title="强制重新执行此步骤" icon="icon-park-outline:replay-music" @click="run(item.id)"></fs-icon>
</a-tooltip>
</div>
</template>
@@ -231,7 +222,7 @@
</div>
<div class="layout-right">
<a-page-header title="运行历史" sub-title="点任务可查看日志" class="logs-block">
<a-page-header title="运行历史" sub-title="点任务可查看日志" class="logs-block" :ghost="false">
<a-timeline class="mt-10">
<template v-for="item of histories" :key="item.id">
<pi-history-timeline-item
@@ -813,7 +804,6 @@ export default defineComponent({
width: 100%;
height: 100%;
position: relative;
background-color: #f0f0f0;
overflow: auto;
}
.pipeline {
@@ -821,7 +811,6 @@ export default defineComponent({
left: 0;
top: 0;
height: 100%;
background-color: #f0f0f0;
.stages {
display: flex;
overflow: auto;
@@ -1,36 +1,39 @@
<template>
<div class="dashboard-user">
<div class="header-profile">
<div class="avatar">
<a-avatar v-if="userInfo.avatar" size="large" :src="'/api/basic/file/download?&key=' + userInfo.avatar" style="background-color: #eee"> </a-avatar>
<a-avatar v-else size="large" style="background-color: #00b4f5">
{{ userInfo.username }}
</a-avatar>
</div>
<div class="text">
<div class="left">
<div>
<span>您好{{ userInfo.nickName || userInfo.username }} 欢迎使用 {{ siteInfo.title }}</span>
</div>
<div class="flex-o">
<a-tag color="green" class="flex-inline pointer m-0"> <fs-icon icon="ion:time-outline"></fs-icon> {{ now }}</a-tag>
<template v-if="userStore.isAdmin">
<a-divider type="vertical" />
<a-badge :dot="hasNewVersion">
<a-tag color="blue" class="flex-inline pointer m-0" :title="'最新版本:' + latestVersion" @click="openUpgradeUrl()">
<fs-icon icon="ion:rocket-outline" class="mr-5"></fs-icon>
v{{ version }}
</a-tag>
</a-badge>
</template>
<template v-if="settingsStore.isComm">
<a-divider type="vertical" />
<suite-card class="m-0"></suite-card>
</template>
<div class="header-profile flex-wrap bg-white dark:bg-black">
<div class="flex flex-1">
<div class="avatar">
<a-avatar v-if="userInfo.avatar" size="large" :src="'/api/basic/file/download?&key=' + userInfo.avatar" style="background-color: #eee"> </a-avatar>
<a-avatar v-else size="large" style="background-color: #00b4f5">
{{ userInfo.username }}
</a-avatar>
</div>
<div class="text">
<div class="left">
<div>
<span>您好{{ userInfo.nickName || userInfo.username }} 欢迎使用 {{ siteInfo.title }}</span>
</div>
<div class="flex-o">
<a-tag color="green" class="flex-inline pointer m-0"> <fs-icon icon="ion:time-outline"></fs-icon> {{ now }}</a-tag>
<template v-if="userStore.isAdmin">
<a-divider type="vertical" />
<a-badge :dot="hasNewVersion">
<a-tag color="blue" class="flex-inline pointer m-0" :title="'最新版本:' + latestVersion" @click="openUpgradeUrl()">
<fs-icon icon="ion:rocket-outline" class="mr-5"></fs-icon>
v{{ version }}
</a-tag>
</a-badge>
</template>
<template v-if="settingsStore.isComm">
<a-divider type="vertical" />
<suite-card class="m-0"></suite-card>
</template>
</div>
</div>
</div>
</div>
<div class="suggest">
<div class="suggest hidden md:block">
<tutorial-button class="flex-center mt-2">
<a-tooltip title="点击查看详细教程">
<a-tag color="blue" class="flex-center">
@@ -53,8 +56,8 @@
</div>
<div class="statistic-data m-20">
<a-row :gutter="20">
<a-col :span="6">
<a-row :gutter="20" class="flex-wrap">
<a-col :md="6" :xs="24">
<statistic-card title="证书流水线数量" :count="count.pipelineCount">
<template v-if="count.pipelineCount === 0" #default>
<div class="flex-center flex-1 flex-col">
@@ -67,17 +70,17 @@
</template>
</statistic-card>
</a-col>
<a-col :span="6">
<a-col :md="6" :xs="24">
<statistic-card title="流水线状态" :footer="false">
<pie-count v-if="count.pipelineStatusCount" :data="count.pipelineStatusCount"></pie-count>
</statistic-card>
</a-col>
<a-col :span="6">
<a-col :md="6" :xs="24">
<statistic-card title="最近运行统计" :footer="false">
<day-count v-if="count.historyCountPerDay" :data="count.historyCountPerDay" title="运行次数"></day-count>
</statistic-card>
</a-col>
<a-col :span="6">
<a-col :md="6" :xs="24">
<statistic-card title="最快到期证书">
<expiring-list v-if="count.expiringList" :data="count.expiringList"></expiring-list>
</statistic-card>
@@ -91,9 +94,9 @@
已支持的部署任务总览 <a-tag color="green">{{ pluginGroups.groups.all.plugins.length }}</a-tag>
</template>
<a-row :gutter="10">
<a-col v-for="item of pluginGroups.groups.all.plugins" :key="item.name" class="plugin-item-col" :span="4">
<a-col v-for="item of pluginGroups.groups.all.plugins" :key="item.name" class="plugin-item-col" :xl="4" :md="6" :xs="24">
<a-card>
<a-tooltip :title="item.desc" class="flex-between">
<a-tooltip :title="item.desc" class="flex-between overflow-hidden">
<div class="plugin-item pointer">
<div class="icon">
<fs-icon :icon="item.icon" class="font-size-16 color-blue" />
@@ -239,7 +242,6 @@ function openUpgradeUrl() {
display: flex;
align-items: center;
padding: 20px;
background-color: #fff;
.avatar {
margin-right: 10px;
@@ -1,5 +1,5 @@
<template>
<fs-page class="home—index">
<fs-page class="home—index bg-neutral-100 dark:bg-black">
<!-- <page-content />-->
<dashboard-user />
<change-password-button ref="changePasswordButtonRef" :show-button="false"></change-password-button>
@@ -32,6 +32,5 @@ onMounted(() => {
</script>
<style lang="less">
.homeindex {
background-color: #eee;
}
</style>
@@ -1,18 +1,17 @@
<template>
<div class="sys-settings-form sys-settings-register">
<a-form :model="formState" name="register" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onFinish">
<a-form-item label="管理其他用户流水线" :name="['public', 'managerOtherUserPipeline']">
<a-switch v-model:checked="formState.public.managerOtherUserPipeline" />
</a-form-item>
<a-form-item label="限制用户流水线数量" :name="['public', 'limitUserPipelineCount']">
<a-input-number v-model:value="formState.public.limitUserPipelineCount" />
<div class="helper">0为不限制</div>
</a-form-item>
<a-form-item label="开启自助注册" :name="['public', 'registerEnabled']">
<a-switch v-model:checked="formState.public.registerEnabled" />
</a-form-item>
<template v-if="formState.public.registerEnabled">
<a-form-item label="限制用户流水线数量" :name="['public', 'limitUserPipelineCount']">
<a-input-number v-model:value="formState.public.limitUserPipelineCount" />
<div class="helper">0为不限制</div>
</a-form-item>
<a-form-item label="管理其他用户流水线" :name="['public', 'managerOtherUserPipeline']">
<a-switch v-model:checked="formState.public.managerOtherUserPipeline" />
</a-form-item>
<a-form-item label="开启用户名注册" :name="['public', 'usernameRegisterEnabled']">
<a-switch v-model:checked="formState.public.usernameRegisterEnabled" />
</a-form-item>