Skip to content

Commit

Permalink
Add a stub router for not-yet-deployed app
Browse files Browse the repository at this point in the history
  • Loading branch information
Gene Gleyzer authored and lagergren committed Feb 21, 2024
1 parent 91ac995 commit 26a89cd
Show file tree
Hide file tree
Showing 12 changed files with 568 additions and 679 deletions.
File renamed without changes.
5 changes: 5 additions & 0 deletions common/src/main/x/common/AccountManager.x
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import common.model.WebAppInfo;
* The account management API.
*/
interface AccountManager {
/**
* Retrieve all known accounts.
*/
AccountInfo[] getAccounts();

/**
* Retrieve accounts for the specified user.
*
Expand Down
4 changes: 3 additions & 1 deletion common/src/main/x/common/model.x
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ package model {
Boolean active) {

WebAppInfo updateStatus(Boolean active) {
return new WebAppInfo(deployment, moduleName, hostName, active);
return active == this.active
? this
: new WebAppInfo(deployment, moduleName, hostName, active);
}
}
}
20 changes: 1 addition & 19 deletions kernel/src/main/x/kernel.x
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,10 @@ module kernel.xqiz.it {

import common.ErrorLog;
import common.HostManager;
import common.WebHost;

import common.names;
import common.utils;

import common.model.AccountInfo;
import common.model.WebAppInfo;

import crypto.CertificateManager;

import json.Doc;
Expand Down Expand Up @@ -137,25 +133,11 @@ module kernel.xqiz.it {
utils.createContainer(repository, uiModule, hostDir, buildDir, True, errors)) {

container.invoke("configure",
Tuple:(server, hostName, keystore, accountManager, hostManager));
Tuple:(server, hostName, keystore, accountManager, hostManager, errors));
} else {
return;
}

// create WebHosts for all active web applications
WebHost[] webHosts = new WebHost[];
for (AccountInfo accountInfo : accountManager.getAccounts()) {
for (WebAppInfo webAppInfo : accountInfo.webApps.values) {
if (webAppInfo.active, WebHost webHost :=
hostManager.createWebHost(server, accountInfo.name, webAppInfo, errors)) {
webHosts += webHost;
console.print($|Info: Initialized deployment: "{webAppInfo.hostName}" \
|of "{webAppInfo.moduleName}"
);
}
}
}

server.start();
console.print($"Info: Started the XtcPlatform at https://{hostName}");

Expand Down
9 changes: 3 additions & 6 deletions kernel/src/main/x/kernel/AccountManager.x
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,13 @@ service AccountManager
}
}

/**
* Retrieve all known accounts. This operation is not a part of the AccountManager interface.
*/
// ----- common.AccountManager API -------------------------------------------------------------

@Override
AccountInfo[] getAccounts() {
return dbConnection.accounts.values.toArray(Constant);
}


// ----- common.AccountManager API -------------------------------------------------------------

@Override
Collection<String> getAccounts(String userName) {
using (val tx = dbConnection.createTransaction()) {
Expand Down
5 changes: 3 additions & 2 deletions platformUI/gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"pinia": "^2.0.11",
"quasar": "^2.6.0",
"vue": "^3.0.0",
"vue-router": "^4.0.0"
"vue-router": "^4.0.0",
"yarn": "^1.22.21"
},
"devDependencies": {
"@quasar/app-vite": "^1.3.0",
Expand All @@ -34,4 +35,4 @@
"npm": ">= 6.13.4",
"yarn": ">= 1.21.1"
}
}
}
8 changes: 8 additions & 0 deletions platformUI/gui/public/pages/not-deployed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head><title>Ecstasy Cloud</title></head>
<body>
<p><p>
<h3>The web application <i>"%deployment%"</i> has been registered, but not yet deployed.</h3>
</body>
</html>
Loading

0 comments on commit 26a89cd

Please sign in to comment.