Skip to content

Commit

Permalink
Finish up frontend (#41)
Browse files Browse the repository at this point in the history
* Finish up frontend

* fixup

Signed-off-by: Matteo Collina <[email protected]>

---------

Signed-off-by: Matteo Collina <[email protected]>
Co-authored-by: Matteo Collina <[email protected]>
  • Loading branch information
flakey5 and mcollina authored May 10, 2024
1 parent af5850e commit e8416a1
Show file tree
Hide file tree
Showing 8 changed files with 462 additions and 139 deletions.
4 changes: 2 additions & 2 deletions lib/generator.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { join } from 'node:path'
import { join, dirname } from 'node:path'
import { readFile } from 'node:fs/promises'
import { Generator as ServiceGenerator } from '@platformatic/service'
import { BaseGenerator } from '@platformatic/generators'
import { schema } from './schema.js'
import { generateGlobalTypesFile } from './templates/types.js'
import { generatePlugins } from '@platformatic/generators/lib/create-plugin.js'
import { fileURLToPath } from 'node:url'
import { dirname } from 'node:path'

interface PackageJson {
name: string
Expand All @@ -19,6 +18,7 @@ class AiWarpGenerator extends ServiceGenerator {

getDefaultConfig (): { [x: string]: BaseGenerator.JSONValue } {
const defaultBaseConfig = super.getDefaultConfig()
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
const dir = import.meta.dirname || dirname(fileURLToPath(import.meta.url))
const defaultConfig = {
aiProvider: 'openai',
Expand Down
3 changes: 2 additions & 1 deletion static/chat.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chat - AI Warp</title>


<link rel="icon" type="image/x-icon" href="/images/favicon.svg">
<link rel="stylesheet" href="/styles/common.css">
<link rel="stylesheet" href="/styles/chat.css">
</head>
Expand Down
9 changes: 9 additions & 0 deletions static/images/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions static/images/icons/arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions static/images/icons/arrow-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Warp</title>

<link rel="icon" type="image/x-icon" href="/images/favicon.svg">
<link rel="stylesheet" href="/styles/common.css">
<link rel="stylesheet" href="/styles/index.css">
</head>
Expand Down Expand Up @@ -98,7 +99,7 @@ <h1>Platformatic Ai-Warp</h1>
}

promptInput.onkeydown = (event) => {
if (event.key === 'Enter') {
if (event.key === 'Enter' && !event.shiftKey) {
promptButton.onclick()
}
}
Expand Down
Loading

0 comments on commit e8416a1

Please sign in to comment.