Skip to content

Commit

Permalink
continue to reg page
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTrunk committed Dec 13, 2023
1 parent a362a07 commit 481f06d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 50 deletions.
2 changes: 1 addition & 1 deletion HomeUI/src/router/routes/apps/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default [
},
},
{
path: '/apps/registerapp',
path: '/apps/registerapp/:appspecs?',
name: 'apps-registerapp',
component: () => import('@/views/apps/RegisterFluxApp.vue'),
meta: {
Expand Down
2 changes: 1 addition & 1 deletion HomeUI/src/views/apps/GlobalApps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ export default {
}
},
redeployApp(appSpecs) {
console.log(appSpecs);
this.$router.replace({ name: 'apps-registerapp', params: { appspecs: appSpecs } });
},
openApp(name, _ip, _port) {
console.log(name, _ip, _port);
Expand Down
99 changes: 51 additions & 48 deletions HomeUI/src/views/apps/RegisterFluxApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2425,6 +2425,10 @@ export default {
const zelidauth = localStorage.getItem('zelidauth');
const auth = qs.parse(zelidauth);
this.appRegistrationSpecification.owner = auth.zelid;
console.log(this.$router.currentRoute.params.appspecs);
if (this.$router.currentRoute.params.appspecs) {
this.appRegistrationSpecification = this.$router.currentRoute.params.appspecs; // TODO this needs adjusting for UI
}
},
methods: {
onFilteredSelection(filteredItems) {
Expand Down Expand Up @@ -2571,55 +2575,54 @@ export default {
},
async getDaemonInfo() {
const daemonGetInfo = await DaemonService.getInfo();
if (daemonGetInfo.data.status === 'error') {
this.showToast('danger', daemonGetInfo.data.data.message || daemonGetInfo.data.data);
} else {
this.currentHeight = daemonGetInfo.data.data.blocks;
}
if (this.currentHeight < 1004000) { // fork height for spec v4
this.specificationVersion = 3;
this.appRegistrationSpecification = this.appRegistrationSpecificationV3Template;
// const daemonGetInfo = await DaemonService.getInfo();
// if (daemonGetInfo.data.status === 'error') {
// this.showToast('danger', daemonGetInfo.data.data.message || daemonGetInfo.data.data);
// } else {
// this.currentHeight = daemonGetInfo.data.data.blocks;
// }
// if (this.currentHeight < 1004000) { // fork height for spec v4
// this.specificationVersion = 3;
// this.appRegistrationSpecification = this.appRegistrationSpecificationV3Template;
// const ports = this.getRandomPort();
// this.appRegistrationSpecification.ports = ports;
// } else if (this.currentHeight < 1142000) {
// this.specificationVersion = 4;
// this.appRegistrationSpecification = this.appRegistrationSpecificationV4Template;
// this.appRegistrationSpecification.compose.forEach((component) => {
// const ports = this.getRandomPort();
// // eslint-disable-next-line no-param-reassign
// component.ports = ports;
// });
// } else if (this.currentHeight < 1300000) {
// this.specificationVersion = 5;
// this.appRegistrationSpecification = this.appRegistrationSpecificationV5Template;
// this.appRegistrationSpecification.compose.forEach((component) => {
// const ports = this.getRandomPort();
// // eslint-disable-next-line no-param-reassign
// component.ports = ports;
// });
// } else if (this.currentHeight < 1420000) {
// this.specificationVersion = 6;
// this.appRegistrationSpecification = this.appRegistrationSpecificationV6Template;
// this.appRegistrationSpecification.compose.forEach((component) => {
// const ports = this.getRandomPort();
// // eslint-disable-next-line no-param-reassign
// component.ports = ports;
// // eslint-disable-next-line no-param-reassign
// component.domains = '[""]';
// });
// } else {
this.specificationVersion = 7;
this.composeTemplate = this.composeTemplatev7;
this.appRegistrationSpecification = this.appRegistrationSpecificationV7Template;
this.appRegistrationSpecification.compose.forEach((component) => {
const ports = this.getRandomPort();
this.appRegistrationSpecification.ports = ports;
} else if (this.currentHeight < 1142000) {
this.specificationVersion = 4;
this.appRegistrationSpecification = this.appRegistrationSpecificationV4Template;
this.appRegistrationSpecification.compose.forEach((component) => {
const ports = this.getRandomPort();
// eslint-disable-next-line no-param-reassign
component.ports = ports;
});
} else if (this.currentHeight < 1300000) {
this.specificationVersion = 5;
this.appRegistrationSpecification = this.appRegistrationSpecificationV5Template;
this.appRegistrationSpecification.compose.forEach((component) => {
const ports = this.getRandomPort();
// eslint-disable-next-line no-param-reassign
component.ports = ports;
});
} else if (this.currentHeight < 1420000) {
this.specificationVersion = 6;
this.appRegistrationSpecification = this.appRegistrationSpecificationV6Template;
this.appRegistrationSpecification.compose.forEach((component) => {
const ports = this.getRandomPort();
// eslint-disable-next-line no-param-reassign
component.ports = ports;
// eslint-disable-next-line no-param-reassign
component.domains = '[""]';
});
} else {
this.specificationVersion = 7;
this.composeTemplate = this.composeTemplatev7;
this.appRegistrationSpecification = this.appRegistrationSpecificationV7Template;
this.appRegistrationSpecification.compose.forEach((component) => {
const ports = this.getRandomPort();
// eslint-disable-next-line no-param-reassign
component.ports = ports;
// eslint-disable-next-line no-param-reassign
component.domains = '[""]';
});
}
// eslint-disable-next-line no-param-reassign
component.ports = ports;
// eslint-disable-next-line no-param-reassign
component.domains = '[""]';
});
const zelidauth = localStorage.getItem('zelidauth');
const auth = qs.parse(zelidauth);
this.appRegistrationSpecification.owner = auth.zelid;
Expand Down

0 comments on commit 481f06d

Please sign in to comment.