feat: update scel

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-04-10 20:34:45 +02:00
parent 13321a44a2
commit 15dd5ce45e
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912
13 changed files with 66 additions and 185 deletions

View File

@ -1,33 +1,2 @@
kind: pipeline
name: default
type: docker
steps:
- name: server
image: plugins/docker
environment:
DOCKER_BUILDKIT: 1
settings:
username: kasperhermansen
password:
from_secret: docker_secret
repo: kasperhermansen/scel
tags: latest
context: .
dockerfile: Dockerfile
cache_from: kasperhermansen/scel:latest
when:
event:
include:
- push
- tag
- promote
- name: send telegram notification
image: appleboy/drone-telegram
settings:
token:
from_secret: telegram_token
to: 2129601481
format: markdown
when:
status: [failure]
kind: template
load: cuddle-rust-service-plan.yaml

21
cuddle.yaml Normal file
View File

@ -0,0 +1,21 @@
# yaml-language-server: $schema=https://git.front.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json
base: "git@git.front.kjuulh.io:kjuulh/cuddle-rust-service-plan.git"
vars:
service: "scel"
registry: kasperhermansen
clusters:
clank-prod:
replicas: "3"
namespace: prod
deployment:
registry: git@git.front.kjuulh.io:kjuulh/clank-clusters
env:
prod:
clusters:
- clank-prod

Binary file not shown.

View File

@ -68,7 +68,7 @@ impl Server {
.expect("Could not parse url"),
];
let app = Router::new()
let api_router = Router::new()
.route(
"/graphql",
routing::get(graphql_playground).post(graphql_handler),
@ -93,6 +93,10 @@ impl Server {
)
.layer(TraceLayer::new_for_http().make_span_with(DefaultMakeSpan::default()));
let app = Router::new()
.nest("/api", api_router)
.fallback(svc)
let addr = SocketAddr::from(([0, 0, 0, 0], 3000));
Server { app, addr }

View File

@ -44,14 +44,7 @@ impl InMemoryDownloadService {
let id = Uuid::new_v4().to_string();
d.id = Some(id.clone());
downloads.insert(
id.clone(),
(
Arc::new(Mutex::new(d.clone())),
shared_tx,
rx,
),
);
downloads.insert(id.clone(), (Arc::new(Mutex::new(d.clone())), shared_tx, rx));
let args = vec![
Arg::new("--progress"),

View File

@ -1,41 +0,0 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}
@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}
.card {
padding: 2em;
}
.read-the-docs {
color: #888;
}

View File

@ -1,34 +1,12 @@
import { useState } from 'react'
import reactLogo from './assets/react.svg'
import './App.css'
import Body from "./components/body/Body"
import Navbar from "./components/navbar/Navbar"
import RequestDownload from "./components/request-download/RequestDownload"
function App() {
const [count, setCount] = useState(0)
return (
<div className="App">
<div>
<a href="https://vitejs.dev" target="_blank">
<img src="/vite.svg" className="logo" alt="Vite logo" />
</a>
<a href="https://reactjs.org" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>
</div>
)
}
const App = () => <div>
<Navbar />
<Body>
<RequestDownload />
</Body>
</div>
export default App

View File

@ -0,0 +1,8 @@
import { FC, ReactNode } from "react"
interface BodyProps {
children?: ReactNode
}
const Body: FC<BodyProps> = ({ children }) => <div>{children}</div>
export default Body

View File

@ -0,0 +1,10 @@
import { getServerUrl } from "../../lib/env"
const Navbar = () => {
return <nav>
<div>Scel</div>
<a href={`${getServerUrl()}/auth/gitea`}>Login</a>
</nav>
}
export default Navbar

View File

@ -0,0 +1,7 @@
const RequestDownload = () => {
return <div>
<input type="text" placeholder="Request download"></input>
</div>
}
export default RequestDownload

View File

@ -1,70 +0,0 @@
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}
a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}
body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}
h1 {
font-size: 3.2em;
line-height: 1.1;
}
button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}
@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}

3
src/web/src/lib/env.ts Normal file
View File

@ -0,0 +1,3 @@
export const getServerUrl = (): string => {
return import.meta.env.VITE_SERVER_BASE_URL
}

View File

@ -1,7 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import './index.css'
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>