Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix icon refreshing (+) #1518

Merged
merged 5 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ go-update-deps:

RUN go get -u ./..
RUN go mod tidy
SAVE ARTIFACT go.mod AS LOCAL go.mod
SAVE ARTIFACT --if-exists go.sum AS LOCAL go.sum
SAVE ARTIFACT --keep-ts go.mod AS LOCAL go.mod
SAVE ARTIFACT --keep-ts --if-exists go.sum AS LOCAL go.sum

# mod-tidy runs 'go mod tidy', saving go.mod and go.sum locally.
mod-tidy:
FROM +go-base

RUN go mod tidy
SAVE ARTIFACT go.mod AS LOCAL go.mod
SAVE ARTIFACT --if-exists go.sum AS LOCAL go.sum
SAVE ARTIFACT --keep-ts go.mod AS LOCAL go.mod
SAVE ARTIFACT --keep-ts --if-exists go.sum AS LOCAL go.sum

# go-build runs 'go build ./cmds/...', saving artifacts locally.
# If --CMDS is not set, it defaults to building portmaster-start, portmaster-core and hub
Expand Down Expand Up @@ -130,10 +130,10 @@ go-build:
DO +GO_ARCH_STRING --goos="${GOOS}" --goarch="${GOARCH}" --goarm="${GOARM}"

FOR bin IN $(ls -1 "/tmp/build/")
SAVE ARTIFACT "/tmp/build/${bin}" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/${bin}"
SAVE ARTIFACT --keep-ts "/tmp/build/${bin}" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/${bin}"
END

SAVE ARTIFACT "/tmp/build/" ./output
SAVE ARTIFACT --keep-ts "/tmp/build/" ./output

# Test one or more go packages.
# Test are always run as -short, as "long" tests require a full desktop system.
Expand Down Expand Up @@ -217,9 +217,9 @@ angular-base:
COPY assets/data ./assets

IF [ "${configuration}" = "production" ]
RUN npm run build-libs
RUN --no-cache npm run build-libs
ELSE
RUN npm run build-libs:dev
RUN --no-cache npm run build-libs:dev
END

# Explicitly cache here.
Expand All @@ -241,11 +241,11 @@ angular-project:
RUN --no-cache ./node_modules/.bin/ng build --configuration ${configuration} --base-href ${baseHref} "${project}"

RUN --no-cache cwd=$(pwd) && cd "${dist}" && zip -r "${cwd}/${project}.zip" ./
SAVE ARTIFACT "${dist}" "./output/${project}"
SAVE ARTIFACT --keep-ts "${dist}" "./output/${project}"

# Save portmaster UI as local artifact.
IF [ "${project}" = "portmaster" ]
SAVE ARTIFACT "./${project}.zip" AS LOCAL ${outputDir}/all/${project}-ui.zip
SAVE ARTIFACT --keep-ts "./${project}.zip" AS LOCAL ${outputDir}/all/${project}-ui.zip
END

# Build the angular projects (portmaster-UI and tauri-builtin) in dev mode
Expand Down Expand Up @@ -441,7 +441,7 @@ tauri-build:
END
# Save output binary as local artifact.
IF [ -f "target/${target}/release/${bin}" ]
SAVE ARTIFACT "target/${target}/release/${bin}" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/${outbin}"
SAVE ARTIFACT --keep-ts "target/${target}/release/${bin}" AS LOCAL "${outputDir}/${GO_ARCH_STRING}/${outbin}"
END
END

Expand Down
4 changes: 2 additions & 2 deletions desktop/angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion desktop/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "portmaster",
"version": "0.8.5",
"version": "0.8.6",
"scripts": {
"ng": "ng",
"start": "npm install && npm run build-libs:dev && ng serve --proxy-config ./proxy.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export class DebugAPI {
})
}

ready(): Observable<string> {
return this.http.get(`${this.httpAPI}/v1/ready`, {
responseType: 'text'
})
}

getStack(): Observable<string> {
return this.http.get(`${this.httpAPI}/v1/debug/stack`, {
responseType: 'text'
Expand Down
2 changes: 1 addition & 1 deletion desktop/angular/src/app/shared/app-icon/app-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
PORTMASTER_HTTP_API_ENDPOINT,
PortapiService,
Record,
deepClone,

Check warning on line 19 in desktop/angular/src/app/shared/app-icon/app-icon.ts

View workflow job for this annotation

GitHub Actions / Lint

'deepClone' is defined but never used
} from '@safing/portmaster-api';
import { Subscription, map, of } from 'rxjs';
import { switchMap } from 'rxjs/operators';
Expand Down Expand Up @@ -94,7 +94,7 @@
this._profile = p || null;

if (this.initDone) {
this.updateView(true);
this.updateView();
}
}
get profile(): IDandName | null | undefined {
Expand Down Expand Up @@ -209,7 +209,7 @@
}

// if there's a source ID only holds the profile ID
if (!!this.profile.Source) {

Check failure on line 212 in desktop/angular/src/app/shared/app-icon/app-icon.ts

View workflow job for this annotation

GitHub Actions / Lint

Redundant double negation
return [this.profile.Source, id];
}

Expand Down Expand Up @@ -242,7 +242,7 @@
switchMap((profile: AppProfile) => {
this.updateLetter(profile);

if (!!profile.Icons?.length) {

Check failure on line 245 in desktop/angular/src/app/shared/app-icon/app-icon.ts

View workflow job for this annotation

GitHub Actions / Lint

Redundant double negation
const firstIcon = profile.Icons[0];

console.log(`profile ${profile.Name} has icon of from source ${firstIcon.Source} stored in ${firstIcon.Type}`)
Expand Down
Loading