aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/authentication/models/current_user_utils.ts4
-rw-r--r--src/server/index.ts29
2 files changed, 22 insertions, 11 deletions
diff --git a/src/server/authentication/models/current_user_utils.ts b/src/server/authentication/models/current_user_utils.ts
index 1c52a3f11..41eb1aa0c 100644
--- a/src/server/authentication/models/current_user_utils.ts
+++ b/src/server/authentication/models/current_user_utils.ts
@@ -50,6 +50,7 @@ export class CurrentUserUtils {
if (doc.workspaces === undefined) {
const workspaces = Docs.Create.TreeDocument([], { title: "Workspaces", height: 100 });
workspaces.excludeFromLibrary = true;
+ workspaces.chromeStatus = "disabled";
workspaces.workspaceLibrary = true;
workspaces.boxShadow = "0 0";
doc.workspaces = workspaces;
@@ -57,6 +58,7 @@ export class CurrentUserUtils {
if (doc.recentlyClosed === undefined) {
const recentlyClosed = Docs.Create.TreeDocument([], { title: "Recently Closed", height: 75 });
recentlyClosed.excludeFromLibrary = true;
+ recentlyClosed.chromeStatus = "disabled";
recentlyClosed.boxShadow = "0 0";
doc.recentlyClosed = recentlyClosed;
}
@@ -65,11 +67,13 @@ export class CurrentUserUtils {
sidebar.excludeFromLibrary = true;
sidebar.gridGap = 5;
sidebar.xMargin = 5;
+ sidebar.chromeStatus = "disabled";
sidebar.yMargin = 5;
Doc.GetProto(sidebar).backgroundColor = "#aca3a6";
sidebar.boxShadow = "1 1 3";
doc.sidebar = sidebar;
}
+ doc.chromeStatus = "disabled";
StrCast(doc.title).indexOf("@") !== -1 && (doc.title = StrCast(doc.title).split("@")[0] + "'s Library");
}
diff --git a/src/server/index.ts b/src/server/index.ts
index 5b086a2cf..40c0e7981 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -139,6 +139,16 @@ app.get("/pull", (req, res) =>
res.redirect("/");
}));
+app.get("/version", (req, res) => {
+ exec('"C:\\Program Files\\Git\\bin\\git.exe" rev-parse HEAD', (err, stdout, stderr) => {
+ if (err) {
+ res.send(err.message);
+ return;
+ }
+ res.send(stdout);
+ });
+});
+
// SEARCH
// GETTERS
@@ -284,18 +294,15 @@ addSecureRoute(
RouteStore.getCurrUser
);
+const ServicesApiKeyMap = new Map<string, string | undefined>([
+ ["face", process.env.FACE],
+ ["vision", process.env.VISION],
+ ["handwriting", process.env.HANDWRITING]
+]);
+
addSecureRoute(Method.GET, (user, res, req) => {
- let requested = req.params.requestedservice;
- switch (requested) {
- case "face":
- res.send(process.env.FACE);
- break;
- case "vision":
- res.send(process.env.VISION);
- break;
- default:
- res.send(undefined);
- }
+ let service = req.params.requestedservice;
+ res.send(ServicesApiKeyMap.get(service));
}, undefined, `${RouteStore.cognitiveServices}/:requestedservice`);
class NodeCanvasFactory {