Skip to content

Commit

Permalink
Merge pull request #1367 from RunOnFlux/development
Browse files Browse the repository at this point in the history
v5.16.0
  • Loading branch information
TheTrunk authored Jul 9, 2024
2 parents 91e5e0a + 9456084 commit f0446d4
Show file tree
Hide file tree
Showing 47 changed files with 3,875 additions and 1,372 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const path = require('path');
module.exports = {
root: true,
env: {
// so we get BigInt etc
es2020: true,
commonjs: true,
node: true,
Expand Down
1 change: 0 additions & 1 deletion HomeUI/dist/css/1481.css

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions HomeUI/dist/css/8837.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions HomeUI/dist/js/1481.js

This file was deleted.

2 changes: 1 addition & 1 deletion HomeUI/dist/js/1849.js → HomeUI/dist/js/1588.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion HomeUI/dist/js/3076.js → HomeUI/dist/js/1942.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion HomeUI/dist/js/3366.js

This file was deleted.

1 change: 1 addition & 0 deletions HomeUI/dist/js/4221.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion HomeUI/dist/js/5281.js

This file was deleted.

1 change: 1 addition & 0 deletions HomeUI/dist/js/65.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions HomeUI/dist/js/8837.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion HomeUI/dist/js/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions HomeUI/src/store/flux/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default {
config: {
apiPort: config.server.apiport,
fluxTeamFluxID: config.fluxTeamFluxID,
fluxSupportTeamFluxID: config.fluxSupportTeamFluxID,
},
privilege: 'none', // user, admin, fluxteam
zelid: '', // logged user zelid
Expand Down
125 changes: 105 additions & 20 deletions HomeUI/src/views/apps/Management.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5151,6 +5151,34 @@
</b-card>
</b-col>
</b-row>
<div
v-if="updateHash && updateSpecifications"
class="match-height"
>
<b-row>
<b-card title="Test Application Installation">
<b-card-text>
<div>
It's now time to test your application install/launch. If you have update app specifications other than hardware specs it's very important to test the app install/launch to make sure your new application specifications work.
You will get the application install/launch log at the bottom of this page once it's completed, if the app starts you can proceed with the payment, if not, you need to fix/change the specifications and try again before pay for the app update.
</div>
<span v-if="testError" style="color: red">
<br>
<b>WARNING: Test failed! Check logs at the bottom. If the error is related with your application specifications try to fix it before you pay your update subscription.</b>
</span>
</b-card-text>
<b-button
v-ripple.400="'rgba(255, 255, 255, 0.15)'"
variant="success"
aria-label="Test Launch"
class="my-1"
@click="testAppInstall(updateHash)"
>
Test Installation
</b-button>
</b-card>
</b-row>
</div>
<b-row
v-if="updateHash && !freeUpdate"
class="match-height"
Expand Down Expand Up @@ -5859,7 +5887,6 @@ export default {
},
data() {
return {
selectedFluxVersion: '5.13.0',
progressVisable: false,
operationTitle: '',
appInfoObject: [],
Expand Down Expand Up @@ -6083,6 +6110,7 @@ export default {
timestamp: '',
signature: '',
updateHash: '',
testError: false,
websocket: null,
selectedAppOwner: '',
appSpecification: {},
Expand Down Expand Up @@ -6634,18 +6662,15 @@ export default {
}
}
},
selectedIp: {
handler() {
this.getFluxVersion();
},
},
appUpdateSpecification: {
handler() {
this.dataToSign = '';
this.signature = '';
this.timestamp = null;
this.dataForAppUpdate = {};
this.updateHash = '';
this.testError = false;
this.output = [];
if (this.websocket !== null) {
this.websocket.close();
this.websocket = null;
Expand All @@ -6660,6 +6685,8 @@ export default {
this.timestamp = null;
this.dataForAppUpdate = {};
this.updateHash = '';
this.testError = false;
this.output = [];
if (this.websocket !== null) {
this.websocket.close();
this.websocket = null;
Expand All @@ -6685,6 +6712,8 @@ export default {
this.timestamp = null;
this.dataForAppUpdate = {};
this.updateHash = '';
this.testError = false;
this.output = [];
if (this.websocket !== null) {
this.websocket.close();
this.websocket = null;
Expand Down Expand Up @@ -8089,13 +8118,9 @@ export default {
const urlPort = this.selectedIp.split(':')[1] || 16127;
const zelidauth = localStorage.getItem('zelidauth');
const [major, minor] = this.selectedFluxVersion.split('.');
const namespace = major >= 5 && minor >= 13 ? 'terminal' : '';
let queryUrl = `https://${url.replace(/\./g, '-')}-${urlPort}.node.api.runonflux.io/${namespace}`;
let queryUrl = `https://${url.replace(/\./g, '-')}-${urlPort}.node.api.runonflux.io/terminal`;
if (this.ipAccess) {
queryUrl = `http://${url}:${urlPort}/${namespace}`;
queryUrl = `http://${url}:${urlPort}/terminal`;
}
this.socket = io.connect(queryUrl);
Expand Down Expand Up @@ -8549,6 +8574,72 @@ export default {
}
}
},
async testAppInstall(app) {
if (this.downloading) {
this.showToast('danger', 'Test install/launch was already initiated');
return;
}
const self = this;
this.output = [];
this.downloadOutput = {};
this.downloadOutputReturned = false;
this.downloading = true;
this.testError = false;
this.showToast('warning', `Testing ${app} installation, please wait`);
const zelidauth = localStorage.getItem('zelidauth');
const axiosConfig = {
headers: {
zelidauth,
},
onDownloadProgress(progressEvent) {
console.log(progressEvent.target.response);
self.output = JSON.parse(`[${progressEvent.target.response.replace(/}{/g, '},{')}]`);
},
};
let response;
try {
if (this.appUpdateSpecification.nodes.length > 0) {
const nodeip = this.appRegistrationSpecification.nodes[Math.floor(Math.random() * this.appUpdateSpecification.nodes.length)];
const ip = nodeip.split(':')[0];
const port = Number(nodeip.split(':')[1] || 16127);
const url = `https://${ip.replace(/\./g, '-')}-${port}.node.api.runonflux.io/apps/testappinstall/${app}`;
response = await axios.get(url, axiosConfig);
} else {
response = await AppsService.justAPI().get(`/apps/testappinstall/${app}`, axiosConfig);
}
if (response.data.status === 'error') {
this.testError = true;
this.showToast('danger', response.data.data.message || response.data.data);
} else {
console.log(response);
this.output = JSON.parse(`[${response.data.replace(/}{/g, '},{')}]`);
console.log(this.output);
for (let i = 0; i < this.output.length; i += 1) {
if (this.output[i] && this.output[i].data && this.output[i].data.message && this.output[i].data.message.includes('Error occured')) {
// error is defined one line above
if (this.output[i - 1] && this.output[i - 1].data) {
this.testError = true;
this.showToast('danger', 'Error on Test, check logs');
return;
}
}
}
if (this.output[this.output.length - 1].status === 'error') {
this.showToast('danger', 'Error on Test, check logs');
this.testError = true;
} else if (this.output[this.output.length - 1].status === 'warning') {
this.showToast('warning', 'Warning on Test, check logs');
this.testError = true;
} else {
this.testError = false;
this.showToast('success', 'Test passed, you can continue with app payment');
}
}
} catch (error) {
this.showToast('danger', error.message || error);
}
this.downloading = false;
},
async update() {
const zelidauth = localStorage.getItem('zelidauth');
Expand Down Expand Up @@ -8662,6 +8753,7 @@ export default {
component.domains = component.domains.replace('\\', '\\"');
if (component.secrets && !component.secrets.startsWith('-----BEGIN PGP MESSAGE')) {
// need encryption
component.secrets = component.secrets.replace('\\', '\\"');
// eslint-disable-next-line no-await-in-loop
const encryptedMessage = await this.encryptMessage(component.secrets, fetchedKeys);
if (!encryptedMessage) {
Expand Down Expand Up @@ -10574,14 +10666,6 @@ export default {
this.applicationManagementAndStatus = niceString;
}
},
async getFluxVersion() {
const res = await this.executeLocalCommand('/flux/version');
if (res?.data?.status === 'success') {
this.selectedFluxVersion = res.data.data;
} else {
this.selectedFluxVersion = '5.13.0';
}
},
selectedIpChanged() {
this.getApplicationManagementAndStatus();
this.getInstalledApplicationSpecifics();
Expand All @@ -10591,6 +10675,7 @@ export default {
this.timestamp = '';
this.signature = '';
this.updateHash = '';
this.output = [];
},
},
};
Expand Down
Loading

0 comments on commit f0446d4

Please sign in to comment.