Skip to content

Commit

Permalink
V1.1.5
Browse files Browse the repository at this point in the history
- Fix critical bug when emitting global event bus
- Add Exit DenoMan button
- Enhanced terminal tab
  • Loading branch information
fakoua committed Feb 20, 2024
1 parent 54aec4a commit 4b7cbbc
Show file tree
Hide file tree
Showing 10 changed files with 182 additions and 76 deletions.
4 changes: 2 additions & 2 deletions q-manui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "q-manui",
"version": "1.1.4",
"description": "DenoMan 1.1.4",
"version": "1.1.5",
"description": "DenoMan 1.1.5",
"productName": "DenoMan",
"author": "Sameh Fakoua <s.fakoua@gmail.com>",
"private": true,
Expand Down
7 changes: 3 additions & 4 deletions q-manui/src/components/ServerComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,22 +199,21 @@ export default defineComponent({
},
},
setup() {
setup(props) {
const doubleClickedService = ref<ServiceModel | undefined>(undefined);
const selectedService = ref<ServiceModel | undefined>(undefined);
const isDialogOpen = ref(false);
const serviceWindow = ref<HTMLDialogElement | null>(null);
onMounted(async () => {
bus.on('controlService', async () => {
bus.on(`${props.host.hostname}:controlService`, async () => {
if (isDialogOpen.value) {
//(serviceWindow.value as HTMLDialogElement).close();
if (serviceWindow.value) {
serviceWindow.value.close();
}
}
});
bus.on('serviceChanged', (service) => {
bus.on(`${props.host.hostname}:serviceChanged`, (service) => {
selectedService.value = service;
if (isDialogOpen.value) {
doubleClickedService.value = service;
Expand Down
8 changes: 8 additions & 0 deletions q-manui/src/components/performance/PerfmonComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@

<script lang="ts">
import { PropType, defineComponent, onMounted, onUnmounted, ref } from 'vue';
import { bus } from 'boot/bus';
import CpuComponent from './CpuComponent.vue';
import MemoryComponent from './MemoryComponent.vue';
import DiskComponent from './DiskComponent.vue';
Expand Down Expand Up @@ -139,6 +141,12 @@ export default defineComponent({
onMounted(async () => {
systemInfo.value = await loadSystem();
await updateData();
bus.on('app:shutdown', () => {
if (timeoutId !== -1) {
runTimer = false;
window.clearTimeout(timeoutId);
}
});
});
onUnmounted(() => {
Expand Down
8 changes: 6 additions & 2 deletions q-manui/src/components/service-window/GeneralTabComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ div.footer {
import { PropType, defineComponent } from 'vue';
import { bus } from 'boot/bus';
import { ControlAction, ServiceModel } from '../models';
import { ControlAction, ServiceModel, WinRMPayload } from '../models';
export default defineComponent({
name: 'GeneralTabComponent',
Expand All @@ -125,11 +125,15 @@ export default defineComponent({
type: Object as PropType<ServiceModel>,
required: false,
},
host: {
type: Object as PropType<WinRMPayload>,
required: true,
},
},
methods: {
async controlService(action: ControlAction) {
bus.emit('controlService', {
bus.emit(`${this.host.hostname}:controlService`, {
action: action,
name: this.service?.name,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export default defineComponent({
this.$emit('onOpenService', this.service);
},
async controlService(action: ControlAction) {
bus.emit('controlService', {
bus.emit(`${this.host.hostname}:controlService`, {
action: action,
name: this.service?.name,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<q-tab-panel name="general">
<general-tab-component
:service="service"
:host="host"
v-on:on-hide-dialog="$emit('onHideDialog')"
v-on:on-show-dialog="
(svr) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export default defineComponent({
},
controlService(action: ControlAction) {
if (this.selected && this.selected.length > 0) {
bus.emit('controlService', {
bus.emit(`${this.host.hostname}:controlService`, {
action: action,
name: (this.selected[0] as ServiceModel).name,
});
Expand Down Expand Up @@ -544,15 +544,15 @@ export default defineComponent({
isLoading.value = false;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
bus.on('controlService', async (action: any) => {
bus.on(`${props.host.hostname}:controlService`, async (action: any) => {
$q.loading.show();
const res = await serviceApi.controlService(
props.host,
action.action,
action.name,
);
await loadServices();
bus.emit('serviceChanged', res);
bus.emit(`${props.host.hostname}:serviceChanged`, res);
if (res) {
setDisabledControls(res);
}
Expand Down
Loading

0 comments on commit 4b7cbbc

Please sign in to comment.