✅ COMPLETED: 1. Dockerfile uses port 80 (astro preview) 2. BaseLayout imports globals.css 3. globals.css with Tailwind v4 @theme syntax 4. index.astro has Header, Footer, FixedContact 5. All image references fixed to existing files 6. Hero uses hdpe_pipe_main.jpg 7. Product cards use hdpe001.jpg 8. pt-20 on main for fixed header ✅ TESTED LOCALLY: - Build: 15 pages in 1.27s - Docker build successful - Port 80 working - Images load - CSS works Ready for Easypanel deployment.
47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
import { ClientError, ClosedError, MisuseError } from "./errors.js";
|
|
/** Text of an SQL statement cached on the server. */
|
|
export class Sql {
|
|
#owner;
|
|
#sqlId;
|
|
#closed;
|
|
/** @private */
|
|
constructor(owner, sqlId) {
|
|
this.#owner = owner;
|
|
this.#sqlId = sqlId;
|
|
this.#closed = undefined;
|
|
}
|
|
/** @private */
|
|
_getSqlId(owner) {
|
|
if (this.#owner !== owner) {
|
|
throw new MisuseError("Attempted to use SQL text opened with other object");
|
|
}
|
|
else if (this.#closed !== undefined) {
|
|
throw new ClosedError("SQL text is closed", this.#closed);
|
|
}
|
|
return this.#sqlId;
|
|
}
|
|
/** Remove the SQL text from the server, releasing resouces. */
|
|
close() {
|
|
this._setClosed(new ClientError("SQL text was manually closed"));
|
|
}
|
|
/** @private */
|
|
_setClosed(error) {
|
|
if (this.#closed === undefined) {
|
|
this.#closed = error;
|
|
this.#owner._closeSql(this.#sqlId);
|
|
}
|
|
}
|
|
/** True if the SQL text is closed (removed from the server). */
|
|
get closed() {
|
|
return this.#closed !== undefined;
|
|
}
|
|
}
|
|
export function sqlToProto(owner, sql) {
|
|
if (sql instanceof Sql) {
|
|
return { sqlId: sql._getSqlId(owner) };
|
|
}
|
|
else {
|
|
return { sql: "" + sql };
|
|
}
|
|
}
|