mirror of https://github.com/certd/certd
				
				
				
			fix: 修复自建插件保存丢失部署策略的bug
							parent
							
								
									aebb07c5cc
								
							
						
					
					
						commit
						863e74dd2e
					
				| 
						 | 
				
			
			@ -91,6 +91,13 @@ export function createAxiosService({ logger }: { logger: Logger }) {
 | 
			
		|||
  // 请求拦截
 | 
			
		||||
  service.interceptors.request.use(
 | 
			
		||||
    (config: any) => {
 | 
			
		||||
      if (config.logParams == null) {
 | 
			
		||||
        config.logParams = false;
 | 
			
		||||
      }
 | 
			
		||||
      if (config.logRes == null) {
 | 
			
		||||
        config.logRes = false;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      logger.info(`http request:${config.url},method:${config.method}`);
 | 
			
		||||
      if (config.logParams !== false && config.params) {
 | 
			
		||||
        logger.info(`params:${JSON.stringify(config.params)}`);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -84,7 +84,6 @@ provide("fn:ai.open", openChat);
 | 
			
		|||
    </template>
 | 
			
		||||
    <template #footer>
 | 
			
		||||
      <PageFooter></PageFooter>
 | 
			
		||||
 | 
			
		||||
      <MaxKBChat v-if="settingsStore.sysPublic.aiChatEnabled !== false" ref="chatBox" />
 | 
			
		||||
    </template>
 | 
			
		||||
  </BasicLayout>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -488,7 +488,7 @@ const idMainContent = ELEMENT_ID_MAIN_CONTENT;
 | 
			
		|||
        </template>
 | 
			
		||||
      </LayoutContent>
 | 
			
		||||
 | 
			
		||||
      <LayoutFooter v-if="footerEnable" class="hidden md:block" :fixed="footerFixed" :height="footerHeight" :show="!isFullContent" :width="footerWidth" :z-index="zIndex">
 | 
			
		||||
      <LayoutFooter v-if="footerEnable" class="hidden md:block" :fixed="footerFixed" :height="footerHeight" :show="!isFullContent" :width="footerWidth" :z-index="zIndex + 2">
 | 
			
		||||
        <slot name="footer"></slot>
 | 
			
		||||
      </LayoutFooter>
 | 
			
		||||
    </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,7 +23,7 @@
 | 
			
		|||
      </a-tab-pane>
 | 
			
		||||
    </a-tabs>
 | 
			
		||||
    <template #footer>
 | 
			
		||||
      <fs-button key="aiChat" type="primary" icon="ion:color-wand-outline" @click="taskModal.onAiChat">AI分析</fs-button>
 | 
			
		||||
      <fs-button v-if="settingsStore.sysPublic.aiChatEnabled !== false" key="aiChat" type="primary" icon="ion:color-wand-outline" @click="taskModal.onAiChat">AI分析</fs-button>
 | 
			
		||||
      <fs-button key="cancel" icon="ion:close-circle-outline" @click="taskModal.onOk">关闭</fs-button>
 | 
			
		||||
      <fs-button key="submit" icon="ion:checkmark-circle-outline" type="primary" @click="taskModal.onOk">确定</fs-button>
 | 
			
		||||
    </template>
 | 
			
		||||
| 
						 | 
				
			
			@ -35,7 +35,7 @@ import { computed, inject, nextTick, Ref, ref, watch } from "vue";
 | 
			
		|||
import { RunHistory } from "../../type";
 | 
			
		||||
import PiStatusShow from "/@/views/certd/pipeline/pipeline/component/status-show.vue";
 | 
			
		||||
import { usePreferences } from "/@/vben/preferences";
 | 
			
		||||
 | 
			
		||||
import { useSettingStore } from "/@/store/settings/index";
 | 
			
		||||
export default {
 | 
			
		||||
  name: "PiTaskView",
 | 
			
		||||
  components: { PiStatusShow },
 | 
			
		||||
| 
						 | 
				
			
			@ -70,7 +70,7 @@ export default {
 | 
			
		|||
      for (let log of logs) {
 | 
			
		||||
        logText += log + "\n";
 | 
			
		||||
      }
 | 
			
		||||
      const maxLength = 5000;
 | 
			
		||||
      const maxLength = 2500;
 | 
			
		||||
      if (logText.length > maxLength) {
 | 
			
		||||
        logText = logText.substring(logText.length - maxLength);
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			@ -172,6 +172,7 @@ export default {
 | 
			
		|||
      taskModal.value.open = false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const settingsStore = useSettingStore();
 | 
			
		||||
    return {
 | 
			
		||||
      detail,
 | 
			
		||||
      taskModal,
 | 
			
		||||
| 
						 | 
				
			
			@ -180,6 +181,7 @@ export default {
 | 
			
		|||
      taskViewClose,
 | 
			
		||||
      tabPosition,
 | 
			
		||||
      triggerRun,
 | 
			
		||||
      settingsStore,
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -204,12 +204,14 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
 | 
			
		|||
      },
 | 
			
		||||
      form: {
 | 
			
		||||
        onSuccess(opts: any) {
 | 
			
		||||
          router.push({
 | 
			
		||||
            name: "SysPluginEdit",
 | 
			
		||||
            query: {
 | 
			
		||||
              id: opts.res.id,
 | 
			
		||||
            },
 | 
			
		||||
          });
 | 
			
		||||
          if (opts.res?.id) {
 | 
			
		||||
            router.push({
 | 
			
		||||
              name: "SysPluginEdit",
 | 
			
		||||
              query: {
 | 
			
		||||
                id: opts.res.id,
 | 
			
		||||
              },
 | 
			
		||||
            });
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
      },
 | 
			
		||||
      columns: {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,9 +44,6 @@ export class PluginController extends CrudController<PluginService> {
 | 
			
		|||
  async update(@Body(ALL) bean: any) {
 | 
			
		||||
 | 
			
		||||
    const res = await super.update(bean);
 | 
			
		||||
      // 更新插件配置
 | 
			
		||||
    const info = await this.service.info(bean.id)
 | 
			
		||||
    await this.service.registerPlugin(info)
 | 
			
		||||
    return res
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -350,12 +350,15 @@ export class PluginService extends BaseService<PluginEntity> {
 | 
			
		|||
 | 
			
		||||
  async registerPlugin(plugin: PluginEntity) {
 | 
			
		||||
    const metadata = plugin.metadata ? yaml.load(plugin.metadata) : {};
 | 
			
		||||
    const extra = plugin.extra ? yaml.load(plugin.extra) : {};
 | 
			
		||||
    const item = {
 | 
			
		||||
      ...plugin,
 | 
			
		||||
      ...metadata
 | 
			
		||||
      ...metadata,
 | 
			
		||||
      ...extra
 | 
			
		||||
    };
 | 
			
		||||
    delete item.metadata;
 | 
			
		||||
    delete item.content;
 | 
			
		||||
    delete item.extra;
 | 
			
		||||
    if (item.author) {
 | 
			
		||||
      item.name = item.author + "/" + item.name;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue