log tools toggled from component

This commit is contained in:
Peter Olu 2022-05-10 13:14:02 +01:00
parent 185bc55450
commit b68cd26511
3 changed files with 14 additions and 8 deletions

View File

@ -41,7 +41,7 @@ interface DashboardState {
currentTabItems: LayoutConfig[];
currentTabName: string; // TODO: remove before commit
showTraceTools: boolean;
showTopologyTools: boolean;
showLogTools: boolean;
dashboards: DashboardItem[];
currentDashboard: Nullable<DashboardItem>;
editMode: boolean;
@ -58,7 +58,7 @@ export const dashboardStore = defineStore({
activedGridItem: "",
durationTime: useAppStoreWithOut().durationTime,
selectorStore: useSelectorStore(),
showTopologyTools: false,
showLogTools: false,
showTraceTools: false,
fullView: false,
currentTabItems: [],
@ -270,8 +270,8 @@ export const dashboardStore = defineStore({
setTraceTools(show: boolean) {
this.showTraceTools = show;
},
setTopologyTools(show: boolean) {
this.showTopologyTools = show;
setLogTools(show: boolean) {
this.showLogTools = show;
},
setConfigs(param: { [key: string]: unknown }) {
const actived = this.activedGridItem.split("-");

View File

@ -38,6 +38,7 @@ limitations under the License. -->
</div>
</template>
<script lang="ts" setup>
import type { onBeforeUnmount, onMounted} from 'vue'
import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard";
// import Header from "../related/log/Header.vue";
@ -57,6 +58,12 @@ const dashboardStore = useDashboardStore();
function removeWidget() {
dashboardStore.removeControls(props.data);
}
onMounted(() => {
dashboardStore.setLogTools(true)
});
onBeforeUnmount(() => {
dashboardStore.setLogTools(false)
})
</script>
<style lang="scss" scoped>
.log-wrapper {

View File

@ -38,13 +38,11 @@ limitations under the License. -->
</div>
</template>
<script lang="ts" setup>
import type { PropType, onMounted } from "vue";
import type { PropType } from "vue";
import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard";
import Topology from "../related/topology/Index.vue";
onMounted(() => {
console.log("TOPOLOGY COMPONENT!!!");
});
/*global defineProps */
const props = defineProps({
data: {
@ -63,6 +61,7 @@ function editConfig() {
dashboardStore.setConfigPanel(true);
dashboardStore.selectWidget(props.data);
}
</script>
<style lang="scss" scoped>
.topology {