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

View File

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

View File

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