fix selector

This commit is contained in:
Fine 2022-08-15 11:28:41 +08:00
parent 12dd47affe
commit 42bd5e3fa6
4 changed files with 23 additions and 3 deletions

View File

@ -65,16 +65,16 @@ export const selectorStore = defineStore({
this.currentDestPod = pod; this.currentDestPod = pod;
}, },
setCurrentProcess(process: Nullable<Process>) { setCurrentProcess(process: Nullable<Process>) {
this.currentPod = process; this.currentProcess = process;
}, },
setCurrentDestProcess(process: Nullable<Process>) { setCurrentDestProcess(process: Nullable<Process>) {
this.currentDestPod = process; this.currentDestProcess = process;
}, },
setDestPods(pods: Array<Instance | Endpoint>) { setDestPods(pods: Array<Instance | Endpoint>) {
this.destPods = pods; this.destPods = pods;
}, },
setDestProcesses(processes: Array<Process>) { setDestProcesses(processes: Array<Process>) {
this.destPods = processes; this.destProcesses = processes;
}, },
async fetchLayers(): Promise<AxiosResponse> { async fetchLayers(): Promise<AxiosResponse> {
const res: AxiosResponse = await graphql.query("queryLayers").params({}); const res: AxiosResponse = await graphql.query("queryLayers").params({});

View File

@ -296,6 +296,11 @@ async function setSourceSelector() {
} }
selectorStore.setCurrentPod(currentPod); selectorStore.setCurrentPod(currentPod);
states.currentPod = currentPod.label; states.currentPod = currentPod.label;
if (!(selectorStore.processes.length && selectorStore.processes[0])) {
selectorStore.setCurrentProcess(null);
states.currentProcess = "";
return;
}
const process = params.processId || selectorStore.processes[0].id; const process = params.processId || selectorStore.processes[0].id;
let currentProcess; let currentProcess;
if (states.currentProcess) { if (states.currentProcess) {

View File

@ -0,0 +1,14 @@
<!-- 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. -->

View File

@ -143,6 +143,7 @@ async function createTask() {
(selectorStore.currentService && selectorStore.currentService.id) || ""; (selectorStore.currentService && selectorStore.currentService.id) || "";
const serviceInstanceId = const serviceInstanceId =
(selectorStore.currentPod && selectorStore.currentPod.id) || ""; (selectorStore.currentPod && selectorStore.currentPod.id) || "";
console.log(selectorStore.currentPod);
if (!serviceId) { if (!serviceId) {
return; return;
} }