Readded the subscription
This commit is contained in:
parent
306dc1c0d8
commit
cec76b42f0
4
Chat.go
4
Chat.go
@ -870,7 +870,7 @@ func GenerateModelPopoverHTML(refresh bool, c *fiber.Ctx) string {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
isPremium, isBasic := IsCurrentUserSubscribed(c)
|
isPremium, _ := IsCurrentUserSubscribed(c)
|
||||||
|
|
||||||
out, err := modelPopoverTmpl.Execute(pongo2.Context{
|
out, err := modelPopoverTmpl.Execute(pongo2.Context{
|
||||||
"IsLogin": checkIfLogin(c),
|
"IsLogin": checkIfLogin(c),
|
||||||
@ -886,7 +886,7 @@ func GenerateModelPopoverHTML(refresh bool, c *fiber.Ctx) string {
|
|||||||
"LLMs": llms,
|
"LLMs": llms,
|
||||||
"ModelInfos": modelInfos,
|
"ModelInfos": modelInfos,
|
||||||
"DeleteUpdate": refresh,
|
"DeleteUpdate": refresh,
|
||||||
"IsSub": isPremium || isBasic,
|
"IsPremium": isPremium,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error generating model popover")
|
fmt.Println("Error generating model popover")
|
||||||
|
@ -84,9 +84,6 @@ func CreateNewStripeCustomer(name string, email string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsCurrentUserSubscribed(c *fiber.Ctx) (bool, bool) {
|
func IsCurrentUserSubscribed(c *fiber.Ctx) (bool, bool) {
|
||||||
// Everybody is premium for now
|
|
||||||
return true, false
|
|
||||||
|
|
||||||
var user User
|
var user User
|
||||||
err := edgeGlobalClient.WithGlobals(map[string]interface{}{"ext::auth::client_token": c.Cookies("jade-edgedb-auth-token")}).QuerySingle(edgeCtx, "SELECT global currentUser { stripe_id } LIMIT 1;", &user)
|
err := edgeGlobalClient.WithGlobals(map[string]interface{}{"ext::auth::client_token": c.Cookies("jade-edgedb-auth-token")}).QuerySingle(edgeCtx, "SELECT global currentUser { stripe_id } LIMIT 1;", &user)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
{% for modelInfo in ModelInfos %}
|
{% for modelInfo in ModelInfos %}
|
||||||
<option value="{{ modelInfo.ModelID }}">{{ modelInfo.Company.Name }} - {{ modelInfo.Name }}</option>
|
<option value="{{ modelInfo.ModelID }}">{{ modelInfo.Company.Name }} - {{ modelInfo.Name }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<option value="{% if IsSub %}custom{% else %}none{% endif %}">Custom Endpoints</option>
|
<option value="{% if IsPremium %}custom{% else %}none{% endif %}">Custom Endpoints</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<p class="is-hidden" style="color: red;" id="endpoint-error">
|
<p class="is-hidden" style="color: red;" id="endpoint-error">
|
||||||
|
@ -119,7 +119,6 @@
|
|||||||
</form>
|
</form>
|
||||||
<p id="api-keys-status"></p>
|
<p id="api-keys-status"></p>
|
||||||
</div>
|
</div>
|
||||||
<!-- Removed subscribtion for now
|
|
||||||
{% if isBasic or isPremium %}
|
{% if isBasic or isPremium %}
|
||||||
<a class="button is-small mt-1" href="{{ StripeSubLink }}" target="_blank">
|
<a class="button is-small mt-1" href="{{ StripeSubLink }}" target="_blank">
|
||||||
<span class="icon is-small" {% if isPremium %}style="color: #b00202" {%else%}style="color: #126d0f"
|
<span class="icon is-small" {% if isPremium %}style="color: #b00202" {%else%}style="color: #126d0f"
|
||||||
@ -137,7 +136,6 @@
|
|||||||
<span>Subscribe to JADE</span>
|
<span>Subscribe to JADE</span>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
-->
|
|
||||||
<a class="button is-small mt-1" hx-get="/generateTermAndService" hx-target="#chat-container"
|
<a class="button is-small mt-1" hx-get="/generateTermAndService" hx-target="#chat-container"
|
||||||
hx-swap="outerHTML" hx-trigger="click">
|
hx-swap="outerHTML" hx-trigger="click">
|
||||||
<span class="icon is-small">
|
<span class="icon is-small">
|
||||||
|
@ -130,7 +130,7 @@
|
|||||||
for users who may not need to use the chatbot extensively. Once the free
|
for users who may not need to use the chatbot extensively. Once the free
|
||||||
credit use, you pay based on the length of you message and the response
|
credit use, you pay based on the length of you message and the response
|
||||||
generated in tokens (a token is around 3 characters). Groq and Google also
|
generated in tokens (a token is around 3 characters). Groq and Google also
|
||||||
offer free tiers that are enough for conversation.<br /><br />
|
offer free tiers that are enough for conversation.<<br /><br />The app itself is free until 200 messages per month then 0.95$ per month.<br /><br />
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user