8000 Resolved after 0 minutes should just be resolved · Issue #28 · cstate/cstate · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Resolved after 0 minutes should just be resolved #28

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

Closed
mistermantas opened this issue Sep 12, 2018 · 10 comments
Closed

Resolved after 0 minutes should just be resolved #28

mistermantas opened this issue Sep 12, 2018 · 10 comments

Comments

@mistermantas
Copy link
Member

No description provided.

@logichub
Copy link
Contributor
logichub commented Oct 1, 2018

I have followed the following instructions:

  1. Download the contents of the exampleSite directory in this repository. This will be your site guts, which will hold the content and configuration for the status page.
  2. Create a themes folder and navigate to it on the command line.
mkdir themes; cd themes;
  1. Now simply add a Git submodule pointing to this repository, like so:
git submodule add https://github.com/cstate/cstate
  1. Set up cState for your liking. It is now ready to be used in production.

I have made changes in the local repo and tested it. What's next?

@mistermantas
Copy link
Member Author

I have made changes in the local repo and tested it. What's next?

Make a pull request.

@mistermantas
Copy link
Member Author

I checked the repo, these are not the changes that needed to be made. This is supposed to be a somewhat complex Hugo if statement made in index.html.

@logichub
Copy link
Contributor
logichub commented Oct 1, 2018

I made following changes in the cstate\layouts\issues\issue.html file:

    <span class="ok">

      {{ $t := (time .Params.ResolvedWhen) }}
      {{ $timeDiff := (sub $t.Unix .Date.Unix) }}
      {{ $diffInMin := (div $timeDiff 60) }}
        
      {{ if lt $timeDiff 60 }}
            ✓ Resolved
      {{ else }}
            ✓ Resolved after
            {{ if gt $timeDiff 3600 }}
                {{ $minutesForCalc := (mod $diffInMin 60) }}

                {{ div (sub $diffInMin $minutesForCalc) 60 }}h
                {{ $minutesForCalc }}m of downtime
            {{ else }}
                {{ $secsForCalc := (mod $timeDiff 60) }}

            {{ div (sub $timeDiff $secsForCalc) 60 }}m
            <!-- {{ $secsForCalc }}s --> of downtime
          {{ end }}
      {{ end }}
    </span>

Then I created 2 more issues in the content\issues folder where incident time is less than a minute e.g.

Incident and resolution time is same i.e. 0 second

title: Test Issues
date: 2018-09-25 00:00:00
resolved: true
resolvedWhen: 2018-09-25 00:00:00

image


Incident and resolution time is less than a minute i.e. 59 seconds

title: Test 2 Issues
date: 2018-10-01 01:15:00
resolved: true
resolvedWhen: 2018-10-01 01:15:59

image


The old incidents are showing hours and/or minutes as usual.

Incident and resolution time is more than a minute but less than an hour i.e. 27 minutes

title: US East Connection Issues
date: 2018-05-25 04:13:00
resolved: true
resolvedWhen: 2018-05-25 04:40:00

image


Incident and resolution time is more than an hour i.e. 1 hour 36 minutes

title: Unavailable Guilds & Connection Issues
date: 2018-04-13 15:54:00
resolved: true
resolvedWhen: 2018-04-13 17:30:00

image


However, my changes are not visible in the forked repo. I am not sure how can I do that.

@mistermantas
Copy link
Member Author

You have the code right here. I mean you could technically reset the repo (just delete it and fork it again) then submit a PR :)

@logichub
Copy link
Contributor
logichub commented Oct 2, 2018

Let me try it. :)

@mistermantas
Copy link
Member Author

Having issues? :)

@logichub
Copy link
Contributor
logichub commented Oct 3, 2018

Didn't try yet. Been busy in other tasks. Will try to do it later tonight. :)

@logichub
Copy link
Contributor
logichub commented Oct 4, 2018

Tried again: #30

@mistermantas
Copy link
Member Author

Alright, moving discussion to there.

mistermantas pushed a commit that referenced this issue Oct 5, 2018
* Resolved after 0 minutes should just be resolved issue
57BF
 #28

* Submodules shouldn’t be in root repo

* #31 - Remove themes/

* Delete test-issue-2.md

* Delete test-issues.md

* Fix indent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0