Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load available cloud build options when selecting the firmware version to build #3384

Merged
merged 3 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions src/js/BuildApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export default class BuildApi {
}

load(url, onSuccess, onFailure) {

const dataTag = `${url}_Data`;
const cacheLastUpdateTag = `${url}_LastUpdate`;

Expand Down Expand Up @@ -49,25 +48,21 @@ export default class BuildApi {
}

loadTargets(callback) {

const url = `${this._url}/api/targets`;
this.load(url, callback);
}

loadTargetReleases(target, callback) {

const url = `${this._url}/api/targets/${target}`;
this.load(url, callback);
}

loadTarget(target, release, onSuccess, onFailure) {

const url = `${this._url}/api/builds/${release}/${target}`;
this.load(url, onSuccess, onFailure);
}

loadTargetHex(path, onSuccess, onFailure) {

const url = `${this._url}${path}`;
$.get(url, function (data) {
gui_log(i18n.getMessage('buildServerSuccess', [path]));
Expand All @@ -81,7 +76,6 @@ export default class BuildApi {
}

getSupportCommands(onSuccess, onFailure) {

const url = `${this._url}/api/support/commands`;
$.get(url, function (data) {
onSuccess(data);
Expand All @@ -94,7 +88,6 @@ export default class BuildApi {
}

submitSupportData(data, onSuccess, onFailure) {

const url = `${this._url}/api/support`;
$.ajax({
url: url,
Expand All @@ -115,7 +108,6 @@ export default class BuildApi {
}

requestBuild(request, onSuccess, onFailure) {

const url = `${this._url}/api/builds`;
$.ajax({
url: url,
Expand All @@ -136,7 +128,6 @@ export default class BuildApi {
}

requestBuildStatus(key, onSuccess, onFailure) {

const url = `${this._url}/api/builds/${key}/status`;
$.get(url, function (data) {
gui_log(i18n.getMessage('buildServerSuccess', [url]));
Expand All @@ -150,7 +141,6 @@ export default class BuildApi {
}

requestBuildOptions(key, onSuccess, onFailure) {

const url = `${this._url}/api/builds/${key}/json`;
$.get(url, function (data) {
onSuccess(data);
Expand All @@ -161,14 +151,12 @@ export default class BuildApi {
});
}

loadOptions(onSuccess, onFailure) {

const url = `${this._url}/api/options`;
loadOptions(release, onSuccess, onFailure) {
const url = `${this._url}/api/options/${release}`;
this.load(url, onSuccess, onFailure);
}

loadCommits(release, onSuccess, onFailure) {

const url = `${this._url}/api/releases/${release}/commits`;
this.load(url, onSuccess, onFailure);
}
Expand Down
6 changes: 3 additions & 3 deletions src/js/tabs/firmware_flasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ firmware_flasher.initialize = function (callback) {
buildOptionsList($('select[name="motorProtocols"]'), data.motorProtocols);
}

self.releaseLoader.loadOptions(buildOptions);

let buildTypesToShow;
const buildType_e = $('select[name="build_type"]');
function buildBuildTypeOptionsList() {
Expand Down Expand Up @@ -330,6 +328,8 @@ firmware_flasher.initialize = function (callback) {
}

self.releaseLoader.loadTarget(target, release, onTargetDetail);

self.releaseLoader.loadOptions(release, buildOptions);
blckmn marked this conversation as resolved.
Show resolved Hide resolved
}

function populateReleases(versions_element, target) {
Expand Down Expand Up @@ -608,7 +608,7 @@ firmware_flasher.initialize = function (callback) {
function onLoadCloudBuild(options) {
if (FC.CONFIG.buildKey.length === 32) {
FC.CONFIG.buildOptions = options.Request.Options;
self.releaseLoader.loadOptions(presetBuildOptions);
self.releaseLoader.loadOptions(options.Request.Release, presetBuildOptions);
}
getBoardInfo();
}
Expand Down