This commit is contained in:
@ -524,10 +524,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.delete-button {
|
.delete-button {
|
||||||
background: none;
|
background: #dc3545;
|
||||||
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 16px;
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
@ -535,8 +537,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.delete-button:hover {
|
.delete-button:hover {
|
||||||
background: rgba(220, 53, 69, 0.1);
|
background: #c82333;
|
||||||
transform: scale(1.1);
|
transform: scale(1.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-content {
|
.comment-content {
|
@ -920,14 +920,14 @@ function App() {
|
|||||||
className="json-button"
|
className="json-button"
|
||||||
title="Show/Hide JSON"
|
title="Show/Hide JSON"
|
||||||
>
|
>
|
||||||
{showJsonFor === record.uri ? '📄 Hide JSON' : '📄 Show JSON'}
|
{showJsonFor === record.uri ? 'Hide JSON' : 'Show JSON'}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => handleDeleteUserList(record.uri)}
|
onClick={() => handleDeleteUserList(record.uri)}
|
||||||
className="delete-button"
|
className="delete-button"
|
||||||
title="Delete user list"
|
title="Delete user list"
|
||||||
>
|
>
|
||||||
🗑️
|
Delete
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1006,7 +1006,7 @@ function App() {
|
|||||||
className="json-button"
|
className="json-button"
|
||||||
title="Show/Hide JSON"
|
title="Show/Hide JSON"
|
||||||
>
|
>
|
||||||
{showJsonFor === record.uri ? '📄' : '📄'}
|
{showJsonFor === record.uri ? 'Hide' : 'JSON'}
|
||||||
</button>
|
</button>
|
||||||
{/* Show delete button only for current user's comments */}
|
{/* Show delete button only for current user's comments */}
|
||||||
{user && record.value.author?.did === user.did && (
|
{user && record.value.author?.did === user.did && (
|
||||||
@ -1015,7 +1015,7 @@ function App() {
|
|||||||
className="delete-button"
|
className="delete-button"
|
||||||
title="Delete comment"
|
title="Delete comment"
|
||||||
>
|
>
|
||||||
🗑️
|
Delete
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
@ -31,32 +31,18 @@ export default defineConfig(({ mode }) => {
|
|||||||
// Generate standalone index.html for testing
|
// Generate standalone index.html for testing
|
||||||
{
|
{
|
||||||
name: 'generate-standalone-html',
|
name: 'generate-standalone-html',
|
||||||
writeBundle() {
|
writeBundle(options, bundle) {
|
||||||
// Generate standalone index.html for testing
|
// Find actual generated filenames
|
||||||
|
const jsFile = Object.keys(bundle).find(fileName => fileName.startsWith('assets/comment-atproto') && fileName.endsWith('.js'))
|
||||||
|
const cssFile = Object.keys(bundle).find(fileName => fileName.startsWith('assets/comment-atproto') && fileName.endsWith('.css'))
|
||||||
|
|
||||||
|
// Generate minimal index.html with just asset references
|
||||||
const indexHtmlPath = path.resolve(__dirname, 'dist/index.html')
|
const indexHtmlPath = path.resolve(__dirname, 'dist/index.html')
|
||||||
const indexHtmlContent = `<!DOCTYPE html>
|
const indexHtmlContent = `<!-- OAuth Comment System - Load globally for session management -->
|
||||||
<html lang="ja">
|
<script type="module" crossorigin src="/${jsFile}"></script>
|
||||||
<head>
|
<link rel="stylesheet" crossorigin href="/${cssFile}">`
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>ai.card OAuth Test</title>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
||||||
background-color: #0a0a0a;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script type="module" crossorigin src="/assets/comment-atproto.js"></script>
|
|
||||||
<link rel="stylesheet" crossorigin href="/assets/comment-atproto.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="comment-atproto"></div>
|
|
||||||
</body>
|
|
||||||
</html>`
|
|
||||||
fs.writeFileSync(indexHtmlPath, indexHtmlContent)
|
fs.writeFileSync(indexHtmlPath, indexHtmlContent)
|
||||||
console.log('Generated standalone index.html for testing')
|
console.log('Generated minimal index.html with asset references')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -65,14 +51,14 @@ export default defineConfig(({ mode }) => {
|
|||||||
minify: 'esbuild',
|
minify: 'esbuild',
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: {
|
||||||
// Fixed filenames for ailog integration
|
// Hash-based filenames to bust cache
|
||||||
entryFileNames: 'assets/comment-atproto.js',
|
entryFileNames: 'assets/comment-atproto-[hash].js',
|
||||||
chunkFileNames: 'assets/comment-atproto-[name].js',
|
chunkFileNames: 'assets/comment-atproto-[name]-[hash].js',
|
||||||
assetFileNames: (assetInfo) => {
|
assetFileNames: (assetInfo) => {
|
||||||
if (assetInfo.name && assetInfo.name.endsWith('.css')) {
|
if (assetInfo.name && assetInfo.name.endsWith('.css')) {
|
||||||
return 'assets/comment-atproto.css';
|
return 'assets/comment-atproto-[hash].css';
|
||||||
}
|
}
|
||||||
return 'assets/[name].[ext]';
|
return 'assets/[name]-[hash].[ext]';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
11
run.zsh
11
run.zsh
@ -3,12 +3,14 @@
|
|||||||
function _env() {
|
function _env() {
|
||||||
d=${0:a:h}
|
d=${0:a:h}
|
||||||
ailog=$d/target/release/ailog
|
ailog=$d/target/release/ailog
|
||||||
|
oauth=$d/oauth
|
||||||
|
myblog=$d/my-blog
|
||||||
port=4173
|
port=4173
|
||||||
case $OSTYPE in
|
case $OSTYPE in
|
||||||
darwin*)
|
darwin*)
|
||||||
export NVM_DIR="$HOME/.nvm"
|
export NVM_DIR="$HOME/.nvm"
|
||||||
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
|
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"
|
||||||
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
|
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@ -29,12 +31,13 @@ function _server_public() {
|
|||||||
|
|
||||||
function _oauth_build() {
|
function _oauth_build() {
|
||||||
_env
|
_env
|
||||||
cd $d/aicard-web-oauth
|
cd $oauth
|
||||||
nvm use 21
|
nvm use 21
|
||||||
npm i
|
npm i
|
||||||
source .env.production
|
source .env.production
|
||||||
npm run build
|
npm run build
|
||||||
cp -rf dist/* $d/my-blog/static/
|
cp -rf dist/* $myblog/static/
|
||||||
|
cp $oauth/dist/index.html $myblog/templates/oauth-assets.html
|
||||||
#npm run preview
|
#npm run preview
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user