diff --git a/tools/otagui/src/components/BuildLibrary.vue b/tools/otagui/src/components/BuildLibrary.vue new file mode 100644 index 000000000..7f27732c9 --- /dev/null +++ b/tools/otagui/src/components/BuildLibrary.vue @@ -0,0 +1,120 @@ + + + + + \ No newline at end of file diff --git a/tools/otagui/src/components/OTAOptions.vue b/tools/otagui/src/components/OTAOptions.vue new file mode 100644 index 000000000..f19db5c50 --- /dev/null +++ b/tools/otagui/src/components/OTAOptions.vue @@ -0,0 +1,150 @@ + + + \ No newline at end of file diff --git a/tools/otagui/src/components/PartialCheckbox.vue b/tools/otagui/src/components/PartialCheckbox.vue index ce4be4dc8..2c369e637 100644 --- a/tools/otagui/src/components/PartialCheckbox.vue +++ b/tools/otagui/src/components/PartialCheckbox.vue @@ -21,7 +21,7 @@ {{ label }} @@ -38,34 +38,48 @@ export default { default: new Array(), }, modelValue: { - type: Map, - default: new Map(), + type: String, + required: true }, }, data() { return { selectAll: 1, selectAllText: ['Select All', 'Unselect All'], + partitionSelected: new Map() + } + }, + watch: { + partitionSelected: { + handler: function() { + let list = '' + for (let [key, value] of this.partitionSelected) { + if (value) { + list += key + ' ' + } + } + this.$emit('update:modelValue', list) + }, + deep: true } }, mounted() { // Set the default value to be true once mounted for (let key of this.labels) { - this.modelValue.set(key, true) + this.partitionSelected.set(key, true) } }, methods: { updateSelected(newSelect) { - this.modelValue.set(newSelect, !this.modelValue.get(newSelect)) - this.$emit('update:modelValue', this.modelValue) + this.partitionSelected.set(newSelect, !this.partitionSelected.get(newSelect)) }, revertAllSelection() { this.selectAll = 1 - this.selectAll - for (let key of this.modelValue.keys()) { - this.modelValue.set(key, Boolean(this.selectAll)) + for (let key of this.partitionSelected.keys()) { + this.partitionSelected.set(key, Boolean(this.selectAll)) } }, - }, + } } diff --git a/tools/otagui/src/router/index.js b/tools/otagui/src/router/index.js index 6f3c3a2fd..a68ac7506 100644 --- a/tools/otagui/src/router/index.js +++ b/tools/otagui/src/router/index.js @@ -2,7 +2,7 @@ import { createRouter, createWebHistory } from 'vue-router' import JobList from '@/views/JobList.vue' import JobDetails from '@/views/JobDetails.vue' import About from '@/views/About.vue' -import SimpleForm from '@/views/SimpleForm.vue' +import JobConfigure from '@/views/JobConfigure.vue' const routes = [ { @@ -24,7 +24,7 @@ const routes = [ { path: '/create', name: 'Create', - component: SimpleForm + component: JobConfigure } ] diff --git a/tools/otagui/src/services/JobSubmission.js b/tools/otagui/src/services/JobSubmission.js new file mode 100644 index 000000000..22f0436ba --- /dev/null +++ b/tools/otagui/src/services/JobSubmission.js @@ -0,0 +1,37 @@ +/** + * @fileoverview Class OTAInput is used to configure and create a process in + * the backend to to start OTA package generation. + * @package vue-uuid + * @package ApiServices + */ +import { uuid } from 'vue-uuid' +import ApiServices from './ApiService.js' + +export class OTAConfiguration { + /** + * Initialize the input for the api /run/ + */ + constructor() { + this.verbose = false, + this.target = '', + this.output = 'output/' + String(this.id) + '.zip', + this.incremental = '', + this.isIncremental = false, + this.partial = '', + this.isPartial = false, + this.extra = '', + this.id = uuid.v1() + } + + /** + * Start the generation process, will throw an error if not succeed + */ + async sendForm() { + try { + let response = await ApiServices.postInput(JSON.stringify(this), this.id) + return response.data + } catch (err) { + throw err + } + } +} \ No newline at end of file diff --git a/tools/otagui/src/views/JobConfigure.vue b/tools/otagui/src/views/JobConfigure.vue new file mode 100644 index 000000000..40e55e056 --- /dev/null +++ b/tools/otagui/src/views/JobConfigure.vue @@ -0,0 +1,55 @@ + + + + +> \ No newline at end of file diff --git a/tools/otagui/src/views/SimpleForm.vue b/tools/otagui/src/views/SimpleForm.vue deleted file mode 100644 index 7f326a170..000000000 --- a/tools/otagui/src/views/SimpleForm.vue +++ /dev/null @@ -1,242 +0,0 @@ - - - - - \ No newline at end of file