feat: set selectors

This commit is contained in:
Qiuxia Fan 2022-01-16 22:48:50 +08:00
parent 0a417b3665
commit ffe35b89f9
2 changed files with 7 additions and 3 deletions

View File

@ -28,6 +28,7 @@ interface SelectorState {
endpoints: Option[]; endpoints: Option[];
currentService: string; currentService: string;
currentPod: string; currentPod: string;
currentDestService: string;
durationTime: any; durationTime: any;
} }
@ -40,6 +41,7 @@ export const selectorStore = defineStore({
endpoints: [], endpoints: [],
currentService: "", currentService: "",
currentPod: "", currentPod: "",
currentDestService: "",
durationTime: useAppStoreWithOut().durationTime, durationTime: useAppStoreWithOut().durationTime,
}), }),
actions: { actions: {

View File

@ -28,9 +28,11 @@ limitations under the License. -->
/> />
</div> </div>
<div class="selectors-item" v-if="states.key === 3 || states.key === 4"> <div class="selectors-item" v-if="states.key === 3 || states.key === 4">
<span class="label">$ServiceInstance</span> <span class="label">
{{ states.entity === "endpoint" ? "$Endpoint" : "$ServiceInstance" }}
</span>
<el-cascader <el-cascader
placeholder="Select a instance" placeholder="Please Select data"
:options="SelectOpts" :options="SelectOpts"
size="mini" size="mini"
filterable filterable
@ -40,7 +42,7 @@ limitations under the License. -->
<div class="selectors-item" v-if="states.key === 2"> <div class="selectors-item" v-if="states.key === 2">
<span class="label">$DestinationService</span> <span class="label">$DestinationService</span>
<Selector <Selector
:value="states.service" :value="selectorStore.currentDestService"
:options="selectorStore.services" :options="selectorStore.services"
size="mini" size="mini"
placeholder="Select a service" placeholder="Select a service"