WIP #217 don't know why it seems to work though
This commit is contained in:
@@ -229,7 +229,6 @@ export default defineStore('conformanceStore', {
|
||||
}
|
||||
|
||||
try {
|
||||
console.log("addConformanceCheckId() axios data", data)
|
||||
const response = await this.$axios.post(api, data);
|
||||
if(filterId !== null) {
|
||||
this.conformanceFilterTempCheckId = response.data.id;
|
||||
@@ -253,10 +252,18 @@ export default defineStore('conformanceStore', {
|
||||
let api = '';
|
||||
|
||||
// 先判斷 Temp 再判斷原 ID;先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterTempCheckId !== null) api = `/api/temp-filter-checks/${filterTempCheckId}`;
|
||||
else if(logTempCheckId !== null) api = `/api/temp-log-checks/${logTempCheckId}`;
|
||||
else if(filterCreateCheckId !== null) api = `/api/filter-checks/${filterCreateCheckId}`;
|
||||
else if(logCreateCheckId !== null) api = `/api/log-checks/${logCreateCheckId}`;
|
||||
if(filterTempCheckId !== null) {
|
||||
api = `/api/temp-filter-checks/${filterTempCheckId}`;
|
||||
}
|
||||
else if(logTempCheckId !== null) {
|
||||
api = `/api/temp-log-checks/${logTempCheckId}`;
|
||||
}
|
||||
else if(filterCreateCheckId !== null) {
|
||||
api = `/api/filter-checks/${filterCreateCheckId}`;
|
||||
}
|
||||
else if(logCreateCheckId !== null) {
|
||||
api = `/api/log-checks/${logCreateCheckId}`;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -277,10 +284,18 @@ export default defineStore('conformanceStore', {
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterTempCheckId !== null) api = `/api/temp-filter-checks/${filterTempCheckId}/issues/${issueNo}`;
|
||||
else if(logTempCheckId !== null) api = `/api/temp-log-checks/${logTempCheckId}/issues/${issueNo}`;
|
||||
else if(filterCreateCheckId !== null) api = `/api/filter-checks/${filterCreateCheckId}/issues/${issueNo}`;
|
||||
else if(logCreateCheckId !== null) api = `/api/log-checks/${logCreateCheckId}/issues/${issueNo}`;
|
||||
if(filterTempCheckId !== null) {
|
||||
api = `/api/temp-filter-checks/${filterTempCheckId}/issues/${issueNo}`;
|
||||
}
|
||||
else if(logTempCheckId !== null) {
|
||||
api = `/api/temp-log-checks/${logTempCheckId}/issues/${issueNo}`;
|
||||
}
|
||||
else if(filterCreateCheckId !== null) {
|
||||
api = `/api/filter-checks/${filterCreateCheckId}/issues/${issueNo}`;
|
||||
}
|
||||
else if(logCreateCheckId !== null) {
|
||||
api = `/api/log-checks/${logCreateCheckId}/issues/${issueNo}`;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -303,10 +318,18 @@ export default defineStore('conformanceStore', {
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterTempCheckId !== null) api = `/api/temp-filter-checks/${filterTempCheckId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
else if(logTempCheckId !== null) api = `/api/temp-log-checks/${logTempCheckId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
else if(filterCreateCheckId !== null) api = `/api/filter-checks/${filterCreateCheckId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
else if(logCreateCheckId !== null) api = `/api/log-checks/${logCreateCheckId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
if(filterTempCheckId !== null) {
|
||||
api = `/api/temp-filter-checks/${filterTempCheckId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
}
|
||||
else if(logTempCheckId !== null) {
|
||||
api = `/api/temp-log-checks/${logTempCheckId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
}
|
||||
else if(filterCreateCheckId !== null) {
|
||||
api = `/api/filter-checks/${filterCreateCheckId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
}
|
||||
else if(logCreateCheckId !== null) {
|
||||
api = `/api/log-checks/${logCreateCheckId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export default defineStore('conformanceDataStore', {
|
||||
state: () => ({
|
||||
dataToSave: {
|
||||
start: null,
|
||||
end: null,
|
||||
min: null,
|
||||
max: null,
|
||||
type: null,
|
||||
task: null,
|
||||
},
|
||||
}),
|
||||
getters: {
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
* Set conformance input data which are fed to backend later.
|
||||
* @param {object} userInputObj
|
||||
*/
|
||||
setConformanceData(userInputObj){
|
||||
this.dataToSave = {...userInputObj};
|
||||
},
|
||||
/**
|
||||
* Set the starting time of time range to be saved later
|
||||
* @param {string} startStr
|
||||
*/
|
||||
setConformanceDataStart(startStr){
|
||||
this.dataToSave.start = startStr;
|
||||
},
|
||||
/**
|
||||
* Set the ending time of time range to be saved later
|
||||
* @param {string} startStr
|
||||
*/
|
||||
setConformanceDataEnd(endStr){
|
||||
this.dataToSave.end = endStr;
|
||||
},
|
||||
},
|
||||
})
|
||||
42
src/stores/conformanceInput.js
Normal file
42
src/stores/conformanceInput.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import { defineStore } from "pinia";
|
||||
import moment from 'moment';
|
||||
|
||||
export default defineStore('conformanceInputStore', {
|
||||
state: () => ({
|
||||
inputDataToSave: {
|
||||
inputStart: null,
|
||||
inputEnd: null,
|
||||
min: null,
|
||||
max: null,
|
||||
type: null,
|
||||
task: null,
|
||||
},
|
||||
}),
|
||||
getters: {
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
* Temporarily set conformance input data which is probably fed to backend later.
|
||||
* @param {object} userInputObj
|
||||
*/
|
||||
setConformanceUserInput(userInputObj){
|
||||
this.inputDataToSave = {...userInputObj};
|
||||
},
|
||||
/**
|
||||
* Set the starting time of time range to be saved later
|
||||
* @param {string} startStr
|
||||
*/
|
||||
setConformanceInputStart(startStr){
|
||||
console.log('startStr', startStr);
|
||||
this.inputDataToSave.inputStart = moment(startStr).format('YYYY-MM-DDTHH:mm:ss');
|
||||
},
|
||||
/**
|
||||
* Set the ending time of time range to be saved later
|
||||
* @param {string} startStr
|
||||
*/
|
||||
setConformanceInputEnd(endStr){
|
||||
console.log('endStr', endStr);
|
||||
this.inputDataToSave.inputEnd = moment(endStr).format('YYYY-MM-DDTHH:mm:ss');
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user