diff --git a/tools/otagui/src/components/OTAOptions.vue b/tools/otagui/src/components/OTAOptions.vue index b194b59b3..6aee09fe0 100644 --- a/tools/otagui/src/components/OTAOptions.vue +++ b/tools/otagui/src/components/OTAOptions.vue @@ -1,76 +1,55 @@ \ No newline at end of file diff --git a/tools/otagui/src/components/PartialCheckbox.vue b/tools/otagui/src/components/PartialCheckbox.vue index d18d011fb..9e716c36a 100644 --- a/tools/otagui/src/components/PartialCheckbox.vue +++ b/tools/otagui/src/components/PartialCheckbox.vue @@ -38,7 +38,7 @@ export default { default: new Array(), }, modelValue: { - type: String, + type: Array, required: true }, }, diff --git a/tools/otagui/src/components/SingleOTAOptions.vue b/tools/otagui/src/components/SingleOTAOptions.vue new file mode 100644 index 000000000..39addf8fc --- /dev/null +++ b/tools/otagui/src/components/SingleOTAOptions.vue @@ -0,0 +1,92 @@ + + + \ No newline at end of file diff --git a/tools/otagui/src/services/JobSubmission.js b/tools/otagui/src/services/JobSubmission.js index f6acfb54e..4c97486f1 100644 --- a/tools/otagui/src/services/JobSubmission.js +++ b/tools/otagui/src/services/JobSubmission.js @@ -21,32 +21,50 @@ export class OTAConfiguration { * disable checkboxes of which dependencies are not fulfilled. */ this.verbose = false, - this.target = '', - this.incremental = '', this.isIncremental = false, this.partial = [], this.isPartial = false, this.extra_keys = [], - this.extra = '', - this.id = uuid.v1() + this.extra = '' } /** - * Start the generation process, will throw an error if not succeed + * Start an OTA package generation from target build to incremental source. + * Throw an error if not succeed, otherwise will return the message from + * the backend. + * @param {String} targetBuild + * @param {String} incrementalSource + * @return String */ - async sendForm() { + async sendForm(targetBuild, incrementalSource='') { + let jsonOptions = Object.assign({}, this) + jsonOptions.target = targetBuild + jsonOptions.incremental = incrementalSource + jsonOptions.id = uuid.v1() for (let flag of OTAExtraFlags) { - if (this[flag.key]) { - this.extra_keys.push(flag.key) + if (jsonOptions[flag.key]) { + jsonOptions.extra_keys.push(flag.key) } } try { - let response = await ApiServices.postInput(JSON.stringify(this), this.id) + let response = await ApiServices.postInput(JSON.stringify(jsonOptions), jsonOptions.id) return response.data } catch (err) { throw err } } + + /** + * Reset all the flags being set in this object. + */ + reset() { + for (let flag of OTAExtraFlags) { + if (this[flag.key]) { + delete this[flag.key] + } + } + this.constructor() + } } export const OTABasicFlags = [ diff --git a/tools/otagui/src/views/JobConfigure.vue b/tools/otagui/src/views/JobConfigure.vue index 40e55e056..afd7252ae 100644 --- a/tools/otagui/src/views/JobConfigure.vue +++ b/tools/otagui/src/views/JobConfigure.vue @@ -1,14 +1,24 @@ > \ No newline at end of file