Skip to content

Commit

Permalink
Bumping version and applying hard cache on chatbot CSS on version
Browse files Browse the repository at this point in the history
  • Loading branch information
polterguy committed Oct 17, 2023
1 parent e043a55 commit dd06d6f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions backend/files/system/openai/front.files/chat/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let ainiroChatbotType = '[[type]]';
if (!window.ainiroHasDownloadIcofont) {
window.ainiroHasDownloadIcofont = true;
const icofontCss = window.document.createElement('link');
icofontCss.href = 'https://ainiro.io/assets/css/icofont.min.css?v=16.9.5';
icofontCss.href = 'https://ainiro.io/assets/css/icofont.min.css?v=[[ainiro_version]]';
icofontCss.rel = 'stylesheet';
window.document.getElementsByTagName('head')[0].appendChild(icofontCss);
}
Expand Down Expand Up @@ -84,7 +84,7 @@ if (window.getAiniroChatbotCssFile) {
// Fetching theme's CSS file and including on page
window.ainiroHasDownloadIcofont = true;
const icofontCss = window.document.createElement('link');
icofontCss.href = '[[url]]/magic/system/openai/include-style?file=' + encodeURIComponent(ainiroChatbotCssFile) + '&v=16.9.8';
icofontCss.href = '[[url]]/magic/system/openai/include-style?file=' + encodeURIComponent(ainiroChatbotCssFile) + '&v=[[ainiro_version]]';
icofontCss.rel = 'stylesheet';
window.document.getElementsByTagName('head')[0].appendChild(icofontCss);

Expand Down
7 changes: 7 additions & 0 deletions backend/files/system/openai/include-javascript.get.hl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
submit_button:bool
stream:bool

// Not used, but allows embedders to do a hard refresh to reload JavaScript.
v:string

// Legacy parameter, ignore, no longer in use.
gpt:bool
.description:Returns the JavaScript required to embed a ChatGPT based chatbot on some website to caller.
Expand Down Expand Up @@ -111,6 +114,10 @@ set-value:x:@.result
get-first-value
config.get:"magic:watermark"
.:"Powered by <a href=\"https://ainiro.io\" target=\"_blank\">AINIRO.IO</a>"
set-value:x:@.result
strings.replace:x:@.result
.:[[ainiro_version]]
version
set-value:x:@.result
strings.replace:x:@.result
.:[[recaptcha]]
Expand Down
4 changes: 2 additions & 2 deletions backend/files/system/openai/include-style.get.hl
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ else

// Making sure we return correct Content-Type to caller, and applying some cache.
response.headers.set
Content-Type:text/css
Cache-Control:public, max-age=3600
Content-Type:text/css; charset=utf-8
Cache-Control:public, max-age=31536000

// Returning result to caller.
return:x:@.result
2 changes: 1 addition & 1 deletion backend/slots/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Version : ISlot
/// <param name="input">Parameters passed from signaler</param>
public void Signal(ISignaler signaler, Node input)
{
input.Value = "v16.9.7";
input.Value = "v16.10.0";
}
}
}

0 comments on commit dd06d6f

Please sign in to comment.