mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-02 17:34:51 +00:00
feat: add new dashboard
This commit is contained in:
parent
9cb8e2b64d
commit
1b30216545
@ -492,7 +492,7 @@ watch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
.datepicker-range {
|
.datepicker-range {
|
||||||
min-width: 260px;
|
min-width: 238px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.datepicker-range .datepicker-popup {
|
.datepicker-range .datepicker-popup {
|
||||||
|
@ -91,6 +91,7 @@ watch(
|
|||||||
background-color: #fafbfc;
|
background-color: #fafbfc;
|
||||||
border-bottom: 1px solid #dfe4e8;
|
border-bottom: 1px solid #dfe4e8;
|
||||||
color: #222;
|
color: #222;
|
||||||
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
.nav-bar.dark {
|
.nav-bar.dark {
|
||||||
background-color: #333840;
|
background-color: #333840;
|
||||||
|
@ -15,16 +15,24 @@ limitations under the License. -->
|
|||||||
<template>
|
<template>
|
||||||
<div class="new-dashboard">
|
<div class="new-dashboard">
|
||||||
<h4>Create a new dashboard</h4>
|
<h4>Create a new dashboard</h4>
|
||||||
|
<div class="item">
|
||||||
|
<div class="label">Name</div>
|
||||||
|
<el-input
|
||||||
|
size="small"
|
||||||
|
v-model="state.name"
|
||||||
|
placeholder="Please input name"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="label">Layer</div>
|
<div class="label">Layer</div>
|
||||||
<el-select
|
<el-select
|
||||||
size="small"
|
size="small"
|
||||||
v-model="template"
|
v-model="state.layer"
|
||||||
placeholder="Select"
|
placeholder="Select a layer"
|
||||||
class="selectors"
|
class="selectors"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in options"
|
v-for="item in Options"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
@ -36,8 +44,8 @@ limitations under the License. -->
|
|||||||
<div class="label">Entity</div>
|
<div class="label">Entity</div>
|
||||||
<el-select
|
<el-select
|
||||||
size="small"
|
size="small"
|
||||||
v-model="entity"
|
v-model="state.entity"
|
||||||
placeholder="Select"
|
placeholder="Select a entity"
|
||||||
class="selectors"
|
class="selectors"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -49,16 +57,16 @@ limitations under the License. -->
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item" v-show="state.entity === 'Service'">
|
||||||
<div class="label">Service</div>
|
<div class="label">Service</div>
|
||||||
<el-select
|
<el-select
|
||||||
size="small"
|
size="small"
|
||||||
v-model="template"
|
v-model="state.service"
|
||||||
placeholder="Select"
|
placeholder="Select a service"
|
||||||
class="selectors"
|
class="selectors"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in options"
|
v-for="item in Options"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
@ -66,24 +74,38 @@ limitations under the License. -->
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item" v-show="state.entity === 'Endpoint'">
|
||||||
<div class="label">Service / Endpoint</div>
|
<div class="label">Service / Endpoint</div>
|
||||||
<el-cascader
|
<el-cascader
|
||||||
v-model="value"
|
v-model="state.serviceEndpoint"
|
||||||
:options="options"
|
:options="SelectOpt"
|
||||||
:props="props"
|
:props="props"
|
||||||
|
size="small"
|
||||||
|
@change="handleChange"
|
||||||
|
:style="{ width: '600px' }"
|
||||||
></el-cascader>
|
></el-cascader>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item" v-show="state.entity === 'ServiceInstance'">
|
||||||
|
<div class="label">Service / Instance</div>
|
||||||
|
<el-cascader
|
||||||
|
v-model="state.serviceInstance"
|
||||||
|
:options="SelectOpt"
|
||||||
|
:props="props"
|
||||||
|
size="small"
|
||||||
|
@change="handleChange"
|
||||||
|
:style="{ width: '600px' }"
|
||||||
|
></el-cascader>
|
||||||
|
</div>
|
||||||
|
<div class="item" v-show="state.entity === 'ServiceRelation'">
|
||||||
<div class="label">Destination Service</div>
|
<div class="label">Destination Service</div>
|
||||||
<el-select
|
<el-select
|
||||||
size="small"
|
size="small"
|
||||||
v-model="template"
|
v-model="state.destService"
|
||||||
placeholder="Select"
|
placeholder="Select"
|
||||||
class="selectors"
|
class="selectors"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in options"
|
v-for="item in Options"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
@ -91,35 +113,67 @@ limitations under the License. -->
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item" v-show="state.entity === 'EndpointRelation'">
|
||||||
<span class="label">Destination Service / Endpoint</span>
|
<span class="label">Destination Service / Endpoint</span>
|
||||||
<el-cascader
|
<el-cascader
|
||||||
v-model="value"
|
v-model="state.destServiceEndpoint"
|
||||||
:options="options"
|
:options="SelectOpt"
|
||||||
:props="props"
|
:props="props"
|
||||||
|
@change="handleChange"
|
||||||
|
:style="{ width: '600px' }"
|
||||||
></el-cascader>
|
></el-cascader>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="item" v-show="state.entity === 'ServiceInstanceRelation'">
|
||||||
|
<span class="label">Destination Service / Instance</span>
|
||||||
|
<el-cascader
|
||||||
|
v-model="state.destServiceInstance"
|
||||||
|
:options="SelectOpt"
|
||||||
|
:props="props"
|
||||||
|
@change="handleChange"
|
||||||
|
:style="{ width: '600px' }"
|
||||||
|
></el-cascader>
|
||||||
|
</div>
|
||||||
|
<div class="btn">
|
||||||
|
<el-button class="create" size="small" type="primary" @click="onCreate">
|
||||||
|
Create
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from "vue";
|
import { reactive } from "vue";
|
||||||
import { ElSelect, ElOption, ElCascader } from "element-plus";
|
import {
|
||||||
import { useSelectorStore } from "@/store/modules/selectors";
|
ElSelect,
|
||||||
|
ElOption,
|
||||||
|
ElCascader,
|
||||||
|
ElInput,
|
||||||
|
ElButton,
|
||||||
|
} from "element-plus";
|
||||||
|
// import { useSelectorStore } from "@/store/modules/selectors";
|
||||||
|
import { EntityType, SelectOpt, Options } from "./data";
|
||||||
|
|
||||||
const EntityType = [
|
// const selectorStore = useSelectorStore();
|
||||||
{ value: "Service", label: "Service" },
|
const props = {
|
||||||
{ value: "All", label: "All" },
|
expandTrigger: "hover",
|
||||||
{ value: "Endpoint", label: "Service Endpoint" },
|
};
|
||||||
{ value: "ServiceInstance", label: "Service Instance" },
|
const state = reactive({
|
||||||
{ value: "ServiceRelation", label: "Service Relation" },
|
name: "",
|
||||||
{ value: "ServiceInstanceRelation", label: "Service Instance Relation" },
|
layer: "",
|
||||||
{ value: "EndpointRelation", label: "Endpoint Relation" },
|
entity: EntityType[0].value,
|
||||||
];
|
service: "",
|
||||||
const selectorStore = useSelectorStore();
|
serviceEndpoint: "",
|
||||||
const entity = ref("");
|
serviceInstance: "",
|
||||||
const template = ref("");
|
destService: "",
|
||||||
const options = ref([]);
|
destServiceEndpoint: "",
|
||||||
selectorStore.fetchServices("general");
|
destServiceInstance: "",
|
||||||
|
});
|
||||||
|
const handleChange = (value: any) => {
|
||||||
|
console.log(value);
|
||||||
|
};
|
||||||
|
const onCreate = () => {
|
||||||
|
console.log(state);
|
||||||
|
};
|
||||||
|
// selectorStore.fetchServices("general");
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.new-dashboard {
|
.new-dashboard {
|
||||||
@ -132,4 +186,13 @@ selectorStore.fetchServices("general");
|
|||||||
.selectors {
|
.selectors {
|
||||||
width: 600px;
|
width: 600px;
|
||||||
}
|
}
|
||||||
|
.el-cascader-menu {
|
||||||
|
width: 600px;
|
||||||
|
}
|
||||||
|
.create {
|
||||||
|
width: 160px;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
margin-top: 40px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
315
src/views/dashboard/data.ts
Normal file
315
src/views/dashboard/data.ts
Normal file
@ -0,0 +1,315 @@
|
|||||||
|
/**
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership.
|
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
* (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
export const EntityType = [
|
||||||
|
{ value: "Service", label: "Service" },
|
||||||
|
{ value: "All", label: "All" },
|
||||||
|
{ value: "Endpoint", label: "Service Endpoint" },
|
||||||
|
{ value: "ServiceInstance", label: "Service Instance" },
|
||||||
|
{ value: "ServiceRelation", label: "Service Relation" },
|
||||||
|
{ value: "ServiceInstanceRelation", label: "Service Instance Relation" },
|
||||||
|
{ value: "EndpointRelation", label: "Endpoint Relation" },
|
||||||
|
];
|
||||||
|
export const SelectOpt = [
|
||||||
|
{
|
||||||
|
value: "guide",
|
||||||
|
label: "Guide",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: "disciplines",
|
||||||
|
label: "Disciplines",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: "consistency",
|
||||||
|
label: "Consistency",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "feedback",
|
||||||
|
label: "Feedback",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "efficiency",
|
||||||
|
label: "Efficiency",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "controllability",
|
||||||
|
label: "Controllability",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "navigation",
|
||||||
|
label: "Navigation",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: "side nav",
|
||||||
|
label: "Side Navigation",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "top nav",
|
||||||
|
label: "Top Navigation",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "component",
|
||||||
|
label: "Component",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: "basic",
|
||||||
|
label: "Basic",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: "layout",
|
||||||
|
label: "Layout",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "color",
|
||||||
|
label: "Color",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "typography",
|
||||||
|
label: "Typography",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "icon",
|
||||||
|
label: "Icon",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "button",
|
||||||
|
label: "Button",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "form",
|
||||||
|
label: "Form",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: "radio",
|
||||||
|
label: "Radio",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "checkbox",
|
||||||
|
label: "Checkbox",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "input",
|
||||||
|
label: "Input",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "input-number",
|
||||||
|
label: "InputNumber",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "select",
|
||||||
|
label: "Select",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "cascader",
|
||||||
|
label: "Cascader",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "switch",
|
||||||
|
label: "Switch",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "slider",
|
||||||
|
label: "Slider",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "time-picker",
|
||||||
|
label: "TimePicker",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "date-picker",
|
||||||
|
label: "DatePicker",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "datetime-picker",
|
||||||
|
label: "DateTimePicker",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "upload",
|
||||||
|
label: "Upload",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "rate",
|
||||||
|
label: "Rate",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "form",
|
||||||
|
label: "Form",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "data",
|
||||||
|
label: "Data",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: "table",
|
||||||
|
label: "Table",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "tag",
|
||||||
|
label: "Tag",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "progress",
|
||||||
|
label: "Progress",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "tree",
|
||||||
|
label: "Tree",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "pagination",
|
||||||
|
label: "Pagination",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "badge",
|
||||||
|
label: "Badge",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "notice",
|
||||||
|
label: "Notice",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: "alert",
|
||||||
|
label: "Alert",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "loading",
|
||||||
|
label: "Loading",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "message",
|
||||||
|
label: "Message",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "message-box",
|
||||||
|
label: "MessageBox",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "notification",
|
||||||
|
label: "Notification",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "navigation",
|
||||||
|
label: "Navigation",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: "menu",
|
||||||
|
label: "Menu",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "tabs",
|
||||||
|
label: "Tabs",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "breadcrumb",
|
||||||
|
label: "Breadcrumb",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "dropdown",
|
||||||
|
label: "Dropdown",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "steps",
|
||||||
|
label: "Steps",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "others",
|
||||||
|
label: "Others",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: "dialog",
|
||||||
|
label: "Dialog",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "tooltip",
|
||||||
|
label: "Tooltip",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "popover",
|
||||||
|
label: "Popover",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "card",
|
||||||
|
label: "Card",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "carousel",
|
||||||
|
label: "Carousel",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "collapse",
|
||||||
|
label: "Collapse",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "resource",
|
||||||
|
label: "Resource",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: "axure",
|
||||||
|
label: "Axure Components",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "sketch",
|
||||||
|
label: "Sketch Templates",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "docs",
|
||||||
|
label: "Design Documentation",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
export const Options = [
|
||||||
|
{
|
||||||
|
value: "Option1",
|
||||||
|
label: "Option1",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "Option2",
|
||||||
|
label: "Option2",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "Option3",
|
||||||
|
label: "Option3",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "Option4",
|
||||||
|
label: "Option4",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "Option5",
|
||||||
|
label: "Option5",
|
||||||
|
},
|
||||||
|
];
|
Loading…
Reference in New Issue
Block a user