Browse Source

perf: merge plugin uninstallation options button (#779)

#### What type of PR is this?

/kind improvement

#### What this PR does / why we need it:

合并卸载插件的选项。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2978

#### Screenshots:

before:

![image](https://user-images.githubusercontent.com/21301288/208060524-fa9de196-ccd2-43dc-82e7-21eefddec44b.png)


after:

<img width="466" alt="image" src="https://user-images.githubusercontent.com/21301288/208060456-77514178-1935-43f4-9d50-13bc606d5573.png">


#### Special notes for your reviewer:

测试方式:

1. 测试插件卸载的两种选项是否功能正常。

#### Does this PR introduce a user-facing change?

```release-note
优化 Console 端的插件卸载选项布局
```
pull/777/head^2
Ryan Wang 2 years ago committed by GitHub
parent
commit
57f4f2226f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 31
      src/modules/system/plugins/components/PluginListItem.vue
  2. 4
      src/modules/system/plugins/composables/use-plugin.ts

31
src/modules/system/plugins/components/PluginListItem.vue

@ -132,12 +132,31 @@ const onUpgradeModalClose = () => {
>
升级
</VButton>
<VButton v-close-popper block type="danger" @click="uninstall">
卸载
</VButton>
<VButton v-close-popper block type="danger" @click="uninstall(true)">
卸载并删除配置
</VButton>
<FloatingDropdown class="w-full" placement="left" :triggers="['click']">
<VButton block type="danger"> 卸载 </VButton>
<template #popper>
<div class="w-52 p-2">
<VSpace class="w-full" direction="column">
<VButton
v-close-popper.all
block
type="danger"
@click="uninstall"
>
卸载
</VButton>
<VButton
v-close-popper.all
block
type="danger"
@click="uninstall(true)"
>
卸载并删除配置
</VButton>
</VSpace>
</div>
</template>
</FloatingDropdown>
</template>
</VEntity>
</template>

4
src/modules/system/plugins/composables/use-plugin.ts

@ -55,7 +55,9 @@ export function usePluginLifeCycle(
: "确定要卸载该插件吗?"
}`,
description: `${
enabled ? "当前插件还在启用状态,将在停止运行后卸载。" : ""
enabled
? "当前插件还在启用状态,将在停止运行后卸载,该操作不可恢复。"
: "该操作不可恢复。"
}`,
confirmType: "danger",
confirmText: `${enabled ? "停止运行并卸载" : "卸载"}`,

Loading…
Cancel
Save