Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b07a114227 | |||
| 88f77edadd | |||
| decad4cc82 |
@@ -27,3 +27,7 @@ cd core
|
||||
go build -o rr ./cmd/rr/main.go
|
||||
./rr
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Apache License 2.0
|
||||
+9
-2
@@ -6,6 +6,8 @@ import (
|
||||
_ "embed"
|
||||
"encoding/json"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"epigas.gitea.cloud/RiskRancher/core/pkg/domain"
|
||||
@@ -18,9 +20,14 @@ var schemaSQL string
|
||||
//go:embed defaults/*.json
|
||||
var defaultAdaptersFS embed.FS
|
||||
|
||||
func InitDB(filepath string) *sql.DB {
|
||||
func InitDB(dbPath string) *sql.DB {
|
||||
|
||||
dsn := "file:" + filepath + "?_pragma=journal_mode(WAL)&_pragma=busy_timeout(5000)&_pragma=synchronous(NORMAL)&_pragma=foreign_keys(1)"
|
||||
dir := filepath.Dir(dbPath)
|
||||
|
||||
if err := os.MkdirAll(dir, 0755); err != nil {
|
||||
log.Fatalf("Failed to create database directory: %v", err)
|
||||
}
|
||||
dsn := "file:" + dbPath + "?_pragma=journal_mode(WAL)&_pragma=busy_timeout(5000)&_pragma=synchronous(NORMAL)&_pragma=foreign_keys(1)"
|
||||
|
||||
db, err := sql.Open("sqlite", dsn)
|
||||
if err != nil {
|
||||
|
||||
@@ -10,15 +10,18 @@
|
||||
<div class="tab-nav">
|
||||
<button class="tab-btn active" onclick="switchTab('tab-metrics', this)">📊 Metrics</button>
|
||||
<button class="tab-btn" onclick="switchTab('tab-performance', this)">📡 Performance</button>
|
||||
{{ block "pro_risk_tab_btn" .}}
|
||||
<button class="tab-btn" style="color: #94a3b8; cursor: not-allowed;" title="Available in RiskRancher Pro">
|
||||
🔒 Risk Reviews (Pro)
|
||||
</button>
|
||||
{{ end }}
|
||||
<button class="tab-btn" onclick="switchTab('tab-config', this)">⚙️ Configuration</button>
|
||||
<button class="tab-btn" onclick="switchTab('tab-feed', this)">📻 System Logs</button>
|
||||
</div>
|
||||
|
||||
{{template "admin_metrics" .}}
|
||||
{{template "admin_performance" .}}
|
||||
{{block "pro_risk_tab_content" .}}{{end}}
|
||||
{{template "admin_config" .}}
|
||||
{{template "admin_feed" .}}
|
||||
{{template "admin_modals" .}}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style="border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px;">
|
||||
{{block "pro_source_routing" .}}
|
||||
<div style="border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px; background: #f8fafc;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
|
||||
<h3 style="margin: 0; color: #64748b;">🛤️ Source Routing</h3>
|
||||
@@ -35,11 +35,12 @@
|
||||
<a href="https://RiskRancher.com/pro" target="_blank" style="color: #8b5cf6; text-decoration: none; font-weight: bold; font-size: 0.85rem;">Learn about RiskRancher Pro →</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 2fr 1fr; gap: 20px;">
|
||||
|
||||
{{block "pro_sla_policy" .}}
|
||||
<div style="border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px; position: relative;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
|
||||
<div>
|
||||
@@ -76,10 +77,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div style="border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px; display: flex; flex-direction: column;">
|
||||
<h3 style="margin: 0 0 15px 0;">⚙️ Operations</h3>
|
||||
|
||||
{{block "pro_backups" .}}
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="font-weight: bold; display: flex; justify-content: space-between;">
|
||||
Automated Backups
|
||||
@@ -94,6 +97,7 @@
|
||||
<button class="btn btn-secondary" style="color: #94a3b8; border-color: #cbd5e1;" onclick="showUpsell('Automated DB Backups')">🔒 Apply</button>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="font-weight: bold;">Data Portability</label>
|
||||
|
||||
@@ -8,9 +8,11 @@
|
||||
</a>
|
||||
<a href="/dashboard?tab=chute" class="tab-btn {{if eq .CurrentTab "chute"}}active{{end}}">🤠 The Chute (Assigned)</a>
|
||||
|
||||
{{block "pro_verification_tab" .}}
|
||||
<a href="javascript:void(0)" onclick="showUpsell('E2E Exception & Verification Pipeline')" class="tab-btn" style="color: #94a3b8;">
|
||||
🔒 Pending Verification (Pro)
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
<a href="/dashboard?tab=archives" class="tab-btn {{if eq .CurrentTab "archives"}}active{{end}}">
|
||||
🗄️ The Archives
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{{define "content"}}
|
||||
|
||||
<script>
|
||||
window.CurrentTab = "{{.CurrentTab}}";
|
||||
</script>
|
||||
|
||||
{{template "dash_tabs" .}}
|
||||
|
||||
{{block "pro_risk_tab_content" .}}{{end}}
|
||||
|
||||
<div class="tab-pane active">
|
||||
{{template "dash_table" .}}
|
||||
</div>
|
||||
@@ -13,5 +14,4 @@
|
||||
{{template "dash_modals" .}}
|
||||
|
||||
<script src="/static/dashboard.js"></script>
|
||||
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user