mirror of https://github.com/certd/certd
pref: 优化插件store
parent
965dc2cb47
commit
cc0657aaa8
|
@ -38,6 +38,9 @@ export function buildLogger(write: (text: string) => void) {
|
||||||
logger.addContext("outputHandler", {
|
logger.addContext("outputHandler", {
|
||||||
write: (text: string) => {
|
write: (text: string) => {
|
||||||
for (const item of _secrets) {
|
for (const item of _secrets) {
|
||||||
|
if (item == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//换成同长度的*号, item可能有多行
|
//换成同长度的*号, item可能有多行
|
||||||
const reg = new RegExp(item, "g");
|
const reg = new RegExp(item, "g");
|
||||||
text = text.replaceAll(reg, "*".repeat(item.length));
|
text = text.replaceAll(reg, "*".repeat(item.length));
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
export default [
|
|
||||||
{
|
|
||||||
path: "/login",
|
|
||||||
method: "post",
|
|
||||||
handle() {
|
|
||||||
return {
|
|
||||||
code: 0,
|
|
||||||
msg: "success",
|
|
||||||
data: {
|
|
||||||
token: "faker token",
|
|
||||||
expire: 10000
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "/sys/authority/user/mine",
|
|
||||||
method: "get",
|
|
||||||
handle() {
|
|
||||||
return {
|
|
||||||
code: 0,
|
|
||||||
msg: "success",
|
|
||||||
data: {
|
|
||||||
id: 1,
|
|
||||||
username: "username",
|
|
||||||
nickName: "admin"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
];
|
|
|
@ -1,9 +1,8 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { get } from "lodash-es";
|
import { get } from "lodash-es";
|
||||||
import Adapter from "axios-mock-adapter";
|
import { errorLog, errorCreate } from "./tools";
|
||||||
import { errorLog, errorCreate, response } from "./tools";
|
|
||||||
import { env } from "/src/utils/util.env";
|
import { env } from "/src/utils/util.env";
|
||||||
import { useUserStore } from "../store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
/**
|
/**
|
||||||
* @description 创建请求实例
|
* @description 创建请求实例
|
||||||
*/
|
*/
|
||||||
|
@ -12,8 +11,8 @@ function createService() {
|
||||||
const service = axios.create();
|
const service = axios.create();
|
||||||
// 请求拦截
|
// 请求拦截
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
(config) => config,
|
config => config,
|
||||||
(error) => {
|
error => {
|
||||||
// 发送失败
|
// 发送失败
|
||||||
console.log(error);
|
console.log(error);
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
|
@ -21,7 +20,7 @@ function createService() {
|
||||||
);
|
);
|
||||||
// 响应拦截
|
// 响应拦截
|
||||||
service.interceptors.response.use(
|
service.interceptors.response.use(
|
||||||
(response) => {
|
response => {
|
||||||
if (response.config.responseType === "blob") {
|
if (response.config.responseType === "blob") {
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
@ -67,7 +66,7 @@ function createService() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(error) => {
|
error => {
|
||||||
const status = get(error, "response.status");
|
const status = get(error, "response.status");
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 400:
|
case 400:
|
||||||
|
@ -130,11 +129,11 @@ function createRequestFunction(service: any) {
|
||||||
return function (config: any) {
|
return function (config: any) {
|
||||||
const configDefault = {
|
const configDefault = {
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": get(config, "headers.Content-Type", "application/json")
|
"Content-Type": get(config, "headers.Content-Type", "application/json"),
|
||||||
},
|
},
|
||||||
timeout: 20000,
|
timeout: 20000,
|
||||||
baseURL: env.API,
|
baseURL: env.API,
|
||||||
data: {}
|
data: {},
|
||||||
};
|
};
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const token = userStore.getToken;
|
const token = userStore.getToken;
|
||||||
|
@ -149,10 +148,3 @@ function createRequestFunction(service: any) {
|
||||||
// 用于真实网络请求的实例和请求方法
|
// 用于真实网络请求的实例和请求方法
|
||||||
export const service = createService();
|
export const service = createService();
|
||||||
export const request = createRequestFunction(service);
|
export const request = createRequestFunction(service);
|
||||||
|
|
||||||
// 用于模拟网络请求的实例和请求方法
|
|
||||||
export const serviceForMock = createService();
|
|
||||||
export const requestForMock = createRequestFunction(serviceForMock);
|
|
||||||
|
|
||||||
// 网络请求数据模拟工具
|
|
||||||
export const mock = new Adapter(serviceForMock, { delayResponse: 200 });
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
</a-input>
|
</a-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="view" @click="edit">
|
<div v-else class="view" @click="edit">
|
||||||
<span> {{ modelValue }}</span>
|
<span class="ellipsis"> {{ modelValue }}</span>
|
||||||
<fs-icon class="edit-icon" icon="ant-design:edit-outlined"></fs-icon>
|
<fs-icon class="edit-icon" icon="ant-design:edit-outlined"></fs-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,19 +22,19 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ""
|
default: "",
|
||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
type: Object
|
type: Object,
|
||||||
},
|
},
|
||||||
disabled: {
|
disabled: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false,
|
||||||
},
|
},
|
||||||
hoverShow: {
|
hoverShow: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
emits: ["update:modelValue"],
|
emits: ["update:modelValue"],
|
||||||
setup(props, ctx) {
|
setup(props, ctx) {
|
||||||
|
@ -44,7 +44,7 @@ export default {
|
||||||
() => {
|
() => {
|
||||||
return props.modelValue;
|
return props.modelValue;
|
||||||
},
|
},
|
||||||
(value) => {
|
value => {
|
||||||
valueRef.value = value;
|
valueRef.value = value;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -66,9 +66,9 @@ export default {
|
||||||
isEdit,
|
isEdit,
|
||||||
save,
|
save,
|
||||||
edit,
|
edit,
|
||||||
inputRef
|
inputRef,
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { notification } from "ant-design-vue";
|
import { notification } from "ant-design-vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mounted(el: any, binding: any, vnode: any) {
|
mounted(el: any, binding: any, vnode: any) {
|
||||||
|
|
|
@ -16,9 +16,9 @@ import { computed, onMounted, reactive } from "vue";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { message, Modal } from "ant-design-vue";
|
import { message, Modal } from "ant-design-vue";
|
||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { mitter } from "/@/utils/util.mitt";
|
import { mitter } from "/@/utils/util.mitt";
|
||||||
|
|
||||||
const settingStore = useSettingStore();
|
const settingStore = useSettingStore();
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, onMounted, ref } from "vue";
|
import { computed, onMounted, ref } from "vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "PageFooter"
|
name: "PageFooter"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ref, defineComponent } from "vue";
|
import { ref, defineComponent } from "vue";
|
||||||
import FsThemeColorPicker from "./color-picker.vue";
|
import FsThemeColorPicker from "./color-picker.vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "FsTheme",
|
name: "FsTheme",
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ref, defineComponent } from "vue";
|
import { ref, defineComponent } from "vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "FsThemeModeSet",
|
name: "FsThemeModeSet",
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useUserStore } from "/src/store/modules/user";
|
import { useUserStore } from "/src/store/user";
|
||||||
import { Modal } from "ant-design-vue";
|
import { Modal } from "ant-design-vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
|
@ -4,10 +4,10 @@ import { BasicLayout, LockScreen, UserDropdown } from "/@/vben/layouts";
|
||||||
import { computed, onErrorCaptured, onMounted } from "vue";
|
import { computed, onErrorCaptured, onMounted } from "vue";
|
||||||
import { preferences } from "/@/vben/preferences";
|
import { preferences } from "/@/vben/preferences";
|
||||||
import { useAccessStore } from "/@/vben/stores";
|
import { useAccessStore } from "/@/vben/stores";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import VipButton from "/@/components/vip-button/index.vue";
|
import VipButton from "/@/components/vip-button/index.vue";
|
||||||
import TutorialButton from "/@/components/tutorial/index.vue";
|
import TutorialButton from "/@/components/tutorial/index.vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import PageFooter from "./components/footer/index.vue";
|
import PageFooter from "./components/footer/index.vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
|
@ -110,8 +110,8 @@ import FsThemeSet from "/@/layout/components/theme/index.vue";
|
||||||
import { env } from "../utils/util.env";
|
import { env } from "../utils/util.env";
|
||||||
import VipButton from "/@/components/vip-button/index.vue";
|
import VipButton from "/@/components/vip-button/index.vue";
|
||||||
import TutorialButton from "/@/components/tutorial/index.vue";
|
import TutorialButton from "/@/components/tutorial/index.vue";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { routerUtils } from "/@/utils/util.router";
|
import { routerUtils } from "/@/utils/util.router";
|
||||||
import { theme } from "ant-design-vue";
|
import { theme } from "ant-design-vue";
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { env } from "/@/utils/util.env";
|
import { env } from "/@/utils/util.env";
|
||||||
import { computed, ref, Ref } from "vue";
|
import { computed, ref, Ref } from "vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { SiteInfo, SysPublicSetting } from "/@/api/modules/api.basic";
|
import { SiteInfo, SysPublicSetting } from "/@/api/modules/api.basic";
|
||||||
|
|
||||||
const envRef = ref(env);
|
const envRef = ref(env);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { request, requestForMock } from "/src/api/service";
|
import { request } from "/src/api/service";
|
||||||
// import "/src/mock";
|
// import "/src/mock";
|
||||||
import { ColumnCompositionProps, CrudOptions, FastCrud, PageQuery, PageRes, setLogger, TransformResProps, useColumns, UseCrudProps, UserPageQuery, useTypes, utils } from "@fast-crud/fast-crud";
|
import { ColumnCompositionProps, CrudOptions, FastCrud, PageQuery, PageRes, setLogger, TransformResProps, useColumns, UseCrudProps, UserPageQuery, useTypes, utils } from "@fast-crud/fast-crud";
|
||||||
import "@fast-crud/fast-crud/dist/style.css";
|
import "@fast-crud/fast-crud/dist/style.css";
|
||||||
|
@ -51,10 +51,6 @@ function install(app: App, options: any = {}) {
|
||||||
app.use(FastCrud, {
|
app.use(FastCrud, {
|
||||||
i18n: options.i18n,
|
i18n: options.i18n,
|
||||||
async dictRequest({ url }: any) {
|
async dictRequest({ url }: any) {
|
||||||
if (url && url.startsWith("/mock")) {
|
|
||||||
//如果是crud开头的dict请求视为mock
|
|
||||||
return await requestForMock({ url, method: "post" });
|
|
||||||
}
|
|
||||||
return await request({ url, method: "post" });
|
return await request({ url, method: "post" });
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import router from "/src/router";
|
import router from "/src/router";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { usePermissionStore } from "./store.permission";
|
import { usePermissionStore } from "./store.permission";
|
||||||
import util from "./util.permission";
|
import util from "./util.permission";
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
|
|
|
@ -5,10 +5,10 @@ import { preferences } from "/@/vben/preferences";
|
||||||
import { useAccessStore } from "/@/vben/stores";
|
import { useAccessStore } from "/@/vben/stores";
|
||||||
import { generateMenus, startProgress, stopProgress } from "/@/vben/utils";
|
import { generateMenus, startProgress, stopProgress } from "/@/vben/utils";
|
||||||
import { frameworkRoutes } from "/@/router/resolve";
|
import { frameworkRoutes } from "/@/router/resolve";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { usePermissionStore } from "/@/plugin/permission/store.permission";
|
import { usePermissionStore } from "/@/plugin/permission/store.permission";
|
||||||
import util from "/@/plugin/permission/util.permission";
|
import util from "/@/plugin/permission/util.permission";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
|
|
||||||
function buildAccessedMenus(menus: any) {
|
function buildAccessedMenus(menus: any) {
|
||||||
if (menus == null) {
|
if (menus == null) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { IFrameView } from "/@/vben/layouts";
|
import { IFrameView } from "/@/vben/layouts";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import TutorialButton from "/@/components/tutorial/index.vue";
|
import TutorialButton from "/@/components/tutorial/index.vue";
|
||||||
export const aboutResource = [
|
export const aboutResource = [
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import aboutResource from "/@/router/source/modules/about";
|
import aboutResource from "/@/router/source/modules/about";
|
||||||
|
|
||||||
export const certdResources = [
|
export const certdResources = [
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import LayoutPass from "/@/layout/layout-pass.vue";
|
import LayoutPass from "/@/layout/layout-pass.vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import aboutResource from "/@/router/source/modules/about";
|
import aboutResource from "/@/router/source/modules/about";
|
||||||
|
|
||||||
export const sysResources = [
|
export const sysResources = [
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
import { createPinia } from "pinia";
|
|
||||||
const store = createPinia();
|
|
||||||
export default {
|
|
||||||
install(app: any) {
|
|
||||||
app.use(store);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export { store };
|
|
|
@ -11,11 +11,17 @@ const defaultInputDefine = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function initPlugins(plugins: any) {
|
function initPlugins(plugins: any) {
|
||||||
|
const checkedComponents = ["a-checkbox", "a-radio", "a-switch"];
|
||||||
for (const plugin of plugins) {
|
for (const plugin of plugins) {
|
||||||
for (const key in plugin.input) {
|
for (const key in plugin.input) {
|
||||||
const field = _.merge({}, defaultInputDefine, plugin.input[key]);
|
const field = _.merge({}, defaultInputDefine, plugin.input[key]);
|
||||||
if (field.component.name === "a-input" || field.component.name === "a-select") {
|
const componentName = field.component.name;
|
||||||
field.component.vModel = "value";
|
if (componentName.startsWith("a-")) {
|
||||||
|
if (checkedComponents.includes(componentName)) {
|
||||||
|
field.component.vModel = "checked";
|
||||||
|
} else {
|
||||||
|
field.component.vModel = "value";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//嵌套对象
|
//嵌套对象
|
||||||
field.key = ["input", key];
|
field.key = ["input", key];
|
|
@ -0,0 +1,161 @@
|
||||||
|
import { defineStore } from "pinia";
|
||||||
|
import * as api from "./api.plugin";
|
||||||
|
import { DynamicType, FormItemProps } from "@fast-crud/fast-crud";
|
||||||
|
|
||||||
|
interface PluginState {
|
||||||
|
group?: PluginGroups;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type PluginGroup = {
|
||||||
|
key: string;
|
||||||
|
title: string;
|
||||||
|
desc?: string;
|
||||||
|
order: number;
|
||||||
|
icon: string;
|
||||||
|
plugins: any[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PluginDefine = {
|
||||||
|
name: string;
|
||||||
|
title: string;
|
||||||
|
desc?: string;
|
||||||
|
shortcut: any;
|
||||||
|
input: {
|
||||||
|
[key: string]: DynamicType<FormItemProps>;
|
||||||
|
};
|
||||||
|
output: {
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export class PluginGroups {
|
||||||
|
groups!: { [key: string]: PluginGroup };
|
||||||
|
map!: { [key: string]: PluginDefine };
|
||||||
|
constructor(groups: { [key: string]: PluginGroup }) {
|
||||||
|
this.groups = groups;
|
||||||
|
this.initGroup(groups);
|
||||||
|
this.initMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
private initGroup(groups: { [p: string]: PluginGroup }) {
|
||||||
|
const all: PluginGroup = {
|
||||||
|
key: "all",
|
||||||
|
title: "全部",
|
||||||
|
order: 0,
|
||||||
|
plugins: [],
|
||||||
|
icon: "material-symbols:border-all-rounded",
|
||||||
|
};
|
||||||
|
for (const key in groups) {
|
||||||
|
all.plugins.push(...groups[key].plugins);
|
||||||
|
}
|
||||||
|
this.groups = {
|
||||||
|
all,
|
||||||
|
...groups,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
initMap() {
|
||||||
|
const map: { [key: string]: PluginDefine } = {};
|
||||||
|
for (const key in this.groups) {
|
||||||
|
const group = this.groups[key];
|
||||||
|
for (const plugin of group.plugins) {
|
||||||
|
map[plugin.name] = plugin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.map = map;
|
||||||
|
}
|
||||||
|
|
||||||
|
getGroups() {
|
||||||
|
return this.groups;
|
||||||
|
}
|
||||||
|
|
||||||
|
get(name: string) {
|
||||||
|
return this.map[name];
|
||||||
|
}
|
||||||
|
|
||||||
|
getPreStepOutputOptions({ pipeline, currentStageIndex, currentTaskIndex, currentStepIndex, currentTask }: any) {
|
||||||
|
const steps = this.collectionPreStepOutputs({
|
||||||
|
pipeline,
|
||||||
|
currentStageIndex,
|
||||||
|
currentTaskIndex,
|
||||||
|
currentStepIndex,
|
||||||
|
currentTask,
|
||||||
|
});
|
||||||
|
const options: any[] = [];
|
||||||
|
for (const step of steps) {
|
||||||
|
const stepDefine = this.get(step.type);
|
||||||
|
for (const key in stepDefine?.output) {
|
||||||
|
options.push({
|
||||||
|
value: `step.${step.id}.${key}`,
|
||||||
|
label: `${stepDefine.output[key].title}【from:${step.title}】`,
|
||||||
|
type: step.type,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
collectionPreStepOutputs({ pipeline, currentStageIndex, currentTaskIndex, currentStepIndex, currentTask }: any) {
|
||||||
|
const steps: any[] = [];
|
||||||
|
// 开始放step
|
||||||
|
for (let i = 0; i < currentStageIndex; i++) {
|
||||||
|
const stage = pipeline.stages[i];
|
||||||
|
for (const task of stage.tasks) {
|
||||||
|
for (const step of task.steps) {
|
||||||
|
steps.push(step);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//当前阶段之前的task
|
||||||
|
const currentStage = pipeline.stages[currentStageIndex];
|
||||||
|
for (let i = 0; i < currentTaskIndex; i++) {
|
||||||
|
const task = currentStage.tasks[i];
|
||||||
|
for (const step of task.steps) {
|
||||||
|
steps.push(step);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//放当前任务下的step
|
||||||
|
for (let i = 0; i < currentStepIndex; i++) {
|
||||||
|
const step = currentTask.steps[i];
|
||||||
|
steps.push(step);
|
||||||
|
}
|
||||||
|
return steps;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const usePluginStore = defineStore({
|
||||||
|
id: "app.plugin",
|
||||||
|
state: (): PluginState => ({
|
||||||
|
group: null,
|
||||||
|
}),
|
||||||
|
actions: {
|
||||||
|
async reload() {
|
||||||
|
const groups = await api.GetGroups({});
|
||||||
|
this.group = new PluginGroups(groups);
|
||||||
|
},
|
||||||
|
async init() {
|
||||||
|
if (!this.group) {
|
||||||
|
await this.reload();
|
||||||
|
}
|
||||||
|
return this.group;
|
||||||
|
},
|
||||||
|
async getGroups(): Promise<PluginGroups> {
|
||||||
|
await this.init();
|
||||||
|
return this.group as PluginGroups;
|
||||||
|
},
|
||||||
|
async clear() {
|
||||||
|
this.group = null;
|
||||||
|
},
|
||||||
|
async getList(): Promise<PluginDefine[]> {
|
||||||
|
await this.init();
|
||||||
|
return this.group.groups.all.plugins;
|
||||||
|
},
|
||||||
|
async getPluginDefine(name: string): Promise<PluginDefine> {
|
||||||
|
await this.init();
|
||||||
|
return this.group.get(name);
|
||||||
|
},
|
||||||
|
async getPluginConfig(query: any) {
|
||||||
|
return await api.GetPluginConfig(query);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
|
@ -1,4 +1,4 @@
|
||||||
import { request } from "../service";
|
import { request } from "/src/api/service";
|
||||||
|
|
||||||
export type SiteEnv = {
|
export type SiteEnv = {
|
||||||
agent?: {
|
agent?: {
|
|
@ -1,9 +1,9 @@
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { Modal, notification } from "ant-design-vue";
|
import { Modal, notification } from "ant-design-vue";
|
||||||
import * as _ from "lodash-es";
|
import * as _ from "lodash-es";
|
||||||
import * as basicApi from "/@/api/modules/api.basic";
|
import * as basicApi from "./api.basic";
|
||||||
import { AppInfo, HeaderMenus, PlusInfo, SiteEnv, SiteInfo, SuiteSetting, SysInstallInfo, SysPublicSetting } from "/@/api/modules/api.basic";
|
import { AppInfo, HeaderMenus, PlusInfo, SiteEnv, SiteInfo, SuiteSetting, SysInstallInfo, SysPublicSetting } from "./api.basic";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "../user";
|
||||||
import { mitter } from "/@/utils/util.mitt";
|
import { mitter } from "/@/utils/util.mitt";
|
||||||
import { env } from "/@/utils/util.env";
|
import { env } from "/@/utils/util.env";
|
||||||
import { updatePreferences } from "/@/vben/preferences";
|
import { updatePreferences } from "/@/vben/preferences";
|
|
@ -1,5 +1,4 @@
|
||||||
import { request, requestForMock } from "../service";
|
import { request } from "/src/api/service";
|
||||||
import { env } from "/@/utils/util.env";
|
|
||||||
|
|
||||||
export interface RegisterReq {
|
export interface RegisterReq {
|
||||||
username: string;
|
username: string;
|
||||||
|
@ -39,24 +38,16 @@ export async function register(user: RegisterReq): Promise<UserInfoRes> {
|
||||||
return await request({
|
return await request({
|
||||||
url: "/register",
|
url: "/register",
|
||||||
method: "post",
|
method: "post",
|
||||||
data: user
|
data: user,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function login(data: LoginReq): Promise<LoginRes> {
|
export async function login(data: LoginReq): Promise<LoginRes> {
|
||||||
if (env.PM_ENABLED === "false") {
|
|
||||||
//没有开启权限模块,模拟登录
|
|
||||||
return await requestForMock({
|
|
||||||
url: "/login",
|
|
||||||
method: "post",
|
|
||||||
data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//如果开启了登录与权限模块,则真实登录
|
//如果开启了登录与权限模块,则真实登录
|
||||||
return await request({
|
return await request({
|
||||||
url: "/login",
|
url: "/login",
|
||||||
method: "post",
|
method: "post",
|
||||||
data
|
data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,20 +56,13 @@ export async function loginBySms(data: SmsLoginReq): Promise<LoginRes> {
|
||||||
return await request({
|
return await request({
|
||||||
url: "/loginBySms",
|
url: "/loginBySms",
|
||||||
method: "post",
|
method: "post",
|
||||||
data
|
data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function mine(): Promise<UserInfoRes> {
|
export async function mine(): Promise<UserInfoRes> {
|
||||||
if (env.PM_ENABLED === "false") {
|
|
||||||
//没有开启权限模块,模拟登录
|
|
||||||
return await requestForMock({
|
|
||||||
url: "/sys/authority/user/mine",
|
|
||||||
method: "post"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return await request({
|
return await request({
|
||||||
url: "/mine/info",
|
url: "/mine/info",
|
||||||
method: "post"
|
method: "post",
|
||||||
});
|
});
|
||||||
}
|
}
|
|
@ -3,8 +3,8 @@ import router from "../../router";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { LocalStorage } from "/src/utils/util.storage";
|
import { LocalStorage } from "/src/utils/util.storage";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import * as UserApi from "/src/api/modules/api.user";
|
import * as UserApi from "./api.user";
|
||||||
import { RegisterReq, SmsLoginReq } from "/src/api/modules/api.user";
|
import { RegisterReq, SmsLoginReq } from "./api.user";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { LoginReq, UserInfoRes } from "/@/api/modules/api.user";
|
import { LoginReq, UserInfoRes } from "/@/api/modules/api.user";
|
||||||
import { message, Modal, notification } from "ant-design-vue";
|
import { message, Modal, notification } from "ant-design-vue";
|
||||||
|
@ -28,7 +28,7 @@ export const useUserStore = defineStore({
|
||||||
// user info
|
// user info
|
||||||
userInfo: null,
|
userInfo: null,
|
||||||
// token
|
// token
|
||||||
token: undefined
|
token: undefined,
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
getUserInfo(): UserInfoRes {
|
getUserInfo(): UserInfoRes {
|
||||||
|
@ -39,7 +39,7 @@ export const useUserStore = defineStore({
|
||||||
},
|
},
|
||||||
isAdmin(): boolean {
|
isAdmin(): boolean {
|
||||||
return this.getUserInfo.roleIds?.includes(1) || this.getUserInfo.id === 1;
|
return this.getUserInfo.roleIds?.includes(1) || this.getUserInfo.id === 1;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
setToken(token: string, expire: number) {
|
setToken(token: string, expire: number) {
|
||||||
|
@ -63,7 +63,7 @@ export const useUserStore = defineStore({
|
||||||
async register(user: RegisterReq) {
|
async register(user: RegisterReq) {
|
||||||
await UserApi.register(user);
|
await UserApi.register(user);
|
||||||
notification.success({
|
notification.success({
|
||||||
message: "注册成功,请登录"
|
message: "注册成功,请登录",
|
||||||
});
|
});
|
||||||
await router.replace("/login");
|
await router.replace("/login");
|
||||||
},
|
},
|
||||||
|
@ -127,8 +127,8 @@ export const useUserStore = defineStore({
|
||||||
content: t("app.login.logoutMessage"),
|
content: t("app.login.logoutMessage"),
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
await this.logout(true);
|
await this.logout(true);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
|
@ -10,7 +10,7 @@ import "./styles/antd/index.css";
|
||||||
|
|
||||||
import { useTitle } from "@vueuse/core";
|
import { useTitle } from "@vueuse/core";
|
||||||
import { setupI18n } from "/@/vben/locales";
|
import { setupI18n } from "/@/vben/locales";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
|
|
||||||
export async function setupVben(app: any, { loadMessages, router }: any) {
|
export async function setupVben(app: any, { loadMessages, router }: any) {
|
||||||
await setupI18n(app, { loadMessages });
|
await setupI18n(app, { loadMessages });
|
||||||
|
|
|
@ -78,11 +78,11 @@ export const useAccessStore = defineStore("core-access", {
|
||||||
},
|
},
|
||||||
setRefreshToken(token: AccessToken) {
|
setRefreshToken(token: AccessToken) {
|
||||||
this.refreshToken = token;
|
this.refreshToken = token;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
persist: {
|
persist: {
|
||||||
// 持久化
|
// 持久化
|
||||||
pick: ["accessToken", "refreshToken", "accessCodes"]
|
pick: ["accessToken", "refreshToken", "accessCodes"],
|
||||||
},
|
},
|
||||||
state: (): AccessState => ({
|
state: (): AccessState => ({
|
||||||
accessCodes: [],
|
accessCodes: [],
|
||||||
|
@ -91,8 +91,8 @@ export const useAccessStore = defineStore("core-access", {
|
||||||
accessToken: null,
|
accessToken: null,
|
||||||
isAccessChecked: false,
|
isAccessChecked: false,
|
||||||
loginExpired: false,
|
loginExpired: false,
|
||||||
refreshToken: null
|
refreshToken: null,
|
||||||
})
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 解决热更新问题
|
// 解决热更新问题
|
||||||
|
|
|
@ -21,13 +21,13 @@ export const useLockStore = defineStore("core-lock", {
|
||||||
unlockScreen() {
|
unlockScreen() {
|
||||||
this.isLockScreen = false;
|
this.isLockScreen = false;
|
||||||
this.lockScreenPassword = undefined;
|
this.lockScreenPassword = undefined;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
persist: {
|
persist: {
|
||||||
pick: ["isLockScreen", "lockScreenPassword"]
|
pick: ["isLockScreen", "lockScreenPassword"],
|
||||||
},
|
},
|
||||||
state: (): AppState => ({
|
state: (): AppState => ({
|
||||||
isLockScreen: false,
|
isLockScreen: false,
|
||||||
lockScreenPassword: undefined
|
lockScreenPassword: undefined,
|
||||||
})
|
}),
|
||||||
});
|
});
|
||||||
|
|
|
@ -49,12 +49,12 @@ export const useUserStore = defineStore("core-user", {
|
||||||
},
|
},
|
||||||
setUserRoles(roles: string[]) {
|
setUserRoles(roles: string[]) {
|
||||||
this.userRoles = roles;
|
this.userRoles = roles;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
state: (): AccessState => ({
|
state: (): AccessState => ({
|
||||||
userInfo: null,
|
userInfo: null,
|
||||||
userRoles: []
|
userRoles: [],
|
||||||
})
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 解决热更新问题
|
// 解决热更新问题
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { useI18n } from "vue-i18n";
|
||||||
import { Ref, ref } from "vue";
|
import { Ref, ref } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
import CnameTip from "/@/components/plugins/cert/domains-verify-plan-editor/cname-tip.vue";
|
import CnameTip from "/@/components/plugins/cert/domains-verify-plan-editor/cname-tip.vue";
|
||||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { useI18n } from "vue-i18n";
|
||||||
import { computed, Ref, ref } from "vue";
|
import { computed, Ref, ref } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
|
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
|
|
||||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { ref } from "vue";
|
||||||
import { CrudOptions, useColumns, useFormWrapper } from "@fast-crud/fast-crud";
|
import { CrudOptions, useColumns, useFormWrapper } from "@fast-crud/fast-crud";
|
||||||
import * as api from "/@/views/certd/mine/api";
|
import * as api from "/@/views/certd/mine/api";
|
||||||
import { notification } from "ant-design-vue";
|
import { notification } from "ant-design-vue";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
showButton: boolean;
|
showButton: boolean;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, Edi
|
||||||
import { siteInfoApi } from "./api";
|
import { siteInfoApi } from "./api";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { notification } from "ant-design-vue";
|
import { notification } from "ant-design-vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { mySuiteApi } from "/@/views/certd/suite/mine/api";
|
import { mySuiteApi } from "/@/views/certd/suite/mine/api";
|
||||||
import { mitter } from "/@/utils/util.mitt";
|
import { mitter } from "/@/utils/util.mitt";
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,10 @@ import { useFs } from "@fast-crud/fast-crud";
|
||||||
import createCrudOptions from "./crud";
|
import createCrudOptions from "./crud";
|
||||||
import { siteInfoApi } from "./api";
|
import { siteInfoApi } from "./api";
|
||||||
import { Modal, notification } from "ant-design-vue";
|
import { Modal, notification } from "ant-design-vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "SiteCertMonitor",
|
name: "SiteCertMonitor",
|
||||||
});
|
});
|
||||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });
|
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });
|
||||||
const settingStore = useSettingStore();
|
|
||||||
function checkAll() {
|
function checkAll() {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: "确认",
|
title: "确认",
|
||||||
|
|
|
@ -3,11 +3,11 @@ import NotificationSelector from "/@/views/certd/notification/notification-selec
|
||||||
import { cloneDeep, omit } from "lodash-es";
|
import { cloneDeep, omit } from "lodash-es";
|
||||||
import { useReference } from "/@/use/use-refrence";
|
import { useReference } from "/@/use/use-refrence";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import * as pluginApi from "../api.plugin";
|
|
||||||
import * as api from "../api";
|
import * as api from "../api";
|
||||||
import { checkPipelineLimit, getAllDomainsFromCrt } from "/@/views/certd/pipeline/utils";
|
import { checkPipelineLimit, getAllDomainsFromCrt } from "/@/views/certd/pipeline/utils";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
|
import { usePluginStore } from "/@/store/plugin";
|
||||||
|
|
||||||
export function useCertUpload() {
|
export function useCertUpload() {
|
||||||
const { openCrudFormDialog } = useFormWrapper();
|
const { openCrudFormDialog } = useFormWrapper();
|
||||||
|
@ -52,8 +52,10 @@ export function useCertUpload() {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const pluginStore = usePluginStore();
|
||||||
|
|
||||||
async function buildUploadCertPluginInputs(getFormData: any) {
|
async function buildUploadCertPluginInputs(getFormData: any) {
|
||||||
const plugin: any = await pluginApi.GetPluginDefine("CertApplyUpload");
|
const plugin: any = await pluginStore.getPluginDefine("CertApplyUpload");
|
||||||
const inputs: any = {};
|
const inputs: any = {};
|
||||||
for (const inputKey in plugin.input) {
|
for (const inputKey in plugin.input) {
|
||||||
if (inputKey === "uploadCert" || inputKey === "domains") {
|
if (inputKey === "uploadCert" || inputKey === "domains") {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { compute, CreateCrudOptionsRet, dict } from "@fast-crud/fast-crud";
|
import { compute, CreateCrudOptionsRet, dict } from "@fast-crud/fast-crud";
|
||||||
import { useReference } from "/@/use/use-refrence";
|
import { useReference } from "/@/use/use-refrence";
|
||||||
import { merge, cloneDeep } from "lodash-es";
|
import { merge, cloneDeep } from "lodash-es";
|
||||||
import * as api from "../api.plugin";
|
|
||||||
import NotificationSelector from "/@/views/certd/notification/notification-selector/index.vue";
|
import NotificationSelector from "/@/views/certd/notification/notification-selector/index.vue";
|
||||||
|
import { usePluginStore } from "/@/store/plugin";
|
||||||
|
|
||||||
export default function (certPlugins: any[], formWrapperRef: any): CreateCrudOptionsRet {
|
export default function (certPlugins: any[], formWrapperRef: any): CreateCrudOptionsRet {
|
||||||
const inputs: any = {};
|
const inputs: any = {};
|
||||||
|
@ -46,6 +46,7 @@ export default function (certPlugins: any[], formWrapperRef: any): CreateCrudOpt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const pluginStore = usePluginStore();
|
||||||
const randomHour = Math.floor(Math.random() * 6);
|
const randomHour = Math.floor(Math.random() * 6);
|
||||||
const randomMin = Math.floor(Math.random() * 60);
|
const randomMin = Math.floor(Math.random() * 60);
|
||||||
return {
|
return {
|
||||||
|
@ -91,7 +92,7 @@ export default function (certPlugins: any[], formWrapperRef: any): CreateCrudOpt
|
||||||
},
|
},
|
||||||
valueChange: {
|
valueChange: {
|
||||||
handle: async ({ form, value }) => {
|
handle: async ({ form, value }) => {
|
||||||
const config = await api.GetPluginConfig({
|
const config = await pluginStore.getPluginConfig({
|
||||||
name: value,
|
name: value,
|
||||||
type: "builtIn",
|
type: "builtIn",
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,68 +2,66 @@
|
||||||
<fs-form-wrapper v-if="formWrapperOptions" ref="formWrapperRef" />
|
<fs-form-wrapper v-if="formWrapperOptions" ref="formWrapperRef" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { useColumns, useExpose } from "@fast-crud/fast-crud";
|
import { useColumns } from "@fast-crud/fast-crud";
|
||||||
import createCrudOptions from "./crud.jsx";
|
import createCrudOptions from "./crud.jsx";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import * as _ from "lodash-es";
|
import { merge } from "lodash-es";
|
||||||
import * as api from "../api.plugin";
|
import { PluginGroup, usePluginStore } from "/@/store/plugin";
|
||||||
import { PluginGroup, PluginGroups } from "/@/views/certd/pipeline/pipeline/type";
|
|
||||||
import { GetPluginDefine } from "../api.plugin";
|
|
||||||
import { createNotificationApi } from "/@/views/certd/notification/api";
|
import { createNotificationApi } from "/@/views/certd/notification/api";
|
||||||
export default {
|
|
||||||
|
defineOptions({
|
||||||
name: "PiCertdForm",
|
name: "PiCertdForm",
|
||||||
setup(props: any, ctx: any) {
|
});
|
||||||
const formWrapperRef = ref();
|
|
||||||
const formWrapperOptions = ref();
|
|
||||||
const doSubmitRef = ref();
|
|
||||||
async function buildFormOptions() {
|
|
||||||
const pluginGroups: { [key: string]: PluginGroup } = await api.GetGroups({});
|
|
||||||
const certPluginGroup = pluginGroups.cert;
|
|
||||||
|
|
||||||
const certPlugins = [];
|
const formWrapperRef = ref();
|
||||||
for (const plugin of certPluginGroup.plugins) {
|
const formWrapperOptions = ref();
|
||||||
const detail: any = await api.GetPluginDefine(plugin.name);
|
const doSubmitRef = ref();
|
||||||
certPlugins.push(detail);
|
const pluginStore = usePluginStore();
|
||||||
}
|
async function buildFormOptions() {
|
||||||
|
const pluginGroup = await pluginStore.getGroups();
|
||||||
|
const pluginGroups: { [key: string]: PluginGroup } = pluginGroup.groups;
|
||||||
|
const certPluginGroup = pluginGroups.cert;
|
||||||
|
|
||||||
// 自定义表单配置
|
const certPlugins = [];
|
||||||
const { buildFormOptions } = useColumns();
|
for (const plugin of certPluginGroup.plugins) {
|
||||||
//使用crudOptions结构来构建自定义表单配置
|
const detail: any = await pluginStore.getPluginDefine(plugin.name);
|
||||||
let { crudOptions } = createCrudOptions(certPlugins, formWrapperRef);
|
certPlugins.push(detail);
|
||||||
|
}
|
||||||
|
|
||||||
const formOptions = buildFormOptions(
|
// 自定义表单配置
|
||||||
_.merge(crudOptions, {
|
const { buildFormOptions } = useColumns();
|
||||||
form: {
|
//使用crudOptions结构来构建自定义表单配置
|
||||||
async doSubmit({ form }: any) {
|
let { crudOptions } = createCrudOptions(certPlugins, formWrapperRef);
|
||||||
// 创建certd 的pipeline
|
|
||||||
await doSubmitRef.value({ form });
|
|
||||||
|
|
||||||
if (form.email) {
|
const formOptions = buildFormOptions(
|
||||||
//创建一个默认的邮件通知
|
merge(crudOptions, {
|
||||||
const notificationApi = createNotificationApi();
|
form: {
|
||||||
await notificationApi.GetOrCreateDefault({ email: form.email });
|
async doSubmit({ form }: any) {
|
||||||
}
|
// 创建certd 的pipeline
|
||||||
},
|
await doSubmitRef.value({ form });
|
||||||
},
|
|
||||||
}) as any
|
|
||||||
);
|
|
||||||
|
|
||||||
formWrapperOptions.value = formOptions;
|
if (form.email) {
|
||||||
}
|
//创建一个默认的邮件通知
|
||||||
buildFormOptions();
|
const notificationApi = createNotificationApi();
|
||||||
function open(doSubmit: any) {
|
await notificationApi.GetOrCreateDefault({ email: form.email });
|
||||||
doSubmitRef.value = doSubmit;
|
}
|
||||||
formWrapperRef.value.open(formWrapperOptions.value);
|
},
|
||||||
}
|
},
|
||||||
|
}) as any
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
formWrapperOptions.value = formOptions;
|
||||||
formWrapperRef,
|
}
|
||||||
open,
|
buildFormOptions();
|
||||||
formWrapperOptions,
|
function open(doSubmit: any) {
|
||||||
};
|
doSubmitRef.value = doSubmit;
|
||||||
},
|
formWrapperRef.value.open(formWrapperOptions.value);
|
||||||
};
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
@ -6,9 +6,9 @@ import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, Edi
|
||||||
import { statusUtil } from "/@/views/certd/pipeline/pipeline/utils/util.status";
|
import { statusUtil } from "/@/views/certd/pipeline/pipeline/utils/util.status";
|
||||||
import { Modal, notification } from "ant-design-vue";
|
import { Modal, notification } from "ant-design-vue";
|
||||||
import { env } from "/@/utils/util.env";
|
import { env } from "/@/utils/util.env";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { cloneDeep } from "lodash-es";
|
import { cloneDeep } from "lodash-es";
|
||||||
import { useModal } from "/@/use/use-modal";
|
import { useModal } from "/@/use/use-modal";
|
||||||
import CertView from "./cert-view.vue";
|
import CertView from "./cert-view.vue";
|
||||||
|
|
|
@ -6,23 +6,23 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { nextTick, onMounted, Ref, ref } from "vue";
|
import { nextTick, Ref, ref } from "vue";
|
||||||
import PipelineEdit from "./pipeline/index.vue";
|
import PipelineEdit from "./pipeline/index.vue";
|
||||||
import * as pluginApi from "./api.plugin";
|
|
||||||
import * as historyApi from "./api.history";
|
import * as historyApi from "./api.history";
|
||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { PipelineDetail, PipelineOptions, PluginGroups, RunHistory } from "./pipeline/type";
|
import { PipelineDetail, PipelineOptions, RunHistory } from "./pipeline/type";
|
||||||
import { TourProps } from "ant-design-vue";
|
|
||||||
import { LocalStorage } from "/@/utils/util.storage";
|
import { LocalStorage } from "/@/utils/util.storage";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
|
import { usePluginStore, PluginGroups } from "/@/store/plugin";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "PipelineDetail",
|
name: "PipelineDetail",
|
||||||
});
|
});
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const pipelineId: Ref = ref(route.query.id);
|
const pipelineId: Ref = ref(route.query.id);
|
||||||
const historyId = ref(route.query.historyId);
|
const historyId = ref(route.query.historyId as string);
|
||||||
|
const pluginStore = usePluginStore();
|
||||||
const pipelineOptions: PipelineOptions = {
|
const pipelineOptions: PipelineOptions = {
|
||||||
async getPipelineDetail({ pipelineId }) {
|
async getPipelineDetail({ pipelineId }) {
|
||||||
const detail = await api.GetDetail(pipelineId);
|
const detail = await api.GetDetail(pipelineId);
|
||||||
|
@ -48,9 +48,8 @@ const pipelineOptions: PipelineOptions = {
|
||||||
return detail;
|
return detail;
|
||||||
},
|
},
|
||||||
|
|
||||||
async getPluginGroups() {
|
async getPluginGroups(): Promise<PluginGroups> {
|
||||||
const groups = await pluginApi.GetGroups({});
|
return await pluginStore.getGroups();
|
||||||
return new PluginGroups(groups);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async doSave(pipelineConfig: any) {
|
async doSave(pipelineConfig: any) {
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Ref, ref, watch } from "vue";
|
import { Ref, ref, watch } from "vue";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
options: {
|
options: {
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import * as pluginApi from "/@/views/certd/pipeline/api.plugin";
|
|
||||||
import TaskShortcut from "./task-shortcut.vue";
|
import TaskShortcut from "./task-shortcut.vue";
|
||||||
|
import { usePluginStore } from "/@/store/plugin";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "TaskShortcuts",
|
name: "TaskShortcuts",
|
||||||
|
@ -15,7 +15,8 @@ defineOptions({
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
task: any;
|
task: any;
|
||||||
}>();
|
}>();
|
||||||
|
const shortcuts = ref([]);
|
||||||
|
const pluginStore = usePluginStore();
|
||||||
watch(
|
watch(
|
||||||
() => props.task,
|
() => props.task,
|
||||||
value => {
|
value => {
|
||||||
|
@ -24,7 +25,6 @@ watch(
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
const shortcuts = ref([]);
|
|
||||||
async function init() {
|
async function init() {
|
||||||
const steps = props.task?.steps || [];
|
const steps = props.task?.steps || [];
|
||||||
if (steps.length === 0) {
|
if (steps.length === 0) {
|
||||||
|
@ -33,7 +33,7 @@ async function init() {
|
||||||
const list = [];
|
const list = [];
|
||||||
for (const step of steps) {
|
for (const step of steps) {
|
||||||
const stepType = step.type;
|
const stepType = step.type;
|
||||||
const pluginDefine = await pluginApi.GetPluginDefine(stepType);
|
const pluginDefine = await pluginStore.getPluginDefine(stepType);
|
||||||
if (pluginDefine.shortcut) {
|
if (pluginDefine.shortcut) {
|
||||||
for (const key in pluginDefine.shortcut) {
|
for (const key in pluginDefine.shortcut) {
|
||||||
const shortcut = pluginDefine.shortcut[key];
|
const shortcut = pluginDefine.shortcut[key];
|
||||||
|
|
|
@ -5,7 +5,9 @@
|
||||||
编辑步骤
|
编辑步骤
|
||||||
<template v-if="editMode">
|
<template v-if="editMode">
|
||||||
<a-button @click="stepDelete()">
|
<a-button @click="stepDelete()">
|
||||||
<template #icon><DeleteOutlined /></template>
|
<template #icon>
|
||||||
|
<DeleteOutlined />
|
||||||
|
</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
@ -65,7 +67,7 @@
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div style="padding: 20px; margin-left: 100px">
|
<div style="padding: 20px; margin-left: 100px">
|
||||||
<a-button v-if="editMode" type="primary" @click="stepTypeSave"> 确定 </a-button>
|
<a-button v-if="editMode" type="primary" @click="stepTypeSave"> 确定</a-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</pi-container>
|
</pi-container>
|
||||||
|
@ -103,7 +105,7 @@
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div v-if="editMode" class="bottom-button">
|
<div v-if="editMode" class="bottom-button">
|
||||||
<a-button type="primary" @click="stepSave"> 确定 </a-button>
|
<a-button type="primary" @click="stepSave"> 确定</a-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</pi-container>
|
</pi-container>
|
||||||
|
@ -111,310 +113,327 @@
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="tsx">
|
<script lang="tsx" setup>
|
||||||
import { message, Modal } from "ant-design-vue";
|
import { message, Modal } from "ant-design-vue";
|
||||||
import { computed, inject, Ref, ref, watch, provide } from "vue";
|
import { computed, provide, ref, Ref, watch } from "vue";
|
||||||
import * as _ from "lodash-es";
|
import { merge, cloneDeep } from "lodash-es";
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
import { CopyOutlined } from "@ant-design/icons-vue";
|
import { usePluginStore, PluginGroups } from "/@/store/plugin";
|
||||||
import { PluginGroups } from "/@/views/certd/pipeline/pipeline/type";
|
import { useCompute } from "@fast-crud/fast-crud";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
|
||||||
import { compute, useCompute } from "@fast-crud/fast-crud";
|
|
||||||
import { useReference } from "/@/use/use-refrence";
|
import { useReference } from "/@/use/use-refrence";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import * as pluginApi from "../../../api.plugin";
|
|
||||||
import { mitter } from "/@/utils/util.mitt";
|
import { mitter } from "/@/utils/util.mitt";
|
||||||
import { utils } from "/@/utils";
|
import { utils } from "/@/utils";
|
||||||
export default {
|
|
||||||
|
defineOptions({
|
||||||
name: "PiStepForm",
|
name: "PiStepForm",
|
||||||
// eslint-disable-next-line vue/no-unused-components
|
});
|
||||||
components: { CopyOutlined },
|
const props = defineProps({
|
||||||
props: {
|
editMode: {
|
||||||
editMode: {
|
type: Boolean,
|
||||||
type: Boolean,
|
default: true,
|
||||||
default: true,
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(["update"]);
|
||||||
|
|
||||||
|
const pluginStore = usePluginStore();
|
||||||
|
|
||||||
|
function transformDesc(desc: string = "") {
|
||||||
|
return utils.transformLink(desc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* step drawer
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
function useStepForm() {
|
||||||
|
const settingStore = useSettingStore();
|
||||||
|
const mode: Ref = ref("add");
|
||||||
|
const callback: Ref = ref();
|
||||||
|
const currentStep: Ref = ref({ title: undefined, input: {} });
|
||||||
|
const stepFormRef: Ref = ref(null);
|
||||||
|
const stepDrawerVisible: Ref = ref(false);
|
||||||
|
const fullscreen: Ref<boolean> = ref(false);
|
||||||
|
const rules: Ref = ref({
|
||||||
|
name: [
|
||||||
|
{
|
||||||
|
type: "string",
|
||||||
|
required: true,
|
||||||
|
message: "请输入名称",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
const stepTypeSelected = (item: any) => {
|
||||||
|
if (item.needPlus && !settingStore.isPlus) {
|
||||||
|
message.warn("此插件需要开通专业版才能使用");
|
||||||
|
mitter.emit("openVipModal");
|
||||||
|
throw new Error("此插件需要开通专业版才能使用");
|
||||||
|
}
|
||||||
|
currentStep.value.type = item.name;
|
||||||
|
currentStep.value.title = item.title;
|
||||||
|
console.log("currentStepTypeChanged:", currentStep.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const stepTypeSave = async () => {
|
||||||
|
currentStep.value._isAdd = false;
|
||||||
|
if (currentStep.value.type == null) {
|
||||||
|
message.warn("请先选择类型");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 给step的input设置默认值
|
||||||
|
await changeCurrentPlugin(currentStep.value);
|
||||||
|
|
||||||
|
//合并默认值
|
||||||
|
merge(
|
||||||
|
currentStep.value,
|
||||||
|
{
|
||||||
|
input: {},
|
||||||
|
strategy: { runStrategy: 0 },
|
||||||
|
},
|
||||||
|
currentPlugin.value.default,
|
||||||
|
currentStep.value
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const stepDrawerShow = () => {
|
||||||
|
stepDrawerVisible.value = true;
|
||||||
|
};
|
||||||
|
const stepDrawerClose = () => {
|
||||||
|
stepDrawerVisible.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
const stepOpen = (step: any, emit: any) => {
|
||||||
|
callback.value = emit;
|
||||||
|
currentStep.value = merge({ input: {}, strategy: {} }, step);
|
||||||
|
|
||||||
|
if (step.type) {
|
||||||
|
changeCurrentPlugin(currentStep.value);
|
||||||
|
}
|
||||||
|
stepDrawerShow();
|
||||||
|
};
|
||||||
|
|
||||||
|
const stepAdd = (emit: any, stepDef: any) => {
|
||||||
|
mode.value = "add";
|
||||||
|
const step: any = {
|
||||||
|
id: nanoid(),
|
||||||
|
title: "新任务",
|
||||||
|
type: undefined,
|
||||||
|
_isAdd: true,
|
||||||
|
input: {},
|
||||||
|
status: null,
|
||||||
|
};
|
||||||
|
merge(step, stepDef);
|
||||||
|
stepOpen(step, emit);
|
||||||
|
};
|
||||||
|
|
||||||
|
const stepEdit = (step: any, emit: any) => {
|
||||||
|
mode.value = "edit";
|
||||||
|
stepOpen(step, emit);
|
||||||
|
};
|
||||||
|
|
||||||
|
const stepView = (step: any, emit: any) => {
|
||||||
|
mode.value = "view";
|
||||||
|
stepOpen(step, emit);
|
||||||
|
};
|
||||||
|
|
||||||
|
const currentPluginDefine = ref();
|
||||||
|
provide("getCurrentPluginDefine", () => {
|
||||||
|
return currentPluginDefine;
|
||||||
|
});
|
||||||
|
provide("get:plugin:type", () => {
|
||||||
|
return "plugin";
|
||||||
|
});
|
||||||
|
|
||||||
|
function getContext() {
|
||||||
|
return {
|
||||||
|
form: currentStep.value.input,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const { doComputed } = useCompute();
|
||||||
|
const currentPlugin = doComputed(() => {
|
||||||
|
return currentPluginDefine.value || {};
|
||||||
|
}, getContext);
|
||||||
|
const changeCurrentPlugin = async (step: any) => {
|
||||||
|
const stepType = step.type;
|
||||||
|
step.type = stepType;
|
||||||
|
step._isAdd = false;
|
||||||
|
const pluginDefine = await pluginStore.getPluginDefine(stepType);
|
||||||
|
// let pluginDefine = pluginGroups.get(stepType);
|
||||||
|
if (pluginDefine == null) {
|
||||||
|
console.log("插件未找到", stepType);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// pluginDefine = _.cloneDeep(pluginDefine);
|
||||||
|
const columns = pluginDefine.input;
|
||||||
|
for (let key in columns) {
|
||||||
|
const column = columns[key];
|
||||||
|
useReference(column);
|
||||||
|
}
|
||||||
|
|
||||||
|
currentPluginDefine.value = pluginDefine;
|
||||||
|
|
||||||
|
for (let key in pluginDefine.input) {
|
||||||
|
const column = pluginDefine.input[key];
|
||||||
|
//设置初始值
|
||||||
|
if ((column.default != null || column.value != null) && currentStep.value.input[key] == null) {
|
||||||
|
currentStep.value.input[key] = column.default ?? column.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//设置系统初始值
|
||||||
|
const pluginSysConfig = await pluginStore.getPluginConfig({ name: pluginDefine.name, type: "builtIn" });
|
||||||
|
if (pluginSysConfig.sysSetting?.input) {
|
||||||
|
for (const key in pluginSysConfig.sysSetting?.input) {
|
||||||
|
currentStep.value.input[key] = pluginSysConfig.sysSetting?.input[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("currentStepTypeChanged:", currentStep.value);
|
||||||
|
console.log("currentStepPlugin:", currentPlugin.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const stepSave = async (e: any) => {
|
||||||
|
console.log("currentStepSave", currentStep.value);
|
||||||
|
try {
|
||||||
|
await stepFormRef.value.validate();
|
||||||
|
} catch (e) {
|
||||||
|
console.error("表单验证失败:", e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
callback.value("save", currentStep.value);
|
||||||
|
stepDrawerClose();
|
||||||
|
};
|
||||||
|
|
||||||
|
const stepDelete = () => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "确认",
|
||||||
|
content: `确定要删除此步骤吗?`,
|
||||||
|
async onOk() {
|
||||||
|
callback.value("delete");
|
||||||
|
stepDrawerClose();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const stepCopy = () => {
|
||||||
|
const step = cloneDeep(currentStep.value);
|
||||||
|
step.id = nanoid();
|
||||||
|
step.title = `${step.title}-copy`;
|
||||||
|
callback.value("copy", step);
|
||||||
|
stepDrawerClose();
|
||||||
|
};
|
||||||
|
|
||||||
|
const getScopeFunc = () => {
|
||||||
|
return {
|
||||||
|
form: currentStep.value,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const pluginSearch = ref({
|
||||||
|
keyword: "",
|
||||||
|
result: [],
|
||||||
|
});
|
||||||
|
const pluginGroupActive = ref("all");
|
||||||
|
const pluginGroup: Ref = ref();
|
||||||
|
const pluginStore = usePluginStore();
|
||||||
|
|
||||||
|
async function loadPluginGroups() {
|
||||||
|
pluginGroup.value = await pluginStore.getGroups();
|
||||||
|
}
|
||||||
|
|
||||||
|
loadPluginGroups();
|
||||||
|
const computedPluginGroups: any = computed(() => {
|
||||||
|
if (!pluginGroup.value) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
const group = pluginGroup.value as PluginGroups;
|
||||||
|
const groups = group.groups;
|
||||||
|
if (pluginSearch.value.keyword) {
|
||||||
|
const keyword = pluginSearch.value.keyword.toLowerCase();
|
||||||
|
const list = groups.all.plugins.filter((plugin: any) => {
|
||||||
|
return plugin.title?.toLowerCase().includes(keyword) || plugin.desc?.toLowerCase().includes(keyword) || plugin.name?.toLowerCase().includes(keyword);
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
search: { key: "search", title: "搜索结果", plugins: list },
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return groups;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
watch(
|
||||||
|
() => {
|
||||||
|
return pluginSearch.value.keyword;
|
||||||
|
},
|
||||||
|
(val: any) => {
|
||||||
|
if (val) {
|
||||||
|
pluginGroupActive.value = "search";
|
||||||
|
} else {
|
||||||
|
pluginGroupActive.value = "all";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
pluginGroupActive,
|
||||||
|
computedPluginGroups,
|
||||||
|
pluginSearch,
|
||||||
|
stepTypeSelected,
|
||||||
|
stepTypeSave,
|
||||||
|
stepFormRef,
|
||||||
|
mode,
|
||||||
|
stepAdd,
|
||||||
|
stepEdit,
|
||||||
|
stepView,
|
||||||
|
stepDrawerShow,
|
||||||
|
stepDrawerVisible,
|
||||||
|
currentStep,
|
||||||
|
currentPlugin,
|
||||||
|
stepSave,
|
||||||
|
stepDelete,
|
||||||
|
rules,
|
||||||
|
getScopeFunc,
|
||||||
|
stepCopy,
|
||||||
|
fullscreen,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const runStrategyProps = ref({
|
||||||
|
title: "运行策略",
|
||||||
|
key: "strategy.runStrategy",
|
||||||
|
component: {
|
||||||
|
name: "a-select",
|
||||||
|
vModel: "value",
|
||||||
|
options: [
|
||||||
|
{ value: 0, label: "正常运行(只有证书申请任务需要选择它)" },
|
||||||
|
{ value: 1, label: "成功后跳过(其他任务请选择它)" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
helper: {
|
||||||
|
render: () => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div class="color-green">一般保持默认即可</div>
|
||||||
|
<div>正常运行:每次都运行,证书任务需要每次都运行</div>
|
||||||
|
<div>成功后跳过:该任务成功一次之后跳过,不重复执行(证书变化之后才会再次运行)</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
emits: ["update"],
|
rules: [{ required: true, message: "此项必填" }],
|
||||||
setup(props: any, context: any) {
|
});
|
||||||
function transformDesc(desc: string = "") {
|
|
||||||
return utils.transformLink(desc);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
const labelCol = ref({ span: 6 });
|
||||||
* step drawer
|
const wrapperCol = ref({ span: 16 });
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
function useStepForm() {
|
|
||||||
const settingStore = useSettingStore();
|
|
||||||
const getPluginGroups: any = inject("getPluginGroups");
|
|
||||||
const pluginGroups: PluginGroups = getPluginGroups();
|
|
||||||
const mode: Ref = ref("add");
|
|
||||||
const callback: Ref = ref();
|
|
||||||
const currentStep: Ref = ref({ title: undefined, input: {} });
|
|
||||||
const stepFormRef: Ref = ref(null);
|
|
||||||
const stepDrawerVisible: Ref = ref(false);
|
|
||||||
const fullscreen: Ref<boolean> = ref(false);
|
|
||||||
const rules: Ref = ref({
|
|
||||||
name: [
|
|
||||||
{
|
|
||||||
type: "string",
|
|
||||||
required: true,
|
|
||||||
message: "请输入名称",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
const stepTypeSelected = (item: any) => {
|
const stepFormRes = useStepForm();
|
||||||
if (item.needPlus && !settingStore.isPlus) {
|
const { pluginGroupActive, computedPluginGroups, pluginSearch, stepTypeSelected, stepTypeSave, stepFormRef, stepDrawerVisible, currentStep, currentPlugin, stepSave, stepDelete, getScopeFunc, fullscreen } = stepFormRes;
|
||||||
message.warn("此插件需要开通专业版才能使用");
|
defineExpose({
|
||||||
mitter.emit("openVipModal");
|
...stepFormRes,
|
||||||
throw new Error("此插件需要开通专业版才能使用");
|
});
|
||||||
}
|
|
||||||
currentStep.value.type = item.name;
|
|
||||||
currentStep.value.title = item.title;
|
|
||||||
console.log("currentStepTypeChanged:", currentStep.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
const stepTypeSave = async () => {
|
|
||||||
currentStep.value._isAdd = false;
|
|
||||||
if (currentStep.value.type == null) {
|
|
||||||
message.warn("请先选择类型");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 给step的input设置默认值
|
|
||||||
await changeCurrentPlugin(currentStep.value);
|
|
||||||
|
|
||||||
//合并默认值
|
|
||||||
_.merge(currentStep.value, { input: {}, strategy: { runStrategy: 0 } }, currentPlugin.value.default, currentStep.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
const stepDrawerShow = () => {
|
|
||||||
stepDrawerVisible.value = true;
|
|
||||||
};
|
|
||||||
const stepDrawerClose = () => {
|
|
||||||
stepDrawerVisible.value = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
const stepOpen = (step: any, emit: any) => {
|
|
||||||
callback.value = emit;
|
|
||||||
currentStep.value = _.merge({ input: {}, strategy: {} }, step);
|
|
||||||
|
|
||||||
if (step.type) {
|
|
||||||
changeCurrentPlugin(currentStep.value);
|
|
||||||
}
|
|
||||||
stepDrawerShow();
|
|
||||||
};
|
|
||||||
|
|
||||||
const stepAdd = (emit: any, stepDef: any) => {
|
|
||||||
mode.value = "add";
|
|
||||||
const step: any = {
|
|
||||||
id: nanoid(),
|
|
||||||
title: "新任务",
|
|
||||||
type: undefined,
|
|
||||||
_isAdd: true,
|
|
||||||
input: {},
|
|
||||||
status: null,
|
|
||||||
};
|
|
||||||
_.merge(step, stepDef);
|
|
||||||
stepOpen(step, emit);
|
|
||||||
};
|
|
||||||
|
|
||||||
const stepEdit = (step: any, emit: any) => {
|
|
||||||
mode.value = "edit";
|
|
||||||
stepOpen(step, emit);
|
|
||||||
};
|
|
||||||
|
|
||||||
const stepView = (step: any, emit: any) => {
|
|
||||||
mode.value = "view";
|
|
||||||
stepOpen(step, emit);
|
|
||||||
};
|
|
||||||
|
|
||||||
const currentPluginDefine = ref();
|
|
||||||
provide("getCurrentPluginDefine", () => {
|
|
||||||
return currentPluginDefine;
|
|
||||||
});
|
|
||||||
provide("get:plugin:type", () => {
|
|
||||||
return "plugin";
|
|
||||||
});
|
|
||||||
|
|
||||||
function getContext() {
|
|
||||||
return {
|
|
||||||
form: currentStep.value.input,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const { doComputed } = useCompute();
|
|
||||||
const currentPlugin = doComputed(() => {
|
|
||||||
return currentPluginDefine.value || {};
|
|
||||||
}, getContext);
|
|
||||||
const changeCurrentPlugin = async (step: any) => {
|
|
||||||
const stepType = step.type;
|
|
||||||
step.type = stepType;
|
|
||||||
step._isAdd = false;
|
|
||||||
const pluginDefine = await pluginApi.GetPluginDefine(stepType);
|
|
||||||
// let pluginDefine = pluginGroups.get(stepType);
|
|
||||||
if (pluginDefine == null) {
|
|
||||||
console.log("插件未找到", stepType);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// pluginDefine = _.cloneDeep(pluginDefine);
|
|
||||||
const columns = pluginDefine.input;
|
|
||||||
for (let key in columns) {
|
|
||||||
const column = columns[key];
|
|
||||||
useReference(column);
|
|
||||||
}
|
|
||||||
|
|
||||||
currentPluginDefine.value = pluginDefine;
|
|
||||||
|
|
||||||
for (let key in pluginDefine.input) {
|
|
||||||
const column = pluginDefine.input[key];
|
|
||||||
//设置初始值
|
|
||||||
if ((column.default != null || column.value != null) && currentStep.value.input[key] == null) {
|
|
||||||
currentStep.value.input[key] = column.default ?? column.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//设置系统初始值
|
|
||||||
const pluginSysConfig = await pluginApi.GetPluginConfig({ name: pluginDefine.name, type: "builtIn" });
|
|
||||||
if (pluginSysConfig.sysSetting?.input) {
|
|
||||||
for (const key in pluginSysConfig.sysSetting?.input) {
|
|
||||||
currentStep.value.input[key] = pluginSysConfig.sysSetting?.input[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("currentStepTypeChanged:", currentStep.value);
|
|
||||||
console.log("currentStepPlugin:", currentPlugin.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
const stepSave = async (e: any) => {
|
|
||||||
console.log("currentStepSave", currentStep.value);
|
|
||||||
try {
|
|
||||||
await stepFormRef.value.validate();
|
|
||||||
} catch (e) {
|
|
||||||
console.error("表单验证失败:", e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
callback.value("save", currentStep.value);
|
|
||||||
stepDrawerClose();
|
|
||||||
};
|
|
||||||
|
|
||||||
const stepDelete = () => {
|
|
||||||
Modal.confirm({
|
|
||||||
title: "确认",
|
|
||||||
content: `确定要删除此步骤吗?`,
|
|
||||||
async onOk() {
|
|
||||||
callback.value("delete");
|
|
||||||
stepDrawerClose();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const stepCopy = () => {
|
|
||||||
const step = _.cloneDeep(currentStep.value);
|
|
||||||
step.id = nanoid();
|
|
||||||
step.title = `${step.title}-copy`;
|
|
||||||
callback.value("copy", step);
|
|
||||||
stepDrawerClose();
|
|
||||||
};
|
|
||||||
|
|
||||||
const getScopeFunc = () => {
|
|
||||||
return {
|
|
||||||
form: currentStep.value,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const pluginSearch = ref({
|
|
||||||
keyword: "",
|
|
||||||
result: [],
|
|
||||||
});
|
|
||||||
const pluginGroupActive = ref("all");
|
|
||||||
const computedPluginGroups: any = computed(() => {
|
|
||||||
const groups = pluginGroups.groups;
|
|
||||||
if (pluginSearch.value.keyword) {
|
|
||||||
const keyword = pluginSearch.value.keyword.toLowerCase();
|
|
||||||
const list = groups.all.plugins.filter(plugin => {
|
|
||||||
return plugin.title?.toLowerCase().includes(keyword) || plugin.desc?.toLowerCase().includes(keyword) || plugin.name?.toLowerCase().includes(keyword);
|
|
||||||
});
|
|
||||||
return {
|
|
||||||
search: { key: "search", title: "搜索结果", plugins: list },
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return groups;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
watch(
|
|
||||||
() => {
|
|
||||||
return pluginSearch.value.keyword;
|
|
||||||
},
|
|
||||||
(val: any) => {
|
|
||||||
if (val) {
|
|
||||||
pluginGroupActive.value = "search";
|
|
||||||
} else {
|
|
||||||
pluginGroupActive.value = "all";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
|
||||||
pluginGroupActive,
|
|
||||||
computedPluginGroups,
|
|
||||||
pluginSearch,
|
|
||||||
stepTypeSelected,
|
|
||||||
stepTypeSave,
|
|
||||||
pluginGroups,
|
|
||||||
stepFormRef,
|
|
||||||
mode,
|
|
||||||
stepAdd,
|
|
||||||
stepEdit,
|
|
||||||
stepView,
|
|
||||||
stepDrawerShow,
|
|
||||||
stepDrawerVisible,
|
|
||||||
currentStep,
|
|
||||||
currentPlugin,
|
|
||||||
stepSave,
|
|
||||||
stepDelete,
|
|
||||||
rules,
|
|
||||||
getScopeFunc,
|
|
||||||
stepCopy,
|
|
||||||
fullscreen,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const runStrategyProps = ref({
|
|
||||||
title: "运行策略",
|
|
||||||
key: "strategy.runStrategy",
|
|
||||||
component: {
|
|
||||||
name: "a-select",
|
|
||||||
vModel: "value",
|
|
||||||
options: [
|
|
||||||
{ value: 0, label: "正常运行(只有证书申请任务需要选择它)" },
|
|
||||||
{ value: 1, label: "成功后跳过(其他任务请选择它)" },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
helper: {
|
|
||||||
render: () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div class="color-green">一般保持默认即可</div>
|
|
||||||
<div>正常运行:每次都运行,证书任务需要每次都运行</div>
|
|
||||||
<div>成功后跳过:该任务成功一次之后跳过,不重复执行(证书变化之后才会再次运行)</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rules: [{ required: true, message: "此项必填" }],
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
...useStepForm(),
|
|
||||||
labelCol: { span: 6 },
|
|
||||||
wrapperCol: { span: 16 },
|
|
||||||
runStrategyProps,
|
|
||||||
transformDesc,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
@ -427,6 +446,7 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
color: #00b7ff;
|
color: #00b7ff;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
vertical-align: middle !important;
|
vertical-align: middle !important;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -437,28 +457,35 @@ export default {
|
||||||
|
|
||||||
.step-form-drawer {
|
.step-form-drawer {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|
||||||
.ant-tabs-right > div > .ant-tabs-nav .ant-tabs-tab {
|
.ant-tabs-right > div > .ant-tabs-nav .ant-tabs-tab {
|
||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-tabs-nav .ant-tabs-tab {
|
.ant-tabs-nav .ant-tabs-tab {
|
||||||
margin-top: 10px !important;
|
margin-top: 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.fullscreen {
|
&.fullscreen {
|
||||||
.pi-step-form {
|
.pi-step-form {
|
||||||
.body {
|
.body {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
|
||||||
.step-plugin {
|
.step-plugin {
|
||||||
width: 16.666666%;
|
width: 16.666666%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.step-form {
|
.step-form {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
width: 1500px;
|
width: 1500px;
|
||||||
|
|
||||||
.fs-form-item {
|
.fs-form-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
.bottom-button {
|
.bottom-button {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -491,14 +518,17 @@ export default {
|
||||||
|
|
||||||
.step-plugin {
|
.step-plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-tabs-content {
|
.ant-tabs-content {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-tabs-tabpane {
|
.ant-tabs-tabpane {
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-card {
|
.ant-card {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<a-drawer
|
<a-drawer v-model:open="taskDrawerVisible" placement="right" :closable="true" width="700px" class="pi-task-form" @after-open-change="taskDrawerOnAfterVisibleChange">
|
||||||
v-model:open="taskDrawerVisible"
|
|
||||||
placement="right"
|
|
||||||
:closable="true"
|
|
||||||
width="700px"
|
|
||||||
class="pi-task-form"
|
|
||||||
@after-open-change="taskDrawerOnAfterVisibleChange"
|
|
||||||
>
|
|
||||||
<template #title>
|
<template #title>
|
||||||
<div>
|
<div>
|
||||||
编辑任务
|
编辑任务
|
||||||
|
@ -25,21 +18,15 @@
|
||||||
key: 'title',
|
key: 'title',
|
||||||
component: {
|
component: {
|
||||||
name: 'a-input',
|
name: 'a-input',
|
||||||
vModel: 'value'
|
vModel: 'value',
|
||||||
},
|
},
|
||||||
rules: [{ required: true, message: '此项必填' }]
|
rules: [{ required: true, message: '此项必填' }],
|
||||||
}"
|
}"
|
||||||
:get-context-fn="blankFn"
|
:get-context-fn="blankFn"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="steps">
|
<div class="steps">
|
||||||
<a-form-item
|
<a-form-item :value="currentTask.steps" name="steps" label="" :wrapper-col="{ span: 24 }" :rules="[{ required: true, message: '至少需要一个步骤,或者你可以点击标题右边删除按钮删除此任务' }]">
|
||||||
:value="currentTask.steps"
|
|
||||||
name="steps"
|
|
||||||
label=""
|
|
||||||
:wrapper-col="{ span: 24 }"
|
|
||||||
:rules="[{ required: true, message: '至少需要一个步骤,或者你可以点击标题右边删除按钮删除此任务' }]"
|
|
||||||
>
|
|
||||||
<a-descriptions title="任务步骤" size="small">
|
<a-descriptions title="任务步骤" size="small">
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<a-button type="primary" @click="stepAdd(currentTask)">添加步骤</a-button>
|
<a-button type="primary" @click="stepAdd(currentTask)">添加步骤</a-button>
|
||||||
|
@ -86,8 +73,8 @@ import PiStepForm from "../step-form/index.vue";
|
||||||
import { Modal } from "ant-design-vue";
|
import { Modal } from "ant-design-vue";
|
||||||
import { CopyOutlined } from "@ant-design/icons-vue";
|
import { CopyOutlined } from "@ant-design/icons-vue";
|
||||||
import VDraggable from "vuedraggable";
|
import VDraggable from "vuedraggable";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { filter } from "lodash-es";
|
import { filter } from "lodash-es";
|
||||||
export default {
|
export default {
|
||||||
name: "PiTaskForm",
|
name: "PiTaskForm",
|
||||||
|
@ -95,8 +82,8 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
editMode: {
|
editMode: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
emits: ["update"],
|
emits: ["update"],
|
||||||
setup(props: any, ctx: any) {
|
setup(props: any, ctx: any) {
|
||||||
|
@ -149,7 +136,7 @@ export default {
|
||||||
content: `确定要删除此步骤吗?`,
|
content: `确定要删除此步骤吗?`,
|
||||||
async onOk() {
|
async onOk() {
|
||||||
task.steps.splice(stepIndex, 1);
|
task.steps.splice(stepIndex, 1);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -176,9 +163,9 @@ export default {
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入名称"
|
message: "请输入名称",
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
const taskDrawerShow = () => {
|
const taskDrawerShow = () => {
|
||||||
|
@ -245,7 +232,7 @@ export default {
|
||||||
async onOk() {
|
async onOk() {
|
||||||
callback.value("delete");
|
callback.value("delete");
|
||||||
taskDrawerClose();
|
taskDrawerClose();
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -265,7 +252,7 @@ export default {
|
||||||
taskSave,
|
taskSave,
|
||||||
taskDelete,
|
taskDelete,
|
||||||
rules,
|
rules,
|
||||||
blankFn
|
blankFn,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
@ -274,9 +261,9 @@ export default {
|
||||||
labelCol: { span: 6 },
|
labelCol: { span: 6 },
|
||||||
wrapperCol: { span: 16 },
|
wrapperCol: { span: 16 },
|
||||||
...useTaskForm(),
|
...useTaskForm(),
|
||||||
...useStep()
|
...useStep(),
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -255,7 +255,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref, provide, Ref, watch, onMounted } from "vue";
|
import { defineComponent, onMounted, provide, Ref, ref, watch } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import PiTaskForm from "./component/task-form/index.vue";
|
import PiTaskForm from "./component/task-form/index.vue";
|
||||||
import PiTriggerForm from "./component/trigger-form/index.vue";
|
import PiTriggerForm from "./component/trigger-form/index.vue";
|
||||||
|
@ -264,16 +264,17 @@ import PiTaskView from "./component/task-view/index.vue";
|
||||||
import PiStatusShow from "./component/status-show.vue";
|
import PiStatusShow from "./component/status-show.vue";
|
||||||
import VDraggable from "vuedraggable";
|
import VDraggable from "vuedraggable";
|
||||||
import * as _ from "lodash-es";
|
import * as _ from "lodash-es";
|
||||||
import { message, Modal, notification, TourProps } from "ant-design-vue";
|
import { message, Modal, notification } from "ant-design-vue";
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
import { PipelineDetail, PipelineOptions, PluginGroups, RunHistory } from "./type";
|
import { PipelineDetail, PipelineOptions, RunHistory } from "./type";
|
||||||
import type { Runnable, Stage } from "@certd/pipeline";
|
import type { Runnable, Stage } from "@certd/pipeline";
|
||||||
import PiHistoryTimelineItem from "/@/views/certd/pipeline/pipeline/component/history-timeline-item.vue";
|
import PiHistoryTimelineItem from "/@/views/certd/pipeline/pipeline/component/history-timeline-item.vue";
|
||||||
import { FsIcon } from "@fast-crud/fast-crud";
|
import { FsIcon } from "@fast-crud/fast-crud";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import TaskShortcuts from "./component/shortcut/task-shortcuts.vue";
|
import TaskShortcuts from "./component/shortcut/task-shortcuts.vue";
|
||||||
import { eachSteps, findStep } from "../utils";
|
import { eachSteps, findStep } from "../utils";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "PipelineEdit",
|
name: "PipelineEdit",
|
||||||
// eslint-disable-next-line vue/no-unused-components
|
// eslint-disable-next-line vue/no-unused-components
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import type { Pipeline } from "@certd/pipeline";
|
import type { Pipeline } from "@certd/pipeline";
|
||||||
import { DynamicType, FormItemProps } from "@fast-crud/fast-crud";
|
import { PluginGroups } from "/@/store/plugin";
|
||||||
|
|
||||||
export type PipelineDetail = {
|
export type PipelineDetail = {
|
||||||
pipeline: Pipeline;
|
pipeline: Pipeline;
|
||||||
};
|
};
|
||||||
|
@ -11,120 +12,6 @@ export type RunHistory = {
|
||||||
[id: string]: string[];
|
[id: string]: string[];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export type PluginGroup = {
|
|
||||||
key: string;
|
|
||||||
title: string;
|
|
||||||
desc?: string;
|
|
||||||
order: number;
|
|
||||||
plugins: any[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type PluginDefine = {
|
|
||||||
name: string;
|
|
||||||
title: string;
|
|
||||||
desc?: string;
|
|
||||||
input: {
|
|
||||||
[key: string]: DynamicType<FormItemProps>;
|
|
||||||
};
|
|
||||||
output: {
|
|
||||||
[key: string]: any;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export class PluginGroups {
|
|
||||||
groups: { [key: string]: PluginGroup };
|
|
||||||
map: { [key: string]: PluginDefine };
|
|
||||||
constructor(groups: { [key: string]: PluginGroup }) {
|
|
||||||
this.groups = groups;
|
|
||||||
this.initGroup(groups);
|
|
||||||
this.initMap();
|
|
||||||
}
|
|
||||||
|
|
||||||
private initGroup(groups: { [p: string]: PluginGroup }) {
|
|
||||||
const all: PluginGroup = {
|
|
||||||
key: "all",
|
|
||||||
title: "全部",
|
|
||||||
order: 0,
|
|
||||||
plugins: [],
|
|
||||||
icon: "material-symbols:border-all-rounded",
|
|
||||||
};
|
|
||||||
for (const key in groups) {
|
|
||||||
all.plugins.push(...groups[key].plugins);
|
|
||||||
}
|
|
||||||
this.groups = {
|
|
||||||
all,
|
|
||||||
...groups,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
initMap() {
|
|
||||||
const map: { [key: string]: PluginDefine } = {};
|
|
||||||
for (const key in this.groups) {
|
|
||||||
const group = this.groups[key];
|
|
||||||
for (const plugin of group.plugins) {
|
|
||||||
map[plugin.name] = plugin;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.map = map;
|
|
||||||
}
|
|
||||||
|
|
||||||
getGroups() {
|
|
||||||
return this.groups;
|
|
||||||
}
|
|
||||||
|
|
||||||
get(name: string) {
|
|
||||||
return this.map[name];
|
|
||||||
}
|
|
||||||
|
|
||||||
getPreStepOutputOptions({ pipeline, currentStageIndex, currentTaskIndex, currentStepIndex, currentTask }: any) {
|
|
||||||
const steps = this.collectionPreStepOutputs({
|
|
||||||
pipeline,
|
|
||||||
currentStageIndex,
|
|
||||||
currentTaskIndex,
|
|
||||||
currentStepIndex,
|
|
||||||
currentTask,
|
|
||||||
});
|
|
||||||
const options: any[] = [];
|
|
||||||
for (const step of steps) {
|
|
||||||
const stepDefine = this.get(step.type);
|
|
||||||
for (const key in stepDefine?.output) {
|
|
||||||
options.push({
|
|
||||||
value: `step.${step.id}.${key}`,
|
|
||||||
label: `${stepDefine.output[key].title}【from:${step.title}】`,
|
|
||||||
type: step.type,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
|
|
||||||
collectionPreStepOutputs({ pipeline, currentStageIndex, currentTaskIndex, currentStepIndex, currentTask }: any) {
|
|
||||||
const steps: any[] = [];
|
|
||||||
// 开始放step
|
|
||||||
for (let i = 0; i < currentStageIndex; i++) {
|
|
||||||
const stage = pipeline.stages[i];
|
|
||||||
for (const task of stage.tasks) {
|
|
||||||
for (const step of task.steps) {
|
|
||||||
steps.push(step);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//当前阶段之前的task
|
|
||||||
const currentStage = pipeline.stages[currentStageIndex];
|
|
||||||
for (let i = 0; i < currentTaskIndex; i++) {
|
|
||||||
const task = currentStage.tasks[i];
|
|
||||||
for (const step of task.steps) {
|
|
||||||
steps.push(step);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//放当前任务下的step
|
|
||||||
for (let i = 0; i < currentStepIndex; i++) {
|
|
||||||
const step = currentTask.steps[i];
|
|
||||||
steps.push(step);
|
|
||||||
}
|
|
||||||
return steps;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type PipelineOptions = {
|
export type PipelineOptions = {
|
||||||
doTrigger(options: { pipelineId: number; stepId?: string }): Promise<void>;
|
doTrigger(options: { pipelineId: number; stepId?: string }): Promise<void>;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { forEach } from "lodash-es";
|
import { forEach } from "lodash-es";
|
||||||
import { mySuiteApi } from "/@/views/certd/suite/mine/api";
|
import { mySuiteApi } from "/@/views/certd/suite/mine/api";
|
||||||
import { notification } from "ant-design-vue";
|
import { notification } from "ant-design-vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
import forge from "node-forge";
|
import forge from "node-forge";
|
||||||
export function eachStages(list: any[], exec: (item: any, runnableType: string) => void, runnableType: string = "stage") {
|
export function eachStages(list: any[], exec: (item: any, runnableType: string) => void, runnableType: string = "stage") {
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { useI18n } from "vue-i18n";
|
||||||
import { computed, Ref, ref } from "vue";
|
import { computed, Ref, ref } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
|
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { Modal } from "ant-design-vue";
|
import { Modal } from "ant-design-vue";
|
||||||
import PriceInput from "/@/views/sys/suite/product/price-input.vue";
|
import PriceInput from "/@/views/sys/suite/product/price-input.vue";
|
||||||
import SuiteValue from "/@/views/sys/suite/product/suite-value.vue";
|
import SuiteValue from "/@/views/sys/suite/product/suite-value.vue";
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, ref, Ref } from "vue";
|
import { computed, ref, Ref } from "vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { SiteInfo } from "/@/api/modules/api.basic";
|
import { SiteInfo } from "/@/api/modules/api.basic";
|
||||||
|
|
||||||
const version = ref(import.meta.env.VITE_APP_VERSION);
|
const version = ref(import.meta.env.VITE_APP_VERSION);
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { LocalStorage } from "/@/utils/util.storage";
|
||||||
export async function GetStatisticCount() {
|
export async function GetStatisticCount() {
|
||||||
return await request({
|
return await request({
|
||||||
url: "/statistic/count",
|
url: "/statistic/count",
|
||||||
method: "POST"
|
method: "POST",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ export async function GetLatestVersion() {
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: "/app/latest",
|
url: "/app/latest",
|
||||||
method: "GET",
|
method: "GET",
|
||||||
unpack: true
|
unpack: true,
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
const latest = res;
|
const latest = res;
|
||||||
|
|
|
@ -125,23 +125,22 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { FsIcon } from "@fast-crud/fast-crud";
|
import { FsIcon } from "@fast-crud/fast-crud";
|
||||||
import SimpleSteps from "/@/components/tutorial/simple-steps.vue";
|
import SimpleSteps from "/@/components/tutorial/simple-steps.vue";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { computed, ComputedRef, onMounted, Ref, ref } from "vue";
|
import { computed, ComputedRef, onMounted, Ref, ref } from "vue";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import StatisticCard from "/@/views/framework/home/dashboard/statistic-card.vue";
|
import StatisticCard from "/@/views/framework/home/dashboard/statistic-card.vue";
|
||||||
import * as pluginApi from "/@/views/certd/pipeline/api.plugin";
|
|
||||||
import { PluginGroups } from "/@/views/certd/pipeline/pipeline/type";
|
|
||||||
import TutorialButton from "/@/components/tutorial/index.vue";
|
import TutorialButton from "/@/components/tutorial/index.vue";
|
||||||
import DayCount from "./charts/day-count.vue";
|
import DayCount from "./charts/day-count.vue";
|
||||||
import PieCount from "./charts/pie-count.vue";
|
import PieCount from "./charts/pie-count.vue";
|
||||||
import ExpiringList from "./charts/expiring-list.vue";
|
import ExpiringList from "./charts/expiring-list.vue";
|
||||||
import SuiteCard from "./suite-card.vue";
|
import SuiteCard from "./suite-card.vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { SiteInfo } from "/@/api/modules/api.basic";
|
import { SiteInfo } from "/@/store/settings/api.basic";
|
||||||
import { UserInfoRes } from "/@/api/modules/api.user";
|
import { UserInfoRes } from "/@/store/user/api.user";
|
||||||
import { GetStatisticCount } from "/@/views/framework/home/dashboard/api";
|
import { GetStatisticCount } from "/@/views/framework/home/dashboard/api";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
|
import { usePluginStore } from "/@/store/plugin";
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "DashboardUser",
|
name: "DashboardUser",
|
||||||
});
|
});
|
||||||
|
@ -227,9 +226,10 @@ async function loadCount() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const pluginStore = usePluginStore();
|
||||||
async function loadPluginGroups() {
|
async function loadPluginGroups() {
|
||||||
const groups = await pluginApi.GetGroups({});
|
const groups = await pluginStore.getGroups();
|
||||||
pluginGroups.value = new PluginGroups(groups);
|
pluginGroups.value = groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pluginGroups = ref();
|
const pluginGroups = ref();
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import DashboardUser from "./dashboard/index.vue";
|
import DashboardUser from "./dashboard/index.vue";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import ChangePasswordButton from "/@/views/certd/mine/change-password-button.vue";
|
import ChangePasswordButton from "/@/views/certd/mine/change-password-button.vue";
|
||||||
import { onMounted, ref } from "vue";
|
import { onMounted, ref } from "vue";
|
||||||
import { Modal } from "ant-design-vue";
|
import { Modal } from "ant-design-vue";
|
||||||
|
|
|
@ -67,8 +67,8 @@
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, reactive, ref, toRaw } from "vue";
|
import { defineComponent, reactive, ref, toRaw } from "vue";
|
||||||
import { useUserStore } from "/src/store/modules/user";
|
import { useUserStore } from "/src/store/user";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { utils } from "@fast-crud/fast-crud";
|
import { utils } from "@fast-crud/fast-crud";
|
||||||
import ImageCode from "/@/views/framework/login/image-code.vue";
|
import ImageCode from "/@/views/framework/login/image-code.vue";
|
||||||
import SmsCode from "/@/views/framework/login/sms-code.vue";
|
import SmsCode from "/@/views/framework/login/sms-code.vue";
|
||||||
|
|
|
@ -87,11 +87,11 @@
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, reactive, ref, toRaw } from "vue";
|
import { defineComponent, reactive, ref, toRaw } from "vue";
|
||||||
import { useUserStore } from "/src/store/modules/user";
|
import { useUserStore } from "/src/store/user";
|
||||||
import { utils } from "@fast-crud/fast-crud";
|
import { utils } from "@fast-crud/fast-crud";
|
||||||
import ImageCode from "/@/views/framework/login/image-code.vue";
|
import ImageCode from "/@/views/framework/login/image-code.vue";
|
||||||
import EmailCode from "./email-code.vue";
|
import EmailCode from "./email-code.vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { notification } from "ant-design-vue";
|
import { notification } from "ant-design-vue";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "RegisterPage",
|
name: "RegisterPage",
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
import { IframeClient } from "@certd/lib-iframe";
|
import { IframeClient } from "@certd/lib-iframe";
|
||||||
import { computed, onMounted, ref } from "vue";
|
import { computed, onMounted, ref } from "vue";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
import { notification } from "ant-design-vue";
|
import { notification } from "ant-design-vue";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
|
|
||||||
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { useI18n } from "vue-i18n";
|
||||||
import { computed, Ref, ref } from "vue";
|
import { computed, Ref, ref } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
|
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { Modal } from "ant-design-vue";
|
import { Modal } from "ant-design-vue";
|
||||||
|
|
||||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||||
|
|
|
@ -3,8 +3,6 @@ import { useI18n } from "vue-i18n";
|
||||||
import { Ref, ref } from "vue";
|
import { Ref, ref } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||||
import { useUserStore } from "/src/store/modules/user";
|
|
||||||
import { useSettingStore } from "/src/store/modules/settings";
|
|
||||||
import { Modal } from "ant-design-vue";
|
import { Modal } from "ant-design-vue";
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
import yaml from "js-yaml";
|
import yaml from "js-yaml";
|
||||||
|
@ -29,8 +27,6 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
|
|
||||||
const userStore = useUserStore();
|
|
||||||
const settingStore = useSettingStore();
|
|
||||||
const selectedRowKeys: Ref<any[]> = ref([]);
|
const selectedRowKeys: Ref<any[]> = ref([]);
|
||||||
context.selectedRowKeys = selectedRowKeys;
|
context.selectedRowKeys = selectedRowKeys;
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ defineOptions({
|
||||||
});
|
});
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
|
const pluginStore = usePluginStore();
|
||||||
const plugin = ref<any>({});
|
const plugin = ref<any>({});
|
||||||
const formOptionsRef: Ref = ref();
|
const formOptionsRef: Ref = ref();
|
||||||
const baseFormRef: Ref = ref({});
|
const baseFormRef: Ref = ref({});
|
||||||
|
@ -145,6 +146,7 @@ async function doSave() {
|
||||||
notification.success({
|
notification.success({
|
||||||
message: "保存成功",
|
message: "保存成功",
|
||||||
});
|
});
|
||||||
|
pluginStore.clear();
|
||||||
} finally {
|
} finally {
|
||||||
saveLoading.value = false;
|
saveLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,16 +8,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="flex-o">
|
<div class="flex-o">
|
||||||
<a-form
|
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" class="email-form-box" @finish="onFinish" @finish-failed="onFinishFailed">
|
||||||
:model="formState"
|
|
||||||
name="basic"
|
|
||||||
:label-col="{ span: 8 }"
|
|
||||||
:wrapper-col="{ span: 16 }"
|
|
||||||
autocomplete="off"
|
|
||||||
class="email-form-box"
|
|
||||||
@finish="onFinish"
|
|
||||||
@finish-failed="onFinishFailed"
|
|
||||||
>
|
|
||||||
<div v-if="!formState.usePlus" class="email-form">
|
<div v-if="!formState.usePlus" class="email-form">
|
||||||
<a-form-item label="使用自定义邮件服务器"> </a-form-item>
|
<a-form-item label="使用自定义邮件服务器"> </a-form-item>
|
||||||
<a-form-item label="SMTP域名" name="host" :rules="[{ required: true, message: '请输入smtp域名或ip' }]">
|
<a-form-item label="SMTP域名" name="host" :rules="[{ required: true, message: '请输入smtp域名或ip' }]">
|
||||||
|
@ -80,13 +71,12 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive } from "vue";
|
import { reactive } from "vue";
|
||||||
import * as api from "../api";
|
import * as api from "../api";
|
||||||
import { EmailSettingsSave, SettingKeys } from "../api";
|
|
||||||
import * as emailApi from "./api.email";
|
import * as emailApi from "./api.email";
|
||||||
import { notification } from "ant-design-vue";
|
import { notification } from "ant-design-vue";
|
||||||
import { useSettingStore } from "/src/store/modules/settings";
|
import { useSettingStore } from "/src/store/settings";
|
||||||
import * as _ from "lodash-es";
|
import * as _ from "lodash-es";
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "EmailSetting"
|
name: "EmailSetting",
|
||||||
});
|
});
|
||||||
|
|
||||||
interface FormState {
|
interface FormState {
|
||||||
|
@ -108,10 +98,10 @@ interface FormState {
|
||||||
const formState = reactive<Partial<FormState>>({
|
const formState = reactive<Partial<FormState>>({
|
||||||
auth: {
|
auth: {
|
||||||
user: "",
|
user: "",
|
||||||
pass: ""
|
pass: "",
|
||||||
},
|
},
|
||||||
tls: {},
|
tls: {},
|
||||||
usePlus: false
|
usePlus: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
async function load() {
|
async function load() {
|
||||||
|
@ -125,7 +115,7 @@ const onFinish = async (form: any) => {
|
||||||
console.log("Success:", form);
|
console.log("Success:", form);
|
||||||
await api.EmailSettingsSave(form);
|
await api.EmailSettingsSave(form);
|
||||||
notification.success({
|
notification.success({
|
||||||
message: "保存成功"
|
message: "保存成功",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -143,14 +133,14 @@ interface TestFormState {
|
||||||
}
|
}
|
||||||
const testFormState = reactive<TestFormState>({
|
const testFormState = reactive<TestFormState>({
|
||||||
receiver: "",
|
receiver: "",
|
||||||
loading: false
|
loading: false,
|
||||||
});
|
});
|
||||||
async function onTestSend() {
|
async function onTestSend() {
|
||||||
testFormState.loading = true;
|
testFormState.loading = true;
|
||||||
try {
|
try {
|
||||||
await emailApi.TestSend(testFormState.receiver);
|
await emailApi.TestSend(testFormState.receiver);
|
||||||
notification.success({
|
notification.success({
|
||||||
message: "发送成功"
|
message: "发送成功",
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
testFormState.loading = false;
|
testFormState.loading = false;
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { useI18n } from "vue-i18n";
|
||||||
import { Ref, ref } from "vue";
|
import { Ref, ref } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { cloneDeep, find, merge, remove } from "lodash-es";
|
import { cloneDeep, find, merge, remove } from "lodash-es";
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
import { HeaderMenusSettingsSave, SettingsSave } from "../api";
|
import { HeaderMenusSettingsSave, SettingsSave } from "../api";
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
import { onActivated, onMounted } from "vue";
|
import { onActivated, onMounted } from "vue";
|
||||||
import { useFs } from "@fast-crud/fast-crud";
|
import { useFs } from "@fast-crud/fast-crud";
|
||||||
import createCrudOptions from "./crud";
|
import createCrudOptions from "./crud";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "SettingsHeaderMenus",
|
name: "SettingsHeaderMenus",
|
||||||
|
|
|
@ -25,7 +25,7 @@ import SettingRegister from "/@/views/sys/settings/tabs/register.vue";
|
||||||
import SettingPayment from "/@/views/sys/settings/tabs/payment.vue";
|
import SettingPayment from "/@/views/sys/settings/tabs/payment.vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "SysSettings",
|
name: "SysSettings",
|
||||||
});
|
});
|
||||||
|
|
|
@ -48,7 +48,7 @@ import { reactive, ref } from "vue";
|
||||||
import { SysSettings } from "/@/views/sys/settings/api";
|
import { SysSettings } from "/@/views/sys/settings/api";
|
||||||
import * as api from "/@/views/sys/settings/api";
|
import * as api from "/@/views/sys/settings/api";
|
||||||
import { merge } from "lodash-es";
|
import { merge } from "lodash-es";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { notification } from "ant-design-vue";
|
import { notification } from "ant-design-vue";
|
||||||
import { util } from "/@/utils";
|
import { util } from "/@/utils";
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ import { reactive, ref, Ref } from "vue";
|
||||||
import { GetSmsTypeDefine, SysSettings } from "/@/views/sys/settings/api";
|
import { GetSmsTypeDefine, SysSettings } from "/@/views/sys/settings/api";
|
||||||
import * as api from "/@/views/sys/settings/api";
|
import * as api from "/@/views/sys/settings/api";
|
||||||
import { merge } from "lodash-es";
|
import { merge } from "lodash-es";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { notification } from "ant-design-vue";
|
import { notification } from "ant-design-vue";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
|
|
|
@ -42,8 +42,8 @@
|
||||||
import { reactive, ref } from "vue";
|
import { reactive, ref } from "vue";
|
||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
import { notification } from "ant-design-vue";
|
import { notification } from "ant-design-vue";
|
||||||
import { useSettingStore } from "/src/store/modules/settings";
|
import { useSettingStore } from "/src/store/settings";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { merge } from "lodash-es";
|
import { merge } from "lodash-es";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
|
|
|
@ -46,7 +46,7 @@ import { notification } from "ant-design-vue";
|
||||||
import { request } from "/@/api/service";
|
import { request } from "/@/api/service";
|
||||||
import SuiteDurationSelector from "/@/views/sys/suite/setting/suite-duration-selector.vue";
|
import SuiteDurationSelector from "/@/views/sys/suite/setting/suite-duration-selector.vue";
|
||||||
import ProductManager from "/@/views/sys/suite/product/index.vue";
|
import ProductManager from "/@/views/sys/suite/product/index.vue";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "SettingsSuite"
|
name: "SettingsSuite"
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { useI18n } from "vue-i18n";
|
||||||
import { computed, Ref, ref } from "vue";
|
import { computed, Ref, ref } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
|
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
|
||||||
import { useUserStore } from "/@/store/modules/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { useSettingStore } from "/@/store/modules/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { Modal } from "ant-design-vue";
|
import { Modal } from "ant-design-vue";
|
||||||
import DurationValue from "/@/views/sys/suite/product/duration-value.vue";
|
import DurationValue from "/@/views/sys/suite/product/duration-value.vue";
|
||||||
import PriceInput from "/@/views/sys/suite/product/price-input.vue";
|
import PriceInput from "/@/views/sys/suite/product/price-input.vue";
|
||||||
|
|
|
@ -43,15 +43,18 @@ export class PluginService extends BaseService<PluginEntity> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async getEnabledBuildInGroup() {
|
async getEnabledBuildInGroup(isSimple = false) {
|
||||||
const groups = this.builtInPluginService.getGroups();
|
const groups = this.builtInPluginService.getGroups();
|
||||||
for (const key in groups) {
|
if(isSimple){
|
||||||
const group = groups[key];
|
for (const key in groups) {
|
||||||
group.plugins.forEach(item => {
|
const group = groups[key];
|
||||||
delete item.input;
|
group.plugins.forEach(item => {
|
||||||
});
|
delete item.input;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!isComm()) {
|
if (!isComm()) {
|
||||||
return groups;
|
return groups;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ importers:
|
||||||
packages/core/acme-client:
|
packages/core/acme-client:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@certd/basic':
|
'@certd/basic':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../basic
|
version: link:../basic
|
||||||
'@peculiar/x509':
|
'@peculiar/x509':
|
||||||
specifier: ^1.11.0
|
specifier: ^1.11.0
|
||||||
|
@ -204,10 +204,10 @@ importers:
|
||||||
packages/core/pipeline:
|
packages/core/pipeline:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@certd/basic':
|
'@certd/basic':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../basic
|
version: link:../basic
|
||||||
'@certd/plus-core':
|
'@certd/plus-core':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../pro/plus-core
|
version: link:../../pro/plus-core
|
||||||
dayjs:
|
dayjs:
|
||||||
specifier: ^1.11.7
|
specifier: ^1.11.7
|
||||||
|
@ -412,7 +412,7 @@ importers:
|
||||||
packages/libs/lib-k8s:
|
packages/libs/lib-k8s:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@certd/basic':
|
'@certd/basic':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/basic
|
version: link:../../core/basic
|
||||||
'@kubernetes/client-node':
|
'@kubernetes/client-node':
|
||||||
specifier: 0.21.0
|
specifier: 0.21.0
|
||||||
|
@ -452,16 +452,16 @@ importers:
|
||||||
packages/libs/lib-server:
|
packages/libs/lib-server:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@certd/acme-client':
|
'@certd/acme-client':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/acme-client
|
version: link:../../core/acme-client
|
||||||
'@certd/basic':
|
'@certd/basic':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/basic
|
version: link:../../core/basic
|
||||||
'@certd/pipeline':
|
'@certd/pipeline':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/pipeline
|
version: link:../../core/pipeline
|
||||||
'@certd/plus-core':
|
'@certd/plus-core':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../pro/plus-core
|
version: link:../../pro/plus-core
|
||||||
'@midwayjs/cache':
|
'@midwayjs/cache':
|
||||||
specifier: ~3.14.0
|
specifier: ~3.14.0
|
||||||
|
@ -604,16 +604,16 @@ importers:
|
||||||
packages/plugins/plugin-cert:
|
packages/plugins/plugin-cert:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@certd/acme-client':
|
'@certd/acme-client':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/acme-client
|
version: link:../../core/acme-client
|
||||||
'@certd/basic':
|
'@certd/basic':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/basic
|
version: link:../../core/basic
|
||||||
'@certd/pipeline':
|
'@certd/pipeline':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/pipeline
|
version: link:../../core/pipeline
|
||||||
'@certd/plugin-lib':
|
'@certd/plugin-lib':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../plugin-lib
|
version: link:../plugin-lib
|
||||||
'@google-cloud/publicca':
|
'@google-cloud/publicca':
|
||||||
specifier: ^1.3.0
|
specifier: ^1.3.0
|
||||||
|
@ -680,10 +680,10 @@ importers:
|
||||||
specifier: ^1.7.10
|
specifier: ^1.7.10
|
||||||
version: 1.8.0
|
version: 1.8.0
|
||||||
'@certd/basic':
|
'@certd/basic':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/basic
|
version: link:../../core/basic
|
||||||
'@certd/pipeline':
|
'@certd/pipeline':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/pipeline
|
version: link:../../core/pipeline
|
||||||
'@kubernetes/client-node':
|
'@kubernetes/client-node':
|
||||||
specifier: 0.21.0
|
specifier: 0.21.0
|
||||||
|
@ -771,19 +771,19 @@ importers:
|
||||||
packages/pro/commercial-core:
|
packages/pro/commercial-core:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@certd/basic':
|
'@certd/basic':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/basic
|
version: link:../../core/basic
|
||||||
'@certd/lib-server':
|
'@certd/lib-server':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../libs/lib-server
|
version: link:../../libs/lib-server
|
||||||
'@certd/pipeline':
|
'@certd/pipeline':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/pipeline
|
version: link:../../core/pipeline
|
||||||
'@certd/plugin-plus':
|
'@certd/plugin-plus':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../plugin-plus
|
version: link:../plugin-plus
|
||||||
'@certd/plus-core':
|
'@certd/plus-core':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../plus-core
|
version: link:../plus-core
|
||||||
'@midwayjs/core':
|
'@midwayjs/core':
|
||||||
specifier: ~3.20.3
|
specifier: ~3.20.3
|
||||||
|
@ -868,22 +868,22 @@ importers:
|
||||||
specifier: ^1.0.2
|
specifier: ^1.0.2
|
||||||
version: 1.0.2
|
version: 1.0.2
|
||||||
'@certd/basic':
|
'@certd/basic':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/basic
|
version: link:../../core/basic
|
||||||
'@certd/lib-k8s':
|
'@certd/lib-k8s':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../libs/lib-k8s
|
version: link:../../libs/lib-k8s
|
||||||
'@certd/pipeline':
|
'@certd/pipeline':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/pipeline
|
version: link:../../core/pipeline
|
||||||
'@certd/plugin-cert':
|
'@certd/plugin-cert':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../plugins/plugin-cert
|
version: link:../../plugins/plugin-cert
|
||||||
'@certd/plugin-lib':
|
'@certd/plugin-lib':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../plugins/plugin-lib
|
version: link:../../plugins/plugin-lib
|
||||||
'@certd/plus-core':
|
'@certd/plus-core':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../plus-core
|
version: link:../plus-core
|
||||||
ali-oss:
|
ali-oss:
|
||||||
specifier: ^6.21.0
|
specifier: ^6.21.0
|
||||||
|
@ -980,7 +980,7 @@ importers:
|
||||||
packages/pro/plus-core:
|
packages/pro/plus-core:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@certd/basic':
|
'@certd/basic':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/basic
|
version: link:../../core/basic
|
||||||
dayjs:
|
dayjs:
|
||||||
specifier: ^1.11.7
|
specifier: ^1.11.7
|
||||||
|
@ -1264,10 +1264,10 @@ importers:
|
||||||
version: 0.1.3(zod@3.24.2)
|
version: 0.1.3(zod@3.24.2)
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@certd/lib-iframe':
|
'@certd/lib-iframe':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../libs/lib-iframe
|
version: link:../../libs/lib-iframe
|
||||||
'@certd/pipeline':
|
'@certd/pipeline':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/pipeline
|
version: link:../../core/pipeline
|
||||||
'@rollup/plugin-commonjs':
|
'@rollup/plugin-commonjs':
|
||||||
specifier: ^25.0.7
|
specifier: ^25.0.7
|
||||||
|
@ -1447,43 +1447,43 @@ importers:
|
||||||
specifier: ^3.705.0
|
specifier: ^3.705.0
|
||||||
version: 3.758.0(aws-crt@1.25.3)
|
version: 3.758.0(aws-crt@1.25.3)
|
||||||
'@certd/acme-client':
|
'@certd/acme-client':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/acme-client
|
version: link:../../core/acme-client
|
||||||
'@certd/basic':
|
'@certd/basic':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/basic
|
version: link:../../core/basic
|
||||||
'@certd/commercial-core':
|
'@certd/commercial-core':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../pro/commercial-core
|
version: link:../../pro/commercial-core
|
||||||
'@certd/jdcloud':
|
'@certd/jdcloud':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../libs/lib-jdcloud
|
version: link:../../libs/lib-jdcloud
|
||||||
'@certd/lib-huawei':
|
'@certd/lib-huawei':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../libs/lib-huawei
|
version: link:../../libs/lib-huawei
|
||||||
'@certd/lib-k8s':
|
'@certd/lib-k8s':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../libs/lib-k8s
|
version: link:../../libs/lib-k8s
|
||||||
'@certd/lib-server':
|
'@certd/lib-server':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../libs/lib-server
|
version: link:../../libs/lib-server
|
||||||
'@certd/midway-flyway-js':
|
'@certd/midway-flyway-js':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../libs/midway-flyway-js
|
version: link:../../libs/midway-flyway-js
|
||||||
'@certd/pipeline':
|
'@certd/pipeline':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../core/pipeline
|
version: link:../../core/pipeline
|
||||||
'@certd/plugin-cert':
|
'@certd/plugin-cert':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../plugins/plugin-cert
|
version: link:../../plugins/plugin-cert
|
||||||
'@certd/plugin-lib':
|
'@certd/plugin-lib':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../plugins/plugin-lib
|
version: link:../../plugins/plugin-lib
|
||||||
'@certd/plugin-plus':
|
'@certd/plugin-plus':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../pro/plugin-plus
|
version: link:../../pro/plugin-plus
|
||||||
'@certd/plus-core':
|
'@certd/plus-core':
|
||||||
specifier: ^1.32.0
|
specifier: ^1.33.0
|
||||||
version: link:../../pro/plus-core
|
version: link:../../pro/plus-core
|
||||||
'@corsinvest/cv4pve-api-javascript':
|
'@corsinvest/cv4pve-api-javascript':
|
||||||
specifier: ^8.3.0
|
specifier: ^8.3.0
|
||||||
|
|
5
start.sh
5
start.sh
|
@ -10,13 +10,14 @@ find ./packages -mindepth 1 -maxdepth 1 -type d ! -name 'ui' -exec rm -rf {} +
|
||||||
|
|
||||||
echo "删除成功"
|
echo "删除成功"
|
||||||
|
|
||||||
echo "安装pnpm 8.15.7, 前提是已经安装了nodejs"
|
echo "安装pnpm, 前提是已经安装了nodejs"
|
||||||
npm install -g pnpm@8.15.7 --registry https://registry.npmmirror.com
|
npm install -g pnpm@ --registry https://registry.npmmirror.com
|
||||||
echo "安装依赖"
|
echo "安装依赖"
|
||||||
pnpm install --registry https://registry.npmmirror.com
|
pnpm install --registry https://registry.npmmirror.com
|
||||||
|
|
||||||
echo "开始构建"
|
echo "开始构建"
|
||||||
echo "构建certd-client"
|
echo "构建certd-client"
|
||||||
|
export NODE_OPTIONS=--max-old-space-size=32768
|
||||||
cd packages/ui/certd-client
|
cd packages/ui/certd-client
|
||||||
npm run build
|
npm run build
|
||||||
cp -r dist/* ../certd-server/public
|
cp -r dist/* ../certd-server/public
|
||||||
|
|
Loading…
Reference in New Issue