feat: Implement the eBPF profile widget on dashboard (#72)

This commit is contained in:
Fine0830
2022-04-24 20:24:23 +08:00
committed by GitHub
parent 393885324b
commit 8a07b1d804
38 changed files with 1894 additions and 113 deletions

View File

@@ -17,7 +17,16 @@ limitations under the License. -->
<div class="profile-task">
<div>
<div class="label">{{ t("endpointName") }}</div>
<el-input v-model="endpointName" class="profile-input" size="small" />
<Selector
class="profile-input"
size="small"
:value="endpointName"
:options="profileStore.endpoints"
placeholder="Select a endpoint"
:isRemote="true"
@change="changeEndpoint"
@query="searchEndpoints"
/>
</div>
<div>
<div class="label">{{ t("monitorTime") }}</div>
@@ -105,6 +114,20 @@ const minThreshold = ref<number>(0);
const dumpPeriod = ref<string>(InitTaskField.dumpPeriod[0].value);
const maxSamplingCount = ref<string>(InitTaskField.maxSamplingCount[0].value);
async function searchEndpoints(keyword: string) {
if (!selectorStore.currentService) {
return;
}
const service = selectorStore.currentService.id;
const res = await profileStore.getEndpoints(service, keyword);
if (res.errors) {
ElMessage.error(res.errors);
return;
}
endpointName.value = profileStore.taskEndpoints[0].value;
}
function changeMonitorTime(opt: string) {
monitorTime.value = opt;
}
@@ -121,10 +144,13 @@ function changeMaxSamplingCount(opt: any[]) {
maxSamplingCount.value = opt[0].value;
}
function changeEndpoint(opt: any[]) {
endpointName.value = opt[0].value;
}
async function createTask() {
emits("close");
const date =
monitorTime.value === "0" ? appStore.durationRow.start : time.value;
const date = monitorTime.value === "0" ? new Date() : time.value;
const params = {
serviceId: selectorStore.currentService.id,
endpointName: endpointName.value,
@@ -153,7 +179,7 @@ function changeTimeRange(val: Date) {
<style lang="scss" scoped>
.profile-task {
margin: 0 auto;
width: 350px;
width: 400px;
}
.date {