Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7689cf23c2 | ||
|
|
64e2553c83 | ||
|
|
fdff294b8c | ||
|
|
7bd14ec4df | ||
|
|
3d584d9e68 | ||
|
|
8e1e254a8b | ||
|
|
5d8379dc50 | ||
|
|
c084687f0e | ||
|
|
6617ed5244 | ||
|
|
583f16358e | ||
|
|
a1872b9d96 | ||
|
|
b2ed89bf23 | ||
|
|
27be9e53a0 | ||
|
|
fcb9e14b10 | ||
|
|
3a13898314 | ||
|
|
5c72c9d3e8 | ||
|
|
42da8a1ee9 |
@@ -1,5 +1,9 @@
|
||||
# ChangeLog
|
||||
|
||||
## v1.8.1 - 2024-03-22
|
||||
|
||||
- Update xyz_plot to support score mode
|
||||
|
||||
## v1.8.0 - 2024-03-19
|
||||
|
||||
- Update xyz_plot to support Z axis
|
||||
|
||||
+4
-1
@@ -4,7 +4,7 @@ from aiohttp import web
|
||||
import server
|
||||
|
||||
from .utils import collections_path, browser_path, sources_path, download_logs_path, outputs_path
|
||||
from .routes import sources, collections, config, files, downloads
|
||||
from .routes import sources, collections, config, files, downloads, xyz_plot as xyz_plot_routes
|
||||
from .nodes import select_inputs, load_image_by_url, xyz_plot, dify_text_generator, upload_to_remote
|
||||
|
||||
|
||||
@@ -32,6 +32,9 @@ browser_app.add_routes([
|
||||
web.get("/downloads", downloads.api_list_downloads),
|
||||
web.get("/downloads/{uuid}", downloads.api_show_download),
|
||||
|
||||
web.put("/xyz_plot/score", xyz_plot_routes.api_update_score),
|
||||
web.get("/xyz_plot/statistic", xyz_plot_routes.api_get_score_statistic),
|
||||
|
||||
web.static("/web", os.path.join(browser_path, 'web/build')),
|
||||
|
||||
web.static("/s/outputs", outputs_path),
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import shutil
|
||||
import time
|
||||
import requests
|
||||
import json
|
||||
from PIL import Image
|
||||
@@ -93,6 +95,8 @@ class XyzPlot:
|
||||
self.save_images(images)
|
||||
return ()
|
||||
|
||||
if os.path.exists(self.output_folder_name):
|
||||
shutil.move(self.output_folder_name, self.output_folder_name + f'_old_{int(time.time())}')
|
||||
|
||||
def filter_values(value):
|
||||
return list(filter(lambda x: x != '', value.split(";")))
|
||||
@@ -141,6 +145,7 @@ class XyzPlot:
|
||||
filename = self.get_filename(ix, iy, iz, i)
|
||||
preview_url = self.get_preview_url(output_folder_name, filename)
|
||||
zCeil.append({
|
||||
"uuid": ":".join([output_folder_name, str(ix), str(iy), str(iz), str(i)]),
|
||||
"type": "img",
|
||||
"src": preview_url,
|
||||
})
|
||||
@@ -155,6 +160,7 @@ class XyzPlot:
|
||||
filename = self.get_filename(ix, iy, -1, i)
|
||||
preview_url = self.get_preview_url(output_folder_name, filename)
|
||||
ceil.append({
|
||||
"uuid": ":".join([output_folder_name, str(ix), str(iy), "-1", str(i)]),
|
||||
"type": "img",
|
||||
"src": preview_url,
|
||||
})
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
import os
|
||||
from aiohttp import web
|
||||
import datetime
|
||||
import csv
|
||||
import json
|
||||
|
||||
import folder_paths
|
||||
|
||||
LOG_FILE_NAME = 'score_log.csv'
|
||||
|
||||
async def api_update_score(request):
|
||||
body = await request.json()
|
||||
user_uuid = body.get("user", "anonymous")
|
||||
source = body.get("source")
|
||||
score = body.get("score")
|
||||
|
||||
source_arr = source.split(":")
|
||||
if len(source_arr) != 5:
|
||||
return web.Response(status=404)
|
||||
|
||||
log_path = os.path.join(
|
||||
folder_paths.get_output_directory(),
|
||||
source_arr[0],
|
||||
LOG_FILE_NAME,
|
||||
)
|
||||
|
||||
dtstr = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S%Z")
|
||||
|
||||
# created_at, user_uuid, score, ix, iy, iz, index
|
||||
new_line = ",".join([dtstr, user_uuid, str(score), source_arr[1], source_arr[2], source_arr[3], source_arr[4]]) + '\n'
|
||||
if not os.path.exists(log_path):
|
||||
with open(log_path, "w", encoding="utf-8") as f:
|
||||
f.write(new_line)
|
||||
else:
|
||||
lines = []
|
||||
with open(log_path, "r", encoding="utf-8") as f:
|
||||
lines = f.readlines()
|
||||
pattern = ",".join([source_arr[1], source_arr[2], source_arr[3], source_arr[4]])
|
||||
lines = [line for line in lines if pattern not in line]
|
||||
lines.append(new_line)
|
||||
with open(log_path, "w", encoding="utf-8") as f:
|
||||
f.writelines(lines)
|
||||
|
||||
return web.Response(status=200)
|
||||
|
||||
async def api_get_score_statistic(request):
|
||||
target_path = request.query.get('path')
|
||||
if not target_path:
|
||||
return web.Response(status=404)
|
||||
|
||||
#/browser/s/outputs/xyz_plot_4/result.json
|
||||
if len(target_path.split('/')) < 5:
|
||||
return web.Response(status=400)
|
||||
|
||||
target_path = target_path.split('/')[4]
|
||||
log_path = os.path.join(
|
||||
folder_paths.get_output_directory(),
|
||||
target_path,
|
||||
LOG_FILE_NAME,
|
||||
)
|
||||
if not os.path.exists(log_path):
|
||||
return web.Response(status=404)
|
||||
|
||||
data = []
|
||||
with open(log_path, 'r', encoding='utf-8') as f:
|
||||
reader = csv.reader(f)
|
||||
for row in reader:
|
||||
data.append(row)
|
||||
|
||||
statistic = {}
|
||||
for row in data:
|
||||
if not row[3] in statistic:
|
||||
statistic[row[3]] = { 'total': 0 }
|
||||
if not row[4] in statistic[row[3]]:
|
||||
statistic[row[3]][row[4]] = { 'total': 0 }
|
||||
if not row[5] in statistic[row[3]][row[4]]:
|
||||
statistic[row[3]][row[4]][row[5]] = 0
|
||||
|
||||
statistic[row[3]][row[4]][row[5]] += int(row[2])
|
||||
statistic[row[3]][row[4]]['total'] += int(row[2])
|
||||
statistic[row[3]]['total'] += int(row[2])
|
||||
|
||||
result_path = os.path.join(
|
||||
folder_paths.get_output_directory(),
|
||||
target_path,
|
||||
'result.json',
|
||||
)
|
||||
xyz_result = []
|
||||
with open(result_path, 'r', encoding='utf-8') as f:
|
||||
xyz_result = json.load(f)['result']
|
||||
|
||||
stat_ret = []
|
||||
for ix, _ in enumerate(xyz_result):
|
||||
vy = xyz_result[ix]['children']
|
||||
rx = {
|
||||
'type': 'axis',
|
||||
'score': statistic.get(str(ix), {}).get('total', 0),
|
||||
'children': [],
|
||||
}
|
||||
for iy, _ in enumerate(vy):
|
||||
vz = vy[iy]['children']
|
||||
ry = {
|
||||
'type': 'axis',
|
||||
'score': statistic.get(str(ix), {}).get(str(iy), {}).get('total', 0),
|
||||
'children': [],
|
||||
}
|
||||
if vz[0]['type'] == 'img':
|
||||
ry['children'].append({
|
||||
'type': 'axis',
|
||||
'score': statistic.get(str(ix), {}).get(str(iy), {}).get('-1', 0),
|
||||
})
|
||||
else:
|
||||
for iz, _ in enumerate(vz):
|
||||
ry['children'].append({
|
||||
'type': 'axis',
|
||||
'score': statistic.get(str(ix), {}).get(str(iy), {}).get(str(iz), 0),
|
||||
})
|
||||
rx['children'].append(ry)
|
||||
stat_ret.append(rx)
|
||||
|
||||
|
||||
return web.json_response({
|
||||
'result': stat_ret,
|
||||
})
|
||||
Generated
+45
@@ -12,13 +12,16 @@
|
||||
"svelte-i18n": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@faker-js/faker": "^8.4.1",
|
||||
"@sveltejs/adapter-auto": "^3.0.1",
|
||||
"@sveltejs/adapter-static": "^3.0.1",
|
||||
"@sveltejs/kit": "^2.0.4",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.1",
|
||||
"@types/node": "^20.11.28",
|
||||
"@types/uuid": "^9.0.8",
|
||||
"autoprefixer": "^10.4.16",
|
||||
"daisyui": "^4.4.22",
|
||||
"dexie": "4.0.1-beta.14",
|
||||
"postcss": "^8.4.32",
|
||||
"sass": "^1.72.0",
|
||||
"svelte": "^4.2.8",
|
||||
@@ -26,6 +29,7 @@
|
||||
"tailwindcss": "^3.4.0",
|
||||
"tslib": "^2.6.2",
|
||||
"typescript": "^5.3.3",
|
||||
"uuid": "^9.0.1",
|
||||
"vite": "^5.0.10"
|
||||
}
|
||||
},
|
||||
@@ -398,6 +402,22 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@faker-js/faker": {
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.4.1.tgz",
|
||||
"integrity": "sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/fakerjs"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0",
|
||||
"npm": ">=6.14.13"
|
||||
}
|
||||
},
|
||||
"node_modules/@formatjs/ecma402-abstract": {
|
||||
"version": "1.18.0",
|
||||
"resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.18.0.tgz",
|
||||
@@ -839,6 +859,12 @@
|
||||
"integrity": "sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/uuid": {
|
||||
"version": "9.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz",
|
||||
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.11.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
|
||||
@@ -1302,6 +1328,12 @@
|
||||
"integrity": "sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/dexie": {
|
||||
"version": "4.0.1-beta.14",
|
||||
"resolved": "https://registry.npmjs.org/dexie/-/dexie-4.0.1-beta.14.tgz",
|
||||
"integrity": "sha512-1Glgs4nyHUriknstBku1T0Qz9qxJbHQy49JFeDEacHQK+XljN/sn1zyIH/HwouQ7a+WAdWHInm51i0GqWOAyHg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/didyoumean": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz",
|
||||
@@ -3068,6 +3100,19 @@
|
||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "9.0.1",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
|
||||
"integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
"https://github.com/sponsors/broofa",
|
||||
"https://github.com/sponsors/ctavan"
|
||||
],
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "5.0.10",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.0.10.tgz",
|
||||
|
||||
@@ -11,20 +11,26 @@
|
||||
"extract": "svelte-i18n extract './src/**/*.svelte' ./src/i18n/zh-CN.json && svelte-i18n extract './src/**/*.svelte' ./src/i18n/en-US.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@faker-js/faker": "^8.4.1",
|
||||
"@sveltejs/adapter-auto": "^3.0.1",
|
||||
"@sveltejs/adapter-static": "^3.0.1",
|
||||
"@sveltejs/kit": "^2.0.4",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.1",
|
||||
"@types/node": "^20.11.28",
|
||||
"@types/pubsub-js": "^1.8.6",
|
||||
"@types/uuid": "^9.0.8",
|
||||
"autoprefixer": "^10.4.16",
|
||||
"daisyui": "^4.4.22",
|
||||
"dexie": "4.0.1-beta.14",
|
||||
"postcss": "^8.4.32",
|
||||
"pubsub-js": "^1.9.4",
|
||||
"sass": "^1.72.0",
|
||||
"svelte": "^4.2.8",
|
||||
"svelte-check": "^3.6.2",
|
||||
"tailwindcss": "^3.4.0",
|
||||
"tslib": "^2.6.2",
|
||||
"typescript": "^5.3.3",
|
||||
"uuid": "^9.0.1",
|
||||
"vite": "^5.0.10"
|
||||
},
|
||||
"type": "module",
|
||||
|
||||
Generated
+44
@@ -13,6 +13,9 @@ dependencies:
|
||||
version: 4.0.0(svelte@4.2.8)
|
||||
|
||||
devDependencies:
|
||||
'@faker-js/faker':
|
||||
specifier: ^8.4.1
|
||||
version: 8.4.1
|
||||
'@sveltejs/adapter-auto':
|
||||
specifier: ^3.0.1
|
||||
version: 3.0.1(@sveltejs/kit@2.0.4)
|
||||
@@ -28,15 +31,27 @@ devDependencies:
|
||||
'@types/node':
|
||||
specifier: ^20.11.28
|
||||
version: 20.11.28
|
||||
'@types/pubsub-js':
|
||||
specifier: ^1.8.6
|
||||
version: 1.8.6
|
||||
'@types/uuid':
|
||||
specifier: ^9.0.8
|
||||
version: 9.0.8
|
||||
autoprefixer:
|
||||
specifier: ^10.4.16
|
||||
version: 10.4.16(postcss@8.4.32)
|
||||
daisyui:
|
||||
specifier: ^4.4.22
|
||||
version: 4.4.22(postcss@8.4.32)
|
||||
dexie:
|
||||
specifier: 4.0.1-beta.14
|
||||
version: 4.0.1-beta.14
|
||||
postcss:
|
||||
specifier: ^8.4.32
|
||||
version: 8.4.32
|
||||
pubsub-js:
|
||||
specifier: ^1.9.4
|
||||
version: 1.9.4
|
||||
sass:
|
||||
specifier: ^1.72.0
|
||||
version: 1.72.0
|
||||
@@ -55,6 +70,9 @@ devDependencies:
|
||||
typescript:
|
||||
specifier: ^5.3.3
|
||||
version: 5.3.3
|
||||
uuid:
|
||||
specifier: ^9.0.1
|
||||
version: 9.0.1
|
||||
vite:
|
||||
specifier: ^5.0.10
|
||||
version: 5.0.10(@types/node@20.11.28)(sass@1.72.0)
|
||||
@@ -257,6 +275,11 @@ packages:
|
||||
requiresBuild: true
|
||||
optional: true
|
||||
|
||||
/@faker-js/faker@8.4.1:
|
||||
resolution: {integrity: sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg==}
|
||||
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0, npm: '>=6.14.13'}
|
||||
dev: true
|
||||
|
||||
/@formatjs/ecma402-abstract@1.18.0:
|
||||
resolution: {integrity: sha512-PEVLoa3zBevWSCZzPIM/lvPCi8P5l4G+NXQMc/CjEiaCWgyHieUoo0nM7Bs0n/NbuQ6JpXEolivQ9pKSBHaDlA==}
|
||||
dependencies:
|
||||
@@ -542,10 +565,18 @@ packages:
|
||||
undici-types: 5.26.5
|
||||
dev: true
|
||||
|
||||
/@types/pubsub-js@1.8.6:
|
||||
resolution: {integrity: sha512-Kwug5cwV0paUDm/NfwDx1sp9xI0bGIvmWJjJWCU8NngkCCMt3EIC7oPDvb6fV7BR8kPpFyyBu4D11bda/2MdPA==}
|
||||
dev: true
|
||||
|
||||
/@types/pug@2.0.10:
|
||||
resolution: {integrity: sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==}
|
||||
dev: true
|
||||
|
||||
/@types/uuid@9.0.8:
|
||||
resolution: {integrity: sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==}
|
||||
dev: true
|
||||
|
||||
/acorn@8.11.2:
|
||||
resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==}
|
||||
engines: {node: '>=0.4.0'}
|
||||
@@ -771,6 +802,10 @@ packages:
|
||||
resolution: {integrity: sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==}
|
||||
dev: true
|
||||
|
||||
/dexie@4.0.1-beta.14:
|
||||
resolution: {integrity: sha512-1Glgs4nyHUriknstBku1T0Qz9qxJbHQy49JFeDEacHQK+XljN/sn1zyIH/HwouQ7a+WAdWHInm51i0GqWOAyHg==}
|
||||
dev: true
|
||||
|
||||
/didyoumean@1.2.2:
|
||||
resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}
|
||||
dev: true
|
||||
@@ -1321,6 +1356,10 @@ packages:
|
||||
source-map-js: 1.0.2
|
||||
dev: true
|
||||
|
||||
/pubsub-js@1.9.4:
|
||||
resolution: {integrity: sha512-hJYpaDvPH4w8ZX/0Fdf9ma1AwRgU353GfbaVfPjfJQf1KxZ2iHaHl3fAUw1qlJIR5dr4F3RzjGaWohYUEyoh7A==}
|
||||
dev: true
|
||||
|
||||
/queue-microtask@1.2.3:
|
||||
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
|
||||
dev: true
|
||||
@@ -1698,6 +1737,11 @@ packages:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
dev: true
|
||||
|
||||
/uuid@9.0.1:
|
||||
resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/vite@5.0.10(@types/node@20.11.28)(sass@1.72.0):
|
||||
resolution: {integrity: sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw==}
|
||||
engines: {node: ^18.0.0 || >=20.0.0}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
import Dexie, { type Table } from 'dexie';
|
||||
export interface User {
|
||||
uuid: string;
|
||||
name: string;
|
||||
ctime: number;
|
||||
mtime: number;
|
||||
}
|
||||
|
||||
export interface Score {
|
||||
uuid: string;
|
||||
score: number;
|
||||
link?: string;
|
||||
ctime: number;
|
||||
mtime: number;
|
||||
}
|
||||
|
||||
export class ScoreDB extends Dexie {
|
||||
user!: Table<User>;
|
||||
scoreboard!: Table<Score>;
|
||||
|
||||
constructor() {
|
||||
super('scores');
|
||||
this.version(1).stores({
|
||||
user: 'uuid, name, ctime, mtime',
|
||||
scoreboard: 'uuid, score, link, ctime, mtime',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const db = new ScoreDB();
|
||||
|
||||
export function getUser() {
|
||||
return db.user.toArray().then((d) => (d.length > 0 ? d[0] : null));
|
||||
}
|
||||
|
||||
export function getScore(uuid: string) {
|
||||
return db.scoreboard
|
||||
.where('uuid')
|
||||
.equals(uuid)
|
||||
.toArray()
|
||||
.then((d) => (d.length > 0 ? d[0] : null));
|
||||
}
|
||||
|
||||
export function updateScore(
|
||||
uuid: string,
|
||||
value: Partial<Omit<Score, 'ctime' | 'mtime' | 'uuid'>>
|
||||
) {
|
||||
return db.scoreboard.where('uuid').equals(uuid).modify({
|
||||
link: value.link,
|
||||
score: value.score,
|
||||
mtime: Date.now(),
|
||||
});
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { TableMode, imageWidth, mode } from './store';
|
||||
|
||||
export let extraItems:
|
||||
| undefined
|
||||
| {
|
||||
@@ -7,6 +9,16 @@
|
||||
}[] = undefined;
|
||||
|
||||
export let sidebarItems: typeof extraItems = undefined;
|
||||
|
||||
let _imageWidth = 180;
|
||||
let _mode = TableMode.View;
|
||||
|
||||
mode.subscribe((v) => {
|
||||
_mode = v;
|
||||
});
|
||||
$: {
|
||||
imageWidth.set(_imageWidth);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="drawer absolute h-full w-full overflow-y-hidden">
|
||||
@@ -41,14 +53,38 @@
|
||||
<div class="flex-none">
|
||||
{#if extraItems}
|
||||
<ul class="menu menu-horizontal items-center">
|
||||
<slot name="extra" />
|
||||
<li>
|
||||
<div>
|
||||
<input
|
||||
type="range"
|
||||
min="30"
|
||||
max="300"
|
||||
bind:value={_imageWidth}
|
||||
class="range"
|
||||
/>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
{#each extraItems as item}
|
||||
<li>
|
||||
<a on:click={item.onClick}>
|
||||
<button on:click={item.onClick}>
|
||||
{item.label}
|
||||
</a>
|
||||
</button>
|
||||
</li>
|
||||
{/each}
|
||||
<li>
|
||||
<button
|
||||
on:click={() => {
|
||||
if (_mode === TableMode.Score) {
|
||||
mode.set(TableMode.View);
|
||||
} else {
|
||||
mode.set(TableMode.Score);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{_mode === TableMode.Score ? 'Score' : 'View'}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -1,29 +1,35 @@
|
||||
export interface Payload {
|
||||
workflow: Workflow
|
||||
annotations: Annotation[],
|
||||
result: Axis[]
|
||||
export interface Payload {
|
||||
workflow: Workflow;
|
||||
annotations: Annotation[];
|
||||
result: Axis[];
|
||||
}
|
||||
|
||||
export interface Workflow {
|
||||
url: string
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface Annotation {
|
||||
axis: string
|
||||
key: string
|
||||
type: string
|
||||
axis: string;
|
||||
key: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface Axis {
|
||||
type: 'axis',
|
||||
value: string
|
||||
children: AxisValue[]
|
||||
type: 'axis';
|
||||
value: string;
|
||||
children: AxisValue[];
|
||||
}
|
||||
|
||||
export type AxisValue = Axis | ImgResult
|
||||
export type AxisValue = Axis | ImgResult;
|
||||
|
||||
export interface ImgResult {
|
||||
type: 'img',
|
||||
uuid: string,
|
||||
src: string
|
||||
}
|
||||
type: 'img';
|
||||
uuid: string;
|
||||
src: string;
|
||||
}
|
||||
|
||||
export interface AxisScore {
|
||||
type: 'axis';
|
||||
score: number;
|
||||
children?: AxisScore[];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<script lang="ts">
|
||||
export let score: number;
|
||||
</script>
|
||||
|
||||
<span>
|
||||
({score})
|
||||
</span>
|
||||
@@ -1,3 +1,19 @@
|
||||
import { writable } from "svelte/store";
|
||||
import { writable } from 'svelte/store';
|
||||
import PubSub from 'pubsub-js';
|
||||
|
||||
export const imageWidth = writable(50)
|
||||
export const imageWidth = writable(50);
|
||||
export const comfyUrl = writable('');
|
||||
|
||||
export enum TableMode {
|
||||
Score,
|
||||
View,
|
||||
}
|
||||
export const mode = writable(TableMode.View);
|
||||
|
||||
export function createRefetchStatisticPublisher() {
|
||||
return () => PubSub.publish('refetch-statistics');
|
||||
}
|
||||
|
||||
export function createRefetchStatisticSubscriber(fn: () => void) {
|
||||
return PubSub.subscribe('refetch-statistics', fn);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,40 @@
|
||||
<script lang="ts">
|
||||
import type { Axis } from './models';
|
||||
import Score from './score.svelte';
|
||||
import type { Axis, AxisScore } from './models';
|
||||
import TableHolder from './table-holder.svelte';
|
||||
import { el } from '@faker-js/faker';
|
||||
import { zip } from './utils';
|
||||
export let axis: Axis;
|
||||
export let score: AxisScore | undefined;
|
||||
</script>
|
||||
|
||||
<tr>
|
||||
<!-- prompts -->
|
||||
<th>{axis.value}</th>
|
||||
{#each axis.children as dim2}
|
||||
{#if dim2.type === 'axis'}
|
||||
<td>
|
||||
{#each dim2.children as dim3}
|
||||
<TableHolder value={dim3}></TableHolder>
|
||||
{/each}
|
||||
</td>
|
||||
<th style="max-width:30vw" class="z-10">
|
||||
{axis.value}
|
||||
{#if score}
|
||||
<Score score={score.score} />
|
||||
{/if}
|
||||
{/each}
|
||||
</th>
|
||||
{#if score && score.children}
|
||||
{#each zip(axis.children, score.children) as [dim2, score2]}
|
||||
{#if dim2.type === 'axis' && score2.children}
|
||||
<td>
|
||||
{#each zip(dim2.children, score2.children) as [dim3, score3]}
|
||||
<TableHolder value={dim3} score={score3}></TableHolder>
|
||||
{/each}
|
||||
</td>
|
||||
{/if}
|
||||
{/each}
|
||||
{:else}
|
||||
{#each axis.children as dim2}
|
||||
{#if dim2.type === 'axis'}
|
||||
<td>
|
||||
{#each dim2.children as dim3}
|
||||
<TableHolder value={dim3} score={undefined}></TableHolder>
|
||||
{/each}
|
||||
</td>
|
||||
{/if}
|
||||
{/each}
|
||||
{/if}
|
||||
</tr>
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
<script lang="ts">
|
||||
import type { Axis } from './models';
|
||||
import type { Axis, AxisScore } from './models';
|
||||
import Score from './score.svelte';
|
||||
import TableHolder from './table-holder.svelte';
|
||||
export let value: Axis;
|
||||
export let score: AxisScore | undefined;
|
||||
</script>
|
||||
|
||||
<div class="m-1 border">
|
||||
<div class="m-1 border box-border inline-block">
|
||||
<div class="text-center font-bold">
|
||||
{value.value}
|
||||
{#if score}
|
||||
<Score score={score.score} />
|
||||
{/if}
|
||||
</div>
|
||||
<div class="flex justify-around my-1">
|
||||
{#each value.children as item}
|
||||
<TableHolder value={item} />
|
||||
<TableHolder value={item} {score} />
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,118 @@
|
||||
<script lang="ts">
|
||||
import type { ImgResult } from './models';
|
||||
import { imageWidth } from './store';
|
||||
import { TableMode, comfyUrl, imageWidth, mode } from './store';
|
||||
import { db, getScore, getUser, updateScore, type User } from '$lib/db';
|
||||
export let value: ImgResult;
|
||||
export let width = 100;
|
||||
import { createRefetchStatisticPublisher } from './store';
|
||||
let refetch = createRefetchStatisticPublisher();
|
||||
let api = '';
|
||||
comfyUrl.subscribe((d) => (api = d));
|
||||
|
||||
let like = false;
|
||||
let _mode = TableMode.View;
|
||||
imageWidth.subscribe((d) => {
|
||||
width = d;
|
||||
});
|
||||
|
||||
mode.subscribe((v) => {
|
||||
_mode = v;
|
||||
if (v === TableMode.Score && value.uuid)
|
||||
db.scoreboard
|
||||
.where('uuid')
|
||||
.equals(value.uuid)
|
||||
.toArray()
|
||||
.then((arr) => {
|
||||
if (arr.length > 0 && arr[0].score > 0) {
|
||||
like = true;
|
||||
} else {
|
||||
like = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function updateSelfScore(score: number) {
|
||||
return updateScore(value.uuid, { score });
|
||||
}
|
||||
|
||||
async function onLike() {
|
||||
const { score } = (await getScore(value.uuid)) ?? {};
|
||||
if (score === undefined) {
|
||||
await db.scoreboard.add({
|
||||
uuid: value.uuid,
|
||||
score: 1,
|
||||
link: value.src,
|
||||
ctime: Date.now(),
|
||||
mtime: Date.now(),
|
||||
});
|
||||
} else if (score === 1) {
|
||||
return;
|
||||
} else {
|
||||
await updateSelfScore(1);
|
||||
}
|
||||
return apiUpdateScore(1)
|
||||
.then(async (res) => {
|
||||
if (res && res.ok) {
|
||||
like = true;
|
||||
refetch();
|
||||
} else await updateSelfScore(0);
|
||||
})
|
||||
.catch(() => {
|
||||
updateSelfScore(0);
|
||||
});
|
||||
}
|
||||
|
||||
async function onDislike() {
|
||||
const { score } = (await getScore(value.uuid)) ?? {};
|
||||
if (score === undefined || score === 0) {
|
||||
return;
|
||||
}
|
||||
await updateSelfScore(0);
|
||||
return apiUpdateScore(0)
|
||||
.then(async (res) => {
|
||||
if (res && res.ok) {
|
||||
like = false;
|
||||
refetch();
|
||||
} else await updateSelfScore(1);
|
||||
})
|
||||
.catch(() => {
|
||||
updateSelfScore(1);
|
||||
});
|
||||
}
|
||||
|
||||
async function apiUpdateScore(score: number) {
|
||||
const user = await getUser();
|
||||
if (!user) return;
|
||||
return fetch(api + '/browser/xyz_plot/score', {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({
|
||||
user: user.name,
|
||||
source: value.uuid,
|
||||
score,
|
||||
}),
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="px-0.5">
|
||||
<img style={`width:${width}px`} src={value.src} alt={value.uuid} />
|
||||
<div class="px-0.5 box-border inline-block relative" style={`width:${width}px`}>
|
||||
<img
|
||||
class="w-full"
|
||||
src={value.src}
|
||||
alt={value.uuid}
|
||||
style={`width:${width}px`}
|
||||
/>
|
||||
{#if _mode === TableMode.Score}
|
||||
<button
|
||||
class="absolute w-full h-full top-0 left-0 flex justify-end items-end p-1"
|
||||
tabindex="0"
|
||||
on:click={like ? onDislike : onLike}
|
||||
>
|
||||
<svg class="inline-block w-1/4" viewBox="0 0 1024 1024">
|
||||
<path
|
||||
d="M725.333333 192c-89.6 0-168.533333 44.8-213.333333 115.2C467.2 236.8 388.266667 192 298.666667 192 157.866667 192 42.666667 307.2 42.666667 448c0 253.866667 469.333333 512 469.333333 512s469.333333-256 469.333333-512c0-140.8-115.2-256-256-256z"
|
||||
fill={like ? '#F44336' : 'grey'}
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
<script lang="ts">
|
||||
import type { AxisValue } from './models';
|
||||
import type { AxisScore, AxisValue } from './models';
|
||||
import TableCellAxis from './table-cell-axis.svelte';
|
||||
import TableCellImg from './table-cell-img.svelte';
|
||||
|
||||
export let value: AxisValue;
|
||||
export let score: AxisScore | undefined;
|
||||
</script>
|
||||
|
||||
<div>
|
||||
{#if value.type === 'img'}
|
||||
<TableCellImg {value} />
|
||||
{:else if value.type === 'axis'}
|
||||
<TableCellAxis {value} />
|
||||
{/if}
|
||||
</div>
|
||||
{#if value.type === 'img'}
|
||||
<TableCellImg {value} />
|
||||
{:else if value.type === 'axis'}
|
||||
<TableCellAxis {value} bind:score />
|
||||
{/if}
|
||||
|
||||
@@ -1,27 +1,67 @@
|
||||
<script lang="ts">
|
||||
import type { Payload } from './models';
|
||||
import { el } from '@faker-js/faker';
|
||||
import type { AxisScore, Payload } from './models';
|
||||
import Score from './score.svelte';
|
||||
import TableAxis from './table-axis.svelte';
|
||||
import { zip } from './utils';
|
||||
export let height: number = 0;
|
||||
export let payload: Payload;
|
||||
console.log({ height });
|
||||
export let scores: AxisScore[] | undefined = undefined;
|
||||
|
||||
let headScore: AxisScore[] | undefined = undefined;
|
||||
$: headScore = scores
|
||||
? scores[0]
|
||||
.children!.map(
|
||||
(d) =>
|
||||
JSON.parse(
|
||||
JSON.stringify({ ...d, children: undefined }),
|
||||
) as AxisScore,
|
||||
)
|
||||
.map((axis, idx) => ({
|
||||
...axis,
|
||||
score:
|
||||
scores
|
||||
?.map((axis) => axis.children![idx].score)
|
||||
.reduce((a, b) => a + b) ?? 0,
|
||||
}))
|
||||
: undefined;
|
||||
</script>
|
||||
|
||||
<div class="overflow-x-auto w-full" style={`max-height: ${height}px`}>
|
||||
<div
|
||||
class="overflow-x-auto max-w-full inline-block"
|
||||
style={`max-height: ${height}px`}
|
||||
>
|
||||
<table class="table table-xs table-pin-rows table-pin-cols table-zebra-grey">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
{#each payload.result[0].children as r}
|
||||
{#if r.type === 'axis'}
|
||||
<td>{r.value}</td>
|
||||
{/if}
|
||||
{/each}
|
||||
{#if headScore}
|
||||
{#each zip(payload.result[0].children, headScore) as [axis, score]}
|
||||
{#if axis.type === 'axis'}
|
||||
<td class="text-wrap">
|
||||
{axis.value}<Score score={score.score} />
|
||||
</td>
|
||||
{/if}
|
||||
{/each}
|
||||
{:else}
|
||||
{#each payload.result[0].children as axis}
|
||||
{#if axis.type === 'axis'}
|
||||
<td class="text-wrap">{axis.value}</td>
|
||||
{/if}
|
||||
{/each}
|
||||
{/if}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each payload.result as axis}
|
||||
<TableAxis {axis} />
|
||||
{/each}
|
||||
{#if scores}
|
||||
{#each zip(payload.result, scores) as [axis, score]}
|
||||
<TableAxis {axis} {score} />
|
||||
{/each}
|
||||
{:else}
|
||||
{#each payload.result as axis}
|
||||
<TableAxis {axis} score={undefined} />
|
||||
{/each}
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export function zip<T = unknown, U = unknown>(arr1: T[], arr2: U[]): [T, U][] {
|
||||
return Array.from({ length: arr1.length }).map((_, i) => [arr1[i], arr2[i]]);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { faker } from '@faker-js/faker';
|
||||
|
||||
export function fakeUsername() {
|
||||
const now = Date.now();
|
||||
const suf = now.toString(32);
|
||||
return `${faker.person.lastName()}_${suf}`;
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import MultiDimTable from '$lib/multi-dim-table/layout.svelte';
|
||||
import MultiDimTableLayout from '$lib/multi-dim-table/layout.svelte';
|
||||
import AnalyzeTable from '$lib/multi-dim-table/table.svelte';
|
||||
import { imageWidth } from '$lib/multi-dim-table/store';
|
||||
import {
|
||||
comfyUrl,
|
||||
createRefetchStatisticPublisher,
|
||||
} from '$lib/multi-dim-table/store';
|
||||
import InfoIcon from '$lib/icons/info.svelte';
|
||||
import { db, getUser } from '$lib/db';
|
||||
import { v1 as uuid } from 'uuid';
|
||||
import { fakeUsername } from '$lib/random';
|
||||
import { createRefetchStatisticSubscriber } from '$lib/multi-dim-table/store';
|
||||
|
||||
/** @type {import('./$types').PageData} */
|
||||
export let data;
|
||||
@@ -11,7 +18,11 @@
|
||||
/** @type {string | null} */
|
||||
export let path;
|
||||
|
||||
/** @type {import('$lib/multi-dim-table/models').AxisScore[]} */
|
||||
let scores;
|
||||
|
||||
$: ({ path } = data);
|
||||
$: comfyUrl.set(data.comfyUrl);
|
||||
|
||||
let mounted = false;
|
||||
|
||||
@@ -22,8 +33,19 @@
|
||||
/**@type {HTMLElement | undefined}*/
|
||||
let tableContainerRef;
|
||||
|
||||
createRefetchStatisticSubscriber(() => {
|
||||
fetch(data.comfyUrl + '/browser/xyz_plot/statistic?path=' + data.path)
|
||||
.then(async (d) => {
|
||||
if (d.ok) {
|
||||
scores = await d.json().then((d) => d.result);
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
const refetch = createRefetchStatisticPublisher();
|
||||
|
||||
$: {
|
||||
if (mounted && path !== null) {
|
||||
if (mounted && path) {
|
||||
loading = true;
|
||||
fetch(path)
|
||||
.then((d) => d.json())
|
||||
@@ -34,15 +56,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
mounted = true;
|
||||
});
|
||||
|
||||
let _imageWidth = 50;
|
||||
|
||||
$: {
|
||||
imageWidth.set(_imageWidth);
|
||||
if (mounted && path) {
|
||||
refetch();
|
||||
}
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
mounted = true;
|
||||
const user = await getUser();
|
||||
if (!user) {
|
||||
db.user.add({
|
||||
uuid: uuid(),
|
||||
name: fakeUsername(),
|
||||
ctime: Date.now(),
|
||||
mtime: Date.now(),
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if typeof data.path === 'string' && data.path.length > 0}
|
||||
@@ -53,7 +84,7 @@
|
||||
{:else if !payload}
|
||||
null
|
||||
{:else}
|
||||
<MultiDimTable
|
||||
<MultiDimTableLayout
|
||||
extraItems={[
|
||||
{
|
||||
label: 'Open Workflow',
|
||||
@@ -64,8 +95,7 @@
|
||||
]}
|
||||
>
|
||||
<div slot="title">
|
||||
XYZ Plots
|
||||
|
||||
XYZ Plot
|
||||
<div
|
||||
class="tooltip tooltip-bottom z-10 before:whitespace-pre-wrap"
|
||||
data-tip={payload.annotations
|
||||
@@ -75,21 +105,14 @@
|
||||
<InfoIcon />
|
||||
</div>
|
||||
</div>
|
||||
<li slot="extra">
|
||||
<div>
|
||||
<input
|
||||
type="range"
|
||||
min="5"
|
||||
max="300"
|
||||
bind:value={_imageWidth}
|
||||
class="range"
|
||||
/>
|
||||
</div>
|
||||
</li>
|
||||
<div class="w-full h-full" bind:this={tableContainerRef}>
|
||||
<AnalyzeTable {payload} height={tableContainerRef?.clientHeight ?? 0} />
|
||||
<AnalyzeTable
|
||||
bind:payload
|
||||
bind:scores
|
||||
height={tableContainerRef?.clientHeight ?? 0}
|
||||
/>
|
||||
</div>
|
||||
</MultiDimTable>
|
||||
</MultiDimTableLayout>
|
||||
{/if}
|
||||
{:else}
|
||||
Invalid Path
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
var o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}export{o as c,l as g};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
import{w as u}from"./index.Bo7-JXlm.js";const b=globalThis.__sveltekit_1ttigzj?.base??"",v=globalThis.__sveltekit_1ttigzj?.assets??b,k="1710838092511",R="sveltekit:snapshot",T="sveltekit:scroll",w="sveltekit:states",I="sveltekit:pageurl",S="sveltekit:history",y="sveltekit:navigation",f={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},_=location.origin;function N(t){if(t instanceof URL)return t;let e=document.baseURI;if(!e){const n=document.getElementsByTagName("base");e=n.length?n[0].href:document.URL}return new URL(t,e)}function U(){return{x:pageXOffset,y:pageYOffset}}function c(t,e){return t.getAttribute(`data-sveltekit-${e}`)}const d={...f,"":f.hover};function g(t){let e=t.assignedSlot??t.parentNode;return e?.nodeType===11&&(e=e.host),e}function L(t,e){for(;t&&t!==e;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=g(t)}}function O(t,e){let n;try{n=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI)}catch{}const a=t instanceof SVGAElement?t.target.baseVal:t.target,r=!n||!!a||m(n,e)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),l=n?.origin===_&&t.hasAttribute("download");return{url:n,external:r,target:a,download:l}}function Y(t){let e=null,n=null,a=null,r=null,l=null,o=null,s=t;for(;s&&s!==document.documentElement;)a===null&&(a=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),e===null&&(e=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),o===null&&(o=c(s,"replacestate")),s=g(s);function i(h){switch(h){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:d[a??"off"],preload_data:d[r??"off"],keepfocus:i(e),noscroll:i(n),reload:i(l),replace_state:i(o)}}function p(t){const e=u(t);let n=!0;function a(){n=!0,e.update(o=>o)}function r(o){n=!1,e.set(o)}function l(o){let s;return e.subscribe(i=>{(s===void 0||n&&i!==s)&&o(s=i)})}return{notify:a,set:r,subscribe:l}}function E(){const{set:t,subscribe:e}=u(!1);let n;async function a(){clearTimeout(n);try{const r=await fetch(`${v}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const o=(await r.json()).version!==k;return o&&(t(!0),clearTimeout(n)),o}catch{return!1}}return{subscribe:e,check:a}}function m(t,e){return t.origin!==_||!t.pathname.startsWith(e)}function j(t){t.client}const x={url:p({}),page:p({}),navigating:u(null),updated:E()};export{S as H,y as N,I as P,T as S,w as a,R as b,Y as c,x as d,b as e,L as f,O as g,f as h,m as i,j,_ as o,N as r,U as s};
|
||||
@@ -0,0 +1 @@
|
||||
import{w as u}from"./index.Bo7-JXlm.js";const b=globalThis.__sveltekit_19afu?.base??"",v=globalThis.__sveltekit_19afu?.assets??b,k="1711098245920",R="sveltekit:snapshot",T="sveltekit:scroll",w="sveltekit:states",I="sveltekit:pageurl",S="sveltekit:history",y="sveltekit:navigation",f={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},_=location.origin;function N(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function U(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function g(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function L(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=g(e)}}function O(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||m(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=n?.origin===_&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function Y(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),a===null&&(a=c(s,"replacestate")),s=g(s);function i(h){switch(h){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:d[o??"off"],preload_data:d[r??"off"],keepfocus:i(t),noscroll:i(n),reload:i(l),replace_state:i(a)}}function p(e){const t=u(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&a(s=i)})}return{notify:o,set:r,subscribe:l}}function E(){const{set:e,subscribe:t}=u(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${v}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==k;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function m(e,t){return e.origin!==_||!e.pathname.startsWith(t)}function x(e){e.client}const P={url:p({}),page:p({}),navigating:u(null),updated:E()};export{S as H,y as N,I as P,T as S,w as a,R as b,Y as c,P as d,b as e,L as f,O as g,f as h,m as i,x as j,_ as o,N as r,U as s};
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,4 +1,4 @@
|
||||
import{_ as c}from"../chunks/preload-helper.0HuHagjb.js";import{r as u,g as n,i as _,$ as f,w as m}from"../chunks/runtime.AyegV5ce.js";import{s as p,c as g,u as d,g as $,d as L}from"../chunks/scheduler.Tg1fnMp_.js";import{S as y,i as S,d as v,t as b}from"../chunks/index.xa2X6v7V.js";u("en-US",()=>c(()=>import("../chunks/en-US.JAQIzv30.js"),__vite__mapDeps([]),import.meta.url));u("zh-CN",()=>c(()=>import("../chunks/zh-CN.giVTFcLQ.js"),__vite__mapDeps([]),import.meta.url));const r="lang",h="en-US";let i=window.navigator.language;n()&&(i=n());localStorage.getItem(r)&&(i=localStorage.getItem(r));_({fallbackLocale:h,initialLocale:i,handleMissingMessage:o=>o.id.split(".").pop()});f.subscribe(o=>{localStorage.setItem(r,o)});const w=!0;async function I({url:o}){await m();let a="";return typeof process>"u"&&(a=o.searchParams.get("comfyUrl")||""),{comfyUrl:a}}const j=Object.freeze(Object.defineProperty({__proto__:null,load:I,prerender:w},Symbol.toStringTag,{value:"Module"}));function P(o){let a;const s=o[1].default,t=g(s,o,o[0],null);return{c(){t&&t.c()},l(e){t&&t.l(e)},m(e,l){t&&t.m(e,l),a=!0},p(e,[l]){t&&t.p&&(!a||l&1)&&d(t,s,e,e[0],a?L(s,e[0],l,null):$(e[0]),null)},i(e){a||(v(t,e),a=!0)},o(e){b(t,e),a=!1},d(e){t&&t.d(e)}}}function E(o,a,s){let{$$slots:t={},$$scope:e}=a;return o.$$set=l=>{"$$scope"in l&&s(0,e=l.$$scope)},[e,t]}class z extends y{constructor(a){super(),S(this,a,E,P,p,{})}}export{z as component,j as universal};
|
||||
import{_ as c}from"../chunks/preload-helper.0HuHagjb.js";import{r as u,g as n,i as _,$ as f,w as m}from"../chunks/runtime.bOPOS4G5.js";import{s as p,c as g,u as d,g as $,d as L}from"../chunks/scheduler.Tg1fnMp_.js";import{S as y,i as S,d as v,t as b}from"../chunks/index.xa2X6v7V.js";u("en-US",()=>c(()=>import("../chunks/en-US.JAQIzv30.js"),__vite__mapDeps([]),import.meta.url));u("zh-CN",()=>c(()=>import("../chunks/zh-CN.giVTFcLQ.js"),__vite__mapDeps([]),import.meta.url));const r="lang",h="en-US";let i=window.navigator.language;n()&&(i=n());localStorage.getItem(r)&&(i=localStorage.getItem(r));_({fallbackLocale:h,initialLocale:i,handleMissingMessage:o=>o.id.split(".").pop()});f.subscribe(o=>{localStorage.setItem(r,o)});const w=!0;async function I({url:o}){await m();let a="";return typeof process>"u"&&(a=o.searchParams.get("comfyUrl")||""),{comfyUrl:a}}const j=Object.freeze(Object.defineProperty({__proto__:null,load:I,prerender:w},Symbol.toStringTag,{value:"Module"}));function P(o){let a;const s=o[1].default,t=g(s,o,o[0],null);return{c(){t&&t.c()},l(e){t&&t.l(e)},m(e,l){t&&t.m(e,l),a=!0},p(e,[l]){t&&t.p&&(!a||l&1)&&d(t,s,e,e[0],a?L(s,e[0],l,null):$(e[0]),null)},i(e){a||(v(t,e),a=!0)},o(e){b(t,e),a=!1},d(e){t&&t.d(e)}}}function E(o,a,s){let{$$slots:t={},$$scope:e}=a;return o.$$set=l=>{"$$scope"in l&&s(0,e=l.$$scope)},[e,t]}class z extends y{constructor(a){super(),S(this,a,E,P,p,{})}}export{z as component,j as universal};
|
||||
function __vite__mapDeps(indexes) {
|
||||
if (!__vite__mapDeps.viteFileDeps) {
|
||||
__vite__mapDeps.viteFileDeps = []
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{s as E,n as b,e as x}from"../chunks/scheduler.Tg1fnMp_.js";import{S,i as j,g as _,m as f,s as q,h as d,j as g,n as h,f as p,c as y,a as l,x as v,o as $}from"../chunks/index.xa2X6v7V.js";import{d as C}from"../chunks/singletons.SwlEVgLy.js";const H=()=>{const s=C;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},P={subscribe(s){return H().page.subscribe(s)}};function k(s){let t,r=s[0].status+"",o,n,i,c=s[0].error?.message+"",u;return{c(){t=_("h1"),o=f(r),n=q(),i=_("p"),u=f(c)},l(e){t=d(e,"H1",{});var a=g(t);o=h(a,r),a.forEach(p),n=y(e),i=d(e,"P",{});var m=g(i);u=h(m,c),m.forEach(p)},m(e,a){l(e,t,a),v(t,o),l(e,n,a),l(e,i,a),v(i,u)},p(e,[a]){a&1&&r!==(r=e[0].status+"")&&$(o,r),a&1&&c!==(c=e[0].error?.message+"")&&$(u,c)},i:b,o:b,d(e){e&&(p(t),p(n),p(i))}}}function w(s,t,r){let o;return x(s,P,n=>r(0,o=n)),[o]}let D=class extends S{constructor(t){super(),j(this,t,w,k,E,{})}};export{D as component};
|
||||
import{s as E,n as b,e as x}from"../chunks/scheduler.Tg1fnMp_.js";import{S,i as j,g as _,m as f,s as q,h as d,j as g,n as h,f as p,c as y,a as l,x as v,o as $}from"../chunks/index.xa2X6v7V.js";import{d as C}from"../chunks/singletons.b6n7ppVR.js";const H=()=>{const s=C;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},P={subscribe(s){return H().page.subscribe(s)}};function k(s){let t,r=s[0].status+"",o,n,i,c=s[0].error?.message+"",u;return{c(){t=_("h1"),o=f(r),n=q(),i=_("p"),u=f(c)},l(e){t=d(e,"H1",{});var a=g(t);o=h(a,r),a.forEach(p),n=y(e),i=d(e,"P",{});var m=g(i);u=h(m,c),m.forEach(p)},m(e,a){l(e,t,a),v(t,o),l(e,n,a),l(e,i,a),v(i,u)},p(e,[a]){a&1&&r!==(r=e[0].status+"")&&$(o,r),a&1&&c!==(c=e[0].error?.message+"")&&$(u,c)},i:b,o:b,d(e){e&&(p(t),p(n),p(i))}}}function w(s,t,r){let o;return x(s,P,n=>r(0,o=n)),[o]}let D=class extends S{constructor(t){super(),j(this,t,w,k,E,{})}};export{D as component};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{w as r}from"../chunks/runtime.AyegV5ce.js";import{s as l,c as i,u,g as f,d as c}from"../chunks/scheduler.Tg1fnMp_.js";import{S as _,i as p,d as m,t as d}from"../chunks/index.xa2X6v7V.js";async function g({url:o}){return await r(),typeof process>"u"?{path:o.searchParams.get("path")}:{}}const v=Object.freeze(Object.defineProperty({__proto__:null,load:g},Symbol.toStringTag,{value:"Module"}));function $(o){let s;const n=o[1].default,e=i(n,o,o[0],null);return{c(){e&&e.c()},l(t){e&&e.l(t)},m(t,a){e&&e.m(t,a),s=!0},p(t,[a]){e&&e.p&&(!s||a&1)&&u(e,n,t,t[0],s?c(n,t[0],a,null):f(t[0]),null)},i(t){s||(m(e,t),s=!0)},o(t){d(e,t),s=!1},d(t){e&&e.d(t)}}}function h(o,s,n){let{$$slots:e={},$$scope:t}=s;return o.$$set=a=>{"$$scope"in a&&n(0,t=a.$$scope)},[t,e]}class w extends _{constructor(s){super(),p(this,s,h,$,l,{})}}export{w as component,v as universal};
|
||||
import{w as r}from"../chunks/runtime.bOPOS4G5.js";import{s as l,c as i,u,g as f,d as c}from"../chunks/scheduler.Tg1fnMp_.js";import{S as _,i as p,d as m,t as d}from"../chunks/index.xa2X6v7V.js";async function g({url:o}){return await r(),typeof process>"u"?{path:o.searchParams.get("path")}:{}}const v=Object.freeze(Object.defineProperty({__proto__:null,load:g},Symbol.toStringTag,{value:"Module"}));function $(o){let s;const n=o[1].default,e=i(n,o,o[0],null);return{c(){e&&e.c()},l(t){e&&e.l(t)},m(t,a){e&&e.m(t,a),s=!0},p(t,[a]){e&&e.p&&(!s||a&1)&&u(e,n,t,t[0],s?c(n,t[0],a,null):f(t[0]),null)},i(t){s||(m(e,t),s=!0)},o(t){d(e,t),s=!1},d(t){e&&e.d(t)}}}function h(o,s,n){let{$$slots:e={},$$scope:t}=s;return o.$$set=a=>{"$$scope"in a&&n(0,t=a.$$scope)},[t,e]}class w extends _{constructor(s){super(),p(this,s,h,$,l,{})}}export{w as component,v as universal};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":"1710838092511"}
|
||||
{"version":"1711098245920"}
|
||||
+11
-10
@@ -5,17 +5,18 @@
|
||||
<link rel="icon" href="./favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<link href="./_app/immutable/assets/0.whLgwaPV.css" rel="stylesheet">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/start.Gdbbwk-X.js">
|
||||
<link href="./_app/immutable/assets/0.sGZW4pel.css" rel="stylesheet">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/start.WorQkyMw.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/scheduler.Tg1fnMp_.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.SwlEVgLy.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.b6n7ppVR.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/index.Bo7-JXlm.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/app.TunG-itD.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/app.qKAh-8tw.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/preload-helper.0HuHagjb.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/index.xa2X6v7V.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/0.qqxLW6jL.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/runtime.AyegV5ce.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/3.uBIKDpRF.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/0.DDyQKHBy.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/runtime.bOPOS4G5.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/_commonjsHelpers.5-cIlDoe.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/3.Lf9V4hWY.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/each.-oqiv04n.js">
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
@@ -23,7 +24,7 @@
|
||||
|
||||
<script>
|
||||
{
|
||||
__sveltekit_1ttigzj = {
|
||||
__sveltekit_19afu = {
|
||||
base: new URL(".", location).pathname.slice(0, -1),
|
||||
env: null
|
||||
};
|
||||
@@ -33,8 +34,8 @@
|
||||
const data = [null,null];
|
||||
|
||||
Promise.all([
|
||||
import("./_app/immutable/entry/start.Gdbbwk-X.js"),
|
||||
import("./_app/immutable/entry/app.TunG-itD.js")
|
||||
import("./_app/immutable/entry/start.WorQkyMw.js"),
|
||||
import("./_app/immutable/entry/app.qKAh-8tw.js")
|
||||
]).then(([kit, app]) => {
|
||||
kit.start(app, element, {
|
||||
node_ids: [0, 3],
|
||||
|
||||
+12
-11
@@ -5,18 +5,19 @@
|
||||
<link rel="icon" href="./favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<link href="./_app/immutable/assets/0.whLgwaPV.css" rel="stylesheet">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/start.Gdbbwk-X.js">
|
||||
<link href="./_app/immutable/assets/0.sGZW4pel.css" rel="stylesheet">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/start.WorQkyMw.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/scheduler.Tg1fnMp_.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.SwlEVgLy.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.b6n7ppVR.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/index.Bo7-JXlm.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/app.TunG-itD.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/app.qKAh-8tw.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/preload-helper.0HuHagjb.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/index.xa2X6v7V.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/0.qqxLW6jL.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/runtime.AyegV5ce.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/2.NObIK4OH.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/4.m7E3a99r.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/0.DDyQKHBy.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/runtime.bOPOS4G5.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/_commonjsHelpers.5-cIlDoe.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/2.R9w-bO9C.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/4.L8Hmv_u7.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/each.-oqiv04n.js">
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
@@ -24,7 +25,7 @@
|
||||
|
||||
<script>
|
||||
{
|
||||
__sveltekit_1ttigzj = {
|
||||
__sveltekit_19afu = {
|
||||
base: new URL(".", location).pathname.slice(0, -1),
|
||||
env: null
|
||||
};
|
||||
@@ -34,8 +35,8 @@
|
||||
const data = [null,null,null];
|
||||
|
||||
Promise.all([
|
||||
import("./_app/immutable/entry/start.Gdbbwk-X.js"),
|
||||
import("./_app/immutable/entry/app.TunG-itD.js")
|
||||
import("./_app/immutable/entry/start.WorQkyMw.js"),
|
||||
import("./_app/immutable/entry/app.qKAh-8tw.js")
|
||||
]).then(([kit, app]) => {
|
||||
kit.start(app, element, {
|
||||
node_ids: [0, 2, 4],
|
||||
|
||||
Reference in New Issue
Block a user