diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index 03f029ba..040f1ba4 100644 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -3,6 +3,7 @@ import copy import sys import re import time +import base64 import json import liquid import logging @@ -48,10 +49,52 @@ def minus(a, b): b = int(b) return standard_filter_manager.filters["minus"](a, b) +@shuffle_filters.register +def multiply(a, b): + a = int(a) + b = int(b) + return standard_filter_manager.filters["multiply"](a, b) + +@shuffle_filters.register +def divide(a, b): + a = int(a) + b = int(b) + return standard_filter_manager.filters["divide"](a, b) + +@shuffle_filters.register +def md5(a): + a = str(a) + return hashlib.md5(a.encode('utf-8')).hexdigest() + +@shuffle_filters.register +def sha256(a): + a = str(a) + return hashlib.sha256(str(a).encode("utf-8")).hexdigest() + +@shuffle_filters.register +def md5_base64(a): + a = str(a) + foundhash = hashlib.md5(a.encode('utf-8')).hexdigest() + return base64.b64encode(foundhash.encode('utf-8')) + +@shuffle_filters.register +def base64_encode(a): + a = str(a) + return base64.b64encode(a.encode('utf-8')).decode() + +@shuffle_filters.register +def base64_decode(a): + a = str(a) + return base64.b64decode(a).decode() + #print(standard_filter_manager.filters) #print(shuffle_filters.filters) -print(Liquid("{{ '10' | plus: 1}}", filters=shuffle_filters.filters).render()) -print(Liquid("{{ '10' | minus: 1}}", filters=shuffle_filters.filters).render()) +#print(Liquid("{{ '10' | plus: 1}}", filters=shuffle_filters.filters).render()) +#print(Liquid("{{ '10' | minus: 1}}", filters=shuffle_filters.filters).render()) +#print(Liquid("{{ asd | size }}", filters=shuffle_filters.filters).render()) +#print(Liquid("{{ 'asd' | md5 }}", filters=shuffle_filters.filters).render()) +#print(Liquid("{{ 'asd' | sha256 }}", filters=shuffle_filters.filters).render()) +#print(Liquid("{{ 'asd' | md5_base64 | base64_decode }}", filters=shuffle_filters.filters).render()) ### ### @@ -1855,7 +1898,7 @@ class AppBase: if len(template) > 100: self.logger.info("[DEBUG] Running liquid with data of length %d" % len(template)) #self.logger.info(f"[DEBUG] Data: {template}") - run = Liquid(template, mode="wild", from_file=False) + run = Liquid(template, mode="wild", from_file=False, filters=shuffle_filters.filters) # Can't handle self yet (?) ret = run.render(**globals()) diff --git a/backend/go-app/go.mod b/backend/go-app/go.mod index 09a4b486..888d811a 100644 --- a/backend/go-app/go.mod +++ b/backend/go-app/go.mod @@ -2,7 +2,7 @@ module main go 1.16 -replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared +//replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared //replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi //replace github.com/frikky/go-elasticsearch => ../../../../git/go-elasticsearch @@ -24,7 +24,7 @@ require ( github.com/h2non/filetype v1.1.3 github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20170819232839-0fbfe93532da // indirect github.com/satori/go.uuid v1.2.0 - github.com/shuffle/shuffle-shared v0.2.3 + github.com/shuffle/shuffle-shared v0.2.4 go4.org v0.0.0-20201209231011-d4a079459e60 // indirect golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce google.golang.org/api v0.65.0 diff --git a/docker-compose.yml b/docker-compose.yml index 4eacbeb7..7b2bf6c3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: frontend: - #build: ./frontend + build: ./frontend image: ghcr.io/frikky/shuffle-frontend:nightly container_name: shuffle-frontend hostname: shuffle-frontend diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 1fe81088..424eb9d5 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -15,7 +15,7 @@ import theme from "./theme"; import Apps from "./views/Apps"; import AppCreator from "./views/AppCreator"; -import Dashboard from "./views/Dashboard"; +import Dashboard from "./views/Dashboard.jsx"; import AdminSetup from "./views/AdminSetup"; import Admin from "./views/Admin"; import Docs from "./views/Docs"; diff --git a/frontend/src/views/Dashboard.jsx b/frontend/src/views/Dashboard.jsx index 1cb9f4a7..9d75f7c2 100644 --- a/frontend/src/views/Dashboard.jsx +++ b/frontend/src/views/Dashboard.jsx @@ -812,7 +812,7 @@ const Dashboard = (props) => { {usecases !== null && usecases !== undefined && usecases.length > 0 ? -
+
{usecases.map((usecase, index) => { return ( { ele.style.borderWidth = "2px" } else { - alert.success("TBD: Coming in version 1.0.0"); + //alert.success("TBD: Coming in version 1.0.0"); } }}> workflows made by other creators! @@ -2211,7 +2211,7 @@ const GettingStarted = (props) => { Learn to use Shuffle by  {setModalOpen(true)}}> creating your first workflow - and reading the docs. + and reading the docs. ), tutorial: "learn_shuffle", diff --git a/frontend/src/views/SettingsPage.jsx b/frontend/src/views/SettingsPage.jsx index 46325bb4..a8e0e0e9 100644 --- a/frontend/src/views/SettingsPage.jsx +++ b/frontend/src/views/SettingsPage.jsx @@ -733,7 +733,7 @@ const Settings = (props) => { {isCloud ? - By connecting your Github account, you agree to our Terms of Service, and acknowledge that your non-sensitive data will be turned into a creator account. This enables you to earn a passive income from Shuffle. This IS reversible. + By connecting your Github account, you agree to our Terms of Service, and acknowledge that your non-sensitive data will be turned into a creator account. This enables you to earn a passive income from Shuffle. This IS reversible.