mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
feat(common): Standardize Event Bus (#7650)
This commit is contained in:
parent
b1adafec2d
commit
022580bbb2
@ -16,8 +16,7 @@ server {
|
||||
access_log /www/sites/domain/log/access.log main;
|
||||
error_log /www/sites/domain/log/error.log;
|
||||
|
||||
location ^~ /.well-known/acme-challenge {
|
||||
location ~ \.well-known{
|
||||
allow all;
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import bus from '@/global/bus';
|
||||
|
||||
defineProps({
|
||||
showClose: {
|
||||
@ -50,6 +51,7 @@ const openWithTaskID = (id: string, tail: boolean) => {
|
||||
config.tail = tail;
|
||||
}
|
||||
open.value = true;
|
||||
bus.emit('refreshTask', true);
|
||||
};
|
||||
|
||||
const openWithResourceID = (taskType: string, taskOperate: string, resourceID: number) => {
|
||||
|
@ -78,6 +78,7 @@ import { isString } from '@vueuse/core';
|
||||
import { getSettingInfo, listNodeOptions } from '@/api/modules/setting';
|
||||
import { countExecutingTask } from '@/api/modules/log';
|
||||
import { compareVersion } from '@/utils/version';
|
||||
import bus from '@/global/bus';
|
||||
|
||||
const route = useRoute();
|
||||
const menuStore = MenuStore();
|
||||
@ -85,6 +86,12 @@ const globalStore = GlobalStore();
|
||||
const nodes = ref([]);
|
||||
const nodeChangeRef = ref<DropdownInstance>();
|
||||
const version = ref();
|
||||
|
||||
bus.on('refreshTask', () => {
|
||||
console.log('on bus message');
|
||||
checkTask();
|
||||
});
|
||||
|
||||
defineProps({
|
||||
menuRouter: {
|
||||
type: Boolean,
|
||||
|
@ -25,8 +25,8 @@ import { getSystemAvailable } from '@/api/modules/setting';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { loadMasterProductProFromDB, loadProductProFromDB } from '@/utils/xpack';
|
||||
import { useTheme } from '@/global/use-theme';
|
||||
const { switchTheme } = useTheme();
|
||||
import TaskList from '@/components/task-list/index.vue';
|
||||
const { switchTheme } = useTheme();
|
||||
|
||||
useResize();
|
||||
|
||||
|
@ -136,16 +136,15 @@ import TaskLog from '@/components/task-log/index.vue';
|
||||
import { newUUID } from '@/utils/util';
|
||||
import { computeSizeFromMB } from '@/utils/util';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
interface InstallRrops {
|
||||
params?: App.AppParams;
|
||||
app: any;
|
||||
}
|
||||
|
||||
const installData = ref<InstallRrops>({
|
||||
app: {},
|
||||
});
|
||||
|
||||
const router = useRouter();
|
||||
const open = ref(false);
|
||||
const rules = ref<FormRules>({
|
||||
name: [Rules.appName],
|
||||
|
@ -13,7 +13,7 @@
|
||||
import i18n from '@/lang';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { SearchAppInstalled } from '@/api/modules/app';
|
||||
import bus from './bus';
|
||||
import bus from '@/global/bus';
|
||||
let showButton = ref(false);
|
||||
|
||||
const buttons = [
|
||||
|
@ -49,7 +49,7 @@ import { onBeforeUnmount, ref } from 'vue';
|
||||
import { App } from '@/api/interface/app';
|
||||
import { InstalledOp } from '@/api/modules/app';
|
||||
import i18n from '@/lang';
|
||||
import bus from '../../bus';
|
||||
import bus from '@/global/bus';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
|
@ -87,7 +87,7 @@ import { reactive, ref, onBeforeUnmount } from 'vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import Diff from './diff/index.vue';
|
||||
import bus from '../../bus';
|
||||
import bus from '@/global/bus';
|
||||
import CodemirrorPro from '@/components/codemirror-pro/index.vue';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
Loading…
x
Reference in New Issue
Block a user