This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from slashbaseide/develop
Release v0.9.0
- Loading branch information
Showing
301 changed files
with
22,081 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# General | ||
.DS_Store | ||
|
||
# Visual Studio Code | ||
.vscode/* | ||
.history/ | ||
__debug_bin | ||
|
||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Environment | ||
.env | ||
development.env | ||
development.server.env | ||
production.env | ||
|
||
# Database | ||
app.db | ||
|
||
# Wails | ||
build/bin | ||
node_modules | ||
frontend/desktop/dist | ||
build/darwin/gon-notarize.json | ||
|
||
# Frontend Server | ||
frontend/server/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
## THIS IS PRODUCTION DOCKERFILE. | ||
## USED TO BUILD: slashbaseide/slashbase image | ||
|
||
# Create base image for building go binary | ||
FROM golang:1.20.3-alpine3.17 as base | ||
WORKDIR /app | ||
|
||
ENV GO111MODULE="on" | ||
ENV GOOS="linux" | ||
ENV CGO_ENABLED=1 | ||
|
||
# System dependencies | ||
RUN apk update && apk add --no-cache ca-certificates git build-base && update-ca-certificates | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
# Executable builder | ||
FROM base as backendbuilder | ||
|
||
WORKDIR /app | ||
COPY . . | ||
RUN mkdir -p /app/frontend/desktop/dist | ||
RUN touch /app/frontend/desktop/dist/nofile | ||
RUN make build-server | ||
|
||
# Install dependencies only when needed | ||
FROM node:alpine AS deps | ||
|
||
RUN apk add --no-cache libc6-compat | ||
WORKDIR /app | ||
COPY ./frontend/server/package.json ./frontend/server/yarn.lock ./ | ||
RUN yarn install --frozen-lockfile | ||
|
||
# Rebuild the source code only when needed | ||
FROM node:alpine AS frontendbuilder | ||
|
||
WORKDIR /app | ||
COPY ./frontend/server/ . | ||
COPY --from=deps /app/node_modules ./node_modules | ||
RUN yarn build | ||
|
||
# Production | ||
FROM alpine:3.14 | ||
|
||
WORKDIR /slashbase | ||
COPY --from=backendbuilder /app/slashbase /slashbase | ||
COPY --from=frontendbuilder /app/dist /slashbase/web | ||
|
||
ENTRYPOINT ["/slashbase/slashbase"] | ||
EXPOSE 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# TODO: write install script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ROOT_USER_EMAIL=${slashbase_root_email} | ||
ROOT_USER_PASSWORD=${slashbase_root_password} | ||
|
||
AUTH_TOKEN_SECRET=${auth_secret} | ||
CRYPTED_DATA_SECRET=${crypted_data_secret} | ||
|
||
APP_DB_HOST=${app_db_host} | ||
APP_DB_PORT=${app_db_port} | ||
APP_DB_USER=${app_db_user} | ||
APP_DB_PASS=${app_db_pass} | ||
APP_DB_NAME=${app_db_name} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# rename this file to development.env and replace the comments below to get started on development of slashbase | ||
ENV_NAME=development | ||
|
||
# some secrets are pre-generated for development and can be changed | ||
CRYPTED_DATA_SECRET=ca8f161ccd170f5600f2beb6c17873a69b689ad1be5c5e97513e39b3158643ba |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import React, { useContext, useEffect } from 'react' | ||
import { DBConnection, Tab } from '../../data/models' | ||
import { selectDBConnection } from '../../redux/dbConnectionSlice' | ||
import { useAppDispatch, useAppSelector } from '../../redux/hooks' | ||
import toast from 'react-hot-toast' | ||
import InfiniteScroll from 'react-infinite-scroll-component' | ||
import dateformat from 'dateformat' | ||
import { getDBQueryLogs, reset, selectDBQueryLogs, selectDBQueryLogsNext } from '../../redux/dbHistorySlice' | ||
import TabContext from '../layouts/tabcontext' | ||
|
||
|
||
type DBHistoryPropType = { | ||
} | ||
|
||
const DBHistoryFragment = ({ }: DBHistoryPropType) => { | ||
|
||
const dispatch = useAppDispatch() | ||
|
||
const currentTab: Tab = useContext(TabContext)! | ||
|
||
const dbConnection: DBConnection | undefined = useAppSelector(selectDBConnection) | ||
const dbQueryLogs = useAppSelector(selectDBQueryLogs) | ||
const dbQueryLogsNext = useAppSelector(selectDBQueryLogsNext) | ||
|
||
useEffect(() => { | ||
if (dbConnection) { | ||
(async () => { | ||
dispatch(reset()) | ||
})() | ||
fetchDBQueryLogs() | ||
} | ||
}, [dispatch, dbConnection]) | ||
|
||
const fetchDBQueryLogs = async () => { | ||
const result = await dispatch(getDBQueryLogs({ dbConnId: dbConnection!.id })).unwrap() | ||
if (!result.success) { | ||
toast.error(result.error!) | ||
} | ||
} | ||
|
||
function refreshHandler() { | ||
dispatch(reset()) | ||
fetchDBQueryLogs() | ||
} | ||
|
||
return ( | ||
<div className={currentTab.isActive ? "db-tab-active" : "db-tab"}> | ||
{dbConnection && | ||
<React.Fragment> | ||
<div className="is-flex is-justify-content-space-between"> | ||
<h1>Showing History in {dbConnection.name}</h1> | ||
<button className="button is-flex" onClick={refreshHandler}> | ||
<span className="icon is-small"> | ||
<i className="fas fa-sync" /> | ||
</span> | ||
<span>Refresh</span> | ||
</button> | ||
</div> | ||
<br /> | ||
<InfiniteScroll | ||
dataLength={dbQueryLogs.length} | ||
next={fetchDBQueryLogs} | ||
hasMore={dbQueryLogsNext !== -1} | ||
loader={ | ||
<p style={{ textAlign: 'center' }}> | ||
Loading... | ||
</p> | ||
} | ||
endMessage={ | ||
<p style={{ textAlign: 'center' }}> | ||
<b>You have seen it all!</b> | ||
</p> | ||
} | ||
scrollableTarget="maincontent" | ||
> | ||
<table className={"table is-bordered is-striped is-narrow is-hoverable is-fullwidth"}> | ||
<tbody> | ||
{dbQueryLogs.map((log) => ( | ||
<tr key={log.id}> | ||
<td> | ||
<code>{log.query}</code> | ||
</td> | ||
<td style={{ fontSize: '14px', width: '120px' }}> | ||
{dateformat(log.createdAt, "mmm dd, yyyy HH:MM:ss")} | ||
</td> | ||
</tr> | ||
) | ||
)} | ||
</tbody> | ||
</table> | ||
</InfiniteScroll> | ||
</React.Fragment> | ||
} | ||
</div> | ||
) | ||
} | ||
|
||
|
||
export default DBHistoryFragment |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.