mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-03-11 13:23:06 +01:00
updates for serving off AWS / cloudfront
This commit is contained in:
parent
60bbf73b14
commit
7134a21f6a
@ -131,7 +131,7 @@ rm *.dmg
|
||||
```bash
|
||||
# @scripthaus command sync-webshare-dev
|
||||
# @scripthaus cd :playbook
|
||||
aws --profile prompt-s3 s3 cp webshare/static/index.html s3://prompt-devshare-static/ --cache-control 'public, max-age=600, s-maxage=300, stale-if-error=60'
|
||||
aws --profile prompt-s3 s3 sync webshare/static s3://prompt-devshare-static/static --cache-control 'public, max-age=600, s-maxage=300, stale-if-error=60'
|
||||
aws --profile prompt-s3 s3 sync webshare/dist-dev s3://prompt-devshare-static/ --cache-control 'public, max-age=600, s-maxage=300, stale-if-error=60'
|
||||
# no-cache for dev
|
||||
aws --profile prompt-s3 s3 sync webshare/static s3://prompt-devshare-static/static --cache-control 'no-cache'
|
||||
aws --profile prompt-s3 s3 sync webshare/dist-dev s3://prompt-devshare-static/dist-dev --cache-control 'no-cache'
|
||||
```
|
||||
|
@ -50,9 +50,16 @@ class WebShareModelClass {
|
||||
remoteScreenVts : number = 0;
|
||||
|
||||
constructor() {
|
||||
let pathName = window.location.pathname;
|
||||
let screenMatch = pathName.match(/\/share\/([a-f0-9-]+)/);
|
||||
if (screenMatch != null) {
|
||||
this.screenId = screenMatch[1];
|
||||
}
|
||||
let urlParams = new URLSearchParams(window.location.search);
|
||||
this.viewKey = urlParams.get("viewkey");
|
||||
this.screenId = urlParams.get("screenid");
|
||||
if (this.screenId == null) {
|
||||
this.screenId = urlParams.get("screenid");
|
||||
}
|
||||
setTimeout(() => this.loadFullScreenData(false), 10);
|
||||
this.wsControl = new WebShareWSControl(getBaseWSUrl(), this.screenId, this.viewKey, this.wsMessageCallback.bind(this));
|
||||
document.addEventListener("keydown", this.docKeyDownHandler.bind(this));
|
||||
|
@ -20,6 +20,9 @@ var merged = merge.merge(common, {
|
||||
headers: {
|
||||
'Cache-Control': 'no-store',
|
||||
},
|
||||
devMiddleware: {
|
||||
publicPath: '/dist-dev/'
|
||||
},
|
||||
allowedHosts: "all",
|
||||
hot: false,
|
||||
liveReload: false,
|
||||
|
21
webshare/static/index-dev.html
Normal file
21
webshare/static/index-dev.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<base href="/">
|
||||
<script charset="UTF-8" src="/dist-dev/webshare.js"></script>
|
||||
<link rel="stylesheet" href="/static/bulma-0.9.4.min.css">
|
||||
<link rel="stylesheet" href="/static/fontawesome/css/fontawesome.min.css">
|
||||
<link rel="stylesheet" href="/static/fontawesome/css/brands.min.css">
|
||||
<link rel="stylesheet" href="/static/fontawesome/css/sharp-solid.min.css">
|
||||
<link rel="stylesheet" href="/static/fontawesome/css/sharp-regular.min.css">
|
||||
<link rel="stylesheet" href="/static/xterm.css" />
|
||||
<link rel="stylesheet" href="/dist-dev/webshare.css" />
|
||||
</head>
|
||||
<body class="prompt-webshare">
|
||||
<div id="measure"></div>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -2,15 +2,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<base href="../">
|
||||
<script charset="UTF-8" src="/webshare.js"></script>
|
||||
<base href="/">
|
||||
<script charset="UTF-8" src="/dist/webshare.js"></script>
|
||||
<link rel="stylesheet" href="/static/bulma-0.9.4.min.css">
|
||||
<link rel="stylesheet" href="/static/fontawesome/css/fontawesome.min.css">
|
||||
<link rel="stylesheet" href="/static/fontawesome/css/brands.min.css">
|
||||
<link rel="stylesheet" href="/static/fontawesome/css/sharp-solid.min.css">
|
||||
<link rel="stylesheet" href="/static/fontawesome/css/sharp-regular.min.css">
|
||||
<link rel="stylesheet" href="/static/xterm.css" />
|
||||
<link rel="stylesheet" href="/webshare.css" />
|
||||
<link rel="stylesheet" href="/dist/webshare.css" />
|
||||
</head>
|
||||
<body class="prompt-webshare">
|
||||
<div id="measure"></div>
|
||||
|
Loading…
Reference in New Issue
Block a user