1
0
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:
zhengkunwang 2025-01-06 18:16:22 +08:00 committed by GitHub
parent b1adafec2d
commit 022580bbb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 16 additions and 9 deletions

View File

@ -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;
}
}

View File

@ -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) => {

View File

@ -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,

View File

@ -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();

View File

@ -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],

View File

@ -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 = [

View File

@ -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';

View File

@ -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';