Readded the subscription

This commit is contained in:
Adrien Bouvais 2024-08-03 16:46:50 +02:00
parent 306dc1c0d8
commit cec76b42f0
5 changed files with 4 additions and 9 deletions

View File

@ -870,7 +870,7 @@ func GenerateModelPopoverHTML(refresh bool, c *fiber.Ctx) string {
panic(err)
}
isPremium, isBasic := IsCurrentUserSubscribed(c)
isPremium, _ := IsCurrentUserSubscribed(c)
out, err := modelPopoverTmpl.Execute(pongo2.Context{
"IsLogin": checkIfLogin(c),
@ -886,7 +886,7 @@ func GenerateModelPopoverHTML(refresh bool, c *fiber.Ctx) string {
"LLMs": llms,
"ModelInfos": modelInfos,
"DeleteUpdate": refresh,
"IsSub": isPremium || isBasic,
"IsPremium": isPremium,
})
if err != nil {
fmt.Println("Error generating model popover")

View File

@ -84,9 +84,6 @@ func CreateNewStripeCustomer(name string, email string) string {
}
func IsCurrentUserSubscribed(c *fiber.Ctx) (bool, bool) {
// Everybody is premium for now
return true, false
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)
if err != nil {

View File

@ -50,7 +50,7 @@
{% for modelInfo in ModelInfos %}
<option value="{{ modelInfo.ModelID }}">{{ modelInfo.Company.Name }} - {{ modelInfo.Name }}</option>
{% endfor %}
<option value="{% if IsSub %}custom{% else %}none{% endif %}">Custom Endpoints</option>
<option value="{% if IsPremium %}custom{% else %}none{% endif %}">Custom Endpoints</option>
</select>
</div>
<p class="is-hidden" style="color: red;" id="endpoint-error">

View File

@ -119,7 +119,6 @@
</form>
<p id="api-keys-status"></p>
</div>
<!-- Removed subscribtion for now
{% if isBasic or isPremium %}
<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"
@ -137,7 +136,6 @@
<span>Subscribe to JADE</span>
</a>
{% endif %}
-->
<a class="button is-small mt-1" hx-get="/generateTermAndService" hx-target="#chat-container"
hx-swap="outerHTML" hx-trigger="click">
<span class="icon is-small">

View File

@ -130,7 +130,7 @@
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
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>
</li>
<li>