Skip to content

Commit

Permalink
chore: workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Adis Durakovic committed Mar 15, 2024
1 parent 521fa60 commit 56dc99c
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: 'resticity-Linux-${{ github.ref_name }}'
platform: 'linux/amd64'
os: 'ubuntu-latest'
- name: 'Resticity-Windows-${{ github.ref_name }}'
- name: 'Resticity-Windows-Portable-${{ github.ref_name }}.exe'
platform: 'windows/amd64'
os: 'windows-latest'
# - name: 'Resticity'
Expand Down
4 changes: 2 additions & 2 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,6 @@ func (a *App) SelectFile(title string) string {
return ""
}

func (a *App) FakeCreateForModels() (internal.SnapshotGroup, internal.Repository, internal.Backup, internal.Config, internal.Schedule, internal.FileDescriptor) {
return internal.SnapshotGroup{}, internal.Repository{}, internal.Backup{}, internal.Config{}, internal.Schedule{}, internal.FileDescriptor{}
func (a *App) FakeCreateForModels() (internal.SnapshotGroup, internal.Repository, internal.Backup, internal.Config, internal.Schedule, internal.FileDescriptor, internal.ScheduleObject) {
return internal.SnapshotGroup{}, internal.Repository{}, internal.Backup{}, internal.Config{}, internal.Schedule{}, internal.FileDescriptor{}, internal.ScheduleObject{}
}
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ case $1 in
cd frontend && pnpm install && pnpm build
;;
"dev")
$wails dev -ldflags="$LD_FLAGS" -loglevel "Error"
RESTICITY_LOG_LEVEL=debug $wails dev -ldflags="$LD_FLAGS" -loglevel "Error"
;;
*)
;;
Expand Down
4 changes: 2 additions & 2 deletions frontend/composables/useHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export default class HttpClient {
}
return res._data
} catch (e: any) {
console.log(e)
console.error(e)
useLogs().setServerError(e)
this.notifyError(e, notify)

return e.data
}
}
Expand Down
7 changes: 7 additions & 0 deletions frontend/composables/useLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ type Log = {
export const useLogs = defineStore('useLogs', () => {
const out = ref<Log>({})
const err = ref<Log>({})
const serverErr = ref<string[]>([])

function setOut(id: string, data: string) {
if (out.value[id] === undefined) {
Expand All @@ -23,10 +24,16 @@ export const useLogs = defineStore('useLogs', () => {
}
}

function setServerError(data: string) {
serverErr.value.push(data)
}

return {
out,
err,
setOut,
setErr,
serverErr,
setServerError,
}
})
3 changes: 3 additions & 0 deletions frontend/pages/logs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
</template>
</UAccordion>
<p v-else>No errors</p>
<h4 class="text-teal-500 mt-5">Server errors</h4>
<pre v-if="useLogs().serverErr.length > 0" class="text-xs overflow-scroll h-72">{{ useLogs().serverErr.join('\n') }}</pre>
<p v-else>No errors</p>
</div>
<div>
<h4 class="text-teal-500">Archive logs</h4>
Expand Down
4 changes: 3 additions & 1 deletion frontend/pages/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
</UAlert>
</div>
</div>
<div class="text-xs text-center mt-10">Resticity<br />Version: {{ version }}<br />Build: {{ build }}</div>
<div class="text-xs text-center mt-10">
Resticity<br />Version: {{ version }}<br />Build: {{ build }} <br />Server: {{ `${useRequestURL().protocol}//${useRequestURL().host}` }}
</div>
</div>
</template>

Expand Down
6 changes: 6 additions & 0 deletions frontend/wailsjs/go/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ export namespace internal {



export interface ScheduleObject {
schedule: Schedule;
to_repository?: Repository;
from_repository?: Repository;
backup?: Backup;
}
export interface Snapshot {
id: string;
// Go type: time
Expand Down
2 changes: 1 addition & 1 deletion internal/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ func SetLogLevel() {
if err == nil {
log.SetLevel(l)
} else {
log.SetLevel(log.WarnLevel)
log.SetLevel(log.ErrorLevel)
}
}

0 comments on commit 56dc99c

Please sign in to comment.