feat: create image, intstance list, endpoint list

This commit is contained in:
Qiuxia Fan
2022-01-04 15:57:15 +08:00
parent 5ac55b5e09
commit 51932ca877
13 changed files with 259 additions and 10 deletions

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { defineStore } from "pinia";
import { Option } from "@/types/app";
import { Option, Duration } from "@/types/app";
import { store } from "@/store";
import graph from "@/graph";
import { AxiosResponse } from "axios";
@@ -45,6 +45,27 @@ export const selectorStore = defineStore({
}
return res;
},
async getServiceInstances(params: {
serviceId: string;
duration: Duration;
}): Promise<AxiosResponse> {
const res: AxiosResponse = await graph
.query("queryInstances")
.params(params);
return res;
},
async getEndpoints(params: {
keyword: string;
serviceId: string;
}): Promise<AxiosResponse> {
if (!params.keyword) {
params.keyword = "";
}
const res: AxiosResponse = await graph
.query("queryEndpoints")
.params(params);
return res;
},
},
});