Compare commits
3 Commits
07ec2d9797
...
013-unify-
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ba28cf93e | |||
| 343f2e29f5 | |||
| c9a53578fd |
@@ -25,6 +25,8 @@ Auto-generated from all feature plans. Last updated: 2025-12-19
|
|||||||
- Filesystem (local git repo), SQLite (for GitServerConfig, Environment) (011-git-integration-dashboard)
|
- Filesystem (local git repo), SQLite (for GitServerConfig, Environment) (011-git-integration-dashboard)
|
||||||
- Python 3.9+ (Backend), Node.js 18+ (Frontend) + FastAPI, SvelteKit, GitPython (or CLI git), Pydantic, SQLAlchemy, Superset API (011-git-integration-dashboard)
|
- Python 3.9+ (Backend), Node.js 18+ (Frontend) + FastAPI, SvelteKit, GitPython (or CLI git), Pydantic, SQLAlchemy, Superset API (011-git-integration-dashboard)
|
||||||
- SQLite (for config/history), Filesystem (local Git repositories) (011-git-integration-dashboard)
|
- SQLite (for config/history), Filesystem (local Git repositories) (011-git-integration-dashboard)
|
||||||
|
- Node.js 18+ (Frontend Build), Svelte 5.x + SvelteKit, Tailwind CSS, `date-fns` (existing) (013-unify-frontend-css)
|
||||||
|
- LocalStorage (for language preference) (013-unify-frontend-css)
|
||||||
|
|
||||||
- Python 3.9+ (Backend), Node.js 18+ (Frontend Build) (001-plugin-arch-svelte-ui)
|
- Python 3.9+ (Backend), Node.js 18+ (Frontend Build) (001-plugin-arch-svelte-ui)
|
||||||
|
|
||||||
@@ -45,9 +47,9 @@ cd src; pytest; ruff check .
|
|||||||
Python 3.9+ (Backend), Node.js 18+ (Frontend Build): Follow standard conventions
|
Python 3.9+ (Backend), Node.js 18+ (Frontend Build): Follow standard conventions
|
||||||
|
|
||||||
## Recent Changes
|
## Recent Changes
|
||||||
|
- 013-unify-frontend-css: Added Node.js 18+ (Frontend Build), Svelte 5.x + SvelteKit, Tailwind CSS, `date-fns` (existing)
|
||||||
- 011-git-integration-dashboard: Added Python 3.9+ (Backend), Node.js 18+ (Frontend) + FastAPI, SvelteKit, GitPython (or CLI git), Pydantic, SQLAlchemy, Superset API
|
- 011-git-integration-dashboard: Added Python 3.9+ (Backend), Node.js 18+ (Frontend) + FastAPI, SvelteKit, GitPython (or CLI git), Pydantic, SQLAlchemy, Superset API
|
||||||
- 011-git-integration-dashboard: Added Python 3.9+ (Backend), Node.js 18+ (Frontend) + FastAPI, SvelteKit, GitPython (or CLI git), Pydantic, SQLAlchemy, Superset API
|
- 011-git-integration-dashboard: Added Python 3.9+ (Backend), Node.js 18+ (Frontend) + FastAPI, SvelteKit, GitPython (or CLI git), Pydantic, SQLAlchemy, Superset API
|
||||||
- 011-git-integration-dashboard: Added Python 3.9+, Node.js 18+
|
|
||||||
|
|
||||||
|
|
||||||
<!-- MANUAL ADDITIONS START -->
|
<!-- MANUAL ADDITIONS START -->
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""Script to delete tasks with RUNNING status from the database."""
|
# [DEF:backend.delete_running_tasks:Module]
|
||||||
|
# @PURPOSE: Script to delete tasks with RUNNING status from the database.
|
||||||
|
# @LAYER: Utility
|
||||||
|
# @SEMANTICS: maintenance, database, cleanup
|
||||||
|
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from src.core.database import TasksSessionLocal
|
from src.core.database import TasksSessionLocal
|
||||||
from src.models.task import TaskRecord
|
from src.models.task import TaskRecord
|
||||||
|
|
||||||
|
# [DEF:delete_running_tasks:Function]
|
||||||
|
# @PURPOSE: Delete all tasks with RUNNING status from the database.
|
||||||
|
# @PRE: Database is accessible and TaskRecord model is defined.
|
||||||
|
# @POST: All tasks with status 'RUNNING' are removed from the database.
|
||||||
def delete_running_tasks():
|
def delete_running_tasks():
|
||||||
"""Delete all tasks with RUNNING status from the database."""
|
"""Delete all tasks with RUNNING status from the database."""
|
||||||
session: Session = TasksSessionLocal()
|
session: Session = TasksSessionLocal()
|
||||||
@@ -30,6 +37,8 @@ def delete_running_tasks():
|
|||||||
print(f"Error deleting tasks: {e}")
|
print(f"Error deleting tasks: {e}")
|
||||||
finally:
|
finally:
|
||||||
session.close()
|
session.close()
|
||||||
|
# [/DEF:delete_running_tasks:Function]
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
delete_running_tasks()
|
delete_running_tasks()
|
||||||
|
# [/DEF:backend.delete_running_tasks:Module]
|
||||||
|
|||||||
79101
backend/logs/app.log.1
Normal file
79101
backend/logs/app.log.1
Normal file
File diff suppressed because it is too large
Load Diff
@@ -30,6 +30,8 @@ git_service = GitService()
|
|||||||
|
|
||||||
# [DEF:get_git_configs:Function]
|
# [DEF:get_git_configs:Function]
|
||||||
# @PURPOSE: List all configured Git servers.
|
# @PURPOSE: List all configured Git servers.
|
||||||
|
# @PRE: Database session `db` is available.
|
||||||
|
# @POST: Returns a list of all GitServerConfig objects from the database.
|
||||||
# @RETURN: List[GitServerConfigSchema]
|
# @RETURN: List[GitServerConfigSchema]
|
||||||
@router.get("/config", response_model=List[GitServerConfigSchema])
|
@router.get("/config", response_model=List[GitServerConfigSchema])
|
||||||
async def get_git_configs(db: Session = Depends(get_db)):
|
async def get_git_configs(db: Session = Depends(get_db)):
|
||||||
@@ -39,6 +41,8 @@ async def get_git_configs(db: Session = Depends(get_db)):
|
|||||||
|
|
||||||
# [DEF:create_git_config:Function]
|
# [DEF:create_git_config:Function]
|
||||||
# @PURPOSE: Register a new Git server configuration.
|
# @PURPOSE: Register a new Git server configuration.
|
||||||
|
# @PRE: `config` contains valid GitServerConfigCreate data.
|
||||||
|
# @POST: A new GitServerConfig record is created in the database.
|
||||||
# @PARAM: config (GitServerConfigCreate)
|
# @PARAM: config (GitServerConfigCreate)
|
||||||
# @RETURN: GitServerConfigSchema
|
# @RETURN: GitServerConfigSchema
|
||||||
@router.post("/config", response_model=GitServerConfigSchema)
|
@router.post("/config", response_model=GitServerConfigSchema)
|
||||||
@@ -53,6 +57,8 @@ async def create_git_config(config: GitServerConfigCreate, db: Session = Depends
|
|||||||
|
|
||||||
# [DEF:delete_git_config:Function]
|
# [DEF:delete_git_config:Function]
|
||||||
# @PURPOSE: Remove a Git server configuration.
|
# @PURPOSE: Remove a Git server configuration.
|
||||||
|
# @PRE: `config_id` corresponds to an existing configuration.
|
||||||
|
# @POST: The configuration record is removed from the database.
|
||||||
# @PARAM: config_id (str)
|
# @PARAM: config_id (str)
|
||||||
@router.delete("/config/{config_id}")
|
@router.delete("/config/{config_id}")
|
||||||
async def delete_git_config(config_id: str, db: Session = Depends(get_db)):
|
async def delete_git_config(config_id: str, db: Session = Depends(get_db)):
|
||||||
@@ -68,6 +74,8 @@ async def delete_git_config(config_id: str, db: Session = Depends(get_db)):
|
|||||||
|
|
||||||
# [DEF:test_git_config:Function]
|
# [DEF:test_git_config:Function]
|
||||||
# @PURPOSE: Validate connection to a Git server using provided credentials.
|
# @PURPOSE: Validate connection to a Git server using provided credentials.
|
||||||
|
# @PRE: `config` contains provider, url, and pat.
|
||||||
|
# @POST: Returns success if the connection is validated via GitService.
|
||||||
# @PARAM: config (GitServerConfigCreate)
|
# @PARAM: config (GitServerConfigCreate)
|
||||||
@router.post("/config/test")
|
@router.post("/config/test")
|
||||||
async def test_git_config(config: GitServerConfigCreate):
|
async def test_git_config(config: GitServerConfigCreate):
|
||||||
@@ -81,6 +89,8 @@ async def test_git_config(config: GitServerConfigCreate):
|
|||||||
|
|
||||||
# [DEF:init_repository:Function]
|
# [DEF:init_repository:Function]
|
||||||
# @PURPOSE: Link a dashboard to a Git repository and perform initial clone/init.
|
# @PURPOSE: Link a dashboard to a Git repository and perform initial clone/init.
|
||||||
|
# @PRE: `dashboard_id` exists and `init_data` contains valid config_id and remote_url.
|
||||||
|
# @POST: Repository is initialized on disk and a GitRepository record is saved in DB.
|
||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
# @PARAM: init_data (RepoInitRequest)
|
# @PARAM: init_data (RepoInitRequest)
|
||||||
@router.post("/repositories/{dashboard_id}/init")
|
@router.post("/repositories/{dashboard_id}/init")
|
||||||
@@ -123,6 +133,8 @@ async def init_repository(dashboard_id: int, init_data: RepoInitRequest, db: Ses
|
|||||||
|
|
||||||
# [DEF:get_branches:Function]
|
# [DEF:get_branches:Function]
|
||||||
# @PURPOSE: List all branches for a dashboard's repository.
|
# @PURPOSE: List all branches for a dashboard's repository.
|
||||||
|
# @PRE: Repository for `dashboard_id` is initialized.
|
||||||
|
# @POST: Returns a list of branches from the local repository.
|
||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
# @RETURN: List[BranchSchema]
|
# @RETURN: List[BranchSchema]
|
||||||
@router.get("/repositories/{dashboard_id}/branches", response_model=List[BranchSchema])
|
@router.get("/repositories/{dashboard_id}/branches", response_model=List[BranchSchema])
|
||||||
@@ -136,6 +148,8 @@ async def get_branches(dashboard_id: int):
|
|||||||
|
|
||||||
# [DEF:create_branch:Function]
|
# [DEF:create_branch:Function]
|
||||||
# @PURPOSE: Create a new branch in the dashboard's repository.
|
# @PURPOSE: Create a new branch in the dashboard's repository.
|
||||||
|
# @PRE: `dashboard_id` repository exists and `branch_data` has name and from_branch.
|
||||||
|
# @POST: A new branch is created in the local repository.
|
||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
# @PARAM: branch_data (BranchCreate)
|
# @PARAM: branch_data (BranchCreate)
|
||||||
@router.post("/repositories/{dashboard_id}/branches")
|
@router.post("/repositories/{dashboard_id}/branches")
|
||||||
@@ -150,6 +164,8 @@ async def create_branch(dashboard_id: int, branch_data: BranchCreate):
|
|||||||
|
|
||||||
# [DEF:checkout_branch:Function]
|
# [DEF:checkout_branch:Function]
|
||||||
# @PURPOSE: Switch the dashboard's repository to a specific branch.
|
# @PURPOSE: Switch the dashboard's repository to a specific branch.
|
||||||
|
# @PRE: `dashboard_id` repository exists and branch `checkout_data.name` exists.
|
||||||
|
# @POST: The local repository HEAD is moved to the specified branch.
|
||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
# @PARAM: checkout_data (BranchCheckout)
|
# @PARAM: checkout_data (BranchCheckout)
|
||||||
@router.post("/repositories/{dashboard_id}/checkout")
|
@router.post("/repositories/{dashboard_id}/checkout")
|
||||||
@@ -164,6 +180,8 @@ async def checkout_branch(dashboard_id: int, checkout_data: BranchCheckout):
|
|||||||
|
|
||||||
# [DEF:commit_changes:Function]
|
# [DEF:commit_changes:Function]
|
||||||
# @PURPOSE: Stage and commit changes in the dashboard's repository.
|
# @PURPOSE: Stage and commit changes in the dashboard's repository.
|
||||||
|
# @PRE: `dashboard_id` repository exists and `commit_data` has message and files.
|
||||||
|
# @POST: Specified files are staged and a new commit is created.
|
||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
# @PARAM: commit_data (CommitCreate)
|
# @PARAM: commit_data (CommitCreate)
|
||||||
@router.post("/repositories/{dashboard_id}/commit")
|
@router.post("/repositories/{dashboard_id}/commit")
|
||||||
@@ -178,6 +196,8 @@ async def commit_changes(dashboard_id: int, commit_data: CommitCreate):
|
|||||||
|
|
||||||
# [DEF:push_changes:Function]
|
# [DEF:push_changes:Function]
|
||||||
# @PURPOSE: Push local commits to the remote repository.
|
# @PURPOSE: Push local commits to the remote repository.
|
||||||
|
# @PRE: `dashboard_id` repository exists and has a remote configured.
|
||||||
|
# @POST: Local commits are pushed to the remote repository.
|
||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
@router.post("/repositories/{dashboard_id}/push")
|
@router.post("/repositories/{dashboard_id}/push")
|
||||||
async def push_changes(dashboard_id: int):
|
async def push_changes(dashboard_id: int):
|
||||||
@@ -191,6 +211,8 @@ async def push_changes(dashboard_id: int):
|
|||||||
|
|
||||||
# [DEF:pull_changes:Function]
|
# [DEF:pull_changes:Function]
|
||||||
# @PURPOSE: Pull changes from the remote repository.
|
# @PURPOSE: Pull changes from the remote repository.
|
||||||
|
# @PRE: `dashboard_id` repository exists and has a remote configured.
|
||||||
|
# @POST: Remote changes are fetched and merged into the local branch.
|
||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
@router.post("/repositories/{dashboard_id}/pull")
|
@router.post("/repositories/{dashboard_id}/pull")
|
||||||
async def pull_changes(dashboard_id: int):
|
async def pull_changes(dashboard_id: int):
|
||||||
@@ -204,6 +226,8 @@ async def pull_changes(dashboard_id: int):
|
|||||||
|
|
||||||
# [DEF:sync_dashboard:Function]
|
# [DEF:sync_dashboard:Function]
|
||||||
# @PURPOSE: Sync dashboard state from Superset to Git using the GitPlugin.
|
# @PURPOSE: Sync dashboard state from Superset to Git using the GitPlugin.
|
||||||
|
# @PRE: `dashboard_id` is valid; GitPlugin is available.
|
||||||
|
# @POST: Dashboard YAMLs are exported from Superset and committed to Git.
|
||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
# @PARAM: source_env_id (Optional[str])
|
# @PARAM: source_env_id (Optional[str])
|
||||||
@router.post("/repositories/{dashboard_id}/sync")
|
@router.post("/repositories/{dashboard_id}/sync")
|
||||||
@@ -223,6 +247,8 @@ async def sync_dashboard(dashboard_id: int, source_env_id: typing.Optional[str]
|
|||||||
|
|
||||||
# [DEF:get_environments:Function]
|
# [DEF:get_environments:Function]
|
||||||
# @PURPOSE: List all deployment environments.
|
# @PURPOSE: List all deployment environments.
|
||||||
|
# @PRE: Config manager is accessible.
|
||||||
|
# @POST: Returns a list of DeploymentEnvironmentSchema objects.
|
||||||
# @RETURN: List[DeploymentEnvironmentSchema]
|
# @RETURN: List[DeploymentEnvironmentSchema]
|
||||||
@router.get("/environments", response_model=List[DeploymentEnvironmentSchema])
|
@router.get("/environments", response_model=List[DeploymentEnvironmentSchema])
|
||||||
async def get_environments(config_manager=Depends(get_config_manager)):
|
async def get_environments(config_manager=Depends(get_config_manager)):
|
||||||
@@ -240,6 +266,8 @@ async def get_environments(config_manager=Depends(get_config_manager)):
|
|||||||
|
|
||||||
# [DEF:deploy_dashboard:Function]
|
# [DEF:deploy_dashboard:Function]
|
||||||
# @PURPOSE: Deploy dashboard from Git to a target environment.
|
# @PURPOSE: Deploy dashboard from Git to a target environment.
|
||||||
|
# @PRE: `dashboard_id` and `deploy_data.environment_id` are valid.
|
||||||
|
# @POST: Dashboard YAMLs are read from Git and imported into the target Superset.
|
||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
# @PARAM: deploy_data (DeployRequest)
|
# @PARAM: deploy_data (DeployRequest)
|
||||||
@router.post("/repositories/{dashboard_id}/deploy")
|
@router.post("/repositories/{dashboard_id}/deploy")
|
||||||
@@ -259,6 +287,8 @@ async def deploy_dashboard(dashboard_id: int, deploy_data: DeployRequest):
|
|||||||
|
|
||||||
# [DEF:get_history:Function]
|
# [DEF:get_history:Function]
|
||||||
# @PURPOSE: View commit history for a dashboard's repository.
|
# @PURPOSE: View commit history for a dashboard's repository.
|
||||||
|
# @PRE: `dashboard_id` repository exists.
|
||||||
|
# @POST: Returns a list of recent commits from the repository.
|
||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
# @PARAM: limit (int)
|
# @PARAM: limit (int)
|
||||||
# @RETURN: List[CommitSchema]
|
# @RETURN: List[CommitSchema]
|
||||||
@@ -273,6 +303,8 @@ async def get_history(dashboard_id: int, limit: int = 50):
|
|||||||
|
|
||||||
# [DEF:get_repository_status:Function]
|
# [DEF:get_repository_status:Function]
|
||||||
# @PURPOSE: Get current Git status for a dashboard repository.
|
# @PURPOSE: Get current Git status for a dashboard repository.
|
||||||
|
# @PRE: `dashboard_id` repository exists.
|
||||||
|
# @POST: Returns the status of the working directory (staged, unstaged, untracked).
|
||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
# @RETURN: dict
|
# @RETURN: dict
|
||||||
@router.get("/repositories/{dashboard_id}/status")
|
@router.get("/repositories/{dashboard_id}/status")
|
||||||
@@ -286,6 +318,8 @@ async def get_repository_status(dashboard_id: int):
|
|||||||
|
|
||||||
# [DEF:get_repository_diff:Function]
|
# [DEF:get_repository_diff:Function]
|
||||||
# @PURPOSE: Get Git diff for a dashboard repository.
|
# @PURPOSE: Get Git diff for a dashboard repository.
|
||||||
|
# @PRE: `dashboard_id` repository exists.
|
||||||
|
# @POST: Returns the diff text for the specified file or all changes.
|
||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
# @PARAM: file_path (Optional[str])
|
# @PARAM: file_path (Optional[str])
|
||||||
# @PARAM: staged (bool)
|
# @PARAM: staged (bool)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ from uuid import UUID
|
|||||||
from src.models.git import GitProvider, GitStatus, SyncStatus
|
from src.models.git import GitProvider, GitStatus, SyncStatus
|
||||||
|
|
||||||
# [DEF:GitServerConfigBase:Class]
|
# [DEF:GitServerConfigBase:Class]
|
||||||
|
# @PURPOSE: Base schema for Git server configuration attributes.
|
||||||
class GitServerConfigBase(BaseModel):
|
class GitServerConfigBase(BaseModel):
|
||||||
name: str = Field(..., description="Display name for the Git server")
|
name: str = Field(..., description="Display name for the Git server")
|
||||||
provider: GitProvider = Field(..., description="Git provider (GITHUB, GITLAB, GITEA)")
|
provider: GitProvider = Field(..., description="Git provider (GITHUB, GITLAB, GITEA)")
|
||||||
@@ -23,12 +24,14 @@ class GitServerConfigBase(BaseModel):
|
|||||||
# [/DEF:GitServerConfigBase:Class]
|
# [/DEF:GitServerConfigBase:Class]
|
||||||
|
|
||||||
# [DEF:GitServerConfigCreate:Class]
|
# [DEF:GitServerConfigCreate:Class]
|
||||||
|
# @PURPOSE: Schema for creating a new Git server configuration.
|
||||||
class GitServerConfigCreate(GitServerConfigBase):
|
class GitServerConfigCreate(GitServerConfigBase):
|
||||||
"""Schema for creating a new Git server configuration."""
|
"""Schema for creating a new Git server configuration."""
|
||||||
pass
|
pass
|
||||||
# [/DEF:GitServerConfigCreate:Class]
|
# [/DEF:GitServerConfigCreate:Class]
|
||||||
|
|
||||||
# [DEF:GitServerConfigSchema:Class]
|
# [DEF:GitServerConfigSchema:Class]
|
||||||
|
# @PURPOSE: Schema for representing a Git server configuration with metadata.
|
||||||
class GitServerConfigSchema(GitServerConfigBase):
|
class GitServerConfigSchema(GitServerConfigBase):
|
||||||
"""Schema for representing a Git server configuration with metadata."""
|
"""Schema for representing a Git server configuration with metadata."""
|
||||||
id: str
|
id: str
|
||||||
@@ -40,6 +43,7 @@ class GitServerConfigSchema(GitServerConfigBase):
|
|||||||
# [/DEF:GitServerConfigSchema:Class]
|
# [/DEF:GitServerConfigSchema:Class]
|
||||||
|
|
||||||
# [DEF:GitRepositorySchema:Class]
|
# [DEF:GitRepositorySchema:Class]
|
||||||
|
# @PURPOSE: Schema for tracking a local Git repository linked to a dashboard.
|
||||||
class GitRepositorySchema(BaseModel):
|
class GitRepositorySchema(BaseModel):
|
||||||
"""Schema for tracking a local Git repository linked to a dashboard."""
|
"""Schema for tracking a local Git repository linked to a dashboard."""
|
||||||
id: str
|
id: str
|
||||||
@@ -55,6 +59,7 @@ class GitRepositorySchema(BaseModel):
|
|||||||
# [/DEF:GitRepositorySchema:Class]
|
# [/DEF:GitRepositorySchema:Class]
|
||||||
|
|
||||||
# [DEF:BranchSchema:Class]
|
# [DEF:BranchSchema:Class]
|
||||||
|
# @PURPOSE: Schema for representing a Git branch metadata.
|
||||||
class BranchSchema(BaseModel):
|
class BranchSchema(BaseModel):
|
||||||
"""Schema for representing a Git branch."""
|
"""Schema for representing a Git branch."""
|
||||||
name: str
|
name: str
|
||||||
@@ -64,6 +69,7 @@ class BranchSchema(BaseModel):
|
|||||||
# [/DEF:BranchSchema:Class]
|
# [/DEF:BranchSchema:Class]
|
||||||
|
|
||||||
# [DEF:CommitSchema:Class]
|
# [DEF:CommitSchema:Class]
|
||||||
|
# @PURPOSE: Schema for representing Git commit details.
|
||||||
class CommitSchema(BaseModel):
|
class CommitSchema(BaseModel):
|
||||||
"""Schema for representing a Git commit."""
|
"""Schema for representing a Git commit."""
|
||||||
hash: str
|
hash: str
|
||||||
@@ -75,6 +81,7 @@ class CommitSchema(BaseModel):
|
|||||||
# [/DEF:CommitSchema:Class]
|
# [/DEF:CommitSchema:Class]
|
||||||
|
|
||||||
# [DEF:BranchCreate:Class]
|
# [DEF:BranchCreate:Class]
|
||||||
|
# @PURPOSE: Schema for branch creation requests.
|
||||||
class BranchCreate(BaseModel):
|
class BranchCreate(BaseModel):
|
||||||
"""Schema for branch creation requests."""
|
"""Schema for branch creation requests."""
|
||||||
name: str
|
name: str
|
||||||
@@ -82,12 +89,14 @@ class BranchCreate(BaseModel):
|
|||||||
# [/DEF:BranchCreate:Class]
|
# [/DEF:BranchCreate:Class]
|
||||||
|
|
||||||
# [DEF:BranchCheckout:Class]
|
# [DEF:BranchCheckout:Class]
|
||||||
|
# @PURPOSE: Schema for branch checkout requests.
|
||||||
class BranchCheckout(BaseModel):
|
class BranchCheckout(BaseModel):
|
||||||
"""Schema for branch checkout requests."""
|
"""Schema for branch checkout requests."""
|
||||||
name: str
|
name: str
|
||||||
# [/DEF:BranchCheckout:Class]
|
# [/DEF:BranchCheckout:Class]
|
||||||
|
|
||||||
# [DEF:CommitCreate:Class]
|
# [DEF:CommitCreate:Class]
|
||||||
|
# @PURPOSE: Schema for staging and committing changes.
|
||||||
class CommitCreate(BaseModel):
|
class CommitCreate(BaseModel):
|
||||||
"""Schema for staging and committing changes."""
|
"""Schema for staging and committing changes."""
|
||||||
message: str
|
message: str
|
||||||
@@ -95,6 +104,7 @@ class CommitCreate(BaseModel):
|
|||||||
# [/DEF:CommitCreate:Class]
|
# [/DEF:CommitCreate:Class]
|
||||||
|
|
||||||
# [DEF:ConflictResolution:Class]
|
# [DEF:ConflictResolution:Class]
|
||||||
|
# @PURPOSE: Schema for resolving merge conflicts.
|
||||||
class ConflictResolution(BaseModel):
|
class ConflictResolution(BaseModel):
|
||||||
"""Schema for resolving merge conflicts."""
|
"""Schema for resolving merge conflicts."""
|
||||||
file_path: str
|
file_path: str
|
||||||
@@ -103,6 +113,7 @@ class ConflictResolution(BaseModel):
|
|||||||
# [/DEF:ConflictResolution:Class]
|
# [/DEF:ConflictResolution:Class]
|
||||||
|
|
||||||
# [DEF:DeploymentEnvironmentSchema:Class]
|
# [DEF:DeploymentEnvironmentSchema:Class]
|
||||||
|
# @PURPOSE: Schema for representing a target deployment environment.
|
||||||
class DeploymentEnvironmentSchema(BaseModel):
|
class DeploymentEnvironmentSchema(BaseModel):
|
||||||
"""Schema for representing a target deployment environment."""
|
"""Schema for representing a target deployment environment."""
|
||||||
id: str
|
id: str
|
||||||
@@ -115,12 +126,14 @@ class DeploymentEnvironmentSchema(BaseModel):
|
|||||||
# [/DEF:DeploymentEnvironmentSchema:Class]
|
# [/DEF:DeploymentEnvironmentSchema:Class]
|
||||||
|
|
||||||
# [DEF:DeployRequest:Class]
|
# [DEF:DeployRequest:Class]
|
||||||
|
# @PURPOSE: Schema for dashboard deployment requests.
|
||||||
class DeployRequest(BaseModel):
|
class DeployRequest(BaseModel):
|
||||||
"""Schema for deployment requests."""
|
"""Schema for deployment requests."""
|
||||||
environment_id: str
|
environment_id: str
|
||||||
# [/DEF:DeployRequest:Class]
|
# [/DEF:DeployRequest:Class]
|
||||||
|
|
||||||
# [DEF:RepoInitRequest:Class]
|
# [DEF:RepoInitRequest:Class]
|
||||||
|
# @PURPOSE: Schema for repository initialization requests.
|
||||||
class RepoInitRequest(BaseModel):
|
class RepoInitRequest(BaseModel):
|
||||||
"""Schema for repository initialization requests."""
|
"""Schema for repository initialization requests."""
|
||||||
config_id: str
|
config_id: str
|
||||||
|
|||||||
@@ -197,11 +197,17 @@ logger = logging.getLogger("superset_tools_app")
|
|||||||
# @PURPOSE: A decorator that wraps a function in a belief scope.
|
# @PURPOSE: A decorator that wraps a function in a belief scope.
|
||||||
# @PARAM: anchor_id (str) - The identifier for the semantic block.
|
# @PARAM: anchor_id (str) - The identifier for the semantic block.
|
||||||
def believed(anchor_id: str):
|
def believed(anchor_id: str):
|
||||||
|
# [DEF:decorator:Function]
|
||||||
|
# @PURPOSE: Internal decorator for belief scope.
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
|
# [DEF:wrapper:Function]
|
||||||
|
# @PURPOSE: Internal wrapper that enters belief scope.
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
with belief_scope(anchor_id):
|
with belief_scope(anchor_id):
|
||||||
return func(*args, **kwargs)
|
return func(*args, **kwargs)
|
||||||
|
# [/DEF:wrapper:Function]
|
||||||
return wrapper
|
return wrapper
|
||||||
|
# [/DEF:decorator:Function]
|
||||||
return decorator
|
return decorator
|
||||||
# [/DEF:believed:Function]
|
# [/DEF:believed:Function]
|
||||||
logger.setLevel(logging.INFO)
|
logger.setLevel(logging.INFO)
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ class SupersetClient:
|
|||||||
@property
|
@property
|
||||||
# [DEF:headers:Function]
|
# [DEF:headers:Function]
|
||||||
# @PURPOSE: Возвращает базовые HTTP-заголовки, используемые сетевым клиентом.
|
# @PURPOSE: Возвращает базовые HTTP-заголовки, используемые сетевым клиентом.
|
||||||
|
# @PRE: APIClient is initialized and authenticated.
|
||||||
|
# @POST: Returns a dictionary of HTTP headers.
|
||||||
def headers(self) -> dict:
|
def headers(self) -> dict:
|
||||||
with belief_scope("headers"):
|
with belief_scope("headers"):
|
||||||
return self.network.headers
|
return self.network.headers
|
||||||
@@ -75,6 +77,8 @@ class SupersetClient:
|
|||||||
# [DEF:get_dashboards:Function]
|
# [DEF:get_dashboards:Function]
|
||||||
# @PURPOSE: Получает полный список дашбордов, автоматически обрабатывая пагинацию.
|
# @PURPOSE: Получает полный список дашбордов, автоматически обрабатывая пагинацию.
|
||||||
# @PARAM: query (Optional[Dict]) - Дополнительные параметры запроса для API.
|
# @PARAM: query (Optional[Dict]) - Дополнительные параметры запроса для API.
|
||||||
|
# @PRE: Client is authenticated.
|
||||||
|
# @POST: Returns a tuple with total count and list of dashboards.
|
||||||
# @RETURN: Tuple[int, List[Dict]] - Кортеж (общее количество, список дашбордов).
|
# @RETURN: Tuple[int, List[Dict]] - Кортеж (общее количество, список дашбордов).
|
||||||
def get_dashboards(self, query: Optional[Dict] = None) -> Tuple[int, List[Dict]]:
|
def get_dashboards(self, query: Optional[Dict] = None) -> Tuple[int, List[Dict]]:
|
||||||
with belief_scope("get_dashboards"):
|
with belief_scope("get_dashboards"):
|
||||||
@@ -94,6 +98,8 @@ class SupersetClient:
|
|||||||
|
|
||||||
# [DEF:get_dashboards_summary:Function]
|
# [DEF:get_dashboards_summary:Function]
|
||||||
# @PURPOSE: Fetches dashboard metadata optimized for the grid.
|
# @PURPOSE: Fetches dashboard metadata optimized for the grid.
|
||||||
|
# @PRE: Client is authenticated.
|
||||||
|
# @POST: Returns a list of dashboard metadata summaries.
|
||||||
# @RETURN: List[Dict]
|
# @RETURN: List[Dict]
|
||||||
def get_dashboards_summary(self) -> List[Dict]:
|
def get_dashboards_summary(self) -> List[Dict]:
|
||||||
with belief_scope("SupersetClient.get_dashboards_summary"):
|
with belief_scope("SupersetClient.get_dashboards_summary"):
|
||||||
@@ -117,6 +123,8 @@ class SupersetClient:
|
|||||||
# [DEF:export_dashboard:Function]
|
# [DEF:export_dashboard:Function]
|
||||||
# @PURPOSE: Экспортирует дашборд в виде ZIP-архива.
|
# @PURPOSE: Экспортирует дашборд в виде ZIP-архива.
|
||||||
# @PARAM: dashboard_id (int) - ID дашборда для экспорта.
|
# @PARAM: dashboard_id (int) - ID дашборда для экспорта.
|
||||||
|
# @PRE: dashboard_id must exist in Superset.
|
||||||
|
# @POST: Returns ZIP content and filename.
|
||||||
# @RETURN: Tuple[bytes, str] - Бинарное содержимое ZIP-архива и имя файла.
|
# @RETURN: Tuple[bytes, str] - Бинарное содержимое ZIP-архива и имя файла.
|
||||||
def export_dashboard(self, dashboard_id: int) -> Tuple[bytes, str]:
|
def export_dashboard(self, dashboard_id: int) -> Tuple[bytes, str]:
|
||||||
with belief_scope("export_dashboard"):
|
with belief_scope("export_dashboard"):
|
||||||
@@ -140,6 +148,8 @@ class SupersetClient:
|
|||||||
# @PARAM: file_name (Union[str, Path]) - Путь к ZIP-архиву.
|
# @PARAM: file_name (Union[str, Path]) - Путь к ZIP-архиву.
|
||||||
# @PARAM: dash_id (Optional[int]) - ID дашборда для удаления при сбое.
|
# @PARAM: dash_id (Optional[int]) - ID дашборда для удаления при сбое.
|
||||||
# @PARAM: dash_slug (Optional[str]) - Slug дашборда для поиска ID.
|
# @PARAM: dash_slug (Optional[str]) - Slug дашборда для поиска ID.
|
||||||
|
# @PRE: file_name must be a valid ZIP dashboard export.
|
||||||
|
# @POST: Dashboard is imported or re-imported after deletion.
|
||||||
# @RETURN: Dict - Ответ API в случае успеха.
|
# @RETURN: Dict - Ответ API в случае успеха.
|
||||||
def import_dashboard(self, file_name: Union[str, Path], dash_id: Optional[int] = None, dash_slug: Optional[str] = None) -> Dict:
|
def import_dashboard(self, file_name: Union[str, Path], dash_id: Optional[int] = None, dash_slug: Optional[str] = None) -> Dict:
|
||||||
with belief_scope("import_dashboard"):
|
with belief_scope("import_dashboard"):
|
||||||
@@ -165,6 +175,8 @@ class SupersetClient:
|
|||||||
# [DEF:delete_dashboard:Function]
|
# [DEF:delete_dashboard:Function]
|
||||||
# @PURPOSE: Удаляет дашборд по его ID или slug.
|
# @PURPOSE: Удаляет дашборд по его ID или slug.
|
||||||
# @PARAM: dashboard_id (Union[int, str]) - ID или slug дашборда.
|
# @PARAM: dashboard_id (Union[int, str]) - ID или slug дашборда.
|
||||||
|
# @PRE: dashboard_id must exist.
|
||||||
|
# @POST: Dashboard is removed from Superset.
|
||||||
def delete_dashboard(self, dashboard_id: Union[int, str]) -> None:
|
def delete_dashboard(self, dashboard_id: Union[int, str]) -> None:
|
||||||
with belief_scope("delete_dashboard"):
|
with belief_scope("delete_dashboard"):
|
||||||
app_logger.info("[delete_dashboard][Enter] Deleting dashboard %s.", dashboard_id)
|
app_logger.info("[delete_dashboard][Enter] Deleting dashboard %s.", dashboard_id)
|
||||||
@@ -183,6 +195,8 @@ class SupersetClient:
|
|||||||
# [DEF:get_datasets:Function]
|
# [DEF:get_datasets:Function]
|
||||||
# @PURPOSE: Получает полный список датасетов, автоматически обрабатывая пагинацию.
|
# @PURPOSE: Получает полный список датасетов, автоматически обрабатывая пагинацию.
|
||||||
# @PARAM: query (Optional[Dict]) - Дополнительные параметры запроса.
|
# @PARAM: query (Optional[Dict]) - Дополнительные параметры запроса.
|
||||||
|
# @PRE: Client is authenticated.
|
||||||
|
# @POST: Returns total count and list of datasets.
|
||||||
# @RETURN: Tuple[int, List[Dict]] - Кортеж (общее количество, список датасетов).
|
# @RETURN: Tuple[int, List[Dict]] - Кортеж (общее количество, список датасетов).
|
||||||
def get_datasets(self, query: Optional[Dict] = None) -> Tuple[int, List[Dict]]:
|
def get_datasets(self, query: Optional[Dict] = None) -> Tuple[int, List[Dict]]:
|
||||||
with belief_scope("get_datasets"):
|
with belief_scope("get_datasets"):
|
||||||
@@ -201,6 +215,8 @@ class SupersetClient:
|
|||||||
# [DEF:get_dataset:Function]
|
# [DEF:get_dataset:Function]
|
||||||
# @PURPOSE: Получает информацию о конкретном датасете по его ID.
|
# @PURPOSE: Получает информацию о конкретном датасете по его ID.
|
||||||
# @PARAM: dataset_id (int) - ID датасета.
|
# @PARAM: dataset_id (int) - ID датасета.
|
||||||
|
# @PRE: dataset_id must exist.
|
||||||
|
# @POST: Returns dataset details.
|
||||||
# @RETURN: Dict - Информация о датасете.
|
# @RETURN: Dict - Информация о датасете.
|
||||||
def get_dataset(self, dataset_id: int) -> Dict:
|
def get_dataset(self, dataset_id: int) -> Dict:
|
||||||
with belief_scope("SupersetClient.get_dataset", f"id={dataset_id}"):
|
with belief_scope("SupersetClient.get_dataset", f"id={dataset_id}"):
|
||||||
@@ -215,6 +231,8 @@ class SupersetClient:
|
|||||||
# @PURPOSE: Обновляет данные датасета по его ID.
|
# @PURPOSE: Обновляет данные датасета по его ID.
|
||||||
# @PARAM: dataset_id (int) - ID датасета.
|
# @PARAM: dataset_id (int) - ID датасета.
|
||||||
# @PARAM: data (Dict) - Данные для обновления.
|
# @PARAM: data (Dict) - Данные для обновления.
|
||||||
|
# @PRE: dataset_id must exist.
|
||||||
|
# @POST: Dataset is updated in Superset.
|
||||||
# @RETURN: Dict - Ответ API.
|
# @RETURN: Dict - Ответ API.
|
||||||
def update_dataset(self, dataset_id: int, data: Dict) -> Dict:
|
def update_dataset(self, dataset_id: int, data: Dict) -> Dict:
|
||||||
with belief_scope("SupersetClient.update_dataset", f"id={dataset_id}"):
|
with belief_scope("SupersetClient.update_dataset", f"id={dataset_id}"):
|
||||||
@@ -237,6 +255,8 @@ class SupersetClient:
|
|||||||
# [DEF:get_databases:Function]
|
# [DEF:get_databases:Function]
|
||||||
# @PURPOSE: Получает полный список баз данных.
|
# @PURPOSE: Получает полный список баз данных.
|
||||||
# @PARAM: query (Optional[Dict]) - Дополнительные параметры запроса.
|
# @PARAM: query (Optional[Dict]) - Дополнительные параметры запроса.
|
||||||
|
# @PRE: Client is authenticated.
|
||||||
|
# @POST: Returns total count and list of databases.
|
||||||
# @RETURN: Tuple[int, List[Dict]] - Кортеж (общее количество, список баз данных).
|
# @RETURN: Tuple[int, List[Dict]] - Кортеж (общее количество, список баз данных).
|
||||||
def get_databases(self, query: Optional[Dict] = None) -> Tuple[int, List[Dict]]:
|
def get_databases(self, query: Optional[Dict] = None) -> Tuple[int, List[Dict]]:
|
||||||
with belief_scope("get_databases"):
|
with belief_scope("get_databases"):
|
||||||
@@ -256,6 +276,8 @@ class SupersetClient:
|
|||||||
# [DEF:get_database:Function]
|
# [DEF:get_database:Function]
|
||||||
# @PURPOSE: Получает информацию о конкретной базе данных по её ID.
|
# @PURPOSE: Получает информацию о конкретной базе данных по её ID.
|
||||||
# @PARAM: database_id (int) - ID базы данных.
|
# @PARAM: database_id (int) - ID базы данных.
|
||||||
|
# @PRE: database_id must exist.
|
||||||
|
# @POST: Returns database details.
|
||||||
# @RETURN: Dict - Информация о базе данных.
|
# @RETURN: Dict - Информация о базе данных.
|
||||||
def get_database(self, database_id: int) -> Dict:
|
def get_database(self, database_id: int) -> Dict:
|
||||||
with belief_scope("get_database"):
|
with belief_scope("get_database"):
|
||||||
@@ -268,6 +290,8 @@ class SupersetClient:
|
|||||||
|
|
||||||
# [DEF:get_databases_summary:Function]
|
# [DEF:get_databases_summary:Function]
|
||||||
# @PURPOSE: Fetch a summary of databases including uuid, name, and engine.
|
# @PURPOSE: Fetch a summary of databases including uuid, name, and engine.
|
||||||
|
# @PRE: Client is authenticated.
|
||||||
|
# @POST: Returns list of database summaries.
|
||||||
# @RETURN: List[Dict] - Summary of databases.
|
# @RETURN: List[Dict] - Summary of databases.
|
||||||
def get_databases_summary(self) -> List[Dict]:
|
def get_databases_summary(self) -> List[Dict]:
|
||||||
with belief_scope("SupersetClient.get_databases_summary"):
|
with belief_scope("SupersetClient.get_databases_summary"):
|
||||||
@@ -286,6 +310,8 @@ class SupersetClient:
|
|||||||
# [DEF:get_database_by_uuid:Function]
|
# [DEF:get_database_by_uuid:Function]
|
||||||
# @PURPOSE: Find a database by its UUID.
|
# @PURPOSE: Find a database by its UUID.
|
||||||
# @PARAM: db_uuid (str) - The UUID of the database.
|
# @PARAM: db_uuid (str) - The UUID of the database.
|
||||||
|
# @PRE: db_uuid must be a valid UUID string.
|
||||||
|
# @POST: Returns database info or None.
|
||||||
# @RETURN: Optional[Dict] - Database info if found, else None.
|
# @RETURN: Optional[Dict] - Database info if found, else None.
|
||||||
def get_database_by_uuid(self, db_uuid: str) -> Optional[Dict]:
|
def get_database_by_uuid(self, db_uuid: str) -> Optional[Dict]:
|
||||||
with belief_scope("SupersetClient.get_database_by_uuid", f"uuid={db_uuid}"):
|
with belief_scope("SupersetClient.get_database_by_uuid", f"uuid={db_uuid}"):
|
||||||
@@ -301,6 +327,9 @@ class SupersetClient:
|
|||||||
# [SECTION: HELPERS]
|
# [SECTION: HELPERS]
|
||||||
|
|
||||||
# [DEF:_resolve_target_id_for_delete:Function]
|
# [DEF:_resolve_target_id_for_delete:Function]
|
||||||
|
# @PURPOSE: Resolves a dashboard ID from either an ID or a slug.
|
||||||
|
# @PRE: Either dash_id or dash_slug should be provided.
|
||||||
|
# @POST: Returns the resolved ID or None.
|
||||||
def _resolve_target_id_for_delete(self, dash_id: Optional[int], dash_slug: Optional[str]) -> Optional[int]:
|
def _resolve_target_id_for_delete(self, dash_id: Optional[int], dash_slug: Optional[str]) -> Optional[int]:
|
||||||
with belief_scope("_resolve_target_id_for_delete"):
|
with belief_scope("_resolve_target_id_for_delete"):
|
||||||
if dash_id is not None:
|
if dash_id is not None:
|
||||||
@@ -319,6 +348,9 @@ class SupersetClient:
|
|||||||
# [/DEF:_resolve_target_id_for_delete:Function]
|
# [/DEF:_resolve_target_id_for_delete:Function]
|
||||||
|
|
||||||
# [DEF:_do_import:Function]
|
# [DEF:_do_import:Function]
|
||||||
|
# @PURPOSE: Performs the actual multipart upload for import.
|
||||||
|
# @PRE: file_name must be a path to an existing ZIP file.
|
||||||
|
# @POST: Returns the API response from the upload.
|
||||||
def _do_import(self, file_name: Union[str, Path]) -> Dict:
|
def _do_import(self, file_name: Union[str, Path]) -> Dict:
|
||||||
with belief_scope("_do_import"):
|
with belief_scope("_do_import"):
|
||||||
app_logger.debug(f"[_do_import][State] Uploading file: {file_name}")
|
app_logger.debug(f"[_do_import][State] Uploading file: {file_name}")
|
||||||
@@ -336,6 +368,9 @@ class SupersetClient:
|
|||||||
# [/DEF:_do_import:Function]
|
# [/DEF:_do_import:Function]
|
||||||
|
|
||||||
# [DEF:_validate_export_response:Function]
|
# [DEF:_validate_export_response:Function]
|
||||||
|
# @PURPOSE: Validates that the export response is a non-empty ZIP archive.
|
||||||
|
# @PRE: response must be a valid requests.Response object.
|
||||||
|
# @POST: Raises SupersetAPIError if validation fails.
|
||||||
def _validate_export_response(self, response: Response, dashboard_id: int) -> None:
|
def _validate_export_response(self, response: Response, dashboard_id: int) -> None:
|
||||||
with belief_scope("_validate_export_response"):
|
with belief_scope("_validate_export_response"):
|
||||||
content_type = response.headers.get("Content-Type", "")
|
content_type = response.headers.get("Content-Type", "")
|
||||||
@@ -346,6 +381,9 @@ class SupersetClient:
|
|||||||
# [/DEF:_validate_export_response:Function]
|
# [/DEF:_validate_export_response:Function]
|
||||||
|
|
||||||
# [DEF:_resolve_export_filename:Function]
|
# [DEF:_resolve_export_filename:Function]
|
||||||
|
# @PURPOSE: Determines the filename for an exported dashboard.
|
||||||
|
# @PRE: response must contain Content-Disposition header or dashboard_id must be provided.
|
||||||
|
# @POST: Returns a sanitized filename string.
|
||||||
def _resolve_export_filename(self, response: Response, dashboard_id: int) -> str:
|
def _resolve_export_filename(self, response: Response, dashboard_id: int) -> str:
|
||||||
with belief_scope("_resolve_export_filename"):
|
with belief_scope("_resolve_export_filename"):
|
||||||
filename = get_filename_from_headers(dict(response.headers))
|
filename = get_filename_from_headers(dict(response.headers))
|
||||||
@@ -358,6 +396,9 @@ class SupersetClient:
|
|||||||
# [/DEF:_resolve_export_filename:Function]
|
# [/DEF:_resolve_export_filename:Function]
|
||||||
|
|
||||||
# [DEF:_validate_query_params:Function]
|
# [DEF:_validate_query_params:Function]
|
||||||
|
# @PURPOSE: Ensures query parameters have default page and page_size.
|
||||||
|
# @PRE: query can be None or a dictionary.
|
||||||
|
# @POST: Returns a dictionary with at least page and page_size.
|
||||||
def _validate_query_params(self, query: Optional[Dict]) -> Dict:
|
def _validate_query_params(self, query: Optional[Dict]) -> Dict:
|
||||||
with belief_scope("_validate_query_params"):
|
with belief_scope("_validate_query_params"):
|
||||||
base_query = {"page": 0, "page_size": 1000}
|
base_query = {"page": 0, "page_size": 1000}
|
||||||
@@ -365,6 +406,9 @@ class SupersetClient:
|
|||||||
# [/DEF:_validate_query_params:Function]
|
# [/DEF:_validate_query_params:Function]
|
||||||
|
|
||||||
# [DEF:_fetch_total_object_count:Function]
|
# [DEF:_fetch_total_object_count:Function]
|
||||||
|
# @PURPOSE: Fetches the total number of items for a given endpoint.
|
||||||
|
# @PRE: endpoint must be a valid Superset API path.
|
||||||
|
# @POST: Returns the total count as an integer.
|
||||||
def _fetch_total_object_count(self, endpoint: str) -> int:
|
def _fetch_total_object_count(self, endpoint: str) -> int:
|
||||||
with belief_scope("_fetch_total_object_count"):
|
with belief_scope("_fetch_total_object_count"):
|
||||||
return self.network.fetch_paginated_count(
|
return self.network.fetch_paginated_count(
|
||||||
@@ -375,12 +419,18 @@ class SupersetClient:
|
|||||||
# [/DEF:_fetch_total_object_count:Function]
|
# [/DEF:_fetch_total_object_count:Function]
|
||||||
|
|
||||||
# [DEF:_fetch_all_pages:Function]
|
# [DEF:_fetch_all_pages:Function]
|
||||||
|
# @PURPOSE: Iterates through all pages to collect all data items.
|
||||||
|
# @PRE: pagination_options must contain base_query, total_count, and results_field.
|
||||||
|
# @POST: Returns a combined list of all items.
|
||||||
def _fetch_all_pages(self, endpoint: str, pagination_options: Dict) -> List[Dict]:
|
def _fetch_all_pages(self, endpoint: str, pagination_options: Dict) -> List[Dict]:
|
||||||
with belief_scope("_fetch_all_pages"):
|
with belief_scope("_fetch_all_pages"):
|
||||||
return self.network.fetch_paginated_data(endpoint=endpoint, pagination_options=pagination_options)
|
return self.network.fetch_paginated_data(endpoint=endpoint, pagination_options=pagination_options)
|
||||||
# [/DEF:_fetch_all_pages:Function]
|
# [/DEF:_fetch_all_pages:Function]
|
||||||
|
|
||||||
# [DEF:_validate_import_file:Function]
|
# [DEF:_validate_import_file:Function]
|
||||||
|
# @PURPOSE: Validates that the file to be imported is a valid ZIP with metadata.yaml.
|
||||||
|
# @PRE: zip_path must be a path to a file.
|
||||||
|
# @POST: Raises error if file is missing, not a ZIP, or missing metadata.
|
||||||
def _validate_import_file(self, zip_path: Union[str, Path]) -> None:
|
def _validate_import_file(self, zip_path: Union[str, Path]) -> None:
|
||||||
with belief_scope("_validate_import_file"):
|
with belief_scope("_validate_import_file"):
|
||||||
path = Path(zip_path)
|
path = Path(zip_path)
|
||||||
|
|||||||
@@ -24,8 +24,10 @@ from ..logger import logger as app_logger, belief_scope
|
|||||||
# [/SECTION]
|
# [/SECTION]
|
||||||
|
|
||||||
# [DEF:InvalidZipFormatError:Class]
|
# [DEF:InvalidZipFormatError:Class]
|
||||||
|
# @PURPOSE: Exception raised when a file is not a valid ZIP archive.
|
||||||
class InvalidZipFormatError(Exception):
|
class InvalidZipFormatError(Exception):
|
||||||
pass
|
pass
|
||||||
|
# [/DEF:InvalidZipFormatError:Class]
|
||||||
|
|
||||||
# [DEF:create_temp_file:Function]
|
# [DEF:create_temp_file:Function]
|
||||||
# @PURPOSE: Контекстный менеджер для создания временного файла или директории с гарантированным удалением.
|
# @PURPOSE: Контекстный менеджер для создания временного файла или директории с гарантированным удалением.
|
||||||
|
|||||||
@@ -20,31 +20,71 @@ from ..logger import logger as app_logger, belief_scope
|
|||||||
# [/SECTION]
|
# [/SECTION]
|
||||||
|
|
||||||
# [DEF:SupersetAPIError:Class]
|
# [DEF:SupersetAPIError:Class]
|
||||||
|
# @PURPOSE: Base exception for all Superset API related errors.
|
||||||
class SupersetAPIError(Exception):
|
class SupersetAPIError(Exception):
|
||||||
|
# [DEF:__init__:Function]
|
||||||
|
# @PURPOSE: Initializes the exception with a message and context.
|
||||||
|
# @PRE: message is a string, context is a dict.
|
||||||
|
# @POST: Exception is initialized with context.
|
||||||
def __init__(self, message: str = "Superset API error", **context: Any):
|
def __init__(self, message: str = "Superset API error", **context: Any):
|
||||||
self.context = context
|
with belief_scope("SupersetAPIError.__init__"):
|
||||||
super().__init__(f"[API_FAILURE] {message} | Context: {self.context}")
|
self.context = context
|
||||||
|
super().__init__(f"[API_FAILURE] {message} | Context: {self.context}")
|
||||||
|
# [/DEF:__init__:Function]
|
||||||
|
# [/DEF:SupersetAPIError:Class]
|
||||||
|
|
||||||
# [DEF:AuthenticationError:Class]
|
# [DEF:AuthenticationError:Class]
|
||||||
|
# @PURPOSE: Exception raised when authentication fails.
|
||||||
class AuthenticationError(SupersetAPIError):
|
class AuthenticationError(SupersetAPIError):
|
||||||
|
# [DEF:__init__:Function]
|
||||||
|
# @PURPOSE: Initializes the authentication error.
|
||||||
|
# @PRE: message is a string, context is a dict.
|
||||||
|
# @POST: AuthenticationError is initialized.
|
||||||
def __init__(self, message: str = "Authentication failed", **context: Any):
|
def __init__(self, message: str = "Authentication failed", **context: Any):
|
||||||
super().__init__(message, type="authentication", **context)
|
with belief_scope("AuthenticationError.__init__"):
|
||||||
|
super().__init__(message, type="authentication", **context)
|
||||||
|
# [/DEF:__init__:Function]
|
||||||
|
# [/DEF:AuthenticationError:Class]
|
||||||
|
|
||||||
# [DEF:PermissionDeniedError:Class]
|
# [DEF:PermissionDeniedError:Class]
|
||||||
|
# @PURPOSE: Exception raised when access is denied.
|
||||||
class PermissionDeniedError(AuthenticationError):
|
class PermissionDeniedError(AuthenticationError):
|
||||||
|
# [DEF:__init__:Function]
|
||||||
|
# @PURPOSE: Initializes the permission denied error.
|
||||||
|
# @PRE: message is a string, context is a dict.
|
||||||
|
# @POST: PermissionDeniedError is initialized.
|
||||||
def __init__(self, message: str = "Permission denied", **context: Any):
|
def __init__(self, message: str = "Permission denied", **context: Any):
|
||||||
super().__init__(message, **context)
|
with belief_scope("PermissionDeniedError.__init__"):
|
||||||
|
super().__init__(message, **context)
|
||||||
|
# [/DEF:__init__:Function]
|
||||||
|
# [/DEF:PermissionDeniedError:Class]
|
||||||
|
|
||||||
# [DEF:DashboardNotFoundError:Class]
|
# [DEF:DashboardNotFoundError:Class]
|
||||||
|
# @PURPOSE: Exception raised when a dashboard cannot be found.
|
||||||
class DashboardNotFoundError(SupersetAPIError):
|
class DashboardNotFoundError(SupersetAPIError):
|
||||||
|
# [DEF:__init__:Function]
|
||||||
|
# @PURPOSE: Initializes the not found error with resource ID.
|
||||||
|
# @PRE: resource_id is provided.
|
||||||
|
# @POST: DashboardNotFoundError is initialized.
|
||||||
def __init__(self, resource_id: Union[int, str], message: str = "Dashboard not found", **context: Any):
|
def __init__(self, resource_id: Union[int, str], message: str = "Dashboard not found", **context: Any):
|
||||||
super().__init__(f"Dashboard '{resource_id}' {message}", subtype="not_found", resource_id=resource_id, **context)
|
with belief_scope("DashboardNotFoundError.__init__"):
|
||||||
|
super().__init__(f"Dashboard '{resource_id}' {message}", subtype="not_found", resource_id=resource_id, **context)
|
||||||
|
# [/DEF:__init__:Function]
|
||||||
|
# [/DEF:DashboardNotFoundError:Class]
|
||||||
|
|
||||||
# [DEF:NetworkError:Class]
|
# [DEF:NetworkError:Class]
|
||||||
|
# @PURPOSE: Exception raised when a network level error occurs.
|
||||||
class NetworkError(Exception):
|
class NetworkError(Exception):
|
||||||
|
# [DEF:__init__:Function]
|
||||||
|
# @PURPOSE: Initializes the network error.
|
||||||
|
# @PRE: message is a string.
|
||||||
|
# @POST: NetworkError is initialized.
|
||||||
def __init__(self, message: str = "Network connection failed", **context: Any):
|
def __init__(self, message: str = "Network connection failed", **context: Any):
|
||||||
self.context = context
|
with belief_scope("NetworkError.__init__"):
|
||||||
super().__init__(f"[NETWORK_FAILURE] {message} | Context: {self.context}")
|
self.context = context
|
||||||
|
super().__init__(f"[NETWORK_FAILURE] {message} | Context: {self.context}")
|
||||||
|
# [/DEF:__init__:Function]
|
||||||
|
# [/DEF:NetworkError:Class]
|
||||||
|
|
||||||
# [DEF:APIClient:Class]
|
# [DEF:APIClient:Class]
|
||||||
# @PURPOSE: Инкапсулирует HTTP-логику для работы с API, включая сессии, аутентификацию, и обработку запросов.
|
# @PURPOSE: Инкапсулирует HTTP-логику для работы с API, включая сессии, аутентификацию, и обработку запросов.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
"""
|
# [DEF:GitModels:Module]
|
||||||
[DEF:GitModels:Module]
|
# @SEMANTICS: git, models, sqlalchemy, database, schema
|
||||||
Git-specific SQLAlchemy models for configuration and repository tracking.
|
# @PURPOSE: Git-specific SQLAlchemy models for configuration and repository tracking.
|
||||||
@RELATION: specs/011-git-integration-dashboard/data-model.md
|
# @LAYER: Model
|
||||||
"""
|
# @RELATION: specs/011-git-integration-dashboard/data-model.md
|
||||||
|
|
||||||
import enum
|
import enum
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ class GitPlugin(PluginBase):
|
|||||||
|
|
||||||
# [DEF:__init__:Function]
|
# [DEF:__init__:Function]
|
||||||
# @PURPOSE: Инициализирует плагин и его зависимости.
|
# @PURPOSE: Инициализирует плагин и его зависимости.
|
||||||
|
# @PRE: config.json exists or shared config_manager is available.
|
||||||
# @POST: Инициализированы git_service и config_manager.
|
# @POST: Инициализированы git_service и config_manager.
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
with belief_scope("GitPlugin.__init__"):
|
with belief_scope("GitPlugin.__init__"):
|
||||||
@@ -59,23 +60,49 @@ class GitPlugin(PluginBase):
|
|||||||
# [/DEF:__init__:Function]
|
# [/DEF:__init__:Function]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
# [DEF:id:Function]
|
||||||
|
# @PURPOSE: Returns the plugin identifier.
|
||||||
|
# @PRE: GitPlugin is initialized.
|
||||||
|
# @POST: Returns 'git-integration'.
|
||||||
def id(self) -> str:
|
def id(self) -> str:
|
||||||
return "git-integration"
|
with belief_scope("GitPlugin.id"):
|
||||||
|
return "git-integration"
|
||||||
|
# [/DEF:id:Function]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
# [DEF:name:Function]
|
||||||
|
# @PURPOSE: Returns the plugin name.
|
||||||
|
# @PRE: GitPlugin is initialized.
|
||||||
|
# @POST: Returns the human-readable name.
|
||||||
def name(self) -> str:
|
def name(self) -> str:
|
||||||
return "Git Integration"
|
with belief_scope("GitPlugin.name"):
|
||||||
|
return "Git Integration"
|
||||||
|
# [/DEF:name:Function]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
# [DEF:description:Function]
|
||||||
|
# @PURPOSE: Returns the plugin description.
|
||||||
|
# @PRE: GitPlugin is initialized.
|
||||||
|
# @POST: Returns the plugin's purpose description.
|
||||||
def description(self) -> str:
|
def description(self) -> str:
|
||||||
return "Version control for Superset dashboards"
|
with belief_scope("GitPlugin.description"):
|
||||||
|
return "Version control for Superset dashboards"
|
||||||
|
# [/DEF:description:Function]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
# [DEF:version:Function]
|
||||||
|
# @PURPOSE: Returns the plugin version.
|
||||||
|
# @PRE: GitPlugin is initialized.
|
||||||
|
# @POST: Returns the version string.
|
||||||
def version(self) -> str:
|
def version(self) -> str:
|
||||||
return "0.1.0"
|
with belief_scope("GitPlugin.version"):
|
||||||
|
return "0.1.0"
|
||||||
|
# [/DEF:version:Function]
|
||||||
|
|
||||||
# [DEF:get_schema:Function]
|
# [DEF:get_schema:Function]
|
||||||
# @PURPOSE: Возвращает JSON-схему параметров для выполнения задач плагина.
|
# @PURPOSE: Возвращает JSON-схему параметров для выполнения задач плагина.
|
||||||
|
# @PRE: GitPlugin is initialized.
|
||||||
|
# @POST: Returns a JSON schema dictionary.
|
||||||
# @RETURN: Dict[str, Any] - Схема параметров.
|
# @RETURN: Dict[str, Any] - Схема параметров.
|
||||||
def get_schema(self) -> Dict[str, Any]:
|
def get_schema(self) -> Dict[str, Any]:
|
||||||
with belief_scope("GitPlugin.get_schema"):
|
with belief_scope("GitPlugin.get_schema"):
|
||||||
@@ -93,6 +120,7 @@ class GitPlugin(PluginBase):
|
|||||||
|
|
||||||
# [DEF:initialize:Function]
|
# [DEF:initialize:Function]
|
||||||
# @PURPOSE: Выполняет начальную настройку плагина.
|
# @PURPOSE: Выполняет начальную настройку плагина.
|
||||||
|
# @PRE: GitPlugin is initialized.
|
||||||
# @POST: Плагин готов к выполнению задач.
|
# @POST: Плагин готов к выполнению задач.
|
||||||
async def initialize(self):
|
async def initialize(self):
|
||||||
with belief_scope("GitPlugin.initialize"):
|
with belief_scope("GitPlugin.initialize"):
|
||||||
@@ -281,6 +309,8 @@ class GitPlugin(PluginBase):
|
|||||||
# [DEF:_get_env:Function]
|
# [DEF:_get_env:Function]
|
||||||
# @PURPOSE: Вспомогательный метод для получения конфигурации окружения.
|
# @PURPOSE: Вспомогательный метод для получения конфигурации окружения.
|
||||||
# @PARAM: env_id (Optional[str]) - ID окружения.
|
# @PARAM: env_id (Optional[str]) - ID окружения.
|
||||||
|
# @PRE: env_id is a string or None.
|
||||||
|
# @POST: Returns an Environment object from config or DB.
|
||||||
# @RETURN: Environment - Объект конфигурации окружения.
|
# @RETURN: Environment - Объект конфигурации окружения.
|
||||||
def _get_env(self, env_id: Optional[str] = None):
|
def _get_env(self, env_id: Optional[str] = None):
|
||||||
with belief_scope("GitPlugin._get_env"):
|
with belief_scope("GitPlugin._get_env"):
|
||||||
@@ -341,5 +371,6 @@ class GitPlugin(PluginBase):
|
|||||||
raise ValueError("No environments configured. Please add a Superset Environment in Settings.")
|
raise ValueError("No environments configured. Please add a Superset Environment in Settings.")
|
||||||
# [/DEF:_get_env:Function]
|
# [/DEF:_get_env:Function]
|
||||||
|
|
||||||
|
# [/DEF:initialize:Function]
|
||||||
# [/DEF:GitPlugin:Class]
|
# [/DEF:GitPlugin:Class]
|
||||||
# [/DEF:backend.src.plugins.git_plugin:Module]
|
# [/DEF:backend.src.plugins.git_plugin:Module]
|
||||||
@@ -29,6 +29,8 @@ class GitService:
|
|||||||
# [DEF:__init__:Function]
|
# [DEF:__init__:Function]
|
||||||
# @PURPOSE: Initializes the GitService with a base path for repositories.
|
# @PURPOSE: Initializes the GitService with a base path for repositories.
|
||||||
# @PARAM: base_path (str) - Root directory for all Git clones.
|
# @PARAM: base_path (str) - Root directory for all Git clones.
|
||||||
|
# @PRE: base_path is a valid string path.
|
||||||
|
# @POST: GitService is initialized; base_path directory exists.
|
||||||
def __init__(self, base_path: str = "backend/git_repos"):
|
def __init__(self, base_path: str = "backend/git_repos"):
|
||||||
with belief_scope("GitService.__init__"):
|
with belief_scope("GitService.__init__"):
|
||||||
self.base_path = base_path
|
self.base_path = base_path
|
||||||
@@ -39,9 +41,12 @@ class GitService:
|
|||||||
# [DEF:_get_repo_path:Function]
|
# [DEF:_get_repo_path:Function]
|
||||||
# @PURPOSE: Resolves the local filesystem path for a dashboard's repository.
|
# @PURPOSE: Resolves the local filesystem path for a dashboard's repository.
|
||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
|
# @PRE: dashboard_id is an integer.
|
||||||
|
# @POST: Returns the absolute or relative path to the dashboard's repo.
|
||||||
# @RETURN: str
|
# @RETURN: str
|
||||||
def _get_repo_path(self, dashboard_id: int) -> str:
|
def _get_repo_path(self, dashboard_id: int) -> str:
|
||||||
return os.path.join(self.base_path, str(dashboard_id))
|
with belief_scope("GitService._get_repo_path"):
|
||||||
|
return os.path.join(self.base_path, str(dashboard_id))
|
||||||
# [/DEF:_get_repo_path:Function]
|
# [/DEF:_get_repo_path:Function]
|
||||||
|
|
||||||
# [DEF:init_repo:Function]
|
# [DEF:init_repo:Function]
|
||||||
@@ -49,6 +54,8 @@ class GitService:
|
|||||||
# @PARAM: dashboard_id (int)
|
# @PARAM: dashboard_id (int)
|
||||||
# @PARAM: remote_url (str)
|
# @PARAM: remote_url (str)
|
||||||
# @PARAM: pat (str) - Personal Access Token for authentication.
|
# @PARAM: pat (str) - Personal Access Token for authentication.
|
||||||
|
# @PRE: dashboard_id is int, remote_url is valid Git URL, pat is provided.
|
||||||
|
# @POST: Repository is cloned or opened at the local path.
|
||||||
# @RETURN: Repo - GitPython Repo object.
|
# @RETURN: Repo - GitPython Repo object.
|
||||||
def init_repo(self, dashboard_id: int, remote_url: str, pat: str) -> Repo:
|
def init_repo(self, dashboard_id: int, remote_url: str, pat: str) -> Repo:
|
||||||
with belief_scope("GitService.init_repo"):
|
with belief_scope("GitService.init_repo"):
|
||||||
@@ -71,7 +78,8 @@ class GitService:
|
|||||||
|
|
||||||
# [DEF:get_repo:Function]
|
# [DEF:get_repo:Function]
|
||||||
# @PURPOSE: Get Repo object for a dashboard.
|
# @PURPOSE: Get Repo object for a dashboard.
|
||||||
# @PRE: Repository must exist on disk.
|
# @PRE: Repository must exist on disk for the given dashboard_id.
|
||||||
|
# @POST: Returns a GitPython Repo instance for the dashboard.
|
||||||
# @RETURN: Repo
|
# @RETURN: Repo
|
||||||
def get_repo(self, dashboard_id: int) -> Repo:
|
def get_repo(self, dashboard_id: int) -> Repo:
|
||||||
with belief_scope("GitService.get_repo"):
|
with belief_scope("GitService.get_repo"):
|
||||||
@@ -88,6 +96,8 @@ class GitService:
|
|||||||
|
|
||||||
# [DEF:list_branches:Function]
|
# [DEF:list_branches:Function]
|
||||||
# @PURPOSE: List all branches for a dashboard's repository.
|
# @PURPOSE: List all branches for a dashboard's repository.
|
||||||
|
# @PRE: Repository for dashboard_id exists.
|
||||||
|
# @POST: Returns a list of branch metadata dictionaries.
|
||||||
# @RETURN: List[dict]
|
# @RETURN: List[dict]
|
||||||
def list_branches(self, dashboard_id: int) -> List[dict]:
|
def list_branches(self, dashboard_id: int) -> List[dict]:
|
||||||
with belief_scope("GitService.list_branches"):
|
with belief_scope("GitService.list_branches"):
|
||||||
@@ -142,6 +152,8 @@ class GitService:
|
|||||||
# @PURPOSE: Create a new branch from an existing one.
|
# @PURPOSE: Create a new branch from an existing one.
|
||||||
# @PARAM: name (str) - New branch name.
|
# @PARAM: name (str) - New branch name.
|
||||||
# @PARAM: from_branch (str) - Source branch.
|
# @PARAM: from_branch (str) - Source branch.
|
||||||
|
# @PRE: Repository exists; name is valid; from_branch exists or repo is empty.
|
||||||
|
# @POST: A new branch is created in the repository.
|
||||||
def create_branch(self, dashboard_id: int, name: str, from_branch: str = "main"):
|
def create_branch(self, dashboard_id: int, name: str, from_branch: str = "main"):
|
||||||
with belief_scope("GitService.create_branch"):
|
with belief_scope("GitService.create_branch"):
|
||||||
repo = self.get_repo(dashboard_id)
|
repo = self.get_repo(dashboard_id)
|
||||||
@@ -171,10 +183,11 @@ class GitService:
|
|||||||
logger.error(f"[create_branch][Coherence:Failed] {e}")
|
logger.error(f"[create_branch][Coherence:Failed] {e}")
|
||||||
raise
|
raise
|
||||||
# [/DEF:create_branch:Function]
|
# [/DEF:create_branch:Function]
|
||||||
# [/DEF:create_branch:Function]
|
|
||||||
|
|
||||||
# [DEF:checkout_branch:Function]
|
# [DEF:checkout_branch:Function]
|
||||||
# @PURPOSE: Switch to a specific branch.
|
# @PURPOSE: Switch to a specific branch.
|
||||||
|
# @PRE: Repository exists and the specified branch name exists.
|
||||||
|
# @POST: The repository working directory is updated to the specified branch.
|
||||||
def checkout_branch(self, dashboard_id: int, name: str):
|
def checkout_branch(self, dashboard_id: int, name: str):
|
||||||
with belief_scope("GitService.checkout_branch"):
|
with belief_scope("GitService.checkout_branch"):
|
||||||
repo = self.get_repo(dashboard_id)
|
repo = self.get_repo(dashboard_id)
|
||||||
@@ -186,6 +199,8 @@ class GitService:
|
|||||||
# @PURPOSE: Stage and commit changes.
|
# @PURPOSE: Stage and commit changes.
|
||||||
# @PARAM: message (str) - Commit message.
|
# @PARAM: message (str) - Commit message.
|
||||||
# @PARAM: files (List[str]) - Optional list of specific files to stage.
|
# @PARAM: files (List[str]) - Optional list of specific files to stage.
|
||||||
|
# @PRE: Repository exists and has changes (dirty) or files are specified.
|
||||||
|
# @POST: Changes are staged and a new commit is created.
|
||||||
def commit_changes(self, dashboard_id: int, message: str, files: List[str] = None):
|
def commit_changes(self, dashboard_id: int, message: str, files: List[str] = None):
|
||||||
with belief_scope("GitService.commit_changes"):
|
with belief_scope("GitService.commit_changes"):
|
||||||
repo = self.get_repo(dashboard_id)
|
repo = self.get_repo(dashboard_id)
|
||||||
@@ -208,6 +223,8 @@ class GitService:
|
|||||||
|
|
||||||
# [DEF:push_changes:Function]
|
# [DEF:push_changes:Function]
|
||||||
# @PURPOSE: Push local commits to remote.
|
# @PURPOSE: Push local commits to remote.
|
||||||
|
# @PRE: Repository exists and has an 'origin' remote.
|
||||||
|
# @POST: Local branch commits are pushed to origin.
|
||||||
def push_changes(self, dashboard_id: int):
|
def push_changes(self, dashboard_id: int):
|
||||||
with belief_scope("GitService.push_changes"):
|
with belief_scope("GitService.push_changes"):
|
||||||
repo = self.get_repo(dashboard_id)
|
repo = self.get_repo(dashboard_id)
|
||||||
@@ -240,6 +257,8 @@ class GitService:
|
|||||||
|
|
||||||
# [DEF:pull_changes:Function]
|
# [DEF:pull_changes:Function]
|
||||||
# @PURPOSE: Pull changes from remote.
|
# @PURPOSE: Pull changes from remote.
|
||||||
|
# @PRE: Repository exists and has an 'origin' remote.
|
||||||
|
# @POST: Changes from origin are pulled and merged into the active branch.
|
||||||
def pull_changes(self, dashboard_id: int):
|
def pull_changes(self, dashboard_id: int):
|
||||||
with belief_scope("GitService.pull_changes"):
|
with belief_scope("GitService.pull_changes"):
|
||||||
repo = self.get_repo(dashboard_id)
|
repo = self.get_repo(dashboard_id)
|
||||||
@@ -261,6 +280,8 @@ class GitService:
|
|||||||
|
|
||||||
# [DEF:get_status:Function]
|
# [DEF:get_status:Function]
|
||||||
# @PURPOSE: Get current repository status (dirty files, untracked, etc.)
|
# @PURPOSE: Get current repository status (dirty files, untracked, etc.)
|
||||||
|
# @PRE: Repository for dashboard_id exists.
|
||||||
|
# @POST: Returns a dictionary representing the Git status.
|
||||||
# @RETURN: dict
|
# @RETURN: dict
|
||||||
def get_status(self, dashboard_id: int) -> dict:
|
def get_status(self, dashboard_id: int) -> dict:
|
||||||
with belief_scope("GitService.get_status"):
|
with belief_scope("GitService.get_status"):
|
||||||
@@ -287,6 +308,8 @@ class GitService:
|
|||||||
# @PURPOSE: Generate diff for a file or the whole repository.
|
# @PURPOSE: Generate diff for a file or the whole repository.
|
||||||
# @PARAM: file_path (str) - Optional specific file.
|
# @PARAM: file_path (str) - Optional specific file.
|
||||||
# @PARAM: staged (bool) - Whether to show staged changes.
|
# @PARAM: staged (bool) - Whether to show staged changes.
|
||||||
|
# @PRE: Repository for dashboard_id exists.
|
||||||
|
# @POST: Returns the diff text as a string.
|
||||||
# @RETURN: str
|
# @RETURN: str
|
||||||
def get_diff(self, dashboard_id: int, file_path: str = None, staged: bool = False) -> str:
|
def get_diff(self, dashboard_id: int, file_path: str = None, staged: bool = False) -> str:
|
||||||
with belief_scope("GitService.get_diff"):
|
with belief_scope("GitService.get_diff"):
|
||||||
@@ -303,6 +326,8 @@ class GitService:
|
|||||||
# [DEF:get_commit_history:Function]
|
# [DEF:get_commit_history:Function]
|
||||||
# @PURPOSE: Retrieve commit history for a repository.
|
# @PURPOSE: Retrieve commit history for a repository.
|
||||||
# @PARAM: limit (int) - Max number of commits to return.
|
# @PARAM: limit (int) - Max number of commits to return.
|
||||||
|
# @PRE: Repository for dashboard_id exists.
|
||||||
|
# @POST: Returns a list of dictionaries for each commit in history.
|
||||||
# @RETURN: List[dict]
|
# @RETURN: List[dict]
|
||||||
def get_commit_history(self, dashboard_id: int, limit: int = 50) -> List[dict]:
|
def get_commit_history(self, dashboard_id: int, limit: int = 50) -> List[dict]:
|
||||||
with belief_scope("GitService.get_commit_history"):
|
with belief_scope("GitService.get_commit_history"):
|
||||||
@@ -333,6 +358,8 @@ class GitService:
|
|||||||
# @PARAM: provider (GitProvider)
|
# @PARAM: provider (GitProvider)
|
||||||
# @PARAM: url (str)
|
# @PARAM: url (str)
|
||||||
# @PARAM: pat (str)
|
# @PARAM: pat (str)
|
||||||
|
# @PRE: provider is valid; url is a valid HTTP(S) URL; pat is provided.
|
||||||
|
# @POST: Returns True if connection to the provider's API succeeds.
|
||||||
# @RETURN: bool
|
# @RETURN: bool
|
||||||
async def test_connection(self, provider: GitProvider, url: str, pat: str) -> bool:
|
async def test_connection(self, provider: GitProvider, url: str, pat: str) -> bool:
|
||||||
with belief_scope("GitService.test_connection"):
|
with belief_scope("GitService.test_connection"):
|
||||||
|
|||||||
BIN
backend/tasks.db
BIN
backend/tasks.db
Binary file not shown.
@@ -18,6 +18,4 @@ def test_environment_model():
|
|||||||
assert env.id == "test-id"
|
assert env.id == "test-id"
|
||||||
assert env.name == "test-env"
|
assert env.name == "test-env"
|
||||||
assert env.url == "http://localhost:8088/api/v1"
|
assert env.url == "http://localhost:8088/api/v1"
|
||||||
# [/DEF:test_superset_config_url_normalization:Function]
|
# [/DEF:test_environment_model:Function]
|
||||||
|
|
||||||
# [/DEF:test_superset_config_invalid_url:Function]
|
|
||||||
|
|||||||
26
frontend/.gitignore
vendored
Executable file
26
frontend/.gitignore
vendored
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
*.local
|
||||||
|
.svelte-kit
|
||||||
|
build
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
@@ -12,6 +12,8 @@
|
|||||||
// [SECTION: IMPORTS]
|
// [SECTION: IMPORTS]
|
||||||
import { createEventDispatcher } from 'svelte';
|
import { createEventDispatcher } from 'svelte';
|
||||||
import type { DashboardMetadata } from '../types/dashboard';
|
import type { DashboardMetadata } from '../types/dashboard';
|
||||||
|
import { t } from '../lib/i18n';
|
||||||
|
import { Button, Input } from '../lib/ui';
|
||||||
import GitManager from './git/GitManager.svelte';
|
import GitManager from './git/GitManager.svelte';
|
||||||
// [/SECTION]
|
// [/SECTION]
|
||||||
|
|
||||||
@@ -143,64 +145,66 @@
|
|||||||
<!-- [SECTION: TEMPLATE] -->
|
<!-- [SECTION: TEMPLATE] -->
|
||||||
<div class="dashboard-grid">
|
<div class="dashboard-grid">
|
||||||
<!-- Filter Input -->
|
<!-- Filter Input -->
|
||||||
<div class="mb-4">
|
<div class="mb-6">
|
||||||
<input
|
<Input
|
||||||
type="text"
|
|
||||||
bind:value={filterText}
|
bind:value={filterText}
|
||||||
placeholder="Search dashboards..."
|
placeholder={$t.dashboard.search}
|
||||||
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Grid/Table -->
|
<!-- Grid/Table -->
|
||||||
<div class="overflow-x-auto">
|
<div class="overflow-x-auto rounded-lg border border-gray-200">
|
||||||
<table class="min-w-full bg-white border border-gray-300">
|
<table class="min-w-full divide-y divide-gray-200">
|
||||||
<thead class="bg-gray-50">
|
<thead class="bg-gray-50">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="px-4 py-2 border-b">
|
<th class="px-6 py-3 text-left">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={allSelected}
|
checked={allSelected}
|
||||||
indeterminate={someSelected && !allSelected}
|
indeterminate={someSelected && !allSelected}
|
||||||
on:change={(e) => handleSelectAll((e.target as HTMLInputElement).checked)}
|
on:change={(e) => handleSelectAll((e.target as HTMLInputElement).checked)}
|
||||||
|
class="h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"
|
||||||
/>
|
/>
|
||||||
</th>
|
</th>
|
||||||
<th class="px-4 py-2 border-b cursor-pointer" on:click={() => handleSort('title')}>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:text-gray-700 transition-colors" on:click={() => handleSort('title')}>
|
||||||
Title {sortColumn === 'title' ? (sortDirection === 'asc' ? '↑' : '↓') : ''}
|
{$t.dashboard.title} {sortColumn === 'title' ? (sortDirection === 'asc' ? '↑' : '↓') : ''}
|
||||||
</th>
|
</th>
|
||||||
<th class="px-4 py-2 border-b cursor-pointer" on:click={() => handleSort('last_modified')}>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:text-gray-700 transition-colors" on:click={() => handleSort('last_modified')}>
|
||||||
Last Modified {sortColumn === 'last_modified' ? (sortDirection === 'asc' ? '↑' : '↓') : ''}
|
{$t.dashboard.last_modified} {sortColumn === 'last_modified' ? (sortDirection === 'asc' ? '↑' : '↓') : ''}
|
||||||
</th>
|
</th>
|
||||||
<th class="px-4 py-2 border-b cursor-pointer" on:click={() => handleSort('status')}>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:text-gray-700 transition-colors" on:click={() => handleSort('status')}>
|
||||||
Status {sortColumn === 'status' ? (sortDirection === 'asc' ? '↑' : '↓') : ''}
|
{$t.dashboard.status} {sortColumn === 'status' ? (sortDirection === 'asc' ? '↑' : '↓') : ''}
|
||||||
</th>
|
</th>
|
||||||
<th class="px-4 py-2 border-b">Git</th>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{$t.dashboard.git}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody class="bg-white divide-y divide-gray-200">
|
||||||
{#each paginatedDashboards as dashboard (dashboard.id)}
|
{#each paginatedDashboards as dashboard (dashboard.id)}
|
||||||
<tr class="hover:bg-gray-50">
|
<tr class="hover:bg-gray-50 transition-colors">
|
||||||
<td class="px-4 py-2 border-b">
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={selectedIds.includes(dashboard.id)}
|
checked={selectedIds.includes(dashboard.id)}
|
||||||
on:change={(e) => handleSelectionChange(dashboard.id, (e.target as HTMLInputElement).checked)}
|
on:change={(e) => handleSelectionChange(dashboard.id, (e.target as HTMLInputElement).checked)}
|
||||||
|
class="h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-2 border-b">{dashboard.title}</td>
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">{dashboard.title}</td>
|
||||||
<td class="px-4 py-2 border-b">{new Date(dashboard.last_modified).toLocaleDateString()}</td>
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{new Date(dashboard.last_modified).toLocaleDateString()}</td>
|
||||||
<td class="px-4 py-2 border-b">
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
||||||
<span class="px-2 py-1 text-xs font-medium rounded-full {dashboard.status === 'published' ? 'bg-green-100 text-green-800' : 'bg-gray-100 text-gray-800'}">
|
<span class="px-2 py-1 text-xs font-medium rounded-full {dashboard.status === 'published' ? 'bg-green-100 text-green-800' : 'bg-gray-100 text-gray-800'}">
|
||||||
{dashboard.status}
|
{dashboard.status}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-2 border-b">
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
|
||||||
<button
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
on:click={() => openGit(dashboard)}
|
on:click={() => openGit(dashboard)}
|
||||||
class="text-indigo-600 hover:text-indigo-900 text-sm font-medium"
|
class="text-blue-600 hover:text-blue-900"
|
||||||
>
|
>
|
||||||
Manage Git
|
{$t.git.manage}
|
||||||
</button>
|
</Button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
@@ -209,25 +213,30 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Pagination Controls -->
|
<!-- Pagination Controls -->
|
||||||
<div class="flex items-center justify-between mt-4">
|
<div class="flex items-center justify-between mt-6">
|
||||||
<div class="text-sm text-gray-700">
|
<div class="text-sm text-gray-500">
|
||||||
Showing {currentPage * pageSize + 1} to {Math.min((currentPage + 1) * pageSize, sortedDashboards.length)} of {sortedDashboards.length} dashboards
|
{($t.dashboard?.showing || "")
|
||||||
|
.replace('{start}', (currentPage * pageSize + 1).toString())
|
||||||
|
.replace('{end}', Math.min((currentPage + 1) * pageSize, sortedDashboards.length).toString())
|
||||||
|
.replace('{total}', sortedDashboards.length.toString())}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex space-x-2">
|
<div class="flex gap-2">
|
||||||
<button
|
<Button
|
||||||
class="px-3 py-1 text-sm border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"
|
variant="secondary"
|
||||||
|
size="sm"
|
||||||
disabled={currentPage === 0}
|
disabled={currentPage === 0}
|
||||||
on:click={() => goToPage(currentPage - 1)}
|
on:click={() => goToPage(currentPage - 1)}
|
||||||
>
|
>
|
||||||
Previous
|
{$t.dashboard.previous}
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button
|
||||||
class="px-3 py-1 text-sm border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"
|
variant="secondary"
|
||||||
|
size="sm"
|
||||||
disabled={currentPage >= totalPages - 1}
|
disabled={currentPage >= totalPages - 1}
|
||||||
on:click={() => goToPage(currentPage + 1)}
|
on:click={() => goToPage(currentPage + 1)}
|
||||||
>
|
>
|
||||||
Next
|
{$t.dashboard.next}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,61 +7,64 @@
|
|||||||
-->
|
-->
|
||||||
<script>
|
<script>
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
|
import { t } from '$lib/i18n';
|
||||||
|
import { LanguageSwitcher } from '$lib/ui';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<header class="bg-white shadow-md p-4 flex justify-between items-center">
|
<header class="bg-white shadow-md p-4 flex justify-between items-center">
|
||||||
<a
|
<a
|
||||||
href="/"
|
href="/"
|
||||||
class="text-3xl font-bold text-gray-800 focus:outline-none"
|
class="text-2xl font-bold text-gray-800 focus:outline-none"
|
||||||
>
|
>
|
||||||
Superset Tools
|
Superset Tools
|
||||||
</a>
|
</a>
|
||||||
<nav class="space-x-4">
|
<nav class="flex items-center space-x-4">
|
||||||
<a
|
<a
|
||||||
href="/"
|
href="/"
|
||||||
class="text-gray-600 hover:text-blue-600 font-medium {$page.url.pathname === '/' ? 'text-blue-600 border-b-2 border-blue-600' : ''}"
|
class="text-gray-600 hover:text-blue-600 font-medium {$page.url.pathname === '/' ? 'text-blue-600 border-b-2 border-blue-600' : ''}"
|
||||||
>
|
>
|
||||||
Dashboard
|
{$t.nav.dashboard}
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="/migration"
|
href="/migration"
|
||||||
class="text-gray-600 hover:text-blue-600 font-medium {$page.url.pathname.startsWith('/migration') ? 'text-blue-600 border-b-2 border-blue-600' : ''}"
|
class="text-gray-600 hover:text-blue-600 font-medium {$page.url.pathname.startsWith('/migration') ? 'text-blue-600 border-b-2 border-blue-600' : ''}"
|
||||||
>
|
>
|
||||||
Migration
|
{$t.nav.migration}
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="/git"
|
href="/git"
|
||||||
class="text-gray-600 hover:text-blue-600 font-medium {$page.url.pathname.startsWith('/git') ? 'text-blue-600 border-b-2 border-blue-600' : ''}"
|
class="text-gray-600 hover:text-blue-600 font-medium {$page.url.pathname.startsWith('/git') ? 'text-blue-600 border-b-2 border-blue-600' : ''}"
|
||||||
>
|
>
|
||||||
Git
|
{$t.nav.git}
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="/tasks"
|
href="/tasks"
|
||||||
class="text-gray-600 hover:text-blue-600 font-medium {$page.url.pathname.startsWith('/tasks') ? 'text-blue-600 border-b-2 border-blue-600' : ''}"
|
class="text-gray-600 hover:text-blue-600 font-medium {$page.url.pathname.startsWith('/tasks') ? 'text-blue-600 border-b-2 border-blue-600' : ''}"
|
||||||
>
|
>
|
||||||
Tasks
|
{$t.nav.tasks}
|
||||||
</a>
|
</a>
|
||||||
<div class="relative inline-block group">
|
<div class="relative inline-block group">
|
||||||
<button class="text-gray-600 hover:text-blue-600 font-medium pb-1 {$page.url.pathname.startsWith('/tools') ? 'text-blue-600 border-b-2 border-blue-600' : ''}">
|
<button class="text-gray-600 hover:text-blue-600 font-medium pb-1 {$page.url.pathname.startsWith('/tools') ? 'text-blue-600 border-b-2 border-blue-600' : ''}">
|
||||||
Tools
|
{$t.nav.tools}
|
||||||
</button>
|
</button>
|
||||||
<div class="absolute hidden group-hover:block bg-white shadow-lg rounded-md mt-1 py-2 w-48 z-10 border border-gray-100 before:absolute before:-top-2 before:left-0 before:right-0 before:h-2 before:content-[''] right-0">
|
<div class="absolute hidden group-hover:block bg-white shadow-lg rounded-md mt-1 py-2 w-48 z-10 border border-gray-100 before:absolute before:-top-2 before:left-0 before:right-0 before:h-2 before:content-[''] right-0">
|
||||||
<a href="/tools/search" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">Dataset Search</a>
|
<a href="/tools/search" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">{$t.nav.tools_search}</a>
|
||||||
<a href="/tools/mapper" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">Dataset Mapper</a>
|
<a href="/tools/mapper" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">{$t.nav.tools_mapper}</a>
|
||||||
<a href="/tools/debug" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">System Debug</a>
|
<a href="/tools/debug" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">{$t.nav.tools_debug}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative inline-block group">
|
<div class="relative inline-block group">
|
||||||
<button class="text-gray-600 hover:text-blue-600 font-medium pb-1 {$page.url.pathname.startsWith('/settings') ? 'text-blue-600 border-b-2 border-blue-600' : ''}">
|
<button class="text-gray-600 hover:text-blue-600 font-medium pb-1 {$page.url.pathname.startsWith('/settings') ? 'text-blue-600 border-b-2 border-blue-600' : ''}">
|
||||||
Settings
|
{$t.nav.settings}
|
||||||
</button>
|
</button>
|
||||||
<div class="absolute hidden group-hover:block bg-white shadow-lg rounded-md mt-1 py-2 w-48 z-10 border border-gray-100 before:absolute before:-top-2 before:left-0 before:right-0 before:h-2 before:content-[''] right-0">
|
<div class="absolute hidden group-hover:block bg-white shadow-lg rounded-md mt-1 py-2 w-48 z-10 border border-gray-100 before:absolute before:-top-2 before:left-0 before:right-0 before:h-2 before:content-[''] right-0">
|
||||||
<a href="/settings" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">General Settings</a>
|
<a href="/settings" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">{$t.nav.settings_general}</a>
|
||||||
<a href="/settings/connections" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">Connections</a>
|
<a href="/settings/connections" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">{$t.nav.settings_connections}</a>
|
||||||
<a href="/settings/git" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">Git Integration</a>
|
<a href="/settings/git" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">{$t.nav.settings_git}</a>
|
||||||
<a href="/settings/environments" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">Environments</a>
|
<a href="/settings/environments" class="block px-4 py-2 text-sm text-gray-700 hover:bg-blue-50 hover:text-blue-600">{$t.nav.settings_environments}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<LanguageSwitcher />
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
<!-- [/DEF:Navbar:Component] -->
|
<!-- [/DEF:Navbar:Component] -->
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createEventDispatcher } from 'svelte';
|
import { createEventDispatcher } from 'svelte';
|
||||||
import { formatDistanceToNow } from 'date-fns';
|
import { formatDistanceToNow } from 'date-fns';
|
||||||
|
import { t } from '../lib/i18n';
|
||||||
|
|
||||||
export let tasks: Array<any> = [];
|
export let tasks: Array<any> = [];
|
||||||
export let loading: boolean = false;
|
export let loading: boolean = false;
|
||||||
@@ -58,9 +59,9 @@
|
|||||||
|
|
||||||
<div class="bg-white shadow overflow-hidden sm:rounded-md">
|
<div class="bg-white shadow overflow-hidden sm:rounded-md">
|
||||||
{#if loading && tasks.length === 0}
|
{#if loading && tasks.length === 0}
|
||||||
<div class="p-4 text-center text-gray-500">Loading tasks...</div>
|
<div class="p-4 text-center text-gray-500">{$t.tasks?.loading || 'Loading...'}</div>
|
||||||
{:else if tasks.length === 0}
|
{:else if tasks.length === 0}
|
||||||
<div class="p-4 text-center text-gray-500">No tasks found.</div>
|
<div class="p-4 text-center text-gray-500">{$t.tasks?.no_tasks || 'No tasks found.'}</div>
|
||||||
{:else}
|
{:else}
|
||||||
<ul class="divide-y divide-gray-200">
|
<ul class="divide-y divide-gray-200">
|
||||||
{#each tasks as task (task.id)}
|
{#each tasks as task (task.id)}
|
||||||
@@ -94,7 +95,7 @@
|
|||||||
<path fill-rule="evenodd" d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z" clip-rule="evenodd" />
|
<path fill-rule="evenodd" d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z" clip-rule="evenodd" />
|
||||||
</svg>
|
</svg>
|
||||||
<p>
|
<p>
|
||||||
Started {formatTime(task.started_at)}
|
{($t.tasks?.started || "").replace('{time}', formatTime(task.started_at))}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import { createEventDispatcher, onMount, onDestroy } from 'svelte';
|
import { createEventDispatcher, onMount, onDestroy } from 'svelte';
|
||||||
import { getTaskLogs } from '../services/taskService.js';
|
import { getTaskLogs } from '../services/taskService.js';
|
||||||
|
import { t } from '../lib/i18n';
|
||||||
|
import { Button } from '../lib/ui';
|
||||||
|
|
||||||
export let show = false;
|
export let show = false;
|
||||||
export let inline = false;
|
export let inline = false;
|
||||||
@@ -143,20 +145,20 @@
|
|||||||
<div class="flex flex-col h-full w-full p-4">
|
<div class="flex flex-col h-full w-full p-4">
|
||||||
<div class="flex justify-between items-center mb-4">
|
<div class="flex justify-between items-center mb-4">
|
||||||
<h3 class="text-lg font-medium text-gray-900">
|
<h3 class="text-lg font-medium text-gray-900">
|
||||||
Task Logs <span class="text-sm text-gray-500 font-normal">({taskId})</span>
|
{$t.tasks?.logs_title} <span class="text-sm text-gray-500 font-normal">({taskId})</span>
|
||||||
</h3>
|
</h3>
|
||||||
<button on:click={fetchLogs} class="text-sm text-indigo-600 hover:text-indigo-900">Refresh</button>
|
<Button variant="ghost" size="sm" on:click={fetchLogs} class="text-blue-600">{$t.tasks?.refresh}</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex-1 border rounded-md bg-gray-50 p-4 overflow-y-auto font-mono text-sm"
|
<div class="flex-1 border rounded-md bg-gray-50 p-4 overflow-y-auto font-mono text-sm"
|
||||||
bind:this={logContainer}
|
bind:this={logContainer}
|
||||||
on:scroll={handleScroll}>
|
on:scroll={handleScroll}>
|
||||||
{#if loading && logs.length === 0}
|
{#if loading && logs.length === 0}
|
||||||
<p class="text-gray-500 text-center">Loading logs...</p>
|
<p class="text-gray-500 text-center">{$t.tasks?.loading}</p>
|
||||||
{:else if error}
|
{:else if error}
|
||||||
<p class="text-red-500 text-center">{error}</p>
|
<p class="text-red-500 text-center">{error}</p>
|
||||||
{:else if logs.length === 0}
|
{:else if logs.length === 0}
|
||||||
<p class="text-gray-500 text-center">No logs available.</p>
|
<p class="text-gray-500 text-center">{$t.tasks?.no_logs}</p>
|
||||||
{:else}
|
{:else}
|
||||||
{#each logs as log}
|
{#each logs as log}
|
||||||
<div class="mb-1 hover:bg-gray-100 p-1 rounded">
|
<div class="mb-1 hover:bg-gray-100 p-1 rounded">
|
||||||
@@ -192,19 +194,19 @@
|
|||||||
<div class="sm:flex sm:items-start">
|
<div class="sm:flex sm:items-start">
|
||||||
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full">
|
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full">
|
||||||
<h3 class="text-lg leading-6 font-medium text-gray-900 flex justify-between items-center" id="modal-title">
|
<h3 class="text-lg leading-6 font-medium text-gray-900 flex justify-between items-center" id="modal-title">
|
||||||
<span>Task Logs <span class="text-sm text-gray-500 font-normal">({taskId})</span></span>
|
<span>{$t.tasks.logs_title} <span class="text-sm text-gray-500 font-normal">({taskId})</span></span>
|
||||||
<button on:click={fetchLogs} class="text-sm text-indigo-600 hover:text-indigo-900">Refresh</button>
|
<Button variant="ghost" size="sm" on:click={fetchLogs} class="text-blue-600">{$t.tasks.refresh}</Button>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<div class="mt-4 border rounded-md bg-gray-50 p-4 h-96 overflow-y-auto font-mono text-sm"
|
<div class="mt-4 border rounded-md bg-gray-50 p-4 h-96 overflow-y-auto font-mono text-sm"
|
||||||
bind:this={logContainer}
|
bind:this={logContainer}
|
||||||
on:scroll={handleScroll}>
|
on:scroll={handleScroll}>
|
||||||
{#if loading && logs.length === 0}
|
{#if loading && logs.length === 0}
|
||||||
<p class="text-gray-500 text-center">Loading logs...</p>
|
<p class="text-gray-500 text-center">{$t.tasks.loading}</p>
|
||||||
{:else if error}
|
{:else if error}
|
||||||
<p class="text-red-500 text-center">{error}</p>
|
<p class="text-red-500 text-center">{error}</p>
|
||||||
{:else if logs.length === 0}
|
{:else if logs.length === 0}
|
||||||
<p class="text-gray-500 text-center">No logs available.</p>
|
<p class="text-gray-500 text-center">{$t.tasks.no_logs}</p>
|
||||||
{:else}
|
{:else}
|
||||||
{#each logs as log}
|
{#each logs as log}
|
||||||
<div class="mb-1 hover:bg-gray-100 p-1 rounded">
|
<div class="mb-1 hover:bg-gray-100 p-1 rounded">
|
||||||
@@ -230,13 +232,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||||
<button
|
<Button variant="secondary" on:click={close}>
|
||||||
type="button"
|
{$t.common.cancel}
|
||||||
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
</Button>
|
||||||
on:click={close}
|
|
||||||
>
|
|
||||||
Close
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
import { onMount, createEventDispatcher } from 'svelte';
|
import { onMount, createEventDispatcher } from 'svelte';
|
||||||
import { gitService } from '../../services/gitService';
|
import { gitService } from '../../services/gitService';
|
||||||
import { addToast as toast } from '../../lib/toasts.js';
|
import { addToast as toast } from '../../lib/toasts.js';
|
||||||
|
import { t } from '../../lib/i18n';
|
||||||
|
import { Button, Select, Input } from '../../lib/ui';
|
||||||
// [/SECTION]
|
// [/SECTION]
|
||||||
|
|
||||||
// [SECTION: PROPS]
|
// [SECTION: PROPS]
|
||||||
@@ -31,6 +33,11 @@
|
|||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
// [DEF:onMount:Function]
|
// [DEF:onMount:Function]
|
||||||
|
/**
|
||||||
|
* @purpose Load branches when component is mounted.
|
||||||
|
* @pre Component is initialized.
|
||||||
|
* @post loadBranches is called.
|
||||||
|
*/
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
await loadBranches();
|
await loadBranches();
|
||||||
});
|
});
|
||||||
@@ -39,6 +46,7 @@
|
|||||||
// [DEF:loadBranches:Function]
|
// [DEF:loadBranches:Function]
|
||||||
/**
|
/**
|
||||||
* @purpose Загружает список веток для дашборда.
|
* @purpose Загружает список веток для дашборда.
|
||||||
|
* @pre dashboardId is provided.
|
||||||
* @post branches обновлен.
|
* @post branches обновлен.
|
||||||
*/
|
*/
|
||||||
async function loadBranches() {
|
async function loadBranches() {
|
||||||
@@ -57,6 +65,11 @@
|
|||||||
// [/DEF:loadBranches:Function]
|
// [/DEF:loadBranches:Function]
|
||||||
|
|
||||||
// [DEF:handleSelect:Function]
|
// [DEF:handleSelect:Function]
|
||||||
|
/**
|
||||||
|
* @purpose Handles branch selection from dropdown.
|
||||||
|
* @pre event contains branch name.
|
||||||
|
* @post handleCheckout is called with selected branch.
|
||||||
|
*/
|
||||||
function handleSelect(event) {
|
function handleSelect(event) {
|
||||||
handleCheckout(event.target.value);
|
handleCheckout(event.target.value);
|
||||||
}
|
}
|
||||||
@@ -86,7 +99,8 @@
|
|||||||
// [DEF:handleCreate:Function]
|
// [DEF:handleCreate:Function]
|
||||||
/**
|
/**
|
||||||
* @purpose Создает новую ветку.
|
* @purpose Создает новую ветку.
|
||||||
* @post Новая ветка создана и загружена.
|
* @pre newBranchName is not empty.
|
||||||
|
* @post Новая ветка создана и загружена; showCreate reset.
|
||||||
*/
|
*/
|
||||||
async function handleCreate() {
|
async function handleCreate() {
|
||||||
if (!newBranchName) return;
|
if (!newBranchName) return;
|
||||||
@@ -107,61 +121,55 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- [SECTION: TEMPLATE] -->
|
<!-- [SECTION: TEMPLATE] -->
|
||||||
<div class="space-y-2">
|
<div class="space-y-3">
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center gap-3">
|
||||||
<div class="relative">
|
<div class="flex-grow">
|
||||||
<select
|
<Select
|
||||||
value={currentBranch}
|
bind:value={currentBranch}
|
||||||
on:change={handleSelect}
|
on:change={handleSelect}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
class="bg-white border rounded px-3 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
|
options={branches.map(b => ({ value: b.name, label: b.name }))}
|
||||||
>
|
/>
|
||||||
{#each branches as branch}
|
|
||||||
<option value={branch.name}>{branch.name}</option>
|
|
||||||
{/each}
|
|
||||||
</select>
|
|
||||||
{#if loading}
|
|
||||||
<span class="absolute -right-6 top-1">
|
|
||||||
<svg class="animate-spin h-4 w-4 text-blue-600" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
||||||
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
||||||
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
||||||
</svg>
|
|
||||||
</span>
|
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
on:click={() => showCreate = !showCreate}
|
on:click={() => showCreate = !showCreate}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
class="text-blue-600 hover:text-blue-800 text-sm font-medium disabled:opacity-50"
|
class="text-blue-600"
|
||||||
>
|
>
|
||||||
+ New Branch
|
+ {$t.git.new_branch}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if showCreate}
|
{#if showCreate}
|
||||||
<div class="flex items-center space-x-1 bg-gray-50 p-2 rounded border border-dashed">
|
<div class="flex items-end gap-2 bg-gray-50 p-3 rounded-lg border border-dashed border-gray-200">
|
||||||
<input
|
<div class="flex-grow">
|
||||||
type="text"
|
<Input
|
||||||
bind:value={newBranchName}
|
bind:value={newBranchName}
|
||||||
placeholder="branch-name"
|
placeholder="branch-name"
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
class="border rounded px-2 py-1 text-sm w-full max-w-[150px]"
|
/>
|
||||||
/>
|
</div>
|
||||||
<button
|
<Button
|
||||||
|
variant="primary"
|
||||||
|
size="sm"
|
||||||
on:click={handleCreate}
|
on:click={handleCreate}
|
||||||
disabled={loading || !newBranchName}
|
disabled={loading || !newBranchName}
|
||||||
class="bg-green-600 text-white px-3 py-1 rounded text-xs font-medium hover:bg-green-700 disabled:opacity-50"
|
isLoading={loading}
|
||||||
|
class="bg-green-600 hover:bg-green-700"
|
||||||
>
|
>
|
||||||
{loading ? '...' : 'Create'}
|
{$t.git.create}
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
on:click={() => showCreate = false}
|
on:click={() => showCreate = false}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
class="text-gray-500 hover:text-gray-700 text-xs px-2 py-1 disabled:opacity-50"
|
|
||||||
>
|
>
|
||||||
Cancel
|
{$t.common.cancel}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { gitService } from '../../services/gitService';
|
import { gitService } from '../../services/gitService';
|
||||||
import { addToast as toast } from '../../lib/toasts.js';
|
import { addToast as toast } from '../../lib/toasts.js';
|
||||||
|
import { t } from '../../lib/i18n';
|
||||||
|
import { Button } from '../../lib/ui';
|
||||||
// [/SECTION]
|
// [/SECTION]
|
||||||
|
|
||||||
// [SECTION: PROPS]
|
// [SECTION: PROPS]
|
||||||
@@ -25,6 +27,8 @@
|
|||||||
// [DEF:onMount:Function]
|
// [DEF:onMount:Function]
|
||||||
/**
|
/**
|
||||||
* @purpose Load history when component is mounted.
|
* @purpose Load history when component is mounted.
|
||||||
|
* @pre Component is initialized with dashboardId.
|
||||||
|
* @post loadHistory is called.
|
||||||
*/
|
*/
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
await loadHistory();
|
await loadHistory();
|
||||||
@@ -34,6 +38,7 @@
|
|||||||
// [DEF:loadHistory:Function]
|
// [DEF:loadHistory:Function]
|
||||||
/**
|
/**
|
||||||
* @purpose Fetch commit history from the backend.
|
* @purpose Fetch commit history from the backend.
|
||||||
|
* @pre dashboardId is valid.
|
||||||
* @post history state is updated.
|
* @post history state is updated.
|
||||||
*/
|
*/
|
||||||
async function loadHistory() {
|
async function loadHistory() {
|
||||||
@@ -53,22 +58,22 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- [SECTION: TEMPLATE] -->
|
<!-- [SECTION: TEMPLATE] -->
|
||||||
<div class="mt-6">
|
<div class="mt-2">
|
||||||
<h3 class="text-lg font-semibold mb-4 flex justify-between items-center">
|
<div class="flex justify-between items-center mb-6">
|
||||||
Commit History
|
<h3 class="text-sm font-semibold text-gray-400 uppercase tracking-wider">
|
||||||
<button on:click={loadHistory} class="text-sm text-blue-600 hover:underline">Refresh</button>
|
{$t.git.history}
|
||||||
</h3>
|
</h3>
|
||||||
|
<Button variant="ghost" size="sm" on:click={loadHistory} class="text-blue-600">
|
||||||
|
{$t.git.refresh}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
{#if loading}
|
{#if loading}
|
||||||
<div class="flex items-center space-x-2 text-gray-500">
|
<div class="flex items-center justify-center py-12">
|
||||||
<svg class="animate-spin h-4 w-4 text-blue-600" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
<div class="animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"></div>
|
||||||
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
||||||
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
||||||
</svg>
|
|
||||||
<span>Loading history...</span>
|
|
||||||
</div>
|
</div>
|
||||||
{:else if history.length === 0}
|
{:else if history.length === 0}
|
||||||
<p class="text-gray-500 italic">No commits yet.</p>
|
<p class="text-gray-500 italic text-center py-12">{$t.git.no_commits}</p>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="space-y-3 max-h-96 overflow-y-auto pr-2">
|
<div class="space-y-3 max-h-96 overflow-y-auto pr-2">
|
||||||
{#each history as commit}
|
{#each history as commit}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
// [DEF:loadStatus:Watcher]
|
// [DEF:loadStatus:Watcher]
|
||||||
$: if (show) loadEnvironments();
|
$: if (show) loadEnvironments();
|
||||||
|
// [/DEF:loadStatus:Watcher]
|
||||||
|
|
||||||
// [DEF:loadEnvironments:Function]
|
// [DEF:loadEnvironments:Function]
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { gitService } from '../../services/gitService';
|
import { gitService } from '../../services/gitService';
|
||||||
import { addToast as toast } from '../../lib/toasts.js';
|
import { addToast as toast } from '../../lib/toasts.js';
|
||||||
|
import { t } from '../../lib/i18n';
|
||||||
|
import { Button, Card, PageHeader, Select, Input } from '../../lib/ui';
|
||||||
import BranchSelector from './BranchSelector.svelte';
|
import BranchSelector from './BranchSelector.svelte';
|
||||||
import CommitModal from './CommitModal.svelte';
|
import CommitModal from './CommitModal.svelte';
|
||||||
import CommitHistory from './CommitHistory.svelte';
|
import CommitHistory from './CommitHistory.svelte';
|
||||||
@@ -49,6 +51,8 @@
|
|||||||
// [DEF:checkStatus:Function]
|
// [DEF:checkStatus:Function]
|
||||||
/**
|
/**
|
||||||
* @purpose Проверяет, инициализирован ли репозиторий для данного дашборда.
|
* @purpose Проверяет, инициализирован ли репозиторий для данного дашборда.
|
||||||
|
* @pre Component is mounted and has dashboardId.
|
||||||
|
* @post initialized state is set; configs loaded if not initialized.
|
||||||
*/
|
*/
|
||||||
async function checkStatus() {
|
async function checkStatus() {
|
||||||
checkingStatus = true;
|
checkingStatus = true;
|
||||||
@@ -70,6 +74,8 @@
|
|||||||
// [DEF:handleInit:Function]
|
// [DEF:handleInit:Function]
|
||||||
/**
|
/**
|
||||||
* @purpose Инициализирует репозиторий для дашборда.
|
* @purpose Инициализирует репозиторий для дашборда.
|
||||||
|
* @pre selectedConfigId and remoteUrl are provided.
|
||||||
|
* @post Repository is created on backend; initialized set to true.
|
||||||
*/
|
*/
|
||||||
async function handleInit() {
|
async function handleInit() {
|
||||||
if (!selectedConfigId || !remoteUrl) {
|
if (!selectedConfigId || !remoteUrl) {
|
||||||
@@ -92,6 +98,8 @@
|
|||||||
// [DEF:handleSync:Function]
|
// [DEF:handleSync:Function]
|
||||||
/**
|
/**
|
||||||
* @purpose Синхронизирует состояние Superset с локальным Git-репозиторием.
|
* @purpose Синхронизирует состояние Superset с локальным Git-репозиторием.
|
||||||
|
* @pre Repository is initialized.
|
||||||
|
* @post Dashboard YAMLs are exported to Git and staged.
|
||||||
*/
|
*/
|
||||||
async function handleSync() {
|
async function handleSync() {
|
||||||
loading = true;
|
loading = true;
|
||||||
@@ -109,6 +117,11 @@
|
|||||||
// [/DEF:handleSync:Function]
|
// [/DEF:handleSync:Function]
|
||||||
|
|
||||||
// [DEF:handlePush:Function]
|
// [DEF:handlePush:Function]
|
||||||
|
/**
|
||||||
|
* @purpose Pushes local commits to the remote repository.
|
||||||
|
* @pre Repository is initialized and has commits.
|
||||||
|
* @post Changes are pushed to origin.
|
||||||
|
*/
|
||||||
async function handlePush() {
|
async function handlePush() {
|
||||||
loading = true;
|
loading = true;
|
||||||
try {
|
try {
|
||||||
@@ -123,6 +136,11 @@
|
|||||||
// [/DEF:handlePush:Function]
|
// [/DEF:handlePush:Function]
|
||||||
|
|
||||||
// [DEF:handlePull:Function]
|
// [DEF:handlePull:Function]
|
||||||
|
/**
|
||||||
|
* @purpose Pulls changes from the remote repository.
|
||||||
|
* @pre Repository is initialized.
|
||||||
|
* @post Local branch is updated with remote changes.
|
||||||
|
*/
|
||||||
async function handlePull() {
|
async function handlePull() {
|
||||||
loading = true;
|
loading = true;
|
||||||
try {
|
try {
|
||||||
@@ -143,17 +161,16 @@
|
|||||||
{#if show}
|
{#if show}
|
||||||
<div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
<div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
||||||
<div class="bg-white p-6 rounded-lg shadow-2xl w-full max-w-4xl max-h-[90vh] overflow-y-auto">
|
<div class="bg-white p-6 rounded-lg shadow-2xl w-full max-w-4xl max-h-[90vh] overflow-y-auto">
|
||||||
<div class="flex justify-between items-center mb-6 border-b pb-4">
|
<PageHeader title="{$t.git.management}: {dashboardTitle}">
|
||||||
<div>
|
<div slot="subtitle" class="text-sm text-gray-500">ID: {dashboardId}</div>
|
||||||
<h2 class="text-2xl font-bold">Git Management: {dashboardTitle}</h2>
|
<div slot="actions">
|
||||||
<p class="text-sm text-gray-500">ID: {dashboardId}</p>
|
<button on:click={() => show = false} class="text-gray-400 hover:text-gray-600 transition-colors">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<button on:click={() => show = false} class="text-gray-500 hover:text-gray-700">
|
</PageHeader>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{#if checkingStatus}
|
{#if checkingStatus}
|
||||||
<div class="flex justify-center py-12">
|
<div class="flex justify-center py-12">
|
||||||
@@ -161,95 +178,94 @@
|
|||||||
</div>
|
</div>
|
||||||
{:else if !initialized}
|
{:else if !initialized}
|
||||||
<div class="max-w-md mx-auto py-8">
|
<div class="max-w-md mx-auto py-8">
|
||||||
<div class="bg-blue-50 border-l-4 border-blue-400 p-4 mb-6">
|
<Card>
|
||||||
<p class="text-sm text-blue-700">
|
<p class="text-sm text-gray-600 mb-6">
|
||||||
This dashboard is not yet linked to a Git repository.
|
{$t.git.not_linked}
|
||||||
Please configure the repository details below.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
|
||||||
|
<div class="space-y-6">
|
||||||
<div class="space-y-4">
|
<Select
|
||||||
<div>
|
label={$t.git.server}
|
||||||
<label class="block text-sm font-medium text-gray-700">Git Server</label>
|
bind:value={selectedConfigId}
|
||||||
<select bind:value={selectedConfigId} class="mt-1 block w-full border rounded p-2">
|
options={configs.map(c => ({ value: c.id, label: `${c.name} (${c.provider})` }))}
|
||||||
{#each configs as config}
|
|
||||||
<option value={config.id}>{config.name} ({config.provider})</option>
|
|
||||||
{/each}
|
|
||||||
</select>
|
|
||||||
{#if configs.length === 0}
|
|
||||||
<p class="text-xs text-red-500 mt-1">No Git servers configured. Go to Settings -> Git to add one.</p>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label class="block text-sm font-medium text-gray-700">Remote Repository URL</label>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
bind:value={remoteUrl}
|
|
||||||
placeholder="https://github.com/org/repo.git"
|
|
||||||
class="mt-1 block w-full border rounded p-2"
|
|
||||||
/>
|
/>
|
||||||
|
{#if configs.length === 0}
|
||||||
|
<p class="text-xs text-red-500 -mt-4">No Git servers configured. Go to Settings -> Git to add one.</p>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<Input
|
||||||
|
label={$t.git.remote_url}
|
||||||
|
bind:value={remoteUrl}
|
||||||
|
placeholder="https://github.com/org/repo.git"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
on:click={handleInit}
|
||||||
|
disabled={loading || configs.length === 0}
|
||||||
|
isLoading={loading}
|
||||||
|
class="w-full"
|
||||||
|
>
|
||||||
|
{$t.git.init_repo}
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<button
|
</Card>
|
||||||
on:click={handleInit}
|
|
||||||
disabled={loading || configs.length === 0}
|
|
||||||
class="w-full bg-blue-600 text-white py-2 rounded font-medium hover:bg-blue-700 disabled:opacity-50"
|
|
||||||
>
|
|
||||||
{loading ? 'Initializing...' : 'Initialize Repository'}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
||||||
<!-- Left Column: Controls -->
|
<!-- Left Column: Controls -->
|
||||||
<div class="md:col-span-1 space-y-6">
|
<div class="md:col-span-1 space-y-6">
|
||||||
<section>
|
<section>
|
||||||
<h3 class="text-sm font-semibold text-gray-400 uppercase tracking-wider mb-2">Branch</h3>
|
<h3 class="text-sm font-semibold text-gray-400 uppercase tracking-wider mb-3">{$t.git.branch}</h3>
|
||||||
<BranchSelector {dashboardId} bind:currentBranch />
|
<BranchSelector {dashboardId} bind:currentBranch />
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="space-y-2">
|
<section class="space-y-3">
|
||||||
<h3 class="text-sm font-semibold text-gray-400 uppercase tracking-wider mb-2">Actions</h3>
|
<h3 class="text-sm font-semibold text-gray-400 uppercase tracking-wider mb-3">{$t.git.actions}</h3>
|
||||||
<button
|
<Button
|
||||||
|
variant="secondary"
|
||||||
on:click={handleSync}
|
on:click={handleSync}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
class="w-full flex items-center justify-center px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded text-sm font-medium transition"
|
class="w-full"
|
||||||
>
|
>
|
||||||
Sync from Superset
|
{$t.git.sync}
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button
|
||||||
on:click={() => showCommitModal = true}
|
on:click={() => showCommitModal = true}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
class="w-full flex items-center justify-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded text-sm font-medium transition"
|
class="w-full"
|
||||||
>
|
>
|
||||||
Commit Changes
|
{$t.git.commit}
|
||||||
</button>
|
</Button>
|
||||||
<div class="grid grid-cols-2 gap-2">
|
<div class="grid grid-cols-2 gap-3">
|
||||||
<button
|
<Button
|
||||||
|
variant="ghost"
|
||||||
on:click={handlePull}
|
on:click={handlePull}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
class="flex items-center justify-center px-4 py-2 border hover:bg-gray-50 rounded text-sm font-medium transition"
|
class="border border-gray-200"
|
||||||
>
|
>
|
||||||
Pull
|
{$t.git.pull}
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button
|
||||||
|
variant="ghost"
|
||||||
on:click={handlePush}
|
on:click={handlePush}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
class="flex items-center justify-center px-4 py-2 border hover:bg-gray-50 rounded text-sm font-medium transition"
|
class="border border-gray-200"
|
||||||
>
|
>
|
||||||
Push
|
{$t.git.push}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h3 class="text-sm font-semibold text-gray-400 uppercase tracking-wider mb-2">Deployment</h3>
|
<h3 class="text-sm font-semibold text-gray-400 uppercase tracking-wider mb-3">{$t.git.deployment}</h3>
|
||||||
<button
|
<Button
|
||||||
|
variant="primary"
|
||||||
on:click={() => showDeployModal = true}
|
on:click={() => showDeployModal = true}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
class="w-full flex items-center justify-center px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded text-sm font-medium transition"
|
class="w-full bg-green-600 hover:bg-green-700 focus-visible:ring-green-500"
|
||||||
>
|
>
|
||||||
Deploy to Environment
|
{$t.git.deploy}
|
||||||
</button>
|
</Button>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
import { createEventDispatcher } from 'svelte';
|
import { createEventDispatcher } from 'svelte';
|
||||||
import { createConnection } from '../../services/connectionService.js';
|
import { createConnection } from '../../services/connectionService.js';
|
||||||
import { addToast } from '../../lib/toasts.js';
|
import { addToast } from '../../lib/toasts.js';
|
||||||
|
import { t } from '../../lib/i18n';
|
||||||
|
import { Button, Input, Card } from '../../lib/ui';
|
||||||
// [/SECTION]
|
// [/SECTION]
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
@@ -17,7 +19,7 @@
|
|||||||
let name = '';
|
let name = '';
|
||||||
let type = 'postgres';
|
let type = 'postgres';
|
||||||
let host = '';
|
let host = '';
|
||||||
let port = 5432;
|
let port = "5432";
|
||||||
let database = '';
|
let database = '';
|
||||||
let username = '';
|
let username = '';
|
||||||
let password = '';
|
let password = '';
|
||||||
@@ -36,7 +38,7 @@
|
|||||||
isSubmitting = true;
|
isSubmitting = true;
|
||||||
try {
|
try {
|
||||||
const newConnection = await createConnection({
|
const newConnection = await createConnection({
|
||||||
name, type, host, port, database, username, password
|
name, type, host, port: Number(port), database, username, password
|
||||||
});
|
});
|
||||||
addToast('Connection created successfully', 'success');
|
addToast('Connection created successfully', 'success');
|
||||||
dispatch('success', newConnection);
|
dispatch('success', newConnection);
|
||||||
@@ -57,7 +59,7 @@
|
|||||||
function resetForm() {
|
function resetForm() {
|
||||||
name = '';
|
name = '';
|
||||||
host = '';
|
host = '';
|
||||||
port = 5432;
|
port = "5432";
|
||||||
database = '';
|
database = '';
|
||||||
username = '';
|
username = '';
|
||||||
password = '';
|
password = '';
|
||||||
@@ -66,43 +68,28 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- [SECTION: TEMPLATE] -->
|
<!-- [SECTION: TEMPLATE] -->
|
||||||
<div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
|
<Card title={$t.connections?.add_new || "Add New Connection"}>
|
||||||
<h3 class="text-lg font-medium text-gray-900 mb-4">Add New Connection</h3>
|
<form on:submit|preventDefault={handleSubmit} class="space-y-6">
|
||||||
<form on:submit|preventDefault={handleSubmit} class="space-y-4">
|
<Input label={$t.connections?.name || "Connection Name"} bind:value={name} placeholder="e.g. Production DWH" />
|
||||||
<div>
|
|
||||||
<label for="conn-name" class="block text-sm font-medium text-gray-700">Connection Name</label>
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
<input type="text" id="conn-name" bind:value={name} placeholder="e.g. Production DWH" class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" />
|
<Input label={$t.connections?.host || "Host"} bind:value={host} placeholder="10.0.0.1" />
|
||||||
|
<Input label={$t.connections?.port || "Port"} type="number" bind:value={port} />
|
||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
||||||
<div>
|
<Input label={$t.connections?.db_name || "Database Name"} bind:value={database} />
|
||||||
<label for="conn-host" class="block text-sm font-medium text-gray-700">Host</label>
|
|
||||||
<input type="text" id="conn-host" bind:value={host} placeholder="10.0.0.1" class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" />
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
</div>
|
<Input label={$t.connections?.user || "Username"} bind:value={username} />
|
||||||
<div>
|
<Input label={$t.connections?.pass || "Password"} type="password" bind:value={password} />
|
||||||
<label for="conn-port" class="block text-sm font-medium text-gray-700">Port</label>
|
|
||||||
<input type="number" id="conn-port" bind:value={port} class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="conn-db" class="block text-sm font-medium text-gray-700">Database Name</label>
|
|
||||||
<input type="text" id="conn-db" bind:value={database} class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" />
|
|
||||||
</div>
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
||||||
<div>
|
|
||||||
<label for="conn-user" class="block text-sm font-medium text-gray-700">Username</label>
|
|
||||||
<input type="text" id="conn-user" bind:value={username} class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="conn-pass" class="block text-sm font-medium text-gray-700">Password</label>
|
|
||||||
<input type="password" id="conn-pass" bind:value={password} class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-end pt-2">
|
<div class="flex justify-end pt-2">
|
||||||
<button type="submit" disabled={isSubmitting} class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:opacity-50">
|
<Button type="submit" disabled={isSubmitting} isLoading={isSubmitting}>
|
||||||
{isSubmitting ? 'Creating...' : 'Create Connection'}
|
{$t.connections?.create || "Create Connection"}
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</Card>
|
||||||
<!-- [/SECTION] -->
|
<!-- [/SECTION] -->
|
||||||
<!-- [/DEF:ConnectionForm:Component] -->
|
<!-- [/DEF:ConnectionForm:Component] -->
|
||||||
@@ -10,6 +10,8 @@
|
|||||||
import { onMount, createEventDispatcher } from 'svelte';
|
import { onMount, createEventDispatcher } from 'svelte';
|
||||||
import { getConnections, deleteConnection } from '../../services/connectionService.js';
|
import { getConnections, deleteConnection } from '../../services/connectionService.js';
|
||||||
import { addToast } from '../../lib/toasts.js';
|
import { addToast } from '../../lib/toasts.js';
|
||||||
|
import { t } from '../../lib/i18n';
|
||||||
|
import { Button, Card } from '../../lib/ui';
|
||||||
// [/SECTION]
|
// [/SECTION]
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
@@ -57,32 +59,30 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- [SECTION: TEMPLATE] -->
|
<!-- [SECTION: TEMPLATE] -->
|
||||||
<div class="bg-white shadow overflow-hidden sm:rounded-md border border-gray-200">
|
<Card title={$t.connections?.saved || "Saved Connections"} padding="none">
|
||||||
<div class="px-4 py-5 sm:px-6 bg-gray-50 border-b border-gray-200">
|
<ul class="divide-y divide-gray-100">
|
||||||
<h3 class="text-lg leading-6 font-medium text-gray-900">Saved Connections</h3>
|
|
||||||
</div>
|
|
||||||
<ul class="divide-y divide-gray-200">
|
|
||||||
{#if isLoading}
|
{#if isLoading}
|
||||||
<li class="p-4 text-center text-gray-500">Loading...</li>
|
<li class="p-6 text-center text-gray-500">{$t.common.loading}</li>
|
||||||
{:else if connections.length === 0}
|
{:else if connections.length === 0}
|
||||||
<li class="p-8 text-center text-gray-500 italic">No connections saved yet.</li>
|
<li class="p-12 text-center text-gray-500 italic">{$t.connections?.no_saved || "No connections saved yet."}</li>
|
||||||
{:else}
|
{:else}
|
||||||
{#each connections as conn}
|
{#each connections as conn}
|
||||||
<li class="p-4 flex items-center justify-between hover:bg-gray-50">
|
<li class="p-6 flex items-center justify-between hover:bg-gray-50 transition-colors">
|
||||||
<div>
|
<div>
|
||||||
<div class="text-sm font-medium text-indigo-600 truncate">{conn.name}</div>
|
<div class="text-sm font-medium text-blue-600 truncate">{conn.name}</div>
|
||||||
<div class="text-xs text-gray-500">{conn.type}://{conn.username}@{conn.host}:{conn.port}/{conn.database}</div>
|
<div class="text-xs text-gray-400 mt-1 font-mono">{conn.type}://{conn.username}@{conn.host}:{conn.port}/{conn.database}</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<Button
|
||||||
|
variant="danger"
|
||||||
|
size="sm"
|
||||||
on:click={() => handleDelete(conn.id)}
|
on:click={() => handleDelete(conn.id)}
|
||||||
class="ml-2 inline-flex items-center px-2 py-1 border border-transparent text-xs font-medium rounded text-red-700 bg-red-100 hover:bg-red-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500"
|
|
||||||
>
|
>
|
||||||
Delete
|
{$t.connections?.delete || "Delete"}
|
||||||
</button>
|
</Button>
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</Card>
|
||||||
<!-- [/SECTION] -->
|
<!-- [/SECTION] -->
|
||||||
<!-- [/DEF:ConnectionList:Component] -->
|
<!-- [/DEF:ConnectionList:Component] -->
|
||||||
@@ -5,6 +5,8 @@
|
|||||||
import { api } from '../lib/api.js';
|
import { api } from '../lib/api.js';
|
||||||
import { get } from 'svelte/store';
|
import { get } from 'svelte/store';
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
|
import { t } from '$lib/i18n';
|
||||||
|
import { Button, Card, PageHeader } from '$lib/ui';
|
||||||
|
|
||||||
/** @type {import('./$types').PageData} */
|
/** @type {import('./$types').PageData} */
|
||||||
export let data;
|
export let data;
|
||||||
@@ -55,34 +57,43 @@
|
|||||||
<div class="container mx-auto p-4">
|
<div class="container mx-auto p-4">
|
||||||
{#if $selectedTask}
|
{#if $selectedTask}
|
||||||
<TaskRunner />
|
<TaskRunner />
|
||||||
<button on:click={() => selectedTask.set(null)} class="mt-4 bg-blue-500 text-white p-2 rounded">
|
<div class="mt-4">
|
||||||
Back to Task List
|
<Button variant="primary" on:click={() => selectedTask.set(null)}>
|
||||||
</button>
|
{$t.common.cancel}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
{:else if $selectedPlugin}
|
{:else if $selectedPlugin}
|
||||||
<h2 class="text-2xl font-bold mb-4">{$selectedPlugin.name}</h2>
|
<PageHeader title={$selectedPlugin.name} />
|
||||||
<DynamicForm schema={$selectedPlugin.schema} on:submit={handleFormSubmit} />
|
<Card>
|
||||||
<button on:click={() => selectedPlugin.set(null)} class="mt-4 bg-gray-500 text-white p-2 rounded">
|
<DynamicForm schema={$selectedPlugin.schema} on:submit={handleFormSubmit} />
|
||||||
Back to Dashboard
|
</Card>
|
||||||
</button>
|
<div class="mt-4">
|
||||||
|
<Button variant="secondary" on:click={() => selectedPlugin.set(null)}>
|
||||||
|
{$t.common.cancel}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<h1 class="text-2xl font-bold mb-4">Available Tools</h1>
|
<PageHeader title={$t.nav.dashboard} />
|
||||||
|
|
||||||
{#if data.error}
|
{#if data.error}
|
||||||
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4">
|
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4">
|
||||||
{data.error}
|
{data.error}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
{#each data.plugins as plugin}
|
{#each data.plugins as plugin}
|
||||||
<div
|
<div
|
||||||
class="border rounded-lg p-4 cursor-pointer hover:bg-gray-100"
|
|
||||||
on:click={() => selectPlugin(plugin)}
|
on:click={() => selectPlugin(plugin)}
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
on:keydown={(e) => e.key === 'Enter' && selectPlugin(plugin)}
|
on:keydown={(e) => e.key === 'Enter' && selectPlugin(plugin)}
|
||||||
|
class="cursor-pointer transition-transform hover:scale-[1.02]"
|
||||||
>
|
>
|
||||||
<h2 class="text-xl font-semibold">{plugin.name}</h2>
|
<Card title={plugin.name}>
|
||||||
<p class="text-gray-600">{plugin.description}</p>
|
<p class="text-gray-600 mb-4">{plugin.description}</p>
|
||||||
<span class="text-sm text-gray-400">v{plugin.version}</span>
|
<span class="text-xs font-mono text-gray-400 bg-gray-50 px-2 py-1 rounded">v{plugin.version}</span>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
<!-- [DEF:GitDashboardPage:Component] -->
|
<!-- [DEF:GitDashboardPage:Component] -->
|
||||||
|
<!--
|
||||||
|
@PURPOSE: Dashboard management page for Git integration.
|
||||||
|
@LAYER: Page
|
||||||
|
@SEMANTICS: git, dashboard, management, ui
|
||||||
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import DashboardGrid from '../../components/DashboardGrid.svelte';
|
import DashboardGrid from '../../components/DashboardGrid.svelte';
|
||||||
import { addToast as toast } from '../../lib/toasts.js';
|
import { addToast as toast } from '../../lib/toasts.js';
|
||||||
import type { DashboardMetadata } from '../../types/dashboard';
|
import type { DashboardMetadata } from '../../types/dashboard';
|
||||||
|
import { t } from '$lib/i18n';
|
||||||
|
import { Button, Card, PageHeader, Select } from '$lib/ui';
|
||||||
|
|
||||||
let environments: any[] = [];
|
let environments: any[] = [];
|
||||||
let selectedEnvId = "";
|
let selectedEnvId = "";
|
||||||
@@ -11,6 +18,10 @@
|
|||||||
let loading = true;
|
let loading = true;
|
||||||
let fetchingDashboards = false;
|
let fetchingDashboards = false;
|
||||||
|
|
||||||
|
// [DEF:fetchEnvironments:Function]
|
||||||
|
// @PURPOSE: Fetches the list of deployment environments from the API.
|
||||||
|
// @PRE: Component is mounted.
|
||||||
|
// @POST: `environments` array is populated with data from /api/environments.
|
||||||
async function fetchEnvironments() {
|
async function fetchEnvironments() {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/api/environments');
|
const response = await fetch('/api/environments');
|
||||||
@@ -25,7 +36,12 @@
|
|||||||
loading = false;
|
loading = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// [/DEF:fetchEnvironments:Function]
|
||||||
|
|
||||||
|
// [DEF:fetchDashboards:Function]
|
||||||
|
// @PURPOSE: Fetches dashboards for a specific environment.
|
||||||
|
// @PRE: `envId` is a valid environment ID.
|
||||||
|
// @POST: `dashboards` array is updated with results from the environment.
|
||||||
async function fetchDashboards(envId: string) {
|
async function fetchDashboards(envId: string) {
|
||||||
if (!envId) return;
|
if (!envId) return;
|
||||||
fetchingDashboards = true;
|
fetchingDashboards = true;
|
||||||
@@ -40,6 +56,7 @@
|
|||||||
fetchingDashboards = false;
|
fetchingDashboards = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// [/DEF:fetchDashboards:Function]
|
||||||
|
|
||||||
onMount(fetchEnvironments);
|
onMount(fetchEnvironments);
|
||||||
|
|
||||||
@@ -50,29 +67,22 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="max-w-6xl mx-auto p-6">
|
<div class="max-w-6xl mx-auto p-6">
|
||||||
<div class="flex justify-between items-center mb-6">
|
<PageHeader title="Git Dashboard Management">
|
||||||
<h1 class="text-2xl font-bold text-gray-800">Git Dashboard Management</h1>
|
<div slot="actions" class="flex items-center space-x-4">
|
||||||
<div class="flex items-center space-x-4">
|
<Select
|
||||||
<label for="env-select" class="text-sm font-medium text-gray-700">Environment:</label>
|
label="Environment"
|
||||||
<select
|
|
||||||
id="env-select"
|
|
||||||
bind:value={selectedEnvId}
|
bind:value={selectedEnvId}
|
||||||
class="border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 p-2 border bg-white"
|
options={environments.map(e => ({ value: e.id, label: e.name }))}
|
||||||
>
|
/>
|
||||||
{#each environments as env}
|
|
||||||
<option value={env.id}>{env.name}</option>
|
|
||||||
{/each}
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</PageHeader>
|
||||||
|
|
||||||
{#if loading}
|
{#if loading}
|
||||||
<div class="flex justify-center py-12">
|
<div class="flex justify-center py-12">
|
||||||
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"></div>
|
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"></div>
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="bg-white rounded-lg shadow p-6">
|
<Card title="Select Dashboard to Manage">
|
||||||
<h2 class="text-lg font-medium mb-4">Select Dashboard to Manage</h2>
|
|
||||||
{#if fetchingDashboards}
|
{#if fetchingDashboards}
|
||||||
<p class="text-gray-500">Loading dashboards...</p>
|
<p class="text-gray-500">Loading dashboards...</p>
|
||||||
{:else if dashboards.length > 0}
|
{:else if dashboards.length > 0}
|
||||||
@@ -80,7 +90,7 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<p class="text-gray-500 italic">No dashboards found in this environment.</p>
|
<p class="text-gray-500 italic">No dashboards found in this environment.</p>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</Card>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<!-- [/DEF:GitDashboardPage:Component] -->
|
<!-- [/DEF:GitDashboardPage:Component] -->
|
||||||
@@ -21,6 +21,8 @@
|
|||||||
import { selectedTask } from '../../lib/stores.js';
|
import { selectedTask } from '../../lib/stores.js';
|
||||||
import { resumeTask } from '../../services/taskService.js';
|
import { resumeTask } from '../../services/taskService.js';
|
||||||
import type { DashboardMetadata, DashboardSelection } from '../../types/dashboard';
|
import type { DashboardMetadata, DashboardSelection } from '../../types/dashboard';
|
||||||
|
import { t } from '$lib/i18n';
|
||||||
|
import { Button, Card, PageHeader } from '$lib/ui';
|
||||||
// [/SECTION]
|
// [/SECTION]
|
||||||
|
|
||||||
// [SECTION: STATE]
|
// [SECTION: STATE]
|
||||||
@@ -294,19 +296,18 @@
|
|||||||
|
|
||||||
<!-- [SECTION: TEMPLATE] -->
|
<!-- [SECTION: TEMPLATE] -->
|
||||||
<div class="max-w-4xl mx-auto p-6">
|
<div class="max-w-4xl mx-auto p-6">
|
||||||
<h1 class="text-2xl font-bold mb-6">Migration Dashboard</h1>
|
<PageHeader title={$t.nav.migration} />
|
||||||
|
|
||||||
<TaskHistory on:viewLogs={handleViewLogs} />
|
<TaskHistory on:viewLogs={handleViewLogs} />
|
||||||
|
|
||||||
{#if $selectedTask}
|
{#if $selectedTask}
|
||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<TaskRunner />
|
<TaskRunner />
|
||||||
<button
|
<div class="mt-4">
|
||||||
on:click={() => selectedTask.set(null)}
|
<Button variant="secondary" on:click={() => selectedTask.set(null)}>
|
||||||
class="mt-4 inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
|
{$t.common.cancel}
|
||||||
>
|
</Button>
|
||||||
Back to New Migration
|
</div>
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
{#if loading}
|
{#if loading}
|
||||||
@@ -383,13 +384,12 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<button
|
<Button
|
||||||
on:click={startMigration}
|
on:click={startMigration}
|
||||||
disabled={!sourceEnvId || !targetEnvId || sourceEnvId === targetEnvId || selectedDashboardIds.length === 0}
|
disabled={!sourceEnvId || !targetEnvId || sourceEnvId === targetEnvId || selectedDashboardIds.length === 0}
|
||||||
class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:bg-gray-400"
|
|
||||||
>
|
>
|
||||||
Start Migration
|
Start Migration
|
||||||
</button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import EnvSelector from '../../../components/EnvSelector.svelte';
|
import EnvSelector from '../../../components/EnvSelector.svelte';
|
||||||
import MappingTable from '../../../components/MappingTable.svelte';
|
import MappingTable from '../../../components/MappingTable.svelte';
|
||||||
|
import { t } from '$lib/i18n';
|
||||||
|
import { Button, PageHeader } from '$lib/ui';
|
||||||
// [/SECTION]
|
// [/SECTION]
|
||||||
|
|
||||||
// [SECTION: STATE]
|
// [SECTION: STATE]
|
||||||
@@ -128,7 +130,7 @@
|
|||||||
|
|
||||||
<!-- [SECTION: TEMPLATE] -->
|
<!-- [SECTION: TEMPLATE] -->
|
||||||
<div class="max-w-6xl mx-auto p-6">
|
<div class="max-w-6xl mx-auto p-6">
|
||||||
<h1 class="text-2xl font-bold mb-6">Database Mapping Management</h1>
|
<PageHeader title="Database Mapping Management" />
|
||||||
|
|
||||||
{#if loading}
|
{#if loading}
|
||||||
<p>Loading environments...</p>
|
<p>Loading environments...</p>
|
||||||
@@ -149,13 +151,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-8">
|
<div class="mb-8">
|
||||||
<button
|
<Button
|
||||||
on:click={fetchDatabases}
|
on:click={fetchDatabases}
|
||||||
disabled={!sourceEnvId || !targetEnvId || sourceEnvId === targetEnvId || fetchingDbs}
|
disabled={!sourceEnvId || !targetEnvId || sourceEnvId === targetEnvId || fetchingDbs}
|
||||||
class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:bg-gray-400"
|
isLoading={fetchingDbs}
|
||||||
>
|
>
|
||||||
{fetchingDbs ? 'Fetching...' : 'Fetch Databases & Suggestions'}
|
Fetch Databases & Suggestions
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if error}
|
{#if error}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { updateGlobalSettings, addEnvironment, updateEnvironment, deleteEnvironment, testEnvironmentConnection } from '../../lib/api';
|
import { updateGlobalSettings, addEnvironment, updateEnvironment, deleteEnvironment, testEnvironmentConnection } from '../../lib/api';
|
||||||
import { addToast } from '../../lib/toasts';
|
import { addToast } from '../../lib/toasts';
|
||||||
|
import { t } from '$lib/i18n';
|
||||||
|
import { Button, Input, Card, PageHeader } from '$lib/ui';
|
||||||
|
|
||||||
/** @type {import('./$types').PageData} */
|
/** @type {import('./$types').PageData} */
|
||||||
export let data;
|
export let data;
|
||||||
@@ -142,7 +144,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="container mx-auto p-4">
|
<div class="container mx-auto p-4">
|
||||||
<h1 class="text-2xl font-bold mb-6">Settings</h1>
|
<PageHeader title={$t.settings.title} />
|
||||||
|
|
||||||
{#if data.error}
|
{#if data.error}
|
||||||
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4">
|
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4">
|
||||||
@@ -150,38 +152,39 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<section class="mb-8 bg-white p-6 rounded shadow">
|
<div class="mb-8">
|
||||||
<h2 class="text-xl font-semibold mb-4">Global Settings</h2>
|
<Card title={$t.settings?.global_title || "Global Settings"}>
|
||||||
<div class="grid grid-cols-1 gap-4">
|
<div class="grid grid-cols-1 gap-6">
|
||||||
<div>
|
<Input
|
||||||
<label for="backup_path" class="block text-sm font-medium text-gray-700">Backup Storage Path</label>
|
label={$t.settings?.backup_path || "Backup Storage Path"}
|
||||||
<input type="text" id="backup_path" bind:value={settings.settings.backup_path} class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm p-2" />
|
bind:value={settings.settings.backup_path}
|
||||||
|
/>
|
||||||
|
<Button on:click={handleSaveGlobal}>
|
||||||
|
{$t.common.save}
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<button on:click={handleSaveGlobal} class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600 w-max">
|
</Card>
|
||||||
Save Global Settings
|
</div>
|
||||||
</button>
|
|
||||||
|
<section class="mb-8">
|
||||||
|
<Card title={$t.settings?.env_title || "Superset Environments"}>
|
||||||
|
|
||||||
|
{#if settings.environments.length === 0}
|
||||||
|
<div class="mb-4 p-4 bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700">
|
||||||
|
<p class="font-bold">Warning</p>
|
||||||
|
<p>{$t.settings?.env_warning || "No Superset environments configured."}</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
{/if}
|
||||||
|
|
||||||
<section class="mb-8 bg-white p-6 rounded shadow">
|
|
||||||
<h2 class="text-xl font-semibold mb-4">Superset Environments</h2>
|
|
||||||
|
|
||||||
{#if settings.environments.length === 0}
|
|
||||||
<div class="mb-4 p-4 bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700">
|
|
||||||
<p class="font-bold">Warning</p>
|
|
||||||
<p>No Superset environments configured. You must add at least one environment to perform backups or migrations.</p>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<div class="mb-6 overflow-x-auto">
|
<div class="mb-6 overflow-x-auto">
|
||||||
<table class="min-w-full divide-y divide-gray-200">
|
<table class="min-w-full divide-y divide-gray-200">
|
||||||
<thead class="bg-gray-50">
|
<thead class="bg-gray-50">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{$t.connections?.name || "Name"}</th>
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">URL</th>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">URL</th>
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Username</th>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{$t.connections?.user || "Username"}</th>
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Default</th>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Default</th>
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{$t.git?.actions || "Actions"}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="bg-white divide-y divide-gray-200">
|
<tbody class="bg-white divide-y divide-gray-200">
|
||||||
@@ -192,9 +195,9 @@
|
|||||||
<td class="px-6 py-4 whitespace-nowrap">{env.username}</td>
|
<td class="px-6 py-4 whitespace-nowrap">{env.username}</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap">{env.is_default ? 'Yes' : 'No'}</td>
|
<td class="px-6 py-4 whitespace-nowrap">{env.is_default ? 'Yes' : 'No'}</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap">
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
<button on:click={() => handleTestEnv(env.id)} class="text-green-600 hover:text-green-900 mr-4">Test</button>
|
<button on:click={() => handleTestEnv(env.id)} class="text-green-600 hover:text-green-900 mr-4">{$t.settings?.env_test || "Test"}</button>
|
||||||
<button on:click={() => editEnv(env)} class="text-indigo-600 hover:text-indigo-900 mr-4">Edit</button>
|
<button on:click={() => editEnv(env)} class="text-indigo-600 hover:text-indigo-900 mr-4">{$t.common.edit}</button>
|
||||||
<button on:click={() => handleDeleteEnv(env.id)} class="text-red-600 hover:text-red-900">Delete</button>
|
<button on:click={() => handleDeleteEnv(env.id)} class="text-red-600 hover:text-red-900">{$t.settings?.env_delete || "Delete"}</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
@@ -202,44 +205,30 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg-gray-50 p-4 rounded">
|
<div class="mt-8 bg-gray-50 p-6 rounded-lg border border-gray-100">
|
||||||
<h3 class="text-lg font-medium mb-4">{editingEnvId ? 'Edit' : 'Add'} Environment</h3>
|
<h3 class="text-lg font-medium mb-6">{editingEnvId ? ($t.settings?.env_edit || "Edit Environment") : ($t.settings?.env_add || "Add Environment")}</h3>
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
<div>
|
<Input label="ID" bind:value={newEnv.id} disabled={!!editingEnvId} />
|
||||||
<label for="env_id" class="block text-sm font-medium text-gray-700">ID</label>
|
<Input label={$t.connections?.name || "Name"} bind:value={newEnv.name} />
|
||||||
<input type="text" id="env_id" bind:value={newEnv.id} disabled={!!editingEnvId} class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm p-2" />
|
<Input label="URL" bind:value={newEnv.url} />
|
||||||
</div>
|
<Input label={$t.connections?.user || "Username"} bind:value={newEnv.username} />
|
||||||
<div>
|
<Input label={$t.connections?.pass || "Password"} type="password" bind:value={newEnv.password} />
|
||||||
<label for="env_name" class="block text-sm font-medium text-gray-700">Name</label>
|
<div class="flex items-center gap-2 h-10 mt-auto">
|
||||||
<input type="text" id="env_name" bind:value={newEnv.name} class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm p-2" />
|
<input type="checkbox" id="env_default" bind:checked={newEnv.is_default} class="h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500" />
|
||||||
</div>
|
<label for="env_default" class="text-sm font-medium text-gray-700">{$t.settings?.env_default || "Default Environment"}</label>
|
||||||
<div>
|
|
||||||
<label for="env_url" class="block text-sm font-medium text-gray-700">URL</label>
|
|
||||||
<input type="text" id="env_url" bind:value={newEnv.url} class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm p-2" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="env_user" class="block text-sm font-medium text-gray-700">Username</label>
|
|
||||||
<input type="text" id="env_user" bind:value={newEnv.username} class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm p-2" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="env_pass" class="block text-sm font-medium text-gray-700">Password</label>
|
|
||||||
<input type="password" id="env_pass" bind:value={newEnv.password} class="mt-1 block w-full border border-gray-300 rounded-md shadow-sm p-2" />
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center">
|
|
||||||
<input type="checkbox" id="env_default" bind:checked={newEnv.is_default} class="h-4 w-4 text-blue-600 border-gray-300 rounded" />
|
|
||||||
<label for="env_default" class="ml-2 block text-sm text-gray-900">Default Environment</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 flex gap-2">
|
<div class="mt-8 flex gap-3">
|
||||||
<button on:click={handleAddOrUpdateEnv} class="bg-green-500 text-white px-4 py-2 rounded hover:bg-green-600">
|
<Button on:click={handleAddOrUpdateEnv}>
|
||||||
{editingEnvId ? 'Update' : 'Add'} Environment
|
{editingEnvId ? $t.common.save : ($t.settings?.env_add || "Add Environment")}
|
||||||
</button>
|
</Button>
|
||||||
{#if editingEnvId}
|
{#if editingEnvId}
|
||||||
<button on:click={resetEnvForm} class="bg-gray-500 text-white px-4 py-2 rounded hover:bg-gray-600">
|
<Button variant="secondary" on:click={resetEnvForm}>
|
||||||
Cancel
|
{$t.common.cancel}
|
||||||
</button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</Card>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,8 +1,24 @@
|
|||||||
<script>
|
<!-- [DEF:GitSettingsPage:Component] -->
|
||||||
|
<!--
|
||||||
|
@SEMANTICS: git, settings, configuration, integration
|
||||||
|
@PURPOSE: Manage Git server configurations for dashboard versioning.
|
||||||
|
@LAYER: Page
|
||||||
|
@RELATION: USES -> gitService
|
||||||
|
@RELATION: USES -> Button, Input, Card, PageHeader, Select
|
||||||
|
|
||||||
|
@INVARIANT: All configurations must be validated via connection test.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
// [SECTION: IMPORTS]
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { gitService } from '../../../services/gitService';
|
import { gitService } from '../../../services/gitService';
|
||||||
import { addToast as toast } from '../../../lib/toasts.js';
|
import { addToast as toast } from '../../../lib/toasts.js';
|
||||||
|
import { t } from '$lib/i18n';
|
||||||
|
import { Button, Input, Card, PageHeader, Select } from '$lib/ui';
|
||||||
|
// [/SECTION: IMPORTS]
|
||||||
|
|
||||||
|
// [SECTION: STATE]
|
||||||
let configs = [];
|
let configs = [];
|
||||||
let newConfig = {
|
let newConfig = {
|
||||||
name: '',
|
name: '',
|
||||||
@@ -12,15 +28,31 @@
|
|||||||
default_repository: ''
|
default_repository: ''
|
||||||
};
|
};
|
||||||
let testing = false;
|
let testing = false;
|
||||||
|
// [/SECTION: STATE]
|
||||||
|
|
||||||
onMount(async () => {
|
// [DEF:loadConfigs:Function]
|
||||||
|
/**
|
||||||
|
* @purpose Fetches existing git configurations.
|
||||||
|
* @pre Component is mounted.
|
||||||
|
* @post configs state is populated.
|
||||||
|
*/
|
||||||
|
async function loadConfigs() {
|
||||||
try {
|
try {
|
||||||
configs = await gitService.getConfigs();
|
configs = await gitService.getConfigs();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
toast(e.message, 'error');
|
toast(e.message, 'error');
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
// [/DEF:loadConfigs:Function]
|
||||||
|
|
||||||
|
onMount(loadConfigs);
|
||||||
|
|
||||||
|
// [DEF:handleTest:Function]
|
||||||
|
/**
|
||||||
|
* @purpose Tests connection to a git server with current form data.
|
||||||
|
* @pre newConfig contains valid provider, url, and pat.
|
||||||
|
* @post testing state is managed; toast shown with result.
|
||||||
|
*/
|
||||||
async function handleTest() {
|
async function handleTest() {
|
||||||
testing = true;
|
testing = true;
|
||||||
try {
|
try {
|
||||||
@@ -36,7 +68,14 @@
|
|||||||
testing = false;
|
testing = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// [/DEF:handleTest:Function]
|
||||||
|
|
||||||
|
// [DEF:handleSave:Function]
|
||||||
|
/**
|
||||||
|
* @purpose Saves a new git configuration.
|
||||||
|
* @pre newConfig is valid and tested.
|
||||||
|
* @post New config is saved to DB and added to configs list.
|
||||||
|
*/
|
||||||
async function handleSave() {
|
async function handleSave() {
|
||||||
try {
|
try {
|
||||||
const saved = await gitService.createConfig(newConfig);
|
const saved = await gitService.createConfig(newConfig);
|
||||||
@@ -47,7 +86,15 @@
|
|||||||
toast(e.message, 'error');
|
toast(e.message, 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// [/DEF:handleSave:Function]
|
||||||
|
|
||||||
|
// [DEF:handleDelete:Function]
|
||||||
|
/**
|
||||||
|
* @purpose Deletes a git configuration by ID.
|
||||||
|
* @param {string} id - Configuration ID.
|
||||||
|
* @pre id is valid; user confirmed deletion.
|
||||||
|
* @post Configuration is removed from DB and local state.
|
||||||
|
*/
|
||||||
async function handleDelete(id) {
|
async function handleDelete(id) {
|
||||||
if (!confirm('Are you sure you want to delete this Git configuration?')) return;
|
if (!confirm('Are you sure you want to delete this Git configuration?')) return;
|
||||||
try {
|
try {
|
||||||
@@ -58,31 +105,34 @@
|
|||||||
toast(e.message, 'error');
|
toast(e.message, 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// [/DEF:handleDelete:Function]
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="p-6">
|
<!-- [SECTION: TEMPLATE] -->
|
||||||
<h1 class="text-2xl font-bold mb-6">Git Integration Settings</h1>
|
<div class="p-6 max-w-6xl mx-auto">
|
||||||
|
<PageHeader title="Git Integration Settings" />
|
||||||
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
||||||
<!-- List of Configs -->
|
<!-- List of Configs -->
|
||||||
<div class="bg-white p-6 rounded shadow">
|
<Card title="Configured Servers">
|
||||||
<h2 class="text-xl font-semibold mb-4">Configured Servers</h2>
|
|
||||||
{#if configs.length === 0}
|
{#if configs.length === 0}
|
||||||
<p class="text-gray-500">No Git servers configured.</p>
|
<p class="text-gray-500">No Git servers configured.</p>
|
||||||
{:else}
|
{:else}
|
||||||
<ul class="divide-y">
|
<ul class="divide-y divide-gray-100">
|
||||||
{#each configs as config}
|
{#each configs as config}
|
||||||
<li class="py-3 flex justify-between items-center">
|
<li class="py-4 flex justify-between items-center">
|
||||||
<div>
|
<div>
|
||||||
<span class="font-medium">{config.name}</span>
|
<div class="flex items-center gap-2">
|
||||||
<span class="text-sm text-gray-500 ml-2">({config.provider})</span>
|
<span class="font-medium text-gray-900">{config.name}</span>
|
||||||
<div class="text-xs text-gray-400">{config.url}</div>
|
<span class="text-xs font-mono bg-gray-50 text-gray-500 px-1.5 py-0.5 rounded">{config.provider}</span>
|
||||||
|
</div>
|
||||||
|
<div class="text-xs text-gray-400 mt-1">{config.url}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center space-x-4">
|
<div class="flex items-center space-x-4">
|
||||||
<span class="px-2 py-1 text-xs rounded {config.status === 'CONNECTED' ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800'}">
|
<span class="px-2 py-1 text-xs font-medium rounded {config.status === 'CONNECTED' ? 'bg-green-50 text-green-700' : 'bg-red-50 text-red-700'}">
|
||||||
{config.status}
|
{config.status}
|
||||||
</span>
|
</span>
|
||||||
<button on:click={() => handleDelete(config.id)} class="text-red-600 hover:text-red-800 p-1" title="Delete">
|
<button on:click={() => handleDelete(config.id)} class="text-gray-400 hover:text-red-600 transition-colors" title="Delete">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
||||||
<path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd" />
|
<path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd" />
|
||||||
</svg>
|
</svg>
|
||||||
@@ -92,45 +142,41 @@
|
|||||||
{/each}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</Card>
|
||||||
|
|
||||||
<!-- Add New Config -->
|
<!-- Add New Config -->
|
||||||
<div class="bg-white p-6 rounded shadow">
|
<Card title="Add Git Server">
|
||||||
<h2 class="text-xl font-semibold mb-4">Add Git Server</h2>
|
<div class="space-y-6">
|
||||||
<div class="space-y-4">
|
<Input label="Display Name" bind:value={newConfig.name} placeholder="e.g. My GitHub" />
|
||||||
<div>
|
<Select
|
||||||
<label class="block text-sm font-medium text-gray-700">Display Name</label>
|
label="Provider"
|
||||||
<input type="text" bind:value={newConfig.name} class="mt-1 block w-full border rounded p-2" placeholder="e.g. My GitHub" />
|
bind:value={newConfig.provider}
|
||||||
</div>
|
options={[
|
||||||
<div>
|
{ value: 'GITHUB', label: 'GitHub' },
|
||||||
<label class="block text-sm font-medium text-gray-700">Provider</label>
|
{ value: 'GITLAB', label: 'GitLab' },
|
||||||
<select bind:value={newConfig.provider} class="mt-1 block w-full border rounded p-2">
|
{ value: 'GITEA', label: 'Gitea' }
|
||||||
<option value="GITHUB">GitHub</option>
|
]}
|
||||||
<option value="GITLAB">GitLab</option>
|
/>
|
||||||
<option value="GITEA">Gitea</option>
|
<Input label="Server URL" bind:value={newConfig.url} />
|
||||||
</select>
|
<Input label="Personal Access Token (PAT)" type="password" bind:value={newConfig.pat} />
|
||||||
</div>
|
<Input label="Default Repository (Optional)" bind:value={newConfig.default_repository} placeholder="org/repo" />
|
||||||
<div>
|
|
||||||
<label class="block text-sm font-medium text-gray-700">Server URL</label>
|
<div class="flex gap-3 pt-2">
|
||||||
<input type="text" bind:value={newConfig.url} class="mt-1 block w-full border rounded p-2" />
|
<Button variant="secondary" on:click={handleTest} isLoading={testing}>
|
||||||
</div>
|
Test Connection
|
||||||
<div>
|
</Button>
|
||||||
<label class="block text-sm font-medium text-gray-700">Personal Access Token (PAT)</label>
|
<Button variant="primary" on:click={handleSave}>
|
||||||
<input type="password" bind:value={newConfig.pat} class="mt-1 block w-full border rounded p-2" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label class="block text-sm font-medium text-gray-700">Default Repository (Optional)</label>
|
|
||||||
<input type="text" bind:value={newConfig.default_repository} class="mt-1 block w-full border rounded p-2" placeholder="org/repo" />
|
|
||||||
</div>
|
|
||||||
<div class="flex space-x-4 pt-4">
|
|
||||||
<button on:click={handleTest} disabled={testing} class="bg-gray-200 px-4 py-2 rounded hover:bg-gray-300 disabled:opacity-50">
|
|
||||||
{testing ? 'Testing...' : 'Test Connection'}
|
|
||||||
</button>
|
|
||||||
<button on:click={handleSave} class="bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700">
|
|
||||||
Save Configuration
|
Save Configuration
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- [/SECTION: TEMPLATE] -->
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/* Styles are handled by Tailwind */
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<!-- [/DEF:GitSettingsPage:Component] -->
|
||||||
@@ -12,6 +12,8 @@
|
|||||||
import { addToast } from '../../lib/toasts';
|
import { addToast } from '../../lib/toasts';
|
||||||
import TaskList from '../../components/TaskList.svelte';
|
import TaskList from '../../components/TaskList.svelte';
|
||||||
import TaskLogViewer from '../../components/TaskLogViewer.svelte';
|
import TaskLogViewer from '../../components/TaskLogViewer.svelte';
|
||||||
|
import { t } from '$lib/i18n';
|
||||||
|
import { Button, Card, PageHeader, Select } from '$lib/ui';
|
||||||
|
|
||||||
let tasks = [];
|
let tasks = [];
|
||||||
let environments = [];
|
let environments = [];
|
||||||
@@ -114,35 +116,35 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="container mx-auto p-4 max-w-6xl">
|
<div class="container mx-auto p-4 max-w-6xl">
|
||||||
<div class="flex justify-between items-center mb-6">
|
<PageHeader title={$t.tasks.management}>
|
||||||
<h1 class="text-2xl font-bold text-gray-800">Task Management</h1>
|
<div slot="actions">
|
||||||
<button
|
<Button on:click={() => showBackupModal = true}>
|
||||||
on:click={() => showBackupModal = true}
|
{$t.tasks.run_backup}
|
||||||
class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md shadow-sm transition duration-150 font-medium"
|
</Button>
|
||||||
>
|
</div>
|
||||||
Run Backup
|
</PageHeader>
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
||||||
<div class="lg:col-span-1">
|
<div class="lg:col-span-1">
|
||||||
<h2 class="text-lg font-semibold mb-3 text-gray-700">Recent Tasks</h2>
|
<h2 class="text-lg font-semibold mb-3 text-gray-700">{$t.tasks.recent}</h2>
|
||||||
<TaskList {tasks} {loading} on:select={handleSelectTask} />
|
<TaskList {tasks} {loading} on:select={handleSelectTask} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="lg:col-span-2">
|
<div class="lg:col-span-2">
|
||||||
<h2 class="text-lg font-semibold mb-3 text-gray-700">Task Details & Logs</h2>
|
<h2 class="text-lg font-semibold mb-3 text-gray-700">{$t.tasks.details_logs}</h2>
|
||||||
{#if selectedTaskId}
|
{#if selectedTaskId}
|
||||||
<div class="bg-white rounded-lg shadow-lg h-[600px] flex flex-col">
|
<Card padding="none">
|
||||||
<TaskLogViewer
|
<div class="h-[600px] flex flex-col overflow-hidden rounded-lg">
|
||||||
taskId={selectedTaskId}
|
<TaskLogViewer
|
||||||
taskStatus={tasks.find(t => t.id === selectedTaskId)?.status}
|
taskId={selectedTaskId}
|
||||||
inline={true}
|
taskStatus={tasks.find(t => t.id === selectedTaskId)?.status}
|
||||||
/>
|
inline={true}
|
||||||
</div>
|
/>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="bg-gray-50 border-2 border-dashed border-gray-300 rounded-lg h-[600px] flex items-center justify-center text-gray-500">
|
<div class="bg-gray-50 border-2 border-dashed border-gray-100 rounded-lg h-[600px] flex items-center justify-center text-gray-400">
|
||||||
<p>Select a task to view logs and details</p>
|
<p>{$t.tasks.select_task}</p>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
@@ -150,36 +152,29 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if showBackupModal}
|
{#if showBackupModal}
|
||||||
<div class="fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50">
|
<div class="fixed inset-0 z-50 flex items-center justify-center bg-gray-900/50 backdrop-blur-sm p-4">
|
||||||
<div class="bg-white rounded-lg shadow-xl p-6 w-full max-w-md">
|
<div class="w-full max-w-md">
|
||||||
<h3 class="text-xl font-bold mb-4">Run Manual Backup</h3>
|
<Card title={$t.tasks.manual_backup}>
|
||||||
<div class="mb-4">
|
<div class="space-y-6">
|
||||||
<label for="env-select" class="block text-sm font-medium text-gray-700 mb-1">Target Environment</label>
|
<Select
|
||||||
<select
|
label={$t.tasks.target_env}
|
||||||
id="env-select"
|
bind:value={selectedEnvId}
|
||||||
bind:value={selectedEnvId}
|
options={[
|
||||||
class="w-full border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 p-2 border"
|
{ value: '', label: $t.tasks.select_env },
|
||||||
>
|
...environments.map(e => ({ value: e.id, label: e.name }))
|
||||||
<option value="" disabled>-- Select Environment --</option>
|
]}
|
||||||
{#each environments as env}
|
/>
|
||||||
<option value={env.id}>{env.name}</option>
|
|
||||||
{/each}
|
<div class="flex justify-end gap-3 pt-2">
|
||||||
</select>
|
<Button variant="secondary" on:click={() => showBackupModal = false}>
|
||||||
</div>
|
{$t.common.cancel}
|
||||||
<div class="flex justify-end space-x-3">
|
</Button>
|
||||||
<button
|
<Button variant="primary" on:click={handleRunBackup}>
|
||||||
on:click={() => showBackupModal = false}
|
Start Backup
|
||||||
class="px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-md transition"
|
</Button>
|
||||||
>
|
</div>
|
||||||
Cancel
|
</div>
|
||||||
</button>
|
</Card>
|
||||||
<button
|
|
||||||
on:click={handleRunBackup}
|
|
||||||
class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition"
|
|
||||||
>
|
|
||||||
Start Backup
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -7,19 +7,18 @@
|
|||||||
<script>
|
<script>
|
||||||
import DebugTool from '../../../components/tools/DebugTool.svelte';
|
import DebugTool from '../../../components/tools/DebugTool.svelte';
|
||||||
import TaskRunner from '../../../components/TaskRunner.svelte';
|
import TaskRunner from '../../../components/TaskRunner.svelte';
|
||||||
|
import { PageHeader } from '$lib/ui';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
|
<div class="max-w-7xl mx-auto p-6">
|
||||||
<div class="px-4 py-6 sm:px-0">
|
<PageHeader title="System Diagnostics" />
|
||||||
<h1 class="text-2xl font-semibold text-gray-900 mb-6">System Diagnostics</h1>
|
|
||||||
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
||||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
<div class="lg:col-span-2">
|
||||||
<div class="lg:col-span-2">
|
<DebugTool />
|
||||||
<DebugTool />
|
</div>
|
||||||
</div>
|
<div class="lg:col-span-1">
|
||||||
<div class="lg:col-span-1">
|
<TaskRunner />
|
||||||
<TaskRunner />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,19 +7,18 @@
|
|||||||
<script>
|
<script>
|
||||||
import MapperTool from '../../../components/tools/MapperTool.svelte';
|
import MapperTool from '../../../components/tools/MapperTool.svelte';
|
||||||
import TaskRunner from '../../../components/TaskRunner.svelte';
|
import TaskRunner from '../../../components/TaskRunner.svelte';
|
||||||
|
import { PageHeader } from '$lib/ui';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
|
<div class="max-w-7xl mx-auto p-6">
|
||||||
<div class="px-4 py-6 sm:px-0">
|
<PageHeader title="Dataset Column Mapper" />
|
||||||
<h1 class="text-2xl font-semibold text-gray-900 mb-6">Dataset Column Mapper</h1>
|
|
||||||
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
||||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
<div class="lg:col-span-2">
|
||||||
<div class="lg:col-span-2">
|
<MapperTool />
|
||||||
<MapperTool />
|
</div>
|
||||||
</div>
|
<div class="lg:col-span-1">
|
||||||
<div class="lg:col-span-1">
|
<TaskRunner />
|
||||||
<TaskRunner />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,19 +7,18 @@
|
|||||||
<script>
|
<script>
|
||||||
import SearchTool from '../../../components/tools/SearchTool.svelte';
|
import SearchTool from '../../../components/tools/SearchTool.svelte';
|
||||||
import TaskRunner from '../../../components/TaskRunner.svelte';
|
import TaskRunner from '../../../components/TaskRunner.svelte';
|
||||||
|
import { PageHeader } from '$lib/ui';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
|
<div class="max-w-7xl mx-auto p-6">
|
||||||
<div class="px-4 py-6 sm:px-0">
|
<PageHeader title="Dataset Search" />
|
||||||
<h1 class="text-2xl font-semibold text-gray-900 mb-6">Dataset Search</h1>
|
|
||||||
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
||||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
<div class="lg:col-span-2">
|
||||||
<div class="lg:col-span-2">
|
<SearchTool />
|
||||||
<SearchTool />
|
</div>
|
||||||
</div>
|
<div class="lg:col-span-1">
|
||||||
<div class="lg:col-span-1">
|
<TaskRunner />
|
||||||
<TaskRunner />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
// [DEF:GitServiceClient:Module]
|
||||||
/**
|
/**
|
||||||
* [DEF:GitServiceClient:Module]
|
|
||||||
* @SEMANTICS: git, service, api, client
|
* @SEMANTICS: git, service, api, client
|
||||||
* @PURPOSE: API client for Git operations, managing the communication between frontend and backend.
|
* @PURPOSE: API client for Git operations, managing the communication between frontend and backend.
|
||||||
* @LAYER: Service
|
* @LAYER: Service
|
||||||
|
|||||||
126
semantics/reports/semantic_report_20260123_214352.md
Normal file
126
semantics/reports/semantic_report_20260123_214352.md
Normal file
File diff suppressed because one or more lines are too long
109
semantics/reports/semantic_report_20260123_214938.md
Normal file
109
semantics/reports/semantic_report_20260123_214938.md
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
# Semantic Compliance Report
|
||||||
|
|
||||||
|
**Generated At:** 2026-01-23T21:49:38.910491
|
||||||
|
**Global Compliance Score:** 96.7%
|
||||||
|
**Scanned Files:** 93
|
||||||
|
|
||||||
|
## Critical Parsing Errors
|
||||||
|
- 🔴 backend/src/core/utils/network.py:27 Function '__init__' implementation found without matching [DEF:__init__:Function] contract.
|
||||||
|
- 🔴 backend/src/core/utils/network.py:38 Function '__init__' implementation found without matching [DEF:__init__:Function] contract.
|
||||||
|
- 🔴 backend/src/core/utils/network.py:48 Function '__init__' implementation found without matching [DEF:__init__:Function] contract.
|
||||||
|
- 🔴 backend/src/core/utils/network.py:58 Function '__init__' implementation found without matching [DEF:__init__:Function] contract.
|
||||||
|
- 🔴 backend/src/core/utils/network.py:68 Function '__init__' implementation found without matching [DEF:__init__:Function] contract.
|
||||||
|
|
||||||
|
## File Compliance Status
|
||||||
|
| File | Score | Issues |
|
||||||
|
|------|-------|--------|
|
||||||
|
| backend/src/api/routes/git_schemas.py | 🟡 54% | [GitServerConfigBase] Missing Mandatory Tag: @PURPOSE<br>[GitServerConfigBase] Missing Mandatory Tag: @PURPOSE<br>[GitServerConfigCreate] Missing Mandatory Tag: @PURPOSE<br>[GitServerConfigCreate] Missing Mandatory Tag: @PURPOSE<br>[GitServerConfigSchema] Missing Mandatory Tag: @PURPOSE<br>[GitServerConfigSchema] Missing Mandatory Tag: @PURPOSE<br>[GitRepositorySchema] Missing Mandatory Tag: @PURPOSE<br>[GitRepositorySchema] Missing Mandatory Tag: @PURPOSE<br>[BranchSchema] Missing Mandatory Tag: @PURPOSE<br>[BranchSchema] Missing Mandatory Tag: @PURPOSE<br>[CommitSchema] Missing Mandatory Tag: @PURPOSE<br>[CommitSchema] Missing Mandatory Tag: @PURPOSE<br>[BranchCreate] Missing Mandatory Tag: @PURPOSE<br>[BranchCreate] Missing Mandatory Tag: @PURPOSE<br>[BranchCheckout] Missing Mandatory Tag: @PURPOSE<br>[BranchCheckout] Missing Mandatory Tag: @PURPOSE<br>[CommitCreate] Missing Mandatory Tag: @PURPOSE<br>[CommitCreate] Missing Mandatory Tag: @PURPOSE<br>[ConflictResolution] Missing Mandatory Tag: @PURPOSE<br>[ConflictResolution] Missing Mandatory Tag: @PURPOSE<br>[DeploymentEnvironmentSchema] Missing Mandatory Tag: @PURPOSE<br>[DeploymentEnvironmentSchema] Missing Mandatory Tag: @PURPOSE<br>[DeployRequest] Missing Mandatory Tag: @PURPOSE<br>[DeployRequest] Missing Mandatory Tag: @PURPOSE<br>[RepoInitRequest] Missing Mandatory Tag: @PURPOSE<br>[RepoInitRequest] Missing Mandatory Tag: @PURPOSE |
|
||||||
|
| frontend/src/components/git/GitManager.svelte | 🟡 67% | [checkStatus] Missing Mandatory Tag: @PRE<br>[checkStatus] Missing Mandatory Tag: @POST<br>[checkStatus] Missing Mandatory Tag: @PRE<br>[checkStatus] Missing Mandatory Tag: @POST<br>[handleInit] Missing Mandatory Tag: @PRE<br>[handleInit] Missing Mandatory Tag: @POST<br>[handleInit] Missing Mandatory Tag: @PRE<br>[handleInit] Missing Mandatory Tag: @POST<br>[handleSync] Missing Mandatory Tag: @PRE<br>[handleSync] Missing Mandatory Tag: @POST<br>[handleSync] Missing Mandatory Tag: @PRE<br>[handleSync] Missing Mandatory Tag: @POST<br>[handlePush] Missing Mandatory Tag: @PURPOSE<br>[handlePush] Missing Mandatory Tag: @PRE<br>[handlePush] Missing Mandatory Tag: @POST<br>[handlePush] Missing Mandatory Tag: @PURPOSE<br>[handlePush] Missing Mandatory Tag: @PRE<br>[handlePush] Missing Mandatory Tag: @POST<br>[handlePull] Missing Mandatory Tag: @PURPOSE<br>[handlePull] Missing Mandatory Tag: @PRE<br>[handlePull] Missing Mandatory Tag: @POST<br>[handlePull] Missing Mandatory Tag: @PURPOSE<br>[handlePull] Missing Mandatory Tag: @PRE<br>[handlePull] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/routes/git/+page.svelte | 🟡 67% | [fetchEnvironments] Missing Mandatory Tag: @PURPOSE<br>[fetchEnvironments] Missing Mandatory Tag: @PRE<br>[fetchEnvironments] Missing Mandatory Tag: @POST<br>[fetchEnvironments] Missing Mandatory Tag: @PURPOSE<br>[fetchEnvironments] Missing Mandatory Tag: @PRE<br>[fetchEnvironments] Missing Mandatory Tag: @POST<br>[fetchDashboards] Missing Mandatory Tag: @PURPOSE<br>[fetchDashboards] Missing Mandatory Tag: @PRE<br>[fetchDashboards] Missing Mandatory Tag: @POST<br>[fetchDashboards] Missing Mandatory Tag: @PURPOSE<br>[fetchDashboards] Missing Mandatory Tag: @PRE<br>[fetchDashboards] Missing Mandatory Tag: @POST |
|
||||||
|
| backend/src/api/routes/git.py | 🟡 69% | [get_git_configs] Missing Mandatory Tag: @PRE<br>[get_git_configs] Missing Mandatory Tag: @POST<br>[get_git_configs] Missing Mandatory Tag: @PRE<br>[get_git_configs] Missing Mandatory Tag: @POST<br>[create_git_config] Missing Mandatory Tag: @PRE<br>[create_git_config] Missing Mandatory Tag: @POST<br>[create_git_config] Missing Mandatory Tag: @PRE<br>[create_git_config] Missing Mandatory Tag: @POST<br>[delete_git_config] Missing Mandatory Tag: @PRE<br>[delete_git_config] Missing Mandatory Tag: @POST<br>[delete_git_config] Missing Mandatory Tag: @PRE<br>[delete_git_config] Missing Mandatory Tag: @POST<br>[test_git_config] Missing Mandatory Tag: @PRE<br>[test_git_config] Missing Mandatory Tag: @POST<br>[test_git_config] Missing Mandatory Tag: @PRE<br>[test_git_config] Missing Mandatory Tag: @POST<br>[init_repository] Missing Mandatory Tag: @PRE<br>[init_repository] Missing Mandatory Tag: @POST<br>[init_repository] Missing Mandatory Tag: @PRE<br>[init_repository] Missing Mandatory Tag: @POST<br>[get_branches] Missing Mandatory Tag: @PRE<br>[get_branches] Missing Mandatory Tag: @POST<br>[get_branches] Missing Mandatory Tag: @PRE<br>[get_branches] Missing Mandatory Tag: @POST<br>[create_branch] Missing Mandatory Tag: @PRE<br>[create_branch] Missing Mandatory Tag: @POST<br>[create_branch] Missing Mandatory Tag: @PRE<br>[create_branch] Missing Mandatory Tag: @POST<br>[checkout_branch] Missing Mandatory Tag: @PRE<br>[checkout_branch] Missing Mandatory Tag: @POST<br>[checkout_branch] Missing Mandatory Tag: @PRE<br>[checkout_branch] Missing Mandatory Tag: @POST<br>[commit_changes] Missing Mandatory Tag: @PRE<br>[commit_changes] Missing Mandatory Tag: @POST<br>[commit_changes] Missing Mandatory Tag: @PRE<br>[commit_changes] Missing Mandatory Tag: @POST<br>[push_changes] Missing Mandatory Tag: @PRE<br>[push_changes] Missing Mandatory Tag: @POST<br>[push_changes] Missing Mandatory Tag: @PRE<br>[push_changes] Missing Mandatory Tag: @POST<br>[pull_changes] Missing Mandatory Tag: @PRE<br>[pull_changes] Missing Mandatory Tag: @POST<br>[pull_changes] Missing Mandatory Tag: @PRE<br>[pull_changes] Missing Mandatory Tag: @POST<br>[sync_dashboard] Missing Mandatory Tag: @PRE<br>[sync_dashboard] Missing Mandatory Tag: @POST<br>[sync_dashboard] Missing Mandatory Tag: @PRE<br>[sync_dashboard] Missing Mandatory Tag: @POST<br>[get_environments] Missing Mandatory Tag: @PRE<br>[get_environments] Missing Mandatory Tag: @POST<br>[get_environments] Missing Mandatory Tag: @PRE<br>[get_environments] Missing Mandatory Tag: @POST<br>[deploy_dashboard] Missing Mandatory Tag: @PRE<br>[deploy_dashboard] Missing Mandatory Tag: @POST<br>[deploy_dashboard] Missing Mandatory Tag: @PRE<br>[deploy_dashboard] Missing Mandatory Tag: @POST<br>[get_history] Missing Mandatory Tag: @PRE<br>[get_history] Missing Mandatory Tag: @POST<br>[get_history] Missing Mandatory Tag: @PRE<br>[get_history] Missing Mandatory Tag: @POST<br>[get_repository_status] Missing Mandatory Tag: @PRE<br>[get_repository_status] Missing Mandatory Tag: @POST<br>[get_repository_status] Missing Mandatory Tag: @PRE<br>[get_repository_status] Missing Mandatory Tag: @POST<br>[get_repository_diff] Missing Mandatory Tag: @PRE<br>[get_repository_diff] Missing Mandatory Tag: @POST<br>[get_repository_diff] Missing Mandatory Tag: @PRE<br>[get_repository_diff] Missing Mandatory Tag: @POST |
|
||||||
|
| backend/src/services/git_service.py | 🟡 72% | [__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Mandatory Tag: @POST<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Mandatory Tag: @POST<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Mandatory Tag: @POST<br>[_get_repo_path] Missing Mandatory Tag: @PRE<br>[_get_repo_path] Missing Mandatory Tag: @POST<br>[_get_repo_path] Missing Belief State Logging: Function should use belief_scope context manager.<br>[_get_repo_path] Missing Mandatory Tag: @PRE<br>[_get_repo_path] Missing Mandatory Tag: @POST<br>[_get_repo_path] Missing Belief State Logging: Function should use belief_scope context manager.<br>[_get_repo_path] Missing Mandatory Tag: @PRE<br>[_get_repo_path] Missing Mandatory Tag: @POST<br>[_get_repo_path] Missing Belief State Logging: Function should use belief_scope context manager.<br>[init_repo] Missing Mandatory Tag: @PRE<br>[init_repo] Missing Mandatory Tag: @POST<br>[init_repo] Missing Mandatory Tag: @PRE<br>[init_repo] Missing Mandatory Tag: @POST<br>[init_repo] Missing Mandatory Tag: @PRE<br>[init_repo] Missing Mandatory Tag: @POST<br>[get_repo] Missing Mandatory Tag: @POST<br>[get_repo] Missing Mandatory Tag: @POST<br>[get_repo] Missing Mandatory Tag: @POST<br>[list_branches] Missing Mandatory Tag: @PRE<br>[list_branches] Missing Mandatory Tag: @POST<br>[list_branches] Missing Mandatory Tag: @PRE<br>[list_branches] Missing Mandatory Tag: @POST<br>[list_branches] Missing Mandatory Tag: @PRE<br>[list_branches] Missing Mandatory Tag: @POST<br>[create_branch] Missing Mandatory Tag: @PRE<br>[create_branch] Missing Mandatory Tag: @POST<br>[create_branch] Missing Mandatory Tag: @PRE<br>[create_branch] Missing Mandatory Tag: @POST<br>[create_branch] Missing Mandatory Tag: @PRE<br>[create_branch] Missing Mandatory Tag: @POST<br>[checkout_branch] Missing Mandatory Tag: @PRE<br>[checkout_branch] Missing Mandatory Tag: @POST<br>[checkout_branch] Missing Mandatory Tag: @PRE<br>[checkout_branch] Missing Mandatory Tag: @POST<br>[checkout_branch] Missing Mandatory Tag: @PRE<br>[checkout_branch] Missing Mandatory Tag: @POST<br>[commit_changes] Missing Mandatory Tag: @PRE<br>[commit_changes] Missing Mandatory Tag: @POST<br>[commit_changes] Missing Mandatory Tag: @PRE<br>[commit_changes] Missing Mandatory Tag: @POST<br>[commit_changes] Missing Mandatory Tag: @PRE<br>[commit_changes] Missing Mandatory Tag: @POST<br>[push_changes] Missing Mandatory Tag: @PRE<br>[push_changes] Missing Mandatory Tag: @POST<br>[push_changes] Missing Mandatory Tag: @PRE<br>[push_changes] Missing Mandatory Tag: @POST<br>[push_changes] Missing Mandatory Tag: @PRE<br>[push_changes] Missing Mandatory Tag: @POST<br>[pull_changes] Missing Mandatory Tag: @PRE<br>[pull_changes] Missing Mandatory Tag: @POST<br>[pull_changes] Missing Mandatory Tag: @PRE<br>[pull_changes] Missing Mandatory Tag: @POST<br>[pull_changes] Missing Mandatory Tag: @PRE<br>[pull_changes] Missing Mandatory Tag: @POST<br>[get_status] Missing Mandatory Tag: @PRE<br>[get_status] Missing Mandatory Tag: @POST<br>[get_status] Missing Mandatory Tag: @PRE<br>[get_status] Missing Mandatory Tag: @POST<br>[get_status] Missing Mandatory Tag: @PRE<br>[get_status] Missing Mandatory Tag: @POST<br>[get_diff] Missing Mandatory Tag: @PRE<br>[get_diff] Missing Mandatory Tag: @POST<br>[get_diff] Missing Mandatory Tag: @PRE<br>[get_diff] Missing Mandatory Tag: @POST<br>[get_diff] Missing Mandatory Tag: @PRE<br>[get_diff] Missing Mandatory Tag: @POST<br>[get_commit_history] Missing Mandatory Tag: @PRE<br>[get_commit_history] Missing Mandatory Tag: @POST<br>[get_commit_history] Missing Mandatory Tag: @PRE<br>[get_commit_history] Missing Mandatory Tag: @POST<br>[get_commit_history] Missing Mandatory Tag: @PRE<br>[get_commit_history] Missing Mandatory Tag: @POST<br>[test_connection] Missing Mandatory Tag: @PRE<br>[test_connection] Missing Mandatory Tag: @POST<br>[test_connection] Missing Mandatory Tag: @PRE<br>[test_connection] Missing Mandatory Tag: @POST<br>[test_connection] Missing Mandatory Tag: @PRE<br>[test_connection] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/routes/settings/git/+page.svelte | 🟡 73% | [loadConfigs] Missing Mandatory Tag: @PRE<br>[loadConfigs] Missing Mandatory Tag: @POST<br>[loadConfigs] Missing Mandatory Tag: @PRE<br>[loadConfigs] Missing Mandatory Tag: @POST<br>[handleTest] Missing Mandatory Tag: @PRE<br>[handleTest] Missing Mandatory Tag: @POST<br>[handleTest] Missing Mandatory Tag: @PRE<br>[handleTest] Missing Mandatory Tag: @POST<br>[handleSave] Missing Mandatory Tag: @PRE<br>[handleSave] Missing Mandatory Tag: @POST<br>[handleSave] Missing Mandatory Tag: @PRE<br>[handleSave] Missing Mandatory Tag: @POST<br>[handleDelete] Missing Mandatory Tag: @PRE<br>[handleDelete] Missing Mandatory Tag: @POST<br>[handleDelete] Missing Mandatory Tag: @PRE<br>[handleDelete] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/git/BranchSelector.svelte | 🟡 75% | [onMount] Missing Mandatory Tag: @PURPOSE<br>[onMount] Missing Mandatory Tag: @PRE<br>[onMount] Missing Mandatory Tag: @POST<br>[onMount] Missing Mandatory Tag: @PURPOSE<br>[onMount] Missing Mandatory Tag: @PRE<br>[onMount] Missing Mandatory Tag: @POST<br>[loadBranches] Missing Mandatory Tag: @PRE<br>[loadBranches] Missing Mandatory Tag: @PRE<br>[handleSelect] Missing Mandatory Tag: @PURPOSE<br>[handleSelect] Missing Mandatory Tag: @PRE<br>[handleSelect] Missing Mandatory Tag: @POST<br>[handleSelect] Missing Mandatory Tag: @PURPOSE<br>[handleSelect] Missing Mandatory Tag: @PRE<br>[handleSelect] Missing Mandatory Tag: @POST<br>[handleCheckout] Missing Mandatory Tag: @PRE<br>[handleCheckout] Missing Mandatory Tag: @PRE<br>[handleCreate] Missing Mandatory Tag: @PRE<br>[handleCreate] Missing Mandatory Tag: @PRE |
|
||||||
|
| backend/src/plugins/git_plugin.py | 🟡 82% | [__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Mandatory Tag: @PRE<br>[id] Missing Mandatory Tag: @PRE<br>[id] Missing Mandatory Tag: @POST<br>[id] Missing Belief State Logging: Function should use belief_scope context manager.<br>[id] Missing Mandatory Tag: @PRE<br>[id] Missing Mandatory Tag: @POST<br>[id] Missing Belief State Logging: Function should use belief_scope context manager.<br>[id] Missing Mandatory Tag: @PRE<br>[id] Missing Mandatory Tag: @POST<br>[id] Missing Belief State Logging: Function should use belief_scope context manager.<br>[name] Missing Mandatory Tag: @PRE<br>[name] Missing Mandatory Tag: @POST<br>[name] Missing Belief State Logging: Function should use belief_scope context manager.<br>[name] Missing Mandatory Tag: @PRE<br>[name] Missing Mandatory Tag: @POST<br>[name] Missing Belief State Logging: Function should use belief_scope context manager.<br>[name] Missing Mandatory Tag: @PRE<br>[name] Missing Mandatory Tag: @POST<br>[name] Missing Belief State Logging: Function should use belief_scope context manager.<br>[description] Missing Mandatory Tag: @PRE<br>[description] Missing Mandatory Tag: @POST<br>[description] Missing Belief State Logging: Function should use belief_scope context manager.<br>[description] Missing Mandatory Tag: @PRE<br>[description] Missing Mandatory Tag: @POST<br>[description] Missing Belief State Logging: Function should use belief_scope context manager.<br>[description] Missing Mandatory Tag: @PRE<br>[description] Missing Mandatory Tag: @POST<br>[description] Missing Belief State Logging: Function should use belief_scope context manager.<br>[version] Missing Mandatory Tag: @PRE<br>[version] Missing Mandatory Tag: @POST<br>[version] Missing Belief State Logging: Function should use belief_scope context manager.<br>[version] Missing Mandatory Tag: @PRE<br>[version] Missing Mandatory Tag: @POST<br>[version] Missing Belief State Logging: Function should use belief_scope context manager.<br>[version] Missing Mandatory Tag: @PRE<br>[version] Missing Mandatory Tag: @POST<br>[version] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_schema] Missing Mandatory Tag: @PRE<br>[get_schema] Missing Mandatory Tag: @POST<br>[get_schema] Missing Mandatory Tag: @PRE<br>[get_schema] Missing Mandatory Tag: @POST<br>[get_schema] Missing Mandatory Tag: @PRE<br>[get_schema] Missing Mandatory Tag: @POST<br>[initialize] Missing Mandatory Tag: @PRE<br>[initialize] Missing Mandatory Tag: @PRE<br>[initialize] Missing Mandatory Tag: @PRE<br>[_get_env] Missing Mandatory Tag: @PRE<br>[_get_env] Missing Mandatory Tag: @POST<br>[_get_env] Missing Mandatory Tag: @PRE<br>[_get_env] Missing Mandatory Tag: @POST<br>[_get_env] Missing Mandatory Tag: @PRE<br>[_get_env] Missing Mandatory Tag: @POST<br>[_get_env] Missing Mandatory Tag: @PRE<br>[_get_env] Missing Mandatory Tag: @POST |
|
||||||
|
| backend/src/models/git.py | 🟡 83% | [GitModels] Missing Mandatory Tag: @SEMANTICS |
|
||||||
|
| frontend/src/components/git/CommitHistory.svelte | 🟡 83% | [onMount] Missing Mandatory Tag: @PRE<br>[onMount] Missing Mandatory Tag: @POST<br>[onMount] Missing Mandatory Tag: @PRE<br>[onMount] Missing Mandatory Tag: @POST<br>[loadHistory] Missing Mandatory Tag: @PRE<br>[loadHistory] Missing Mandatory Tag: @PRE |
|
||||||
|
| backend/src/core/utils/network.py | 🟡 93% | [SupersetAPIError.__init__] Missing Mandatory Tag: @PRE<br>[SupersetAPIError.__init__] Missing Mandatory Tag: @POST<br>[SupersetAPIError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[SupersetAPIError.__init__] Missing Mandatory Tag: @PRE<br>[SupersetAPIError.__init__] Missing Mandatory Tag: @POST<br>[SupersetAPIError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[SupersetAPIError.__init__] Missing Mandatory Tag: @PRE<br>[SupersetAPIError.__init__] Missing Mandatory Tag: @POST<br>[SupersetAPIError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[AuthenticationError.__init__] Missing Mandatory Tag: @PRE<br>[AuthenticationError.__init__] Missing Mandatory Tag: @POST<br>[AuthenticationError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[AuthenticationError.__init__] Missing Mandatory Tag: @PRE<br>[AuthenticationError.__init__] Missing Mandatory Tag: @POST<br>[AuthenticationError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[AuthenticationError.__init__] Missing Mandatory Tag: @PRE<br>[AuthenticationError.__init__] Missing Mandatory Tag: @POST<br>[AuthenticationError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[PermissionDeniedError.__init__] Missing Mandatory Tag: @PRE<br>[PermissionDeniedError.__init__] Missing Mandatory Tag: @POST<br>[PermissionDeniedError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[PermissionDeniedError.__init__] Missing Mandatory Tag: @PRE<br>[PermissionDeniedError.__init__] Missing Mandatory Tag: @POST<br>[PermissionDeniedError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[PermissionDeniedError.__init__] Missing Mandatory Tag: @PRE<br>[PermissionDeniedError.__init__] Missing Mandatory Tag: @POST<br>[PermissionDeniedError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[DashboardNotFoundError.__init__] Missing Mandatory Tag: @PRE<br>[DashboardNotFoundError.__init__] Missing Mandatory Tag: @POST<br>[DashboardNotFoundError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[DashboardNotFoundError.__init__] Missing Mandatory Tag: @PRE<br>[DashboardNotFoundError.__init__] Missing Mandatory Tag: @POST<br>[DashboardNotFoundError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[DashboardNotFoundError.__init__] Missing Mandatory Tag: @PRE<br>[DashboardNotFoundError.__init__] Missing Mandatory Tag: @POST<br>[DashboardNotFoundError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[NetworkError.__init__] Missing Mandatory Tag: @PRE<br>[NetworkError.__init__] Missing Mandatory Tag: @POST<br>[NetworkError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[NetworkError.__init__] Missing Mandatory Tag: @PRE<br>[NetworkError.__init__] Missing Mandatory Tag: @POST<br>[NetworkError.__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[NetworkError.__init__] Missing Mandatory Tag: @PRE<br>[NetworkError.__init__] Missing Mandatory Tag: @POST<br>[NetworkError.__init__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/logger.py | 🟡 93% | [format] Missing Belief State Logging: Function should use belief_scope context manager.<br>[format] Missing Belief State Logging: Function should use belief_scope context manager.<br>[format] Missing Belief State Logging: Function should use belief_scope context manager.<br>[belief_scope] Missing Belief State Logging: Function should use belief_scope context manager.<br>[belief_scope] Missing Belief State Logging: Function should use belief_scope context manager.<br>[configure_logger] Missing Belief State Logging: Function should use belief_scope context manager.<br>[configure_logger] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[emit] Missing Belief State Logging: Function should use belief_scope context manager.<br>[emit] Missing Belief State Logging: Function should use belief_scope context manager.<br>[emit] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_recent_logs] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_recent_logs] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_recent_logs] Missing Belief State Logging: Function should use belief_scope context manager.<br>[believed] Missing Mandatory Tag: @PRE<br>[believed] Missing Mandatory Tag: @POST<br>[believed] Missing Belief State Logging: Function should use belief_scope context manager.<br>[believed] Missing Mandatory Tag: @PRE<br>[believed] Missing Mandatory Tag: @POST<br>[believed] Missing Belief State Logging: Function should use belief_scope context manager.<br>[believed] Missing Mandatory Tag: @PRE<br>[believed] Missing Mandatory Tag: @POST<br>[believed] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/git/CommitModal.svelte | 🟡 94% | [loadStatus] Missing Mandatory Tag: @POST<br>[loadStatus] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/DashboardGrid.svelte | 🟡 94% | [openGit] Missing Mandatory Tag: @PRE<br>[openGit] Missing Mandatory Tag: @POST<br>[openGit] Missing Mandatory Tag: @PRE<br>[openGit] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/git/DeploymentModal.svelte | 🟡 96% | [loadEnvironments] Missing Mandatory Tag: @PRE<br>[loadEnvironments] Missing Mandatory Tag: @PRE |
|
||||||
|
| backend/src/core/utils/dataset_mapper.py | 🟡 97% | [__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| generate_semantic_map.py | 🟢 100% | [__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__enter__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__enter__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__exit__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__exit__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| frontend/src/components/TaskHistory.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/MappingTable.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/EnvSelector.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/TaskList.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/DynamicForm.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/Footer.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/Navbar.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/TaskRunner.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/TaskLogViewer.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/PasswordPrompt.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/MissingMappingModal.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/Toast.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/git/ConflictResolver.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/DebugTool.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/ConnectionForm.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/MapperTool.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/SearchTool.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/ConnectionList.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/pages/Settings.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/pages/Dashboard.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/gitService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/connectionService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/taskService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/toolsService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/lib/stores.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/lib/toasts.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/lib/api.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/+page.ts | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tasks/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/settings/+page.ts | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/settings/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/settings/connections/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tools/mapper/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tools/debug/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tools/search/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/migration/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/migration/mappings/+page.svelte | 🟢 100% | OK |
|
||||||
|
| backend/delete_running_tasks.py | 🟢 100% | [delete_running_tasks] Missing Belief State Logging: Function should use belief_scope context manager.<br>[delete_running_tasks] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/dependencies.py | 🟢 100% | OK |
|
||||||
|
| backend/src/app.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/mapping.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/dashboard.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/task.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/connection.py | 🟢 100% | OK |
|
||||||
|
| backend/src/services/mapping_service.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/config_manager.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/superset_client.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/migration_engine.py | 🟢 100% | [_transform_yaml] Missing Belief State Logging: Function should use belief_scope context manager.<br>[_transform_yaml] Missing Belief State Logging: Function should use belief_scope context manager.<br>[_transform_yaml] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/database.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/config_models.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/scheduler.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/plugin_loader.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/plugin_base.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/utils/matching.py | 🟢 100% | [suggest_mappings] Missing Belief State Logging: Function should use belief_scope context manager.<br>[suggest_mappings] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/utils/fileio.py | 🟢 100% | [replacer] Missing Belief State Logging: Function should use belief_scope context manager.<br>[replacer] Missing Belief State Logging: Function should use belief_scope context manager.<br>[replacer] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/task_manager/manager.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/task_manager/__init__.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/task_manager/cleanup.py | 🟢 100% | [__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/task_manager/models.py | 🟢 100% | [__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/task_manager/persistence.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/search.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/backup.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/debug.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/migration.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/mapper.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/auth.py | 🟢 100% | [get_current_user] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_current_user] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/api/routes/settings.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/connections.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/tasks.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/environments.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/plugins.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/migration.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/mappings.py | 🟢 100% | OK |
|
||||||
|
| backend/tests/test_models.py | 🟢 100% | OK |
|
||||||
|
| backend/tests/test_logger.py | 🟢 100% | OK |
|
||||||
102
semantics/reports/semantic_report_20260123_215313.md
Normal file
102
semantics/reports/semantic_report_20260123_215313.md
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
# Semantic Compliance Report
|
||||||
|
|
||||||
|
**Generated At:** 2026-01-23T21:53:13.473176
|
||||||
|
**Global Compliance Score:** 98.0%
|
||||||
|
**Scanned Files:** 93
|
||||||
|
|
||||||
|
## File Compliance Status
|
||||||
|
| File | Score | Issues |
|
||||||
|
|------|-------|--------|
|
||||||
|
| frontend/src/components/git/GitManager.svelte | 🟡 67% | [checkStatus] Missing Mandatory Tag: @PRE<br>[checkStatus] Missing Mandatory Tag: @POST<br>[checkStatus] Missing Mandatory Tag: @PRE<br>[checkStatus] Missing Mandatory Tag: @POST<br>[handleInit] Missing Mandatory Tag: @PRE<br>[handleInit] Missing Mandatory Tag: @POST<br>[handleInit] Missing Mandatory Tag: @PRE<br>[handleInit] Missing Mandatory Tag: @POST<br>[handleSync] Missing Mandatory Tag: @PRE<br>[handleSync] Missing Mandatory Tag: @POST<br>[handleSync] Missing Mandatory Tag: @PRE<br>[handleSync] Missing Mandatory Tag: @POST<br>[handlePush] Missing Mandatory Tag: @PURPOSE<br>[handlePush] Missing Mandatory Tag: @PRE<br>[handlePush] Missing Mandatory Tag: @POST<br>[handlePush] Missing Mandatory Tag: @PURPOSE<br>[handlePush] Missing Mandatory Tag: @PRE<br>[handlePush] Missing Mandatory Tag: @POST<br>[handlePull] Missing Mandatory Tag: @PURPOSE<br>[handlePull] Missing Mandatory Tag: @PRE<br>[handlePull] Missing Mandatory Tag: @POST<br>[handlePull] Missing Mandatory Tag: @PURPOSE<br>[handlePull] Missing Mandatory Tag: @PRE<br>[handlePull] Missing Mandatory Tag: @POST |
|
||||||
|
| backend/src/services/git_service.py | 🟡 72% | [__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Mandatory Tag: @POST<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Mandatory Tag: @POST<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Mandatory Tag: @POST<br>[_get_repo_path] Missing Mandatory Tag: @PRE<br>[_get_repo_path] Missing Mandatory Tag: @POST<br>[_get_repo_path] Missing Belief State Logging: Function should use belief_scope context manager.<br>[_get_repo_path] Missing Mandatory Tag: @PRE<br>[_get_repo_path] Missing Mandatory Tag: @POST<br>[_get_repo_path] Missing Belief State Logging: Function should use belief_scope context manager.<br>[_get_repo_path] Missing Mandatory Tag: @PRE<br>[_get_repo_path] Missing Mandatory Tag: @POST<br>[_get_repo_path] Missing Belief State Logging: Function should use belief_scope context manager.<br>[init_repo] Missing Mandatory Tag: @PRE<br>[init_repo] Missing Mandatory Tag: @POST<br>[init_repo] Missing Mandatory Tag: @PRE<br>[init_repo] Missing Mandatory Tag: @POST<br>[init_repo] Missing Mandatory Tag: @PRE<br>[init_repo] Missing Mandatory Tag: @POST<br>[get_repo] Missing Mandatory Tag: @POST<br>[get_repo] Missing Mandatory Tag: @POST<br>[get_repo] Missing Mandatory Tag: @POST<br>[list_branches] Missing Mandatory Tag: @PRE<br>[list_branches] Missing Mandatory Tag: @POST<br>[list_branches] Missing Mandatory Tag: @PRE<br>[list_branches] Missing Mandatory Tag: @POST<br>[list_branches] Missing Mandatory Tag: @PRE<br>[list_branches] Missing Mandatory Tag: @POST<br>[create_branch] Missing Mandatory Tag: @PRE<br>[create_branch] Missing Mandatory Tag: @POST<br>[create_branch] Missing Mandatory Tag: @PRE<br>[create_branch] Missing Mandatory Tag: @POST<br>[create_branch] Missing Mandatory Tag: @PRE<br>[create_branch] Missing Mandatory Tag: @POST<br>[checkout_branch] Missing Mandatory Tag: @PRE<br>[checkout_branch] Missing Mandatory Tag: @POST<br>[checkout_branch] Missing Mandatory Tag: @PRE<br>[checkout_branch] Missing Mandatory Tag: @POST<br>[checkout_branch] Missing Mandatory Tag: @PRE<br>[checkout_branch] Missing Mandatory Tag: @POST<br>[commit_changes] Missing Mandatory Tag: @PRE<br>[commit_changes] Missing Mandatory Tag: @POST<br>[commit_changes] Missing Mandatory Tag: @PRE<br>[commit_changes] Missing Mandatory Tag: @POST<br>[commit_changes] Missing Mandatory Tag: @PRE<br>[commit_changes] Missing Mandatory Tag: @POST<br>[push_changes] Missing Mandatory Tag: @PRE<br>[push_changes] Missing Mandatory Tag: @POST<br>[push_changes] Missing Mandatory Tag: @PRE<br>[push_changes] Missing Mandatory Tag: @POST<br>[push_changes] Missing Mandatory Tag: @PRE<br>[push_changes] Missing Mandatory Tag: @POST<br>[pull_changes] Missing Mandatory Tag: @PRE<br>[pull_changes] Missing Mandatory Tag: @POST<br>[pull_changes] Missing Mandatory Tag: @PRE<br>[pull_changes] Missing Mandatory Tag: @POST<br>[pull_changes] Missing Mandatory Tag: @PRE<br>[pull_changes] Missing Mandatory Tag: @POST<br>[get_status] Missing Mandatory Tag: @PRE<br>[get_status] Missing Mandatory Tag: @POST<br>[get_status] Missing Mandatory Tag: @PRE<br>[get_status] Missing Mandatory Tag: @POST<br>[get_status] Missing Mandatory Tag: @PRE<br>[get_status] Missing Mandatory Tag: @POST<br>[get_diff] Missing Mandatory Tag: @PRE<br>[get_diff] Missing Mandatory Tag: @POST<br>[get_diff] Missing Mandatory Tag: @PRE<br>[get_diff] Missing Mandatory Tag: @POST<br>[get_diff] Missing Mandatory Tag: @PRE<br>[get_diff] Missing Mandatory Tag: @POST<br>[get_commit_history] Missing Mandatory Tag: @PRE<br>[get_commit_history] Missing Mandatory Tag: @POST<br>[get_commit_history] Missing Mandatory Tag: @PRE<br>[get_commit_history] Missing Mandatory Tag: @POST<br>[get_commit_history] Missing Mandatory Tag: @PRE<br>[get_commit_history] Missing Mandatory Tag: @POST<br>[test_connection] Missing Mandatory Tag: @PRE<br>[test_connection] Missing Mandatory Tag: @POST<br>[test_connection] Missing Mandatory Tag: @PRE<br>[test_connection] Missing Mandatory Tag: @POST<br>[test_connection] Missing Mandatory Tag: @PRE<br>[test_connection] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/routes/settings/git/+page.svelte | 🟡 73% | [loadConfigs] Missing Mandatory Tag: @PRE<br>[loadConfigs] Missing Mandatory Tag: @POST<br>[loadConfigs] Missing Mandatory Tag: @PRE<br>[loadConfigs] Missing Mandatory Tag: @POST<br>[handleTest] Missing Mandatory Tag: @PRE<br>[handleTest] Missing Mandatory Tag: @POST<br>[handleTest] Missing Mandatory Tag: @PRE<br>[handleTest] Missing Mandatory Tag: @POST<br>[handleSave] Missing Mandatory Tag: @PRE<br>[handleSave] Missing Mandatory Tag: @POST<br>[handleSave] Missing Mandatory Tag: @PRE<br>[handleSave] Missing Mandatory Tag: @POST<br>[handleDelete] Missing Mandatory Tag: @PRE<br>[handleDelete] Missing Mandatory Tag: @POST<br>[handleDelete] Missing Mandatory Tag: @PRE<br>[handleDelete] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/git/BranchSelector.svelte | 🟡 75% | [onMount] Missing Mandatory Tag: @PURPOSE<br>[onMount] Missing Mandatory Tag: @PRE<br>[onMount] Missing Mandatory Tag: @POST<br>[onMount] Missing Mandatory Tag: @PURPOSE<br>[onMount] Missing Mandatory Tag: @PRE<br>[onMount] Missing Mandatory Tag: @POST<br>[loadBranches] Missing Mandatory Tag: @PRE<br>[loadBranches] Missing Mandatory Tag: @PRE<br>[handleSelect] Missing Mandatory Tag: @PURPOSE<br>[handleSelect] Missing Mandatory Tag: @PRE<br>[handleSelect] Missing Mandatory Tag: @POST<br>[handleSelect] Missing Mandatory Tag: @PURPOSE<br>[handleSelect] Missing Mandatory Tag: @PRE<br>[handleSelect] Missing Mandatory Tag: @POST<br>[handleCheckout] Missing Mandatory Tag: @PRE<br>[handleCheckout] Missing Mandatory Tag: @PRE<br>[handleCreate] Missing Mandatory Tag: @PRE<br>[handleCreate] Missing Mandatory Tag: @PRE |
|
||||||
|
| backend/src/plugins/git_plugin.py | 🟡 82% | [__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Mandatory Tag: @PRE<br>[id] Missing Mandatory Tag: @PRE<br>[id] Missing Mandatory Tag: @POST<br>[id] Missing Belief State Logging: Function should use belief_scope context manager.<br>[id] Missing Mandatory Tag: @PRE<br>[id] Missing Mandatory Tag: @POST<br>[id] Missing Belief State Logging: Function should use belief_scope context manager.<br>[id] Missing Mandatory Tag: @PRE<br>[id] Missing Mandatory Tag: @POST<br>[id] Missing Belief State Logging: Function should use belief_scope context manager.<br>[name] Missing Mandatory Tag: @PRE<br>[name] Missing Mandatory Tag: @POST<br>[name] Missing Belief State Logging: Function should use belief_scope context manager.<br>[name] Missing Mandatory Tag: @PRE<br>[name] Missing Mandatory Tag: @POST<br>[name] Missing Belief State Logging: Function should use belief_scope context manager.<br>[name] Missing Mandatory Tag: @PRE<br>[name] Missing Mandatory Tag: @POST<br>[name] Missing Belief State Logging: Function should use belief_scope context manager.<br>[description] Missing Mandatory Tag: @PRE<br>[description] Missing Mandatory Tag: @POST<br>[description] Missing Belief State Logging: Function should use belief_scope context manager.<br>[description] Missing Mandatory Tag: @PRE<br>[description] Missing Mandatory Tag: @POST<br>[description] Missing Belief State Logging: Function should use belief_scope context manager.<br>[description] Missing Mandatory Tag: @PRE<br>[description] Missing Mandatory Tag: @POST<br>[description] Missing Belief State Logging: Function should use belief_scope context manager.<br>[version] Missing Mandatory Tag: @PRE<br>[version] Missing Mandatory Tag: @POST<br>[version] Missing Belief State Logging: Function should use belief_scope context manager.<br>[version] Missing Mandatory Tag: @PRE<br>[version] Missing Mandatory Tag: @POST<br>[version] Missing Belief State Logging: Function should use belief_scope context manager.<br>[version] Missing Mandatory Tag: @PRE<br>[version] Missing Mandatory Tag: @POST<br>[version] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_schema] Missing Mandatory Tag: @PRE<br>[get_schema] Missing Mandatory Tag: @POST<br>[get_schema] Missing Mandatory Tag: @PRE<br>[get_schema] Missing Mandatory Tag: @POST<br>[get_schema] Missing Mandatory Tag: @PRE<br>[get_schema] Missing Mandatory Tag: @POST<br>[initialize] Missing Mandatory Tag: @PRE<br>[initialize] Missing Mandatory Tag: @PRE<br>[initialize] Missing Mandatory Tag: @PRE<br>[_get_env] Missing Mandatory Tag: @PRE<br>[_get_env] Missing Mandatory Tag: @POST<br>[_get_env] Missing Mandatory Tag: @PRE<br>[_get_env] Missing Mandatory Tag: @POST<br>[_get_env] Missing Mandatory Tag: @PRE<br>[_get_env] Missing Mandatory Tag: @POST<br>[_get_env] Missing Mandatory Tag: @PRE<br>[_get_env] Missing Mandatory Tag: @POST |
|
||||||
|
| backend/src/models/git.py | 🟡 83% | [GitModels] Missing Mandatory Tag: @SEMANTICS |
|
||||||
|
| frontend/src/components/git/CommitHistory.svelte | 🟡 83% | [onMount] Missing Mandatory Tag: @PRE<br>[onMount] Missing Mandatory Tag: @POST<br>[onMount] Missing Mandatory Tag: @PRE<br>[onMount] Missing Mandatory Tag: @POST<br>[loadHistory] Missing Mandatory Tag: @PRE<br>[loadHistory] Missing Mandatory Tag: @PRE |
|
||||||
|
| backend/src/core/logger.py | 🟡 93% | [format] Missing Belief State Logging: Function should use belief_scope context manager.<br>[format] Missing Belief State Logging: Function should use belief_scope context manager.<br>[format] Missing Belief State Logging: Function should use belief_scope context manager.<br>[belief_scope] Missing Belief State Logging: Function should use belief_scope context manager.<br>[belief_scope] Missing Belief State Logging: Function should use belief_scope context manager.<br>[configure_logger] Missing Belief State Logging: Function should use belief_scope context manager.<br>[configure_logger] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[emit] Missing Belief State Logging: Function should use belief_scope context manager.<br>[emit] Missing Belief State Logging: Function should use belief_scope context manager.<br>[emit] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_recent_logs] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_recent_logs] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_recent_logs] Missing Belief State Logging: Function should use belief_scope context manager.<br>[believed] Missing Mandatory Tag: @PRE<br>[believed] Missing Mandatory Tag: @POST<br>[believed] Missing Belief State Logging: Function should use belief_scope context manager.<br>[believed] Missing Mandatory Tag: @PRE<br>[believed] Missing Mandatory Tag: @POST<br>[believed] Missing Belief State Logging: Function should use belief_scope context manager.<br>[believed] Missing Mandatory Tag: @PRE<br>[believed] Missing Mandatory Tag: @POST<br>[believed] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/git/CommitModal.svelte | 🟡 94% | [loadStatus] Missing Mandatory Tag: @POST<br>[loadStatus] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/DashboardGrid.svelte | 🟡 94% | [openGit] Missing Mandatory Tag: @PRE<br>[openGit] Missing Mandatory Tag: @POST<br>[openGit] Missing Mandatory Tag: @PRE<br>[openGit] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/git/DeploymentModal.svelte | 🟡 96% | [loadEnvironments] Missing Mandatory Tag: @PRE<br>[loadEnvironments] Missing Mandatory Tag: @PRE |
|
||||||
|
| backend/src/core/utils/dataset_mapper.py | 🟡 97% | [__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| generate_semantic_map.py | 🟢 100% | [__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__enter__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__enter__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__exit__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__exit__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| frontend/src/components/TaskHistory.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/MappingTable.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/EnvSelector.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/TaskList.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/DynamicForm.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/Footer.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/Navbar.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/TaskRunner.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/TaskLogViewer.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/PasswordPrompt.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/MissingMappingModal.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/Toast.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/git/ConflictResolver.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/DebugTool.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/ConnectionForm.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/MapperTool.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/SearchTool.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/ConnectionList.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/pages/Settings.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/pages/Dashboard.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/gitService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/connectionService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/taskService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/toolsService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/lib/stores.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/lib/toasts.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/lib/api.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/+page.ts | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tasks/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/git/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/settings/+page.ts | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/settings/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/settings/connections/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tools/mapper/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tools/debug/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tools/search/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/migration/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/migration/mappings/+page.svelte | 🟢 100% | OK |
|
||||||
|
| backend/delete_running_tasks.py | 🟢 100% | [delete_running_tasks] Missing Belief State Logging: Function should use belief_scope context manager.<br>[delete_running_tasks] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/dependencies.py | 🟢 100% | OK |
|
||||||
|
| backend/src/app.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/mapping.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/dashboard.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/task.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/connection.py | 🟢 100% | OK |
|
||||||
|
| backend/src/services/mapping_service.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/config_manager.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/superset_client.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/migration_engine.py | 🟢 100% | [_transform_yaml] Missing Belief State Logging: Function should use belief_scope context manager.<br>[_transform_yaml] Missing Belief State Logging: Function should use belief_scope context manager.<br>[_transform_yaml] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/database.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/config_models.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/scheduler.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/plugin_loader.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/plugin_base.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/utils/matching.py | 🟢 100% | [suggest_mappings] Missing Belief State Logging: Function should use belief_scope context manager.<br>[suggest_mappings] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/utils/network.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/utils/fileio.py | 🟢 100% | [replacer] Missing Belief State Logging: Function should use belief_scope context manager.<br>[replacer] Missing Belief State Logging: Function should use belief_scope context manager.<br>[replacer] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/task_manager/manager.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/task_manager/__init__.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/task_manager/cleanup.py | 🟢 100% | [__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/task_manager/models.py | 🟢 100% | [__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/task_manager/persistence.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/search.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/backup.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/debug.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/migration.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/mapper.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/auth.py | 🟢 100% | [get_current_user] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_current_user] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/api/routes/git_schemas.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/settings.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/connections.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/tasks.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/git.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/environments.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/plugins.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/migration.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/mappings.py | 🟢 100% | OK |
|
||||||
|
| backend/tests/test_models.py | 🟢 100% | OK |
|
||||||
|
| backend/tests/test_logger.py | 🟢 100% | OK |
|
||||||
102
semantics/reports/semantic_report_20260123_215507.md
Normal file
102
semantics/reports/semantic_report_20260123_215507.md
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
# Semantic Compliance Report
|
||||||
|
|
||||||
|
**Generated At:** 2026-01-23T21:55:07.969831
|
||||||
|
**Global Compliance Score:** 98.6%
|
||||||
|
**Scanned Files:** 93
|
||||||
|
|
||||||
|
## File Compliance Status
|
||||||
|
| File | Score | Issues |
|
||||||
|
|------|-------|--------|
|
||||||
|
| frontend/src/components/git/GitManager.svelte | 🟡 67% | [checkStatus] Missing Mandatory Tag: @PRE<br>[checkStatus] Missing Mandatory Tag: @POST<br>[checkStatus] Missing Mandatory Tag: @PRE<br>[checkStatus] Missing Mandatory Tag: @POST<br>[handleInit] Missing Mandatory Tag: @PRE<br>[handleInit] Missing Mandatory Tag: @POST<br>[handleInit] Missing Mandatory Tag: @PRE<br>[handleInit] Missing Mandatory Tag: @POST<br>[handleSync] Missing Mandatory Tag: @PRE<br>[handleSync] Missing Mandatory Tag: @POST<br>[handleSync] Missing Mandatory Tag: @PRE<br>[handleSync] Missing Mandatory Tag: @POST<br>[handlePush] Missing Mandatory Tag: @PURPOSE<br>[handlePush] Missing Mandatory Tag: @PRE<br>[handlePush] Missing Mandatory Tag: @POST<br>[handlePush] Missing Mandatory Tag: @PURPOSE<br>[handlePush] Missing Mandatory Tag: @PRE<br>[handlePush] Missing Mandatory Tag: @POST<br>[handlePull] Missing Mandatory Tag: @PURPOSE<br>[handlePull] Missing Mandatory Tag: @PRE<br>[handlePull] Missing Mandatory Tag: @POST<br>[handlePull] Missing Mandatory Tag: @PURPOSE<br>[handlePull] Missing Mandatory Tag: @PRE<br>[handlePull] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/routes/settings/git/+page.svelte | 🟡 73% | [loadConfigs] Missing Mandatory Tag: @PRE<br>[loadConfigs] Missing Mandatory Tag: @POST<br>[loadConfigs] Missing Mandatory Tag: @PRE<br>[loadConfigs] Missing Mandatory Tag: @POST<br>[handleTest] Missing Mandatory Tag: @PRE<br>[handleTest] Missing Mandatory Tag: @POST<br>[handleTest] Missing Mandatory Tag: @PRE<br>[handleTest] Missing Mandatory Tag: @POST<br>[handleSave] Missing Mandatory Tag: @PRE<br>[handleSave] Missing Mandatory Tag: @POST<br>[handleSave] Missing Mandatory Tag: @PRE<br>[handleSave] Missing Mandatory Tag: @POST<br>[handleDelete] Missing Mandatory Tag: @PRE<br>[handleDelete] Missing Mandatory Tag: @POST<br>[handleDelete] Missing Mandatory Tag: @PRE<br>[handleDelete] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/git/BranchSelector.svelte | 🟡 75% | [onMount] Missing Mandatory Tag: @PURPOSE<br>[onMount] Missing Mandatory Tag: @PRE<br>[onMount] Missing Mandatory Tag: @POST<br>[onMount] Missing Mandatory Tag: @PURPOSE<br>[onMount] Missing Mandatory Tag: @PRE<br>[onMount] Missing Mandatory Tag: @POST<br>[loadBranches] Missing Mandatory Tag: @PRE<br>[loadBranches] Missing Mandatory Tag: @PRE<br>[handleSelect] Missing Mandatory Tag: @PURPOSE<br>[handleSelect] Missing Mandatory Tag: @PRE<br>[handleSelect] Missing Mandatory Tag: @POST<br>[handleSelect] Missing Mandatory Tag: @PURPOSE<br>[handleSelect] Missing Mandatory Tag: @PRE<br>[handleSelect] Missing Mandatory Tag: @POST<br>[handleCheckout] Missing Mandatory Tag: @PRE<br>[handleCheckout] Missing Mandatory Tag: @PRE<br>[handleCreate] Missing Mandatory Tag: @PRE<br>[handleCreate] Missing Mandatory Tag: @PRE |
|
||||||
|
| frontend/src/components/git/CommitHistory.svelte | 🟡 83% | [onMount] Missing Mandatory Tag: @PRE<br>[onMount] Missing Mandatory Tag: @POST<br>[onMount] Missing Mandatory Tag: @PRE<br>[onMount] Missing Mandatory Tag: @POST<br>[loadHistory] Missing Mandatory Tag: @PRE<br>[loadHistory] Missing Mandatory Tag: @PRE |
|
||||||
|
| backend/src/core/logger.py | 🟡 93% | [format] Missing Belief State Logging: Function should use belief_scope context manager.<br>[format] Missing Belief State Logging: Function should use belief_scope context manager.<br>[format] Missing Belief State Logging: Function should use belief_scope context manager.<br>[belief_scope] Missing Belief State Logging: Function should use belief_scope context manager.<br>[belief_scope] Missing Belief State Logging: Function should use belief_scope context manager.<br>[configure_logger] Missing Belief State Logging: Function should use belief_scope context manager.<br>[configure_logger] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[emit] Missing Belief State Logging: Function should use belief_scope context manager.<br>[emit] Missing Belief State Logging: Function should use belief_scope context manager.<br>[emit] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_recent_logs] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_recent_logs] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_recent_logs] Missing Belief State Logging: Function should use belief_scope context manager.<br>[believed] Missing Mandatory Tag: @PRE<br>[believed] Missing Mandatory Tag: @POST<br>[believed] Missing Belief State Logging: Function should use belief_scope context manager.<br>[believed] Missing Mandatory Tag: @PRE<br>[believed] Missing Mandatory Tag: @POST<br>[believed] Missing Belief State Logging: Function should use belief_scope context manager.<br>[believed] Missing Mandatory Tag: @PRE<br>[believed] Missing Mandatory Tag: @POST<br>[believed] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/git/CommitModal.svelte | 🟡 94% | [loadStatus] Missing Mandatory Tag: @POST<br>[loadStatus] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/DashboardGrid.svelte | 🟡 94% | [openGit] Missing Mandatory Tag: @PRE<br>[openGit] Missing Mandatory Tag: @POST<br>[openGit] Missing Mandatory Tag: @PRE<br>[openGit] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/git/DeploymentModal.svelte | 🟡 96% | [loadEnvironments] Missing Mandatory Tag: @PRE<br>[loadEnvironments] Missing Mandatory Tag: @PRE |
|
||||||
|
| backend/src/core/utils/dataset_mapper.py | 🟡 97% | [__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| generate_semantic_map.py | 🟢 100% | [__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__enter__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__enter__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__exit__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__exit__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| frontend/src/components/TaskHistory.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/MappingTable.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/EnvSelector.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/TaskList.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/DynamicForm.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/Footer.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/Navbar.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/TaskRunner.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/TaskLogViewer.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/PasswordPrompt.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/MissingMappingModal.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/Toast.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/git/ConflictResolver.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/DebugTool.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/ConnectionForm.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/MapperTool.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/SearchTool.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/ConnectionList.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/pages/Settings.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/pages/Dashboard.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/gitService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/connectionService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/taskService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/toolsService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/lib/stores.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/lib/toasts.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/lib/api.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/+page.ts | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tasks/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/git/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/settings/+page.ts | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/settings/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/settings/connections/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tools/mapper/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tools/debug/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tools/search/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/migration/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/migration/mappings/+page.svelte | 🟢 100% | OK |
|
||||||
|
| backend/delete_running_tasks.py | 🟢 100% | [delete_running_tasks] Missing Belief State Logging: Function should use belief_scope context manager.<br>[delete_running_tasks] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/dependencies.py | 🟢 100% | OK |
|
||||||
|
| backend/src/app.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/mapping.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/git.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/dashboard.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/task.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/connection.py | 🟢 100% | OK |
|
||||||
|
| backend/src/services/mapping_service.py | 🟢 100% | OK |
|
||||||
|
| backend/src/services/git_service.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/config_manager.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/superset_client.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/migration_engine.py | 🟢 100% | [_transform_yaml] Missing Belief State Logging: Function should use belief_scope context manager.<br>[_transform_yaml] Missing Belief State Logging: Function should use belief_scope context manager.<br>[_transform_yaml] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/database.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/config_models.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/scheduler.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/plugin_loader.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/plugin_base.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/utils/matching.py | 🟢 100% | [suggest_mappings] Missing Belief State Logging: Function should use belief_scope context manager.<br>[suggest_mappings] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/utils/network.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/utils/fileio.py | 🟢 100% | [replacer] Missing Belief State Logging: Function should use belief_scope context manager.<br>[replacer] Missing Belief State Logging: Function should use belief_scope context manager.<br>[replacer] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/task_manager/manager.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/task_manager/__init__.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/task_manager/cleanup.py | 🟢 100% | [__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/task_manager/models.py | 🟢 100% | [__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/task_manager/persistence.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/search.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/backup.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/debug.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/migration.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/git_plugin.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/mapper.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/auth.py | 🟢 100% | [get_current_user] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_current_user] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/api/routes/git_schemas.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/settings.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/connections.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/tasks.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/git.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/environments.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/plugins.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/migration.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/mappings.py | 🟢 100% | OK |
|
||||||
|
| backend/tests/test_models.py | 🟢 100% | OK |
|
||||||
|
| backend/tests/test_logger.py | 🟢 100% | OK |
|
||||||
102
semantics/reports/semantic_report_20260123_215737.md
Normal file
102
semantics/reports/semantic_report_20260123_215737.md
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
# Semantic Compliance Report
|
||||||
|
|
||||||
|
**Generated At:** 2026-01-23T21:57:37.610032
|
||||||
|
**Global Compliance Score:** 99.7%
|
||||||
|
**Scanned Files:** 93
|
||||||
|
|
||||||
|
## File Compliance Status
|
||||||
|
| File | Score | Issues |
|
||||||
|
|------|-------|--------|
|
||||||
|
| backend/src/core/logger.py | 🟡 93% | [format] Missing Belief State Logging: Function should use belief_scope context manager.<br>[format] Missing Belief State Logging: Function should use belief_scope context manager.<br>[format] Missing Belief State Logging: Function should use belief_scope context manager.<br>[belief_scope] Missing Belief State Logging: Function should use belief_scope context manager.<br>[belief_scope] Missing Belief State Logging: Function should use belief_scope context manager.<br>[configure_logger] Missing Belief State Logging: Function should use belief_scope context manager.<br>[configure_logger] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[emit] Missing Belief State Logging: Function should use belief_scope context manager.<br>[emit] Missing Belief State Logging: Function should use belief_scope context manager.<br>[emit] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_recent_logs] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_recent_logs] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_recent_logs] Missing Belief State Logging: Function should use belief_scope context manager.<br>[believed] Missing Mandatory Tag: @PRE<br>[believed] Missing Mandatory Tag: @POST<br>[believed] Missing Belief State Logging: Function should use belief_scope context manager.<br>[believed] Missing Mandatory Tag: @PRE<br>[believed] Missing Mandatory Tag: @POST<br>[believed] Missing Belief State Logging: Function should use belief_scope context manager.<br>[believed] Missing Mandatory Tag: @PRE<br>[believed] Missing Mandatory Tag: @POST<br>[believed] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[decorator] Missing Mandatory Tag: @PRE<br>[decorator] Missing Mandatory Tag: @POST<br>[decorator] Missing Belief State Logging: Function should use belief_scope context manager.<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST<br>[wrapper] Missing Mandatory Tag: @PRE<br>[wrapper] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/git/CommitModal.svelte | 🟡 94% | [loadStatus] Missing Mandatory Tag: @POST<br>[loadStatus] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/DashboardGrid.svelte | 🟡 94% | [openGit] Missing Mandatory Tag: @PRE<br>[openGit] Missing Mandatory Tag: @POST<br>[openGit] Missing Mandatory Tag: @PRE<br>[openGit] Missing Mandatory Tag: @POST |
|
||||||
|
| frontend/src/components/git/DeploymentModal.svelte | 🟡 96% | [loadEnvironments] Missing Mandatory Tag: @PRE<br>[loadEnvironments] Missing Mandatory Tag: @PRE |
|
||||||
|
| frontend/src/components/git/BranchSelector.svelte | 🟡 97% | [handleCheckout] Missing Mandatory Tag: @PRE<br>[handleCheckout] Missing Mandatory Tag: @PRE |
|
||||||
|
| backend/src/core/utils/dataset_mapper.py | 🟡 97% | [__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Mandatory Tag: @PRE<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| generate_semantic_map.py | 🟢 100% | [__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__enter__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__enter__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__exit__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__exit__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| frontend/src/components/TaskHistory.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/MappingTable.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/EnvSelector.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/TaskList.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/DynamicForm.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/Footer.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/Navbar.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/TaskRunner.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/TaskLogViewer.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/PasswordPrompt.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/MissingMappingModal.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/Toast.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/git/GitManager.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/git/ConflictResolver.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/git/CommitHistory.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/DebugTool.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/ConnectionForm.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/MapperTool.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/SearchTool.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/components/tools/ConnectionList.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/pages/Settings.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/pages/Dashboard.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/gitService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/connectionService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/taskService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/services/toolsService.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/lib/stores.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/lib/toasts.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/lib/api.js | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/+page.ts | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tasks/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/git/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/settings/+page.ts | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/settings/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/settings/git/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/settings/connections/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tools/mapper/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tools/debug/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/tools/search/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/migration/+page.svelte | 🟢 100% | OK |
|
||||||
|
| frontend/src/routes/migration/mappings/+page.svelte | 🟢 100% | OK |
|
||||||
|
| backend/delete_running_tasks.py | 🟢 100% | [delete_running_tasks] Missing Belief State Logging: Function should use belief_scope context manager.<br>[delete_running_tasks] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/dependencies.py | 🟢 100% | OK |
|
||||||
|
| backend/src/app.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/mapping.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/git.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/dashboard.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/task.py | 🟢 100% | OK |
|
||||||
|
| backend/src/models/connection.py | 🟢 100% | OK |
|
||||||
|
| backend/src/services/mapping_service.py | 🟢 100% | OK |
|
||||||
|
| backend/src/services/git_service.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/config_manager.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/superset_client.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/migration_engine.py | 🟢 100% | [_transform_yaml] Missing Belief State Logging: Function should use belief_scope context manager.<br>[_transform_yaml] Missing Belief State Logging: Function should use belief_scope context manager.<br>[_transform_yaml] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/database.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/config_models.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/scheduler.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/plugin_loader.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/plugin_base.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/utils/matching.py | 🟢 100% | [suggest_mappings] Missing Belief State Logging: Function should use belief_scope context manager.<br>[suggest_mappings] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/utils/network.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/utils/fileio.py | 🟢 100% | [replacer] Missing Belief State Logging: Function should use belief_scope context manager.<br>[replacer] Missing Belief State Logging: Function should use belief_scope context manager.<br>[replacer] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/task_manager/manager.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/task_manager/__init__.py | 🟢 100% | OK |
|
||||||
|
| backend/src/core/task_manager/cleanup.py | 🟢 100% | [__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/task_manager/models.py | 🟢 100% | [__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager.<br>[__init__] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/core/task_manager/persistence.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/search.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/backup.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/debug.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/migration.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/git_plugin.py | 🟢 100% | OK |
|
||||||
|
| backend/src/plugins/mapper.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/auth.py | 🟢 100% | [get_current_user] Missing Belief State Logging: Function should use belief_scope context manager.<br>[get_current_user] Missing Belief State Logging: Function should use belief_scope context manager. |
|
||||||
|
| backend/src/api/routes/git_schemas.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/settings.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/connections.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/tasks.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/git.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/environments.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/plugins.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/migration.py | 🟢 100% | OK |
|
||||||
|
| backend/src/api/routes/mappings.py | 🟢 100% | OK |
|
||||||
|
| backend/tests/test_models.py | 🟢 100% | OK |
|
||||||
|
| backend/tests/test_logger.py | 🟢 100% | OK |
|
||||||
File diff suppressed because it is too large
Load Diff
42
specs/013-unify-frontend-css/checklists/requirements.md
Normal file
42
specs/013-unify-frontend-css/checklists/requirements.md
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# Checklist: Frontend UI & i18n Requirements Quality
|
||||||
|
|
||||||
|
**Purpose**: Validate the quality, clarity, and completeness of the requirements for the unified frontend CSS and localization feature.
|
||||||
|
|
||||||
|
**Meta**:
|
||||||
|
- **Feature**: 013-unify-frontend-css
|
||||||
|
- **Created**: 2026-01-23
|
||||||
|
- **Focus**: UX Consistency, Component Contracts, i18n Completeness
|
||||||
|
|
||||||
|
## Requirement Completeness
|
||||||
|
- [x] CHK001 Are all necessary UI components (Button, Input, Select, Card, PageHeader) explicitly identified for standardization? [Completeness, Spec §FR-002]
|
||||||
|
- [x] CHK002 Are the supported languages (RU, EN) and default language (RU) explicitly defined? [Completeness, Spec §FR-008, §FR-009]
|
||||||
|
- [x] CHK003 Is the persistence mechanism for language selection (LocalStorage) specified? [Completeness, Spec §FR-010]
|
||||||
|
- [x] CHK004 Are the specific pages (Dashboard, Settings) targeted for migration identified? [Completeness, Spec §FR-005]
|
||||||
|
|
||||||
|
## Requirement Clarity
|
||||||
|
- [x] CHK005 Is the "consistent spacing" requirement quantified with specific values or a system (e.g., Tailwind scale)? [Clarity, Spec §FR-004]
|
||||||
|
- [x] CHK006 Are the specific visual properties (color, padding, hover state) that must be consistent defined in the design system configuration? [Clarity, Spec §SC-001]
|
||||||
|
- [x] CHK007 Is the behavior of "legacy components" clearly defined (refactor vs. approximate)? [Clarity, Spec Edge Cases]
|
||||||
|
|
||||||
|
## Requirement Consistency
|
||||||
|
- [x] CHK008 Do the component contracts in `contracts/ui-components.md` align with the visual requirements in the spec? [Consistency]
|
||||||
|
- [x] CHK009 Is the decision to use Svelte stores for i18n consistent with the requirement for client-side persistence? [Consistency, Research §2]
|
||||||
|
|
||||||
|
## Acceptance Criteria Quality
|
||||||
|
- [x] CHK010 Can the "consistent visual experience" be objectively verified through the defined independent tests? [Measurability, Spec §User Story 1]
|
||||||
|
- [x] CHK011 Is the "0 instances of arbitrary hardcoded color values" criterion measurable via static analysis or search? [Measurability, Spec §SC-003]
|
||||||
|
- [x] CHK012 Is the language persistence requirement testable by reloading the page? [Measurability, Spec §SC-006]
|
||||||
|
|
||||||
|
## Scenario Coverage
|
||||||
|
- [x] CHK013 Are requirements defined for the scenario where a translation key is missing? [Coverage, Spec Edge Cases]
|
||||||
|
- [x] CHK014 Are requirements defined for the initial load state (default language)? [Coverage, Spec §User Story 3]
|
||||||
|
- [x] CHK015 Are requirements defined for switching languages while on a page with dynamic content? [Coverage, Gap]
|
||||||
|
|
||||||
|
## Edge Case Coverage
|
||||||
|
- [x] CHK016 Is the behavior defined for text that overflows when translated to a longer language (e.g., RU vs EN)? [Edge Case, Gap]
|
||||||
|
- [x] CHK017 Is the behavior defined if LocalStorage is disabled or inaccessible? [Edge Case, Gap]
|
||||||
|
- [x] CHK018 Are requirements defined for responsive behavior on mobile devices? [Edge Case, Spec §Edge Cases]
|
||||||
|
|
||||||
|
## Non-Functional Requirements
|
||||||
|
- [x] CHK019 Are there specific performance targets for language switching (e.g., "instant", "no layout shift")? [NFR, Research §Technical Context]
|
||||||
|
- [x] CHK020 Are accessibility requirements (ARIA labels, keyboard nav) defined for the new components? [NFR, Gap]
|
||||||
50
specs/013-unify-frontend-css/contracts/ui-components.md
Normal file
50
specs/013-unify-frontend-css/contracts/ui-components.md
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# UI Component Contracts
|
||||||
|
|
||||||
|
This document defines the strict API contracts for the standardized UI components.
|
||||||
|
|
||||||
|
## Button Component
|
||||||
|
|
||||||
|
### Description
|
||||||
|
A standard interactive button element that triggers an action.
|
||||||
|
|
||||||
|
### Props
|
||||||
|
| Prop | Type | Default | Description |
|
||||||
|
|------|------|---------|-------------|
|
||||||
|
| `variant` | `'primary' \| 'secondary' \| 'danger' \| 'ghost'` | `'primary'` | Visual style of the button. |
|
||||||
|
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Size of the button. |
|
||||||
|
| `isLoading` | `boolean` | `false` | If true, shows a spinner and disables interaction. |
|
||||||
|
| `disabled` | `boolean` | `false` | If true, prevents interaction. |
|
||||||
|
| `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | HTML button type. |
|
||||||
|
| `onclick` | `(event: MouseEvent) => void` | `undefined` | Click handler. |
|
||||||
|
| `class` | `string` | `''` | Additional CSS classes (use sparingly). |
|
||||||
|
|
||||||
|
### Slots
|
||||||
|
- `default`: The content of the button (text or icon).
|
||||||
|
|
||||||
|
## Input Component
|
||||||
|
|
||||||
|
### Description
|
||||||
|
A standard text input field with support for labels and error messages.
|
||||||
|
|
||||||
|
### Props
|
||||||
|
| Prop | Type | Default | Description |
|
||||||
|
|------|------|---------|-------------|
|
||||||
|
| `label` | `string` | `undefined` | Text label displayed above the input. |
|
||||||
|
| `value` | `string` | `''` | The current value (bindable). |
|
||||||
|
| `placeholder` | `string` | `''` | Placeholder text. |
|
||||||
|
| `error` | `string` | `undefined` | Error message displayed below the input. |
|
||||||
|
| `disabled` | `boolean` | `false` | If true, prevents interaction. |
|
||||||
|
| `type` | `'text' \| 'password' \| 'email' \| 'number'` | `'text'` | HTML input type. |
|
||||||
|
|
||||||
|
## Select Component
|
||||||
|
|
||||||
|
### Description
|
||||||
|
A standard dropdown selection component.
|
||||||
|
|
||||||
|
### Props
|
||||||
|
| Prop | Type | Default | Description |
|
||||||
|
|------|------|---------|-------------|
|
||||||
|
| `label` | `string` | `undefined` | Text label displayed above the select. |
|
||||||
|
| `value` | `string \| number` | `''` | The selected value (bindable). |
|
||||||
|
| `options` | `{ value: string \| number, label: string }[]` | `[]` | List of options to display. |
|
||||||
|
| `disabled` | `boolean` | `false` | If true, prevents interaction. |
|
||||||
59
specs/013-unify-frontend-css/data-model.md
Normal file
59
specs/013-unify-frontend-css/data-model.md
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
# Data Model: Frontend State & Components
|
||||||
|
|
||||||
|
## 1. i18n State (Client-Side)
|
||||||
|
|
||||||
|
The application state for internationalization is transient (in-memory) but initialized from and persisted to `localStorage`.
|
||||||
|
|
||||||
|
### Entities
|
||||||
|
|
||||||
|
#### `Locale`
|
||||||
|
- **Type**: String Enum
|
||||||
|
- **Values**: `"ru"`, `"en"`
|
||||||
|
- **Default**: `"ru"`
|
||||||
|
- **Persistence**: `localStorage.getItem("locale")`
|
||||||
|
|
||||||
|
#### `TranslationDictionary`
|
||||||
|
- **Type**: JSON Object
|
||||||
|
- **Structure**: Nested key-value pairs where values are strings.
|
||||||
|
- **Example**:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"common": {
|
||||||
|
"save": "Сохранить",
|
||||||
|
"cancel": "Отмена"
|
||||||
|
},
|
||||||
|
"dashboard": {
|
||||||
|
"title": "Панель управления"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2. Component Props (Contracts)
|
||||||
|
|
||||||
|
These define the "API" for the standardized UI components.
|
||||||
|
|
||||||
|
### `Button`
|
||||||
|
- **variant**: `"primary" | "secondary" | "danger" | "ghost"` (default: "primary")
|
||||||
|
- **size**: `"sm" | "md" | "lg"` (default: "md")
|
||||||
|
- **isLoading**: `boolean` (default: false)
|
||||||
|
- **disabled**: `boolean` (default: false)
|
||||||
|
- **type**: `"button" | "submit" | "reset"` (default: "button")
|
||||||
|
- **onClick**: `() => void` (optional)
|
||||||
|
|
||||||
|
### `Input`
|
||||||
|
- **label**: `string` (optional)
|
||||||
|
- **value**: `string` (two-way binding)
|
||||||
|
- **placeholder**: `string` (optional)
|
||||||
|
- **error**: `string` (optional)
|
||||||
|
- **disabled**: `boolean` (default: false)
|
||||||
|
- **type**: `"text" | "password" | "email" | "number"` (default: "text")
|
||||||
|
|
||||||
|
### `Card`
|
||||||
|
- **title**: `string` (optional)
|
||||||
|
- **padding**: `"none" | "sm" | "md" | "lg"` (default: "md")
|
||||||
|
|
||||||
|
### `Select`
|
||||||
|
- **options**: `Array<{ value: string | number, label: string }>`
|
||||||
|
- **value**: `string | number` (two-way binding)
|
||||||
|
- **label**: `string` (optional)
|
||||||
|
- **disabled**: `boolean` (default: false)
|
||||||
70
specs/013-unify-frontend-css/plan.md
Normal file
70
specs/013-unify-frontend-css/plan.md
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# Implementation Plan: [FEATURE]
|
||||||
|
|
||||||
|
**Branch**: `[###-feature-name]` | **Date**: [DATE] | **Spec**: [link]
|
||||||
|
**Input**: Feature specification from `/specs/[###-feature-name]/spec.md`
|
||||||
|
|
||||||
|
**Note**: This template is filled in by the `/speckit.plan` command. See `.specify/templates/commands/plan.md` for the execution workflow.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Unify frontend styling using a centralized Tailwind CSS configuration and a set of standardized Svelte wrapper components. Implement internationalization (i18n) with support for Russian (default) and English, persisting language preference in LocalStorage.
|
||||||
|
|
||||||
|
## Technical Context
|
||||||
|
|
||||||
|
**Language/Version**: Node.js 18+ (Frontend Build), Svelte 5.x
|
||||||
|
**Primary Dependencies**: SvelteKit, Tailwind CSS, `date-fns` (existing)
|
||||||
|
**Storage**: LocalStorage (for language preference)
|
||||||
|
**Testing**: Manual verification per User Scenarios (Visual Regression)
|
||||||
|
**Target Platform**: Web Browser (Responsive)
|
||||||
|
**Project Type**: Web application (Frontend)
|
||||||
|
**Performance Goals**: Instant language switching, zero layout shift
|
||||||
|
**Constraints**: Must support existing pages without breaking layout
|
||||||
|
**Scale/Scope**: ~10-15 core UI components, global CSS update
|
||||||
|
|
||||||
|
## Constitution Check
|
||||||
|
|
||||||
|
*GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*
|
||||||
|
|
||||||
|
- **Semantic Protocol Compliance**: PASS. New Svelte components must follow the Component Header standard.
|
||||||
|
- **Causal Validity**: PASS. Design System (Tokens) and Component Contracts will be defined before implementation.
|
||||||
|
- **Immutability of Architecture**: PASS. No changes to backend architecture; strictly frontend presentation layer.
|
||||||
|
- **Design by Contract**: PASS. Components will define strict props/interfaces.
|
||||||
|
- **Everything is a Plugin**: N/A. UI components are not backend plugins, but will be modular.
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
|
||||||
|
### Documentation (this feature)
|
||||||
|
|
||||||
|
```text
|
||||||
|
specs/[###-feature]/
|
||||||
|
├── plan.md # This file (/speckit.plan command output)
|
||||||
|
├── research.md # Phase 0 output (/speckit.plan command)
|
||||||
|
├── data-model.md # Phase 1 output (/speckit.plan command)
|
||||||
|
├── quickstart.md # Phase 1 output (/speckit.plan command)
|
||||||
|
├── contracts/ # Phase 1 output (/speckit.plan command)
|
||||||
|
└── tasks.md # Phase 2 output (/speckit.tasks command - NOT created by /speckit.plan)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Source Code (repository root)
|
||||||
|
|
||||||
|
```text
|
||||||
|
frontend/
|
||||||
|
├── src/
|
||||||
|
│ ├── lib/
|
||||||
|
│ │ ├── i18n/ # [NEW] Translation dictionaries and stores
|
||||||
|
│ │ └── ui/ # [NEW] Standardized Svelte components
|
||||||
|
│ ├── components/ # [EXISTING] To be refactored to use lib/ui
|
||||||
|
│ ├── routes/ # [EXISTING] Pages
|
||||||
|
│ └── app.css # [EXISTING] Global styles (Tailwind directives)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Structure Decision**: Adopting a standard SvelteKit structure where reusable UI components and logic (i18n) reside in `src/lib`, accessible via `$lib` alias. Existing `components` directory will be gradually refactored or moved to `lib/ui` if generic enough.
|
||||||
|
|
||||||
|
## Complexity Tracking
|
||||||
|
|
||||||
|
> **Fill ONLY if Constitution Check has violations that must be justified**
|
||||||
|
|
||||||
|
| Violation | Why Needed | Simpler Alternative Rejected Because |
|
||||||
|
|-----------|------------|-------------------------------------|
|
||||||
|
| [e.g., 4th project] | [current need] | [why 3 projects insufficient] |
|
||||||
|
| [e.g., Repository pattern] | [specific problem] | [why direct DB access insufficient] |
|
||||||
63
specs/013-unify-frontend-css/quickstart.md
Normal file
63
specs/013-unify-frontend-css/quickstart.md
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
# Quickstart: Frontend Development
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Node.js 18+
|
||||||
|
- npm
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
1. Navigate to the frontend directory:
|
||||||
|
```bash
|
||||||
|
cd frontend
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Install dependencies:
|
||||||
|
```bash
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running the Development Server
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
The application will be available at `http://localhost:5173`.
|
||||||
|
|
||||||
|
## Using Standard UI Components
|
||||||
|
|
||||||
|
Import components from `$lib/ui`:
|
||||||
|
|
||||||
|
```svelte
|
||||||
|
<script>
|
||||||
|
import { Button, Input } from '$lib/ui';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Input label="Username" bind:value={username} />
|
||||||
|
<Button variant="primary" onclick={submit}>Submit</Button>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Using Internationalization
|
||||||
|
|
||||||
|
Import the `t` store from `$lib/i18n`:
|
||||||
|
|
||||||
|
```svelte
|
||||||
|
<script>
|
||||||
|
import { t } from '$lib/i18n';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h1>{$t.dashboard.title}</h1>
|
||||||
|
<button>{$t.common.save}</button>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Adding New Translations
|
||||||
|
|
||||||
|
1. Open `frontend/src/lib/i18n/locales/ru.json` and add the new key-value pair.
|
||||||
|
2. Open `frontend/src/lib/i18n/locales/en.json` and add the corresponding English translation.
|
||||||
|
|
||||||
|
## Adding New Components
|
||||||
|
|
||||||
|
1. Create a new `.svelte` file in `frontend/src/lib/ui/`.
|
||||||
|
2. Define props and styles using Tailwind CSS.
|
||||||
|
3. Export the component in `frontend/src/lib/ui/index.ts`.
|
||||||
51
specs/013-unify-frontend-css/research.md
Normal file
51
specs/013-unify-frontend-css/research.md
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# Research: Unify Frontend CSS & Localization
|
||||||
|
|
||||||
|
## 1. Design System & Theming
|
||||||
|
|
||||||
|
**Decision**: Use Tailwind CSS as the engine for the design system, but encapsulate usage within reusable Svelte components (`src/lib/ui/*`).
|
||||||
|
|
||||||
|
**Rationale**:
|
||||||
|
- **Consistency**: Centralizing styles in components ensures that a "Button" always looks like a "Button" without copy-pasting utility classes.
|
||||||
|
- **Maintainability**: Tailwind configuration (`tailwind.config.js`) will hold the "Design Tokens" (colors, spacing), while components hold the "Structure".
|
||||||
|
- **Speed**: Tailwind is already integrated and allows for rapid development.
|
||||||
|
|
||||||
|
**Alternatives Considered**:
|
||||||
|
- *Pure CSS/SCSS Modules*: Rejected because it requires more boilerplate and context switching between files.
|
||||||
|
- *Component Library (e.g., Skeleton, Flowbite)*: Rejected to maintain full control over the visual identity and avoid bloat, but we will use the "Headless UI" concept where we build our own accessible components.
|
||||||
|
|
||||||
|
## 2. Internationalization (i18n)
|
||||||
|
|
||||||
|
**Decision**: Implement a lightweight, store-based i18n solution using Svelte stores and JSON dictionaries.
|
||||||
|
|
||||||
|
**Rationale**:
|
||||||
|
- **Simplicity**: For just two languages (RU, EN) and a moderate number of strings, a full-blown library like `svelte-i18n` or `i18next` adds unnecessary complexity and bundle size.
|
||||||
|
- **Control**: A custom store allows us to easily handle `localStorage` persistence and reactive updates across the app without fighting library-specific lifecycle issues.
|
||||||
|
- **Performance**: Direct object lookups are extremely fast.
|
||||||
|
|
||||||
|
**Implementation Detail**:
|
||||||
|
- `src/lib/i18n/index.ts`: Exports a derived store `t` that reacts to the current `locale` store.
|
||||||
|
- `src/lib/i18n/locales/ru.json`: Default dictionary.
|
||||||
|
- `src/lib/i18n/locales/en.json`: English dictionary.
|
||||||
|
|
||||||
|
**Alternatives Considered**:
|
||||||
|
- *svelte-i18n*: Good library, but overkill for current requirements.
|
||||||
|
- *Server-side i18n*: Rejected because the requirement specifies client-side persistence (LocalStorage) and immediate switching without page reloads.
|
||||||
|
|
||||||
|
## 3. Component Architecture
|
||||||
|
|
||||||
|
**Decision**: Create "Atomic" components in `src/lib/ui` that expose props for variants (e.g., `variant="primary" | "secondary"`).
|
||||||
|
|
||||||
|
**Proposed Components**:
|
||||||
|
- `Button.svelte`: Handles variants, sizes, loading states.
|
||||||
|
- `Card.svelte`: Standard container with padding/shadow.
|
||||||
|
- `Input.svelte`: Standardized text input with label and error state.
|
||||||
|
- `Select.svelte`: Standardized dropdown.
|
||||||
|
- `PageHeader.svelte`: Unified title and actions area for pages.
|
||||||
|
|
||||||
|
**Rationale**: These cover 80% of the UI inconsistency issues identified in the spec.
|
||||||
|
|
||||||
|
## 4. Migration Strategy
|
||||||
|
|
||||||
|
**Decision**: "Strangler Fig" pattern - create new components first, then incrementally replace usage in `src/routes` and existing `src/components`.
|
||||||
|
|
||||||
|
**Rationale**: Allows the application to remain functional at all times. We can migrate one page or one section at a time.
|
||||||
102
specs/013-unify-frontend-css/spec.md
Normal file
102
specs/013-unify-frontend-css/spec.md
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
# Feature Specification: Unify Frontend CSS & Localization
|
||||||
|
|
||||||
|
**Feature Branch**: `013-unify-frontend-css`
|
||||||
|
**Created**: 2026-01-23
|
||||||
|
**Status**: Draft
|
||||||
|
**Input**: User description: "Я хочу унифицировать CSS для фронта. Добавь в спецификацию требование, что я хочу l18n для всех текстовых элементов. Плюс, должен быть переключатель языков. Для начала два языка - русский и английский, русский по умолчанию."
|
||||||
|
|
||||||
|
## Clarifications
|
||||||
|
|
||||||
|
### Session 2026-01-23
|
||||||
|
|
||||||
|
- Q: Should we refactor existing UI elements into reusable Svelte components or just apply standardized CSS utility classes? → A: Create thin wrapper Svelte components (e.g., `<Button variant="primary">`) that apply utility classes internally, using Svelte's reactivity for states.
|
||||||
|
- Q: How should the selected language persist across sessions? → A: Use a simple client-side persistence (LocalStorage) for now; migrate to user profile settings later when a full user system is implemented.
|
||||||
|
|
||||||
|
## User Scenarios & Testing
|
||||||
|
|
||||||
|
### User Story 1 - Consistent Visual Experience (Priority: P1)
|
||||||
|
|
||||||
|
As a user, I want the application to look consistent across all pages (Dashboard, Settings, Tools) so that I have a cohesive user experience without jarring visual differences.
|
||||||
|
|
||||||
|
**Why this priority**: Inconsistent UI makes the application feel unprofessional and harder to use. Unifying styles ensures a polished look and predictable interactions.
|
||||||
|
|
||||||
|
**Independent Test**: Navigate to at least 3 different pages (e.g., Dashboard, Settings, a Tool page) and verify that buttons, inputs, and layout spacing share the same visual properties (colors, padding, border radius).
|
||||||
|
|
||||||
|
**Acceptance Scenarios**:
|
||||||
|
|
||||||
|
1. **Given** I am on the Dashboard, **When** I look at a primary action button, **Then** it should have the same color, padding, and hover state as a primary action button on the Settings page.
|
||||||
|
2. **Given** I am viewing a data table in "Migration", **When** I compare it to a table in "Tasks", **Then** the headers, row spacing, and borders should be identical in style.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### User Story 2 - Efficient Design Updates (Priority: P2)
|
||||||
|
|
||||||
|
As a designer or developer, I want to change a core brand color in one place and have it reflect across the entire application, so that maintaining the visual identity is fast and error-free.
|
||||||
|
|
||||||
|
**Why this priority**: Reduces maintenance time and prevents "drift" where slightly different styles are introduced over time.
|
||||||
|
|
||||||
|
**Independent Test**: Change a primary color value in the central configuration and verify it updates on multiple distinct pages without individual code changes.
|
||||||
|
|
||||||
|
**Acceptance Scenarios**:
|
||||||
|
|
||||||
|
1. **Given** the primary brand color is updated in the central theme, **When** I reload the application, **Then** all primary buttons, links, and active states should reflect the new color immediately.
|
||||||
|
2. **Given** a new UI element is added, **When** standard style tokens are applied, **Then** it should automatically match the existing design system without manual pixel adjustments.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### User Story 3 - Multi-language Support (Priority: P2)
|
||||||
|
|
||||||
|
As a user, I want to switch the interface language between Russian and English so that I can work in my preferred language.
|
||||||
|
|
||||||
|
**Why this priority**: Expands accessibility and usability for non-Russian speakers (or English speakers).
|
||||||
|
|
||||||
|
**Independent Test**: Switch the language using the UI toggle and verify that static text elements on the page update immediately.
|
||||||
|
|
||||||
|
**Acceptance Scenarios**:
|
||||||
|
|
||||||
|
1. **Given** I am on any page, **When** I switch the language to "English", **Then** all menu items, labels, and button text should change to English.
|
||||||
|
2. **Given** I open the application for the first time, **Then** the interface should be in Russian (default).
|
||||||
|
3. **Given** I have selected "English", **When** I refresh the page, **Then** the interface should remain in English (persisted via LocalStorage).
|
||||||
|
|
||||||
|
## Edge Cases
|
||||||
|
|
||||||
|
- **Legacy Components**: What happens to older components that don't fit the new system?
|
||||||
|
- *Handling*: They should be refactored to use the new system. If refactoring is too complex, they should visually approximate the new system as closely as possible until fully replaced.
|
||||||
|
- **Theme Conflicts**: What happens if a specific page requires unique styling that contradicts the global theme?
|
||||||
|
- *Handling*: The system should allow for local overrides, but these should be used sparingly and documented.
|
||||||
|
- **Browser Compatibility**: How does the new styling behave on different screen sizes?
|
||||||
|
- *Handling*: The unified styles must support responsive behavior, adapting spacing and font sizes appropriately for standard breakpoints (mobile, tablet, desktop).
|
||||||
|
- **Missing Translations**: What happens if a translation key is missing for the selected language?
|
||||||
|
- *Handling*: The system should fallback to the default language (Russian) or display the key itself in a non-breaking way.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
### Functional Requirements
|
||||||
|
|
||||||
|
- **FR-001**: The system MUST use a centralized configuration for all design tokens (colors, typography, spacing, breakpoints).
|
||||||
|
- **FR-002**: The system MUST provide standardized, **thin wrapper Svelte components** (e.g., `<Button variant="primary">`) that encapsulate the design system.
|
||||||
|
- **FR-003**: The system MUST NOT use hardcoded color values or "magic numbers" for spacing in individual page views; all styling must reference the central design tokens.
|
||||||
|
- **FR-004**: The system MUST ensure consistent spacing (margins and padding) between elements across all layouts.
|
||||||
|
- **FR-005**: All existing pages (Dashboard, Settings, Tools) MUST be updated to utilize the new centralized design system components.
|
||||||
|
- **FR-006**: The system MUST support **Internationalization (i18n)** for all static text elements.
|
||||||
|
- **FR-007**: The system MUST provide a **Language Switcher** in the UI (e.g., Navbar or Settings).
|
||||||
|
- **FR-008**: Supported languages MUST be **Russian (RU)** and **English (EN)**.
|
||||||
|
- **FR-009**: The default language MUST be **Russian**.
|
||||||
|
- **FR-010**: The selected language MUST be persisted in **LocalStorage** to survive page reloads (until a user profile system is implemented).
|
||||||
|
|
||||||
|
### Key Entities
|
||||||
|
|
||||||
|
- **Design System Configuration**: The single source of truth for visual values (colors, fonts, spacing).
|
||||||
|
- **Standardized UI Components**: Reusable Svelte components that implement the design tokens.
|
||||||
|
- **Translation Dictionary**: A collection of key-value pairs for text strings in each supported language.
|
||||||
|
|
||||||
|
## Success Criteria
|
||||||
|
|
||||||
|
### Measurable Outcomes
|
||||||
|
|
||||||
|
- **SC-001**: Central design configuration contains definitions for all primary, secondary, background, and status (success/error/warning) colors.
|
||||||
|
- **SC-002**: 100% of primary UI elements (buttons, inputs, cards) on key pages (Dashboard, Settings) use the standardized Svelte components.
|
||||||
|
- **SC-003**: 0 instances of arbitrary hardcoded color values for primary UI elements remain in the codebase.
|
||||||
|
- **SC-004**: Visual regression check confirms that Dashboard, Settings, and Task pages share identical styling for common elements (buttons, tables, headers).
|
||||||
|
- **SC-005**: User can successfully switch between Russian and English, with 100% of navigation and primary action text translating correctly.
|
||||||
|
- **SC-006**: Selected language persists after a page reload 100% of the time.
|
||||||
71
specs/013-unify-frontend-css/tasks.md
Normal file
71
specs/013-unify-frontend-css/tasks.md
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
# Implementation Tasks: Unify Frontend CSS & Localization
|
||||||
|
|
||||||
|
**Branch**: `013-unify-frontend-css`
|
||||||
|
|
||||||
|
## Phase 1: Setup & Infrastructure
|
||||||
|
|
||||||
|
**Goal**: Initialize the i18n system and component structure.
|
||||||
|
|
||||||
|
- [ ] T001 Initialize i18n locales directory and JSON files in `frontend/src/lib/i18n/locales/ru.json` and `frontend/src/lib/i18n/locales/en.json`
|
||||||
|
- [ ] T002 Implement i18n store with LocalStorage persistence in `frontend/src/lib/i18n/index.ts`
|
||||||
|
- [ ] T003 Create UI component directory structure in `frontend/src/lib/ui/` and `frontend/src/lib/ui/index.ts`
|
||||||
|
- [ ] T004 [P] Configure Tailwind utility classes for design tokens (if strictly needed beyond defaults) in `frontend/tailwind.config.js`
|
||||||
|
|
||||||
|
## Phase 2: Foundational Components (User Stories 1 & 2)
|
||||||
|
|
||||||
|
**Goal**: Create the core standardized components required for visual consistency.
|
||||||
|
**User Story**: US1 (Consistent Visual Experience) & US2 (Efficient Design Updates)
|
||||||
|
|
||||||
|
- [ ] T005 [P] [US1] Create `Button` component with variants in `frontend/src/lib/ui/Button.svelte`
|
||||||
|
- [ ] T006 [P] [US1] Create `Input` component with label/error support in `frontend/src/lib/ui/Input.svelte`
|
||||||
|
- [ ] T007 [P] [US1] Create `Select` component in `frontend/src/lib/ui/Select.svelte`
|
||||||
|
- [ ] T008 [P] [US1] Create `Card` container component in `frontend/src/lib/ui/Card.svelte`
|
||||||
|
- [ ] T009 [P] [US1] Create `PageHeader` component in `frontend/src/lib/ui/PageHeader.svelte`
|
||||||
|
- [ ] T010 [US1] Export all components from `frontend/src/lib/ui/index.ts`
|
||||||
|
|
||||||
|
## Phase 3: Internationalization Support (User Story 3)
|
||||||
|
|
||||||
|
**Goal**: Enable language switching and translation.
|
||||||
|
**User Story**: US3 (Multi-language Support)
|
||||||
|
|
||||||
|
- [ ] T011 [US3] Create `LanguageSwitcher` component in `frontend/src/lib/ui/LanguageSwitcher.svelte`
|
||||||
|
- [ ] T012 [US3] Integrate `LanguageSwitcher` into the main layout `frontend/src/routes/+layout.svelte`
|
||||||
|
- [ ] T013 [US3] Populate `ru.json` and `en.json` with initial common terms (Save, Cancel, Dashboard, Settings)
|
||||||
|
|
||||||
|
## Phase 4: Migration - Dashboard & Settings (User Story 1)
|
||||||
|
|
||||||
|
**Goal**: Apply new components to key pages to prove consistency.
|
||||||
|
**User Story**: US1 (Consistent Visual Experience)
|
||||||
|
|
||||||
|
- [ ] T014 [US1] Refactor `frontend/src/routes/+page.svelte` (Dashboard) to use `PageHeader` and `Card`
|
||||||
|
- [ ] T015 [US1] Refactor `frontend/src/routes/settings/+page.svelte` (Settings) to use `Button`, `Input`, and `Select`
|
||||||
|
- [ ] T016 [US1] Refactor `frontend/src/routes/tools/*` pages to use standardized components
|
||||||
|
- [ ] T017 [US1] Replace hardcoded text in Dashboard, Settings, and Tools with `$t` store keys
|
||||||
|
|
||||||
|
## Phase 5: Polish & Cross-Cutting Concerns
|
||||||
|
|
||||||
|
**Goal**: Final cleanup and verification.
|
||||||
|
|
||||||
|
- [ ] T018 Verify all hardcoded colors are removed from refactored pages
|
||||||
|
- [ ] T019 Ensure LocalStorage persistence works for language selection
|
||||||
|
- [ ] T020 Check responsiveness of new components on mobile view
|
||||||
|
- [ ] T021 [US3] Verify UI stability and text alignment with long RU translations (overflow check)
|
||||||
|
- [ ] T022 [US3] Implement fallback to default language if translation key or LocalStorage is missing
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
1. **Phase 1** (Infrastructure) MUST be completed first.
|
||||||
|
2. **Phase 2** (Components) depends on Phase 1.
|
||||||
|
3. **Phase 3** (i18n UI) depends on Phase 1 (Store) and Phase 2 (Select/Button components).
|
||||||
|
4. **Phase 4** (Migration) depends on Phase 2 and Phase 3.
|
||||||
|
|
||||||
|
## Parallel Execution Examples
|
||||||
|
|
||||||
|
- **Components**: T005 (Button), T006 (Input), T007 (Select), and T008 (Card) can be built simultaneously by different developers.
|
||||||
|
- **Migration**: T014 (Dashboard) and T015 (Settings) can be refactored in parallel once components are ready.
|
||||||
|
|
||||||
|
## Implementation Strategy
|
||||||
|
|
||||||
|
1. **MVP**: Build the i18n store and the `Button` component. Refactor one small page to prove the concept.
|
||||||
|
2. **Expansion**: Build remaining components (`Input`, `Select`).
|
||||||
|
3. **Rollout**: Systematically refactor pages one by one.
|
||||||
1420
specs/project_map.md
1420
specs/project_map.md
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user