update table style

This commit is contained in:
Qiuxia Fan 2022-03-18 21:30:27 +08:00
parent cd31fb7a50
commit 846aada0e2
16 changed files with 148 additions and 99 deletions

View File

@ -110,6 +110,8 @@ const msg = {
showYAxis: "Show Y Axis", showYAxis: "Show Y Axis",
nameError: "The dashboard name cannot be duplicate", nameError: "The dashboard name cannot be duplicate",
showGroup: "Show Group", showGroup: "Show Group",
noRoot: "Please set a root dashboard for",
noWidget: "Please add widgets.",
hourTip: "Select Hour", hourTip: "Select Hour",
minuteTip: "Select Minute", minuteTip: "Select Minute",
secondTip: "Select Second", secondTip: "Select Second",

View File

@ -109,7 +109,9 @@ const msg = {
showXAxis: "显示X轴", showXAxis: "显示X轴",
showYAxis: "显示Y轴", showYAxis: "显示Y轴",
nameError: "仪表板名称不能重复", nameError: "仪表板名称不能重复",
noRoot: "请设置根仪表板,为",
showGroup: "显示分组", showGroup: "显示分组",
noWidget: "请添加组件",
hourTip: "选择小时", hourTip: "选择小时",
minuteTip: "选择分钟", minuteTip: "选择分钟",
secondTip: "选择秒数", secondTip: "选择秒数",

View File

@ -14,16 +14,18 @@ See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<Edit v-if="dashboardStore.currentDashboard" /> <Edit v-if="dashboardStore.currentDashboard" />
<div class="no-root" v-else>Please set a root dashboard for {{ layer }}</div> <div class="no-root" v-else>{{ t("noRoot") }}{{ layer }}</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, watch } from "vue"; import { ref, watch } from "vue";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { useI18n } from "vue-i18n";
import { EntityType } from "./dashboard/data"; import { EntityType } from "./dashboard/data";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import Edit from "./dashboard/Edit.vue"; import Edit from "./dashboard/Edit.vue";
const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
const routeNames = [ const routeNames = [
@ -90,4 +92,8 @@ watch(
text-align: center; text-align: center;
color: #888; color: #888;
} }
.layer {
height: 100%;
}
</style> </style>

View File

@ -14,7 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<Tool v-if="p.entity" /> <Tool v-if="p.entity" />
<div class="ds-main" @click="handleClick"> <div
class="ds-main"
@click="handleClick"
:style="{ height: p.entity ? 'calc(100% - 45px)' : '100%' }"
>
<grid-layout /> <grid-layout />
<el-dialog <el-dialog
v-model="dashboardStore.showConfig" v-model="dashboardStore.showConfig"
@ -92,18 +96,6 @@ function handleClick(e: any) {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.ds-main { .ds-main {
height: calc(100% - 45px);
overflow: auto; overflow: auto;
} }
.layout {
height: 100%;
flex-grow: 2;
overflow: hidden;
}
.grids {
height: 100%;
overflow-y: auto;
}
</style> </style>

View File

@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<div> <div class="item">
<span class="label">{{ t("showGroup") }}</span> <span class="label">{{ t("showGroup") }}</span>
<el-switch <el-switch
v-model="selectedGrid.graph.showGroup" v-model="selectedGrid.graph.showGroup"
@ -22,7 +22,7 @@ limitations under the License. -->
@change="updateConfig({ showGroup: selectedGrid.graph.showGroup })" @change="updateConfig({ showGroup: selectedGrid.graph.showGroup })"
/> />
</div> </div>
<div> <div class="item">
<span class="label">{{ t("fontSize") }}</span> <span class="label">{{ t("fontSize") }}</span>
<el-slider <el-slider
class="slider" class="slider"
@ -67,4 +67,8 @@ function updateConfig(param: { [key: string]: unknown }) {
display: block; display: block;
margin-bottom: 5px; margin-bottom: 5px;
} }
.item {
margin-top: 5px;
}
</style> </style>

View File

@ -14,7 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<div class="log-wrapper flex-v"> <div class="log-wrapper flex-v">
<el-popover placement="bottom" trigger="click" :width="100"> <el-popover
placement="bottom"
trigger="click"
:width="100"
v-if="routeParams.entity"
>
<template #reference> <template #reference>
<span class="delete cp"> <span class="delete cp">
<Icon iconName="ellipsis_v" size="middle" class="operation" /> <Icon iconName="ellipsis_v" size="middle" class="operation" />
@ -34,6 +39,7 @@ limitations under the License. -->
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { useRoute } from "vue-router";
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";
import List from "../related/log/List.vue"; import List from "../related/log/List.vue";
@ -47,6 +53,7 @@ const props = defineProps({
activeIndex: { type: String, default: "" }, activeIndex: { type: String, default: "" },
}); });
const { t } = useI18n(); const { t } = useI18n();
const routeParams = useRoute().params;
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
function removeWidget() { function removeWidget() {

View File

@ -14,7 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<div class="profile-wrapper flex-v"> <div class="profile-wrapper flex-v">
<el-popover placement="bottom" trigger="click" :width="100"> <el-popover
placement="bottom"
trigger="click"
:width="100"
v-if="routeParams.entity"
>
<template #reference> <template #reference>
<span class="delete cp"> <span class="delete cp">
<Icon iconName="ellipsis_v" size="middle" class="operation" /> <Icon iconName="ellipsis_v" size="middle" class="operation" />
@ -34,6 +39,7 @@ import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import Header from "../related/profile/Header.vue"; import Header from "../related/profile/Header.vue";
import Content from "../related/profile/Content.vue"; import Content from "../related/profile/Content.vue";
import { useRoute } from "vue-router";
/*global defineProps */ /*global defineProps */
const props = defineProps({ const props = defineProps({
@ -44,6 +50,7 @@ const props = defineProps({
activeIndex: { type: String, default: "" }, activeIndex: { type: String, default: "" },
}); });
const { t } = useI18n(); const { t } = useI18n();
const routeParams = useRoute().params;
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
function removeWidget() { function removeWidget() {
dashboardStore.removeControls(props.data); dashboardStore.removeControls(props.data);

View File

@ -34,9 +34,10 @@ limitations under the License. -->
size="sm" size="sm"
iconName="cancel" iconName="cancel"
@click="deleteTabItem($event, idx)" @click="deleteTabItem($event, idx)"
v-if="routeParams.entity"
/> />
</span> </span>
<span class="tab-icons"> <span class="tab-icons" v-if="routeParams.entity">
<el-tooltip content="Add tab items" placement="bottom"> <el-tooltip content="Add tab items" placement="bottom">
<i @click="addTabItem"> <i @click="addTabItem">
<Icon size="middle" iconName="add" /> <Icon size="middle" iconName="add" />
@ -44,7 +45,7 @@ limitations under the License. -->
</el-tooltip> </el-tooltip>
</span> </span>
</div> </div>
<div class="operations"> <div class="operations" v-if="routeParams.entity">
<el-popover <el-popover
placement="bottom" placement="bottom"
trigger="click" trigger="click"
@ -105,12 +106,13 @@ limitations under the License. -->
/> />
</grid-item> </grid-item>
</grid-layout> </grid-layout>
<div class="no-data-tips" v-else>Please add widgets.</div> <div class="no-data-tips" v-else>{{ t("noWidget") }}</div>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { ref, watch, defineComponent, toRefs } from "vue"; import { ref, watch, defineComponent, toRefs } from "vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { useRoute } from "vue-router";
import type { PropType } from "vue"; import type { PropType } from "vue";
import { LayoutConfig } from "@/types/dashboard"; import { LayoutConfig } from "@/types/dashboard";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
@ -133,6 +135,7 @@ export default defineComponent({
props, props,
setup(props) { setup(props) {
const { t } = useI18n(); const { t } = useI18n();
const routeParams = useRoute().params;
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
const activeTabIndex = ref<number>(0); const activeTabIndex = ref<number>(0);
const activeTabWidget = ref<string>(""); const activeTabWidget = ref<string>("");
@ -237,6 +240,7 @@ export default defineComponent({
needQuery, needQuery,
canEditTabName, canEditTabName,
showTools, showTools,
routeParams,
t, t,
}; };
}, },

View File

@ -27,7 +27,12 @@ limitations under the License. -->
/> />
</span> </span>
</el-tooltip> </el-tooltip>
<el-popover placement="bottom" trigger="click" :width="100"> <el-popover
placement="bottom"
trigger="click"
:width="100"
v-if="routeParams.entity"
>
<template #reference> <template #reference>
<span> <span>
<Icon iconName="ellipsis_v" size="middle" class="operation" /> <Icon iconName="ellipsis_v" size="middle" class="operation" />
@ -64,6 +69,7 @@ limitations under the License. -->
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type { PropType } from "vue"; import type { PropType } from "vue";
import { useRoute } from "vue-router";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import { Colors } from "../data"; import { Colors } from "../data";
@ -76,6 +82,7 @@ const props = defineProps({
activeIndex: { type: String, default: "" }, activeIndex: { type: String, default: "" },
}); });
const { t } = useI18n(); const { t } = useI18n();
const routeParams = useRoute().params;
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
function editConfig() { function editConfig() {

View File

@ -20,7 +20,7 @@ limitations under the License. -->
<Icon iconName="ellipsis_v" size="middle" class="operation" /> <Icon iconName="ellipsis_v" size="middle" class="operation" />
</span> </span>
</template> </template>
<div class="tools" @click="removeWidget"> <div class="tools" @click="removeWidget" v-if="routeParams.entity">
<span>{{ t("delete") }}</span> <span>{{ t("delete") }}</span>
</div> </div>
</el-popover> </el-popover>
@ -35,6 +35,7 @@ limitations under the License. -->
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type { PropType } from "vue"; import type { PropType } from "vue";
import { useRoute } from "vue-router";
import Filter from "../related/trace/Filter.vue"; import Filter from "../related/trace/Filter.vue";
import TraceList from "../related/trace/TraceList.vue"; import TraceList from "../related/trace/TraceList.vue";
import TraceDetail from "../related/trace/Detail.vue"; import TraceDetail from "../related/trace/Detail.vue";
@ -50,6 +51,7 @@ const props = defineProps({
activeIndex: { type: String, default: "" }, activeIndex: { type: String, default: "" },
}); });
const { t } = useI18n(); const { t } = useI18n();
const routeParams = useRoute().params;
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
function removeWidget() { function removeWidget() {
dashboardStore.removeControls(props.data); dashboardStore.removeControls(props.data);

View File

@ -34,7 +34,12 @@ limitations under the License. -->
/> />
</span> </span>
</el-tooltip> </el-tooltip>
<el-popover placement="bottom" trigger="click" :width="100"> <el-popover
placement="bottom"
trigger="click"
:width="100"
v-if="routeParams.entity"
>
<template #reference> <template #reference>
<span> <span>
<Icon iconName="ellipsis_v" size="middle" class="operation" /> <Icon iconName="ellipsis_v" size="middle" class="operation" />
@ -69,6 +74,7 @@ limitations under the License. -->
<script lang="ts"> <script lang="ts">
import { toRefs, reactive, defineComponent, ref, watch } from "vue"; import { toRefs, reactive, defineComponent, ref, watch } from "vue";
import type { PropType } from "vue"; import type { PropType } from "vue";
import { useRoute } from "vue-router";
import { LayoutConfig } from "@/types/dashboard"; import { LayoutConfig } from "@/types/dashboard";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import { useAppStoreWithOut } from "@/store/modules/app"; import { useAppStoreWithOut } from "@/store/modules/app";
@ -92,6 +98,7 @@ export default defineComponent({
props, props,
setup(props) { setup(props) {
const { t } = useI18n(); const { t } = useI18n();
const routeParams = useRoute().params;
const loading = ref<boolean>(false); const loading = ref<boolean>(false);
const state = reactive<{ source: { [key: string]: unknown } }>({ const state = reactive<{ source: { [key: string]: unknown } }>({
source: {}, source: {},
@ -189,6 +196,7 @@ export default defineComponent({
editConfig, editConfig,
data, data,
loading, loading,
routeParams,
t, t,
}; };
}, },

View File

@ -29,6 +29,7 @@ limitations under the License. -->
</template> </template>
</el-input> </el-input>
</div> </div>
<div class="list">
<el-table v-loading="chartLoading" :data="endpoints" style="width: 100%"> <el-table v-loading="chartLoading" :data="endpoints" style="width: 100%">
<el-table-column label="Endpoints"> <el-table-column label="Endpoints">
<template #default="scope"> <template #default="scope">
@ -63,6 +64,7 @@ limitations under the License. -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div>
<el-pagination <el-pagination
class="pagination" class="pagination"
background background

View File

@ -29,6 +29,7 @@ limitations under the License. -->
</template> </template>
</el-input> </el-input>
</div> </div>
<div class="list">
<el-table v-loading="chartLoading" :data="instances" style="width: 100%"> <el-table v-loading="chartLoading" :data="instances" style="width: 100%">
<el-table-column label="Service Instances"> <el-table-column label="Service Instances">
<template #default="scope"> <template #default="scope">
@ -63,6 +64,7 @@ limitations under the License. -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div>
<el-pagination <el-pagination
class="pagination" class="pagination"
background background

View File

@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<div class="list"> <div class="table">
<div class="search"> <div class="search">
<el-input <el-input
v-model="searchText" v-model="searchText"
@ -29,7 +29,7 @@ limitations under the License. -->
</template> </template>
</el-input> </el-input>
</div> </div>
<div class="table"> <div class="list">
<el-table <el-table
v-loading="chartLoading" v-loading="chartLoading"
:data="services" :data="services"
@ -232,8 +232,4 @@ watch(
.inputs { .inputs {
width: 300px; width: 300px;
} }
.table {
margin: 10px 0;
}
</style> </style>

View File

@ -20,6 +20,11 @@
padding: 0 10px 5px 0; padding: 0 10px 5px 0;
} }
.list {
margin-top: 10px;
margin-bottom: 10px;
}
.pagination { .pagination {
width: 100%; width: 100%;
text-align: center; text-align: center;

View File

@ -36,10 +36,11 @@ limitations under the License. -->
<component :is="item.type" :data="item" /> <component :is="item.type" :data="item" />
</grid-item> </grid-item>
</grid-layout> </grid-layout>
<div class="no-data-tips" v-else>Please add widgets.</div> <div class="no-data-tips" v-else>{{ t("noWidget") }}</div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, onBeforeUnmount } from "vue"; import { defineComponent, onBeforeUnmount } from "vue";
import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import { LayoutConfig } from "@/types/dashboard"; import { LayoutConfig } from "@/types/dashboard";
import controls from "../controls/index"; import controls from "../controls/index";
@ -48,6 +49,7 @@ export default defineComponent({
name: "Layout", name: "Layout",
components: { ...controls }, components: { ...controls },
setup() { setup() {
const { t } = useI18n();
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
function layoutUpdatedEvent(newLayout: LayoutConfig[]) { function layoutUpdatedEvent(newLayout: LayoutConfig[]) {
dashboardStore.setLayout(newLayout); dashboardStore.setLayout(newLayout);
@ -63,6 +65,7 @@ export default defineComponent({
dashboardStore, dashboardStore,
layoutUpdatedEvent, layoutUpdatedEvent,
clickGrid, clickGrid,
t,
}; };
}, },
}); });