-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor strings resource and update dependencies Moved strings resources from the "launchpad" module to the "commonCompose" module and updated Compose and AndroidX versions. Additionally, the "app" module was added to settings.gradle.kts and the new module's build file structure was introduced. This change provides a unified location for storing string resources across modules and keeps the dependencies up to date. * Update JVM toolchain, plugin version, and upgrade dependencies JVM toolchain has been updated to use libs.versions.java and vendor was set to JvmVendorSpec.AZUL on shared, pdnsClient and server build files. Foojay resolver convention plugin was added to settings.gradle.kts. Java version in libs.versions file has been bumped up to 17 and ktor version has been updated to 2.3.10. This improves the toolchain control and keeps the project up-to-date with the latest stable versions of the plugins and dependencies. * Add new database migration for pdns scheme The new file 'pdns.ts' within database migrations has been created. This migration file includes definitions for new tables (domains, records, supermasters, comments, domainmetadata, cryptokeys, tsigkeys) and associated indexes in the database. Corresponding 'up' and 'down' methods have been written to handle the creation and removal of these tables and indexes. * Update resource package name and add Github workflow Updated the package name of resources in the build.gradle.kts, TextField.kt, Res.kt, LoginScreen.kt, RegisterScreen.kt, and Screen.kt files from 'pdnsmanager.commoncompose.resources' to 'pdnsmanager.commonCompose.resources'. Added Github workflow 'page-release.yml' for building and pushing Wasm Assets on every published release.
- Loading branch information
1 parent
2841b52
commit bb263c5
Showing
20 changed files
with
341 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Build and Push Wasm Assets | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest # Adjust OS if needed | ||
steps: | ||
- uses: actions/checkout@v4 # Checkout the source code | ||
|
||
- name: Run Gradle Build | ||
run: ./gradlew :launchpad:wasmJsBrowserProductionWebpack | ||
|
||
- name: Extract Wasm Assets | ||
run: | | ||
# Assuming launchpad/build/dist/wasmJs/productionExecutable exists after build | ||
mkdir -p ./wasmJs # Create a folder to store extracted assets locally | ||
cp -r launchpad/build/dist/wasmJs/productionExecutable/* ./wasmJs/ | ||
- name: Checkout Destination Repo (shallow clone) | ||
uses: actions/checkout@v4 # Checkout the destination repository (shallow clone) | ||
with: | ||
repository: https://github.com/mdsadique-inam/launchpad | ||
ref: main # Adjust branch if needed | ||
token: ${{ secrets.PUSH_TOKEN }} # Use a secret for access token | ||
fetch-depth: 1 # Only download the latest commit for efficiency | ||
|
||
- name: Push Wasm Assets to /docs | ||
run: | | ||
git config user.name "mdsadique-inam" # Replace with your name | ||
git config user.email "[email protected]" # Replace with your email | ||
git checkout -b main # Create a new branch (replace with desired branch) | ||
mv ./wasmJs/* ./docs/ # Move extracted assets to /docs folder | ||
git add docs/ # Add the /docs folder to Git | ||
git commit -m "Update Wasm assets from build" | ||
git push origin main # Push the new branch | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl | ||
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig | ||
|
||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.jetbrainsCompose) | ||
alias(libs.plugins.serialization) | ||
} | ||
|
||
kotlin { | ||
@OptIn(ExperimentalWasmDsl::class) | ||
wasmJs { | ||
moduleName = "app" | ||
browser { | ||
commonWebpackConfig { | ||
outputFileName = "app.js" | ||
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply { | ||
static = (static ?: mutableListOf()).apply { | ||
// Serve sources to debug inside browser | ||
add(project.projectDir.path) | ||
add(project.projectDir.path + "/commonMain/") | ||
add(project.projectDir.path + "/wasmJsMain/") | ||
} | ||
proxy = (proxy ?: mutableMapOf()).apply { | ||
put("/api", mapOf( | ||
"target" to "http://localhost:8000", | ||
"pathRewrite" to mapOf( | ||
"/api" to "" | ||
) | ||
)) | ||
} | ||
} | ||
} | ||
} | ||
binaries.executable() | ||
} | ||
|
||
sourceSets { | ||
all { | ||
languageSettings { | ||
optIn("androidx.compose.material3.ExperimentalMaterial3Api") | ||
optIn("org.jetbrains.compose.resources.ExperimentalResourceApi") | ||
} | ||
} | ||
|
||
commonMain.dependencies { | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
implementation(compose.material3) | ||
implementation(compose.ui) | ||
implementation(compose.components.uiToolingPreview) | ||
implementation(compose.components.resources) | ||
implementation(compose.materialIconsExtended) | ||
implementation(projects.commonCompose) | ||
implementation(projects.shared) | ||
implementation(projects.pdnsClient) | ||
implementation(projects.koinCompose) | ||
implementation(libs.androidx.lifecycle.viewmodel.compose) | ||
implementation(libs.androidx.navigation.compose) | ||
implementation(libs.bundles.ktor.client) | ||
implementation(libs.kotlinx.serialization.core) | ||
implementation(libs.kotlinx.coroutines.core) | ||
} | ||
val wasmJsMain by getting { | ||
dependencies { | ||
implementation(libs.bundles.ktor.client.wasm) | ||
} | ||
} | ||
} | ||
} | ||
|
||
compose.experimental { | ||
web.application {} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
commonCompose/src/commonMain/composeResources/values/strings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
<resources> | ||
<string name="error">Error</string> | ||
<string name="login">Login</string> | ||
<string name="login_to_powerdns_manager">Login to PowerDNS manager</string> | ||
<string name="register">Register</string> | ||
<string name="create_an_account_in_powerdns_manager">Create an account in PowerDNS manager</string> | ||
<string name="icon_warning">Icon warning</string> | ||
<string name="show_password">Show Password</string> | ||
<string name="hide_password">Hide Password</string> | ||
<string name="error">Error</string> | ||
<string name="dont_have_an_account_create_one">Don't have an account? Create one</string> | ||
<string name="signup">Sign Up</string> | ||
<string name="full_name">Full Name</string> | ||
<string name="username">Username</string> | ||
<string name="email">Email</string> | ||
<string name="password">Password</string> | ||
<string name="confirm_password">Confirm Password</string> | ||
<string name="username_or_email">Username / Email</string> | ||
<string name="already_have_an_account_login">Already have an account? Login</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
import type { Knex } from "knex"; | ||
|
||
export async function up(knex: Knex): Promise<any> { | ||
return knex.schema.raw(` | ||
CREATE TABLE domains ( | ||
id SERIAL PRIMARY KEY, | ||
name VARCHAR(255) NOT NULL, | ||
master VARCHAR(128) DEFAULT NULL, | ||
last_check INT DEFAULT NULL, | ||
type TEXT NOT NULL, | ||
notified_serial BIGINT DEFAULT NULL, | ||
account VARCHAR(40) DEFAULT NULL, | ||
options TEXT DEFAULT NULL, | ||
catalog TEXT DEFAULT NULL, | ||
CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT))) | ||
); | ||
CREATE UNIQUE INDEX name_index ON domains(name); | ||
CREATE INDEX catalog_idx ON domains(catalog); | ||
CREATE TABLE records ( | ||
id BIGSERIAL PRIMARY KEY, | ||
domain_id INT DEFAULT NULL, | ||
name VARCHAR(255) DEFAULT NULL, | ||
type VARCHAR(10) DEFAULT NULL, | ||
content VARCHAR(65535) DEFAULT NULL, | ||
ttl INT DEFAULT NULL, | ||
prio INT DEFAULT NULL, | ||
disabled BOOL DEFAULT 'f', | ||
ordername VARCHAR(255), | ||
auth BOOL DEFAULT 't', | ||
CONSTRAINT domain_exists | ||
FOREIGN KEY(domain_id) REFERENCES domains(id) | ||
ON DELETE CASCADE, | ||
CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT))) | ||
); | ||
CREATE INDEX rec_name_index ON records(name); | ||
CREATE INDEX nametype_index ON records(name,type); | ||
CREATE INDEX domain_id ON records(domain_id); | ||
CREATE INDEX recordorder ON records (domain_id, ordername text_pattern_ops); | ||
CREATE TABLE supermasters ( | ||
ip INET NOT NULL, | ||
nameserver VARCHAR(255) NOT NULL, | ||
account VARCHAR(40) NOT NULL, | ||
PRIMARY KEY(ip, nameserver) | ||
); | ||
CREATE TABLE comments ( | ||
id SERIAL PRIMARY KEY, | ||
domain_id INT NOT NULL, | ||
name VARCHAR(255) NOT NULL, | ||
type VARCHAR(10) NOT NULL, | ||
modified_at INT NOT NULL, | ||
account VARCHAR(40) DEFAULT NULL, | ||
comment VARCHAR(65535) NOT NULL, | ||
CONSTRAINT domain_exists | ||
FOREIGN KEY(domain_id) REFERENCES domains(id) | ||
ON DELETE CASCADE, | ||
CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT))) | ||
); | ||
CREATE INDEX comments_domain_id_idx ON comments (domain_id); | ||
CREATE INDEX comments_name_type_idx ON comments (name, type); | ||
CREATE INDEX comments_order_idx ON comments (domain_id, modified_at); | ||
CREATE TABLE domainmetadata ( | ||
id SERIAL PRIMARY KEY, | ||
domain_id INT REFERENCES domains(id) ON DELETE CASCADE, | ||
kind VARCHAR(32), | ||
content TEXT | ||
); | ||
CREATE INDEX domainidmetaindex ON domainmetadata(domain_id); | ||
CREATE TABLE cryptokeys ( | ||
id SERIAL PRIMARY KEY, | ||
domain_id INT REFERENCES domains(id) ON DELETE CASCADE, | ||
flags INT NOT NULL, | ||
active BOOL, | ||
published BOOL DEFAULT TRUE, | ||
content TEXT | ||
); | ||
CREATE INDEX domainidindex ON cryptokeys(domain_id); | ||
CREATE TABLE tsigkeys ( | ||
id SERIAL PRIMARY KEY, | ||
name VARCHAR(255), | ||
algorithm VARCHAR(50), | ||
secret VARCHAR(255), | ||
CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT))) | ||
); | ||
CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm); | ||
`) | ||
} | ||
|
||
|
||
export async function down(knex: Knex): Promise<any> { | ||
return knex.schema.raw(` | ||
DROP INDEX namealgoindex; | ||
DROP TABLE tsigkeys; | ||
DROP INDEX domainidindex; | ||
DROP TABLE cryptokeys; | ||
DROP INDEX domainidmetaindex; | ||
DROP TABLE domainmetadata; | ||
DROP INDEX comments_order_idx; | ||
DROP INDEX comments_name_type_idx; | ||
DROP INDEX comments_domain_id_idx; | ||
DROP TABLE comments; | ||
DROP TABLE supermasters; | ||
DROP INDEX recordorder; | ||
DROP INDEX domain_id; | ||
DROP INDEX nametype_index; | ||
DROP INDEX rec_name_index; | ||
DROP TABLE records; | ||
DROP INDEX catalog_idx; | ||
DROP INDEX name_index; | ||
DROP INDEX domains; | ||
`) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 1 addition & 16 deletions
17
launchpad/src/commonMain/composeResources/values/strings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,3 @@ | ||
<resources> | ||
<string name="login">Login</string> | ||
<string name="login_to_powerdns_manager">Login to PowerDNS manager</string> | ||
<string name="register">Register</string> | ||
<string name="create_an_account_in_powerdns_manager">Create an account in PowerDNS manager</string> | ||
<string name="icon_warning">Icon warning</string> | ||
<string name="show_password">Show Password</string> | ||
<string name="hide_password">Hide Password</string> | ||
<string name="dont_have_an_account_create_one">Don't have an account? Create one</string> | ||
<string name="signup">Sign Up</string> | ||
<string name="full_name">Full Name</string> | ||
<string name="username">Username</string> | ||
<string name="email">Email</string> | ||
<string name="password">Password</string> | ||
<string name="confirm_password">Confirm Password</string> | ||
<string name="username_or_email">Username / Email</string> | ||
<string name="already_have_an_account_login">Already have an account? Login</string> | ||
|
||
</resources> |
Oops, something went wrong.