mirror of
https://gitcode.com/JianFeeeee/TrulyMEM-TrueHumanMEM.git
synced 2026-09-24 19:08:15 +00:00
- GraphDatabase.ets: - Export TimeRangeParams interface - Add graph(), snapshot(), queryArchived() methods - Add SnapshotData interface - Add NameCacheEntry interface, remove duplicates - Fix Context import to use named import from @ohos.abilityAccessCtrl - GraphMemoryService.ets: - Import TimeRangeParams from GraphDatabase - Import RecordResult from GraphDatabase - Add graph(), snapshot(), queryArchived() delegate methods - Add timeRange optional param to MemoryRecallParams - AIAgentService.ets: - Fix Context import: named import from @ohos.abilityAccessCtrl - Import TimeRangeParams from GraphDatabase instead of GraphMemoryService - Add dryRun, keyword, attribute to ToolPropertiesDefinition - Index.ets: - Fix displayCallback type to Callback<number> - Add display import
49 lines
1.1 KiB
Plaintext
49 lines
1.1 KiB
Plaintext
import { MainPage } from './MainPage';
|
|
import { SettingsPage } from './SettingsPage';
|
|
import { GraphDatabase } from '../model/GraphDatabase';
|
|
import { ImmersiveTabNavigation } from '../components/ImmersiveTabNavigation';
|
|
import display from '@ohos.display';
|
|
|
|
@Entry
|
|
@Component
|
|
struct Index {
|
|
@State currentIndex: number = 0;
|
|
private db: GraphDatabase = new GraphDatabase();
|
|
private displayCallback?: Callback<number>;
|
|
|
|
aboutToAppear() {
|
|
this.db.init(getContext(this));
|
|
}
|
|
|
|
aboutToDisappear() {
|
|
if (this.displayCallback) {
|
|
display.off('change', this.displayCallback);
|
|
}
|
|
}
|
|
|
|
@Builder
|
|
tabContentBuilder() {
|
|
Column() {
|
|
if (this.currentIndex === 0) {
|
|
MainPage({ db: this.db })
|
|
} else {
|
|
SettingsPage()
|
|
}
|
|
}
|
|
.width('100%')
|
|
.height('100%')
|
|
}
|
|
|
|
build() {
|
|
Stack() {
|
|
ImmersiveTabNavigation({
|
|
currentIndex: this.currentIndex,
|
|
onTabChange: (index: number): void => { this.currentIndex = index; },
|
|
contentBuilder: (): void => { this.tabContentBuilder(); }
|
|
})
|
|
}
|
|
.width('100%')
|
|
.height('100%')
|
|
}
|
|
}
|