Skip to content

Commit

Permalink
debugging the task details (stereum-dev#1453)
Browse files Browse the repository at this point in the history
  • Loading branch information
mabasian authored Sep 15, 2023
1 parent 0a5eb8b commit e250339
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
33 changes: 17 additions & 16 deletions launcher/src/components/UI/task-manager/SubTasks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="subTask-table">
<div class="subTask-content">
<div
v-for="(item, index) in modifiedSubTasks"
v-for="(item, index) in taskShow"
:key="index"
class="subTask-row"
:class="{
Expand All @@ -22,7 +22,7 @@
<span v-if="displayTaskResult" class="itemAction">{{ item.action }}</span>
<span v-else class="itemName">{{ item.name }}</span>
<div class="loading-box">
<img src="../../../../public/img/icon/task-manager-icons/check5.png" alt="" />
<img src="/img/icon/task-manager-icons/check5.png" alt="" />
</div>
<div v-if="item.showTooltip" class="success-tooltip">
<span>{{ item.action }}</span>
Expand All @@ -32,7 +32,7 @@
<span v-if="displayTaskResult" class="error">{{ item.action }}</span>
<span v-else class="noError">{{ item.name }}</span>
<div class="error-icon">
<img src="../../../../public/img/icon/task-manager-icons/cancel.png" alt="" />
<img src="/img/icon/task-manager-icons/cancel.png" alt="" />
<div v-if="item.showTooltip" class="failed-tooltip">
<span>{{ item.name }}</span>
</div>
Expand All @@ -42,7 +42,7 @@
<span v-if="displayTaskResult" class="error">{{ item.action }}</span>
<span v-else class="noError">{{ item.name }}</span>
<div class="loading-box">
<img src="../../../../public/img/icon/task-manager-icons/check5.png" alt="" />
<img src="/img/icon/task-manager-icons/check5.png" alt="" />
</div>
<div v-if="item.showTooltip" class="skipped-tooltip">
<span>{{ item.name }}</span>
Expand All @@ -55,24 +55,25 @@
</div>
</template>
<script>
import { mapState } from "pinia";
import { useTaskManager } from "@/store/taskManager";
import ErrorTerminal from "./ErrorTerminal.vue";
export default {
components: { ErrorTerminal },
props: {
subTasks: {
type: Array,
required: true,
},
},
data() {
return {
displayTaskResult: false,
modifiedSubTasks: this.subTasks,
terminalModal: false,
};
},
computed: {
...mapState(useTaskManager, {
taskShow: "taskShow",
}),
},
created() {
this.modifiedSubTasks = this.modifiedSubTasks.map((item) => {
this.taskShow = this.taskShow.map((item) => {
return {
showErrorterminal: false,
...item,
Expand All @@ -99,27 +100,27 @@ export default {
});
},
tooltipShowHandler(el) {
this.modifiedSubTasks.filter((item) => {
this.taskShow.filter((item) => {
item.name.toLowerCase() === el.name.toLowerCase();
el.showTooltip = true;
});
},
tooltipHideHandler(el) {
this.modifiedSubTasks.filter((item) => {
this.taskShow.filter((item) => {
item.name.toLowerCase() === el.name.toLowerCase();
el.showTooltip = false;
});
},
openTerminalHandler(el) {
this.modifiedSubTasks.forEach(() => {
this.taskShow.forEach(() => {
if (el.showTooltip) {
el.showTooltip = false;
}
if (el.showErrorterminal) {
el.showErrorterminal = false;
}
});
this.modifiedSubTasks.filter((item) => {
this.taskShow.filter((item) => {
item.name.toLowerCase() === el.name.toLowerCase();
el.showErrorterminal = true;
});
Expand Down
7 changes: 5 additions & 2 deletions launcher/src/components/UI/task-manager/TaskManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
<span>{{ item.name }}</span>
<drop-tasks :item="item" @droptaskActive="openDropDown"></drop-tasks>
</div>
<sub-tasks v-if="item.showDropDown" :sub-tasks="item.subTasks"></sub-tasks>
<SubTasks v-if="item.showDropDown" />
</div>
</div>
</div>
<div class="list-cleaner">
<span class="footer-text">{{ $t("taskManager.clickDisplay") }}</span>
<img src="../../../../public/img/icon/task-manager-icons/remove-tasks.png" alt="" @click="listCleanerHandler" />
<img src="/img/icon/task-manager-icons/remove-tasks.png" alt="" @click="listCleanerHandler" />
</div>
</div>
</div>
Expand Down Expand Up @@ -74,6 +74,7 @@ export default {
playbookTasks: "playbookTasks",
taskManagerIcons: "taskManagerIcons",
installIconSrc: "installIconSrc",
taskShow: "taskShow",
}),
...mapWritableState(useFooter, {
cursorLocation: "cursorLocation",
Expand All @@ -91,6 +92,7 @@ export default {
return this.taskManagerIcons.progressIcon;
},
},
created() {
this.checkNewTasks = this.displayingTasks;
},
Expand All @@ -113,6 +115,7 @@ export default {
//if DropDown is open only update what the user sees so the menue doesn't close
this.displayingTasks[0].subTasks = this.Tasks.find((t) => t.id === this.displayingTasks[0].id).subTasks;
this.displayingTasks[0].status = this.Tasks.find((t) => t.id === this.displayingTasks[0].id).status;
this.taskShow = this.displayingTasks[0].subTasks;
}
},
taskModalHandler() {
Expand Down
1 change: 1 addition & 0 deletions launcher/src/store/taskManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineStore } from "pinia";
export const useTaskManager = defineStore("taskManager", {
state: () => {
return {
taskShow: [],
playbookTasks: [],
taskManagerIcons: {
progressIcon: require("../../public/img/icon/task-manager-icons/task-manager-icon.png"),
Expand Down

0 comments on commit e250339

Please sign in to comment.